mirror of
https://github.com/boostorg/ublas.git
synced 2026-02-22 03:42:19 +00:00
Documentation update and some fixes.
svn path=/trunk/boost/libs/numeric/ublas/; revision=17184
This commit is contained in:
17
doc/samples/triangular_matrix.cpp
Normal file
17
doc/samples/triangular_matrix.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include <boost/numeric/ublas/triangular.hpp>
|
||||
#include <boost/numeric/ublas/io.hpp>
|
||||
|
||||
int main () {
|
||||
using namespace boost::numeric::ublas;
|
||||
triangular_matrix<double, lower> ml (3, 3);
|
||||
for (unsigned i = 0; i < ml.size1 (); ++ i)
|
||||
for (unsigned j = 0; j <= i; ++ j)
|
||||
ml (i, j) = 3 * i + j;
|
||||
std::cout << ml << std::endl;
|
||||
triangular_matrix<double, upper> mu (3, 3);
|
||||
for (unsigned i = 0; i < mu.size1 (); ++ i)
|
||||
for (unsigned j = i; j < mu.size2 (); ++ j)
|
||||
mu (i, j) = 3 * i + j;
|
||||
std::cout << mu << std::endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user