Boost logo

Ublas :

From: Ralf Denzer (denzer_at_[hidden])
Date: 2007-01-19 09:14:47


Hi,

I was playing a little bit with the bindings traits lib for ublas sparse
matrices and encounter some problems. My source code looks like:

//------
#include <boost/numeric/bindings/traits/ublas_vector.hpp>
#include <boost/numeric/bindings/traits/ublas_sparse.hpp>

namespace ublas = boost::numeric::ublas;
namespace traits = boost::numeric::bindings::traits;

int main() {
ublas::compressed_matrix<double> M(5,5,10);
traits::sparse_matrix_traits<ublas::compressed_matrix<double> >::storage(M);
traits::sparse_matrix_traits<ublas::compressed_matrix<double> >::size1(M);
traits::sparse_matrix_traits<ublas::compressed_matrix<double>
>::index1_storage(M);
}
//------

I'm getting the following compile time errors:

1. triggered by storage(M)
/mount/stokes/denzer/Projects/test_traits/src/test_traits.cpp:10: error:
'storage' is not a member of
'boost::numeric::bindings::traits::sparse_matrix_traits<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> > > >'

and 2. triggered by index1_storage(M)

/mount/stokes/denzer/Projects/test_traits/src/test_traits.cpp:12:
instantiated from here
/mount/stokes/denzer/local/include/boost/numeric/bindings/traits/ublas_sparse.hpp:73:
error: 'size1' is not a member of
'boost::numeric::ublas::basic_row_major<unsigned int, int>'

but the line with 'traits::sparse_...::size1(M)' seems to work.

I checkout boost from
:pserver:anonymous_at_[hidden]:/cvsroot/boost

and boost-sandbox from
:pserver:anonymous_at_[hidden]:/cvsroot/boost-sandbox
yesterday.

I tested this with g++ compiler
g++ --version
g++ (GCC) 4.1.2 20060901 (prerelease) (Debian 4.1.1-13)

and

g++-4.0 --version
g++-4.0 (GCC) 4.0.4 20060507 (prerelease) (Debian 4.0.3-3)

Do I make a stupid mistake in my example?

Ralf