Boost logo

Ublas :

From: Angus Leeming (angus.leeming_at_[hidden])
Date: 2005-09-09 04:21:32


Ott Toomet wrote:
> I want to compile the following

 #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;
+ vector<double> n;
 
     // ... snip ....
 
     n = prod(v, m);
- std::cout << "v*m=" << prod(v,m) << std::endl;
+ std::cout << "v*m=" << n << std::endl;
+
+ return 0;
 }

$ g++ -W -Wall -DNDEBUG -Iboost/cvs -o trial trial.cpp
$ ./trial
v*m=[3](0,0,0)

Regards,
Angus