Boost logo

Boost Users :

From: Mike Hayford (yg-boost-users_at_[hidden])
Date: 2003-03-19 22:24:53


I found I had to include the ublas config header before any ublas headers to get things
to work properly.
#include <boost/numeric/ublas/config.hpp>
#include <boost/numeric/ublas/matrix.hpp>

As another poster noted, you'll also need ublas/io.hpp

HTH

Mike

Zdenek Hurak wrote:

> Hello,
>
> Could anybody help me with my first compilation of a simple code using
> MATRIX class from uBLAS library?
>
> Namely, I can't set all the "include" properly. Have a look at the code
> snipet:
>
> ----------------------------------------------------------------------------------
> #include <iostream.h>
> #include <stdlib.h>
>
> #include <boost/numeric/ublas/matrix.hpp>
>
> int main(int argc, char *argv[])
> {
> using namespace boost::numeric::ublas;
> matrix<double> m (3, 3);
> for (int i = 0; i < m.size1 (); ++ i)
> for (int j = 0; j < m.size2 (); ++ j)
> m (i, j) = 3 * i + j;
> std::cout << m << std::endl;
> }
> ------------------------------------------------------------------------------------
>
> I get an error message:
> main.cpp:21:42: boost/numeric/ublas/matrix.hpp: No such file or directory
>
> I use gcc/g++ on i386-linux and I set a parameter of the compiler to:
>
> --x-includes=/home/hurak/Documents/cpluspluswork/boost_1_29_0/
>
> which is exactly the parent directory of "boost/numeric/ublas/matrix.hpp".
>
> Could you please explain to me what is still missing? I cannot find any
> example on the BOOST web. I am not much experienced in all this "include"
> stuff. Before delving deeper into the compiler options I would like to know
> if everything else is correct.
>
> Thanks
> Zdenek Hurak
>
>
> Info: <http://www.boost.org>
> Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
> Unsubscribe: <mailto:boost-users-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net