Boost logo

Ublas :

Subject: [ublas] [bindings LAPACK] Types in bindings::lapack::dospvx? (revision 64977)
From: Marcel Rehberg (Marcel.Rehberg_at_[hidden])
Date: 2010-10-28 11:25:26


Hi,

I recently started to use ublas and also the bindings tree of the sandbox
repository. I tried to solve a linear system with the method lapack::posvx
which has the signature:

posvx( const char fact, MatrixA& a, MatrixAF& af, char& equed,
         VectorS& s, MatrixB& b, MatrixX& x, typename remove_imaginary<
         typename bindings::value_type< MatrixA >::type >::type& rcond,
         VectorFERR& ferr, VectorBERR& berr )

The typenames are declared elsewhere. The point I'm getting at is that I
assumed the vectors (s, ferr and berr) to be of ublas::vector<double>
type. However when I tried that I got a compilation error which basically
ended in:

error: no type named ‘property_map’ in ‘struct
boost::numeric::bindings::detail::adaptor_access<boost::numeric::ublas::vector<double,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >,
void>’

The error is thrown (for the s vector) line 171 of dposvx.hpp:

BOOST_STATIC_ASSERT( (boost::is_same< typename remove_const<
           typename bindings::value_type< MatrixA >::type >::type,
           typename remove_const< typename bindings::value_type<
           VectorS >::type >::type >::value) );

So I tried to use ublas::matrix<> with one column for all vectors but got
another compile error:

boost/numeric/bindings/lapack/driver/posvx.hpp:198: error: no matching
function for call to ‘size(boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_column_major<unsigned int, int>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
>&)’

The line is

BOOST_ASSERT( bindings::size(berr) >= bindings::size_column(b) );

which I guess tries to assure that berr has the right size (weirdly enough
that is the only user-input vector that is checked for size). However it
assumes berr to be a vector and calls size(). When I commented that line
everything works fine and the method solves the linear system.

Did I use the right types for the input or is this an inconsistency?

Regards Marcel

ps. sorry for the long mail for such a minor problem, but I wanted to
explain the details.

-- 
Marcel Rehberg
Center for Systems Biology (ZBSA)
AG Modeling and Scientific Computing
Habsburger Str. 49
79104 Freiburg
Germany
phone: +49 (0)761 203-97159
http://omnibus.uni-freiburg.de/~dl954/