Boost logo

Ublas :

Subject: Re: [ublas] LAPACK bindings error
From: Thomas Klimpel (thomas.klimpel_at_[hidden])
Date: 2014-03-24 13:28:08


Hi,

> Is this the latest version of boost/numeric/bindings?
> https://svn.boost.org/svn/boost/sandbox/numeric_bindings/boost/numeric/bindings/

Yes, at least that's the version I use. (Maybe I should try to get up to speed with "git", so I could answer such questions with more confidence.)

I think the errors that you showed now should be fixable. The first error I see is
 
/home/dmitry/zfilter/boost_1_55_0/boost/numeric/bindings/lapack/driver/gesv.hpp:
191:9: error: invalid application of 'sizeof' to incomplete type 'boost::STATIC_ASSERTION_FAILURE<false>'
         BOOST_STATIC_ASSERT( (bindings::is_column_major< MatrixB >::value) );
 
One issue here is that the lapack routine xGESV expects two matrices: A of size (n,n), and B of size(n,nrhs). The bindings are generated automatically, and we didn't generate a version to also accept a vector for B. (Not sure whether this would be desirable.)  
In case you already tried to use a matrix for B, you might have forgotten to add "blas::column_major", i.e. "ublas::matrix<double, ublas::column_major>" instead of just "ublas::matrix<double>", because lapack always expects column_major matrices.

Another error I see is
 
/home/dmitry/zfilter/boost_1_55_0/boost/numeric/bindings/detail/property_map.hpp
:30:85: error: no type named 'property_map' in 'struct boost::numeric::bindings::detail::adaptor_access<const boost::numeric::ublas::permutation_matrix<long unsigned int>, void>'
     typedef typename mpl::at< typename adaptor_access<T>::property_map, Key >::type type;

The type "ublas::permutation_matrix" from "numeric/ublas/lu.hpp" is totally unrelated to lapack and the bindings. You just need a vector of integers here (for example ublas::vector<fortran_int_t> or std::vector<fortran_int_t> would work, if you include numeric/bindings/std/vector.hpp), lapack will know how to interpret this as a permutation matrix.

Regards,
 
Thomas Klimpel