Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2005-09-09 05:15:59


On Friday 09 September 2005 10:55, Ott Toomet wrote:
> #include <boost/numeric/ublas/vector.hpp>
> #include <boost/numeric/ublas/matrix.hpp>
> #include <boost/numeric/ublas/io.hpp>
>
> int main() {
> using namespace boost::numeric::ublas;
> vector<double> v(3);
> matrix<double> m(3,3);
> matrix<double> n;

> n = prod(v, m);
> std::cout << "v*m=" << prod(v,m) << std::endl;
> }

The result of vector * matrix is a vector, not a matrix. So n should be
declared a vector<double>. (The compiler told you, that there is no
matrix::operator= (vector) but an matrix::operator=(matrix) )

mfg
Gunter