Boost logo

Ublas :

From: Maik Beckmann (maikbeckmann_at_[hidden])
Date: 2006-11-14 11:52:00


Am Dienstag, den 14.11.2006, 16:20 +0100 schrieb Giacomo Piccolo:
> Hello to everybody,
>
> I tried to run this simple code but it doesn't seem to work.It seems
> there are some problem with unbounded_array in storage.hpp header. I
> tried to fix it but i don't know how to do it.
> Can anybody help me?
> Here's the backtrace of that segmentation fault problem.
>

Don't call the dtors explicitly

    //A.~compressed_matrix();
    //H.~compressed_matrix();

If you call them like you did, they are called again when A and H leaves
the scope of main().

But another weird thing happened to me. Compiling the example code by
typing
   g++-4.1.1 test.cc -I/home/maik/cvs/boost/ -O3
works fine, but doesn't when -DNDEBUG is added
   g++-4.1.1 test.cc -I/home/maik/cvs/boost/ -O3 -DNDEBUG

<error message>
/home/maik/cvs/boost/boost/numeric/ublas/operation.hpp: In function 'M&
boost::numeric::ublas::axpy_prod(const
boost::numeric::ublas::matrix_expression<E2>&, const
boost::numeric::ublas::matrix_expression<E2>&, M&, bool) [with M =
boost::numeric::ublas::compressed_matrix<double,
boost::numeric::ublas::basic_row_major<unsigned int, int>, 0u,
boost::numeric::ublas::unbounded_array<unsigned int,
std::allocator<unsigned int> >,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, E1 = boost::numeric::ublas::compressed_matrix<double,
boost::numeric::ublas::basic_row_major<unsigned int, int>, 0u,
boost::numeric::ublas::unbounded_array<unsigned int,
std::allocator<unsigned int> >,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>, E2 = boost::numeric::ublas::compressed_matrix<double,
boost::numeric::ublas::basic_row_major<unsigned int, int>, 0u,
boost::numeric::ublas::unbounded_array<unsigned int,
std::allocator<unsigned int> >,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>]':
test.cc:37: instantiated from here
/home/maik/cvs/boost/boost/numeric/ublas/operation.hpp:723: error:
invalid use of undefined type 'struct
boost::numeric::ublas::zero_matrix<double>'
/home/maik/cvs/boost/boost/numeric/ublas/fwd.hpp:136: error: declaration
of 'struct boost::numeric::ublas::zero_matrix<double>'
</error message>

g++-3.4.6 says the same

Maik