Boost logo

Ublas :

Subject: [ublas] [bindings] Problem with assertion in GGES
From: Marco Guazzone (marco.guazzone_at_[hidden])
Date: 2010-07-14 09:48:54


Hi,

today I think I'm stressing a bit "bindings" people... sorry but I'm
rather new to this great lib.

I have trouble in successfully doing Generalized Schur Decomposition
by using GGES.

I attach a sample code.

If I compile this code with GCC 4.4.4:

  g++ -Wall -ansi -pedantic -lm -llapack -o lapack_gges lapack_gges.cpp

and run the obtained executable, I get this error:

--- [error] ---
lapack_gges: /home/marco/tmp/boost-numeric_bindings/boost/numeric/bindings/lapack/driver/gges.hpp:204:
static ptrdiff_t boost::numeric::bindings::lapack::gges_impl<Value,
typename boost::enable_if<boost::numeric::bindings::is_real<T>,
void>::type>::invoke(char, char, char, logical_t*, MatrixA&, MatrixB&,
fortran_int_t&, VectorALPHAR&, VectorALPHAI&, VectorBETA&, MatrixVSL&,
MatrixVSR&, boost::numeric::bindings::lapack::detail::workspace2<WORK,
BWORK>) [with MatrixA = boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_column_major<long unsigned int, long
int>, boost::numeric::ublas::unbounded_array<double,
std::allocator<double> > >, MatrixB =
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_column_major<long unsigned int, long
int>, boost::numeric::ublas::unbounded_array<double,
std::allocator<double> > >, VectorALPHAR =
boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>
> >, VectorALPHAI = boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>
> >, VectorBETA = boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>
> >, MatrixVSL = boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_column_major<long unsigned int, long
int>, boost::numeric::ublas::unbounded_array<double,
std::allocator<double> > >, MatrixVSR =
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_column_major<long unsigned int, long
int>, boost::numeric::ublas::unbounded_array<double,
std::allocator<double> > >, WORK =
boost::numeric::bindings::detail::array<double>, BWORK =
boost::numeric::bindings::detail::array<bool>, Value = double]:
Assertion `bindings::size(work.select(real_type())) >= min_size_work(
bindings::size_column(a) )' failed.
Aborted (core dumped)
--- [/error] ---

Looking inside the gges.hpp code, the failing assertion

        BOOST_ASSERT( bindings::size(work.select(real_type())) >=
min_size_work( bindings::size_column(a) ));

fails because for this example:

    bindings::size(work.select(real_type())) --> 28
    min_size_work(size_column(a)) --> 32

I've tried to comment this assertion and all works and the computations are OK.

So, where am I wrong?

Thank you for your patience!!

Cheers,

-- Marco