Boost logo

Ublas :

From: Karl Meerbergen (Karl.Meerbergen_at_[hidden])
Date: 2005-10-19 10:21:36


Shawn D. Pautz wrote:

>All,
>
>Here's some more information that may be relevant to this discussion.
>The code below does not compile with gcc 3.2.3 (I've suppressed the
>include statements; I've tried including a lot of the ublas header files
>without success). Which lines ought to work, and which lines are an
>error on my part?
>
>int main()
>{
> ublas::matrix<double> A(2,2);
> ublas::matrix<double> B(2,2);
> lu_factorize(A); // compiles
> lu_factorize(B); // compiles
> lu_factorize(ublas::prod(A,B)); // won't compile
> lu_factorize(ublas::matrix<double>(ublas::prod(A,B))); // won't compile
> lu_factorize(static_cast<ublas::matrix<double>
> >(ublas::prod(A,B))); // won't compile
> ublas::matrix<double> tempMatrix(ublas::prod(A,B)); // compiles
> lu_factorize(tempMatrix); // compiles
>}
>
>

I am not familiar with lu_factorize(), but I guess the reason why some
lines do not compile is that you pass a const object to a function that
requires a reference to a non-const object. This is not possible.

Karl