Boost logo

Ublas :

From: Rutger ter Borg (rutger_at_[hidden])
Date: 2005-01-31 04:08:24


Hi,

since the upgrade to boost-1.32, several cases of using ublas-bindings
stopped to successfully compile, and I haven't been able to figure out why
(although it seems to involve temporaries). The following testcase fails
to compile with gcc-3.3.5, boost-1.32 and a boost bindings from
boost-sandbox of jan 31.

ublas::matrix<double> A(50,50);
ublas::vector<double> b(50);
ublas::vector<double> result(50);

atlas::set( 1.0, ublas::column(A,2));
atlas::gemv( ublas::trans(A), b, result );

I have included a small part of the complaints of the compiler below.
Thanks in advance for any help on this.

Regards,

Rutger

svm.cpp:222: error: invalid initialization of non-const reference of type '
   boost::numeric::ublas::matrix_column<boost::numeric::ublas::matrix<double,
   boost::numeric::ublas::row_major,
   boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
> >&
   ' from a temporary of type '
   boost::numeric::ublas::matrix_column<boost::numeric::ublas::matrix<double,
   boost::numeric::ublas::row_major,
   boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
> >'
/home/rutger/development/include/boost/numeric/bindings/atlas/cblas1.hpp:38:
error: in
   passing argument 2 of `void boost::numeric::bindings::atlas::set(const T&,
   Vct&) [with T = double, Vct =
   boost::numeric::ublas::matrix_column<boost::numeric::ublas::matrix<double,
   boost::numeric::ublas::row_major,
   boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
> >]
   '
/usr/include/boost/numeric/ublas/matrix_expression.hpp: In static member
   function `static typename
   boost::numeric::bindings::traits::detail::generate_const<MR, typename
   M::value_type>::type*
   boost::numeric::bindings::traits::matrix_detail_traits<boost::numeric::ublas::matrix_reference<E>,
   MR>::storage(MR&) [with M = boost::numeric::ublas::matrix<double,
   boost::numeric::ublas::row_major,
   boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >,
   MR =
   boost::numeric::ublas::matrix_reference<boost::numeric::ublas::matrix<double,
   boost::numeric::ublas::row_major,
   boost::numeric::ublas::unbounded_array<double, std::allocator<double> >
> >]
   ':
/home/rutger/development/include/boost/numeric/bindings/traits/ublas_matrix.hpp:295:
  instantiated from `static typename
boost::numeric::bindings::traits::default_vector_traits<MR, typename
M::value_type>::pointer
boost::numeric::bindings::traits::vector_detail_traits<boost::numeric::ublas::matrix_column<E>,
MC>::storage(MC&) [with M = boost::numeric::ublas::matrix<double,
boost::numeric::ublas::row_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >,
MC =
boost::numeric::ublas::matrix_column<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::row_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >
>]'
/home/rutger/development/include/boost/numeric/bindings/traits/vector_traits.hpp:76:
  instantiated from `typename
boost::numeric::bindings::traits::vector_traits<V>::pointer
boost::numeric::bindings::traits::vector_storage(V&) [with V =
boost::numeric::ublas::matrix_column<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::row_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >
>]'
/home/rutger/development/include/boost/numeric/bindings/atlas/cblas1.hpp:39:
  instantiated from `void boost::numeric::bindings::atlas::set(const T&,
Vct&) [with T = double, Vct =
boost::numeric::ublas::matrix_column<boost::numeric::ublas::matrix<double,
boost::numeric::ublas::row_major,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >
>]'
svm.cpp:222: instantiated from here