2
0
mirror of https://github.com/boostorg/ublas.git synced 2026-01-22 05:42:44 +00:00
Files
ublas/doc/samples/matrix_vector_binary.cpp
Jörg Walter 4ab34dbb6e Documentation update and some fixes.
[SVN r17184]
2003-02-04 07:22:11 +00:00

18 lines
464 B
C++

#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
int main () {
using namespace boost::numeric::ublas;
matrix<double> m (3, 3);
vector<double> v (3);
for (unsigned i = 0; i < std::min (m.size1 (), v.size ()); ++ i) {
for (unsigned j = 0; j < m.size2 (); ++ j)
m (i, j) = 3 * i + j;
v (i) = i;
}
std::cout << prod (m, v) << std::endl;
std::cout << prod (v, m) << std::endl;
}