Boost logo

Ublas :

Subject: Re: [ublas] syev error
From: Nizar Khalifa Sallem (nksallem_at_[hidden])
Date: 2010-11-15 06:34:10


At Mon, 15 Nov 2010 10:11:14 +0100,
Nizar Khalifa Sallem wrote:
>
> At Mon, 15 Nov 2010 10:03:49 +0100,
> Rutger ter Borg wrote:
> >
> > On 11/15/2010 12:03 AM, Nizar Khalifa Sallem wrote:
> > > Hi all,
> > >
> > > I am trying to migrate from the bindings_v1 to the 'official' bindings
> > > but I am encountering some errors:
> > > the former call to syev is :
> > > int syev (char jobz, A& a, W& w)
> > > the later is this one :
> > > inline typename boost::disable_if< detail::is_workspace< VectorW>,
> > > std::ptrdiff_t>::type
> > > syev( const char jobz, MatrixA& a, VectorW& w )
> > >
> > > Here is my code:
> > > lapack::syev('V',A,alpha);
> > > with A a column major matrix and alpha a ublas::vector
> > >
> > > And here is corresponding gcc answer:
> > > boost/numeric/bindings/detail/property_map.hpp:30: error: no type
> > > named ‘property_map’ in ‘struct
> > > boost::numeric::bindings::detail::adaptor_access<boost::numeric::ublas::matrix<double,
> > > boost::numeric::ublas::basic_column_major<unsigned int, int>,
> > > boost::numeric::ublas::unbounded_array<double, std::allocator<double>
> > >>> , void>’
> > >
> > > --
> > > Nizar
> >
> > I guess it's time for a FAQ. :-)
> >
> > Q: "This doesn't compile, the compiler is complaining about no type
> > named 'property map'"
> > A: You probably didn't include the binding for each of the containers
> > you are passing to the algorithm. Add, e.g., #include
> > <boost/numeric/bindings/ublas/vector.hpp>, to your code.
> Hi Rutger,
> I was about to say I've solved it :)
> Actually that is what was going on:
> CA is for complete answer
> CA: 1. I was including ublas_matrix and ublas_vector from former
> binding/traits instead of ublas/matrix and ublas/vector
> 2. For the 'official' bindings the matrix you pass to a symmetric
> routine needs to be explicitely symmetric i.e. not ublas::matrix
> but ublas::symmetric_matrix
> May be this is worth sticking somewhere in the ublas FAQ for instance.
> Anyway, thank you very much Rutger
>
> >
> > Cheers,
> >
> > Rutger
> >
> >
> > _______________________________________________
> > ublas mailing list
> > ublas_at_[hidden]
> > http://lists.boost.org/mailman/listinfo.cgi/ublas
> > Sent to: nksallem_at_[hidden]
> >
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/ublas
> Sent to: nksallem_at_[hidden]
>
Hi again,

This time I couldn't figure it out, so I attach the error
corresponding to this snippet:
A is a ublas::matrix<double, ublas::column_major>, namespace
lapack = boost::numeric::bindings::lapack and namespace ublas =
boost::numeric::ublas.

ublas::triangular_adaptor<ublas::matrix<double, ublas::column_major>,
ublas::upper> A_up (A);
error = lapack::trtrs(ublas::trans(A_up), X);

In the include part I have:
#include <boost/numeric/bindings/lapack/computational/trtrs.hpp>
#include <boost/numeric/bindings/ublas.hpp>

and here is the error:

In file included from
boost-sandbox/boost/numeric/bindings/detail/adaptor.hpp:49,
                 from
                                                                 boost-sandbox/boost/numeric/bindings/begin.hpp:12,
                 from
                                                                 boost-sandbox/boost/numeric/bindings/lapack/computational/geqrf.hpp:18,
                 from
                                                                 test.cpp:13:
boost-sandbox/boost/numeric/bindings/detail/property_map.hpp:
In instantiation of
‘boost::numeric::bindings::detail::property_at<boost::numeric::ublas::matrix_unary2<boost::numeric::ublas::triangular_adaptor<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_column_major<unsigned int, int>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>
> >, boost::numeric::ublas::basic_upper<unsigned int> >,
> boost::numeric::ublas::scalar_identity<double> >,
> boost::numeric::bindings::tag::value_type>’:
boost-sandbox/boost/numeric/bindings/value_type.hpp:20:
instantiated from
‘boost::numeric::bindings::value_type<boost::numeric::ublas::matrix_unary2<boost::numeric::ublas::triangular_adaptor<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_column_major<unsigned int, int>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>
> >, boost::numeric::ublas::basic_upper<unsigned int> >,
> boost::numeric::ublas::scalar_identity<double> > >’
boost-sandbox/boost/numeric/bindings/lapack/computational/trtrs.hpp:179:
instantiated from ‘ptrdiff_t
boost::numeric::bindings::lapack::trtrs(const MatrixA&, MatrixB&)
[with MatrixA =
boost::numeric::ublas::matrix_unary2<boost::numeric::ublas::triangular_adaptor<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_column_major<unsigned int, int>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>
> >, boost::numeric::ublas::basic_upper<unsigned int> >,
> boost::numeric::ublas::scalar_identity<double> >, MatrixB =
> boost::numeric::ublas::matrix<double,
> boost::numeric::ublas::basic_row_major<unsigned int, int>,
> boost::numeric::ublas::unbounded_array<double,
> std::allocator<double> > >]’
test.cpp:123:
instantiated from here
boost-sandbox/boost/numeric/bindings/detail/property_map.hpp:30:
error: no type named ‘property_map’ in ‘struct
boost::numeric::bindings::detail::adaptor_access<boost::numeric::ublas::matrix_unary2<boost::numeric::ublas::triangular_adaptor<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_column_major<unsigned int, int>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double>
> >, boost::numeric::ublas::basic_upper<unsigned int> >,
> boost::numeric::ublas::scalar_identity<double> >, void>’