Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2005-08-24 07:33:26


Hello,

does anyone have an idea why

    matrix_column<triangular_matrix<DBL, lower> > cLk(L, 1);
    project( cLk, range(2, 3) )
      = project( column(A, 2), range(2, 3) );

compiles fine, but

    project( column(L, 2), range(2, 3) )
      = project( column(A, 2), range(2, 3) );

complains about discarding 'const' qualifier of column(L, 2)?

Is the type of column(L, 2) a const range even if L is non-const?

The full error message is:
cholesky_test.cpp:119: error: passing `const
   boost::numeric::ublas::vector_range<const
   boost::numeric::ublas::matrix_column<boost::numeric::ublas::triangular_matrix<DBL,
   boost::numeric::ublas::lower, boost::numeric::ublas::basic_row_major<size_t,
   ptrdiff_t>, boost::numeric::ublas::unbounded_array<DBL, std::allocator<DBL>
> > > >' as `this' argument of `boost::numeric::ublas::vector_range<E>&
   boost::numeric::ublas::vector_range<E>::operator=(const
   boost::numeric::ublas::vector_range<E>&) [with V = const
   boost::numeric::ublas::matrix_column<boost::numeric::ublas::triangular_matrix<DBL,
   boost::numeric::ublas::lower, boost::numeric::ublas::basic_row_major<size_t,
   ptrdiff_t>, boost::numeric::ublas::unbounded_array<DBL, std::allocator<DBL>
> > >]' discards qualifiers
/home/a11aguwi/include/boost/numeric/ublas/detail/temporary.hpp: At global
   scope:
/home/a11aguwi/include/boost/numeric/ublas/detail/temporary.hpp: In instantiation of `boost::numeric::ublas::vector_temporary_traits<const boost::numeric::ublas::matrix_column<boost::numeric::ublas::triangular_matrix<DBL, boost::numeric::ublas::lower, boost::numeric::ublas::basic_row_major<size_t, ptrdiff_t>, boost::numeric::ublas::unbounded_array<DBL, std::allocator<DBL> > > > >':
/home/a11aguwi/include/boost/numeric/ublas/vector_proxy.hpp:135: instantiated from `boost::numeric::ublas::vector_range<E>& boost::numeric::ublas::vector_range<E>::operator=(const boost::numeric::ublas::vector_range<E>&) [with V = const boost::numeric::ublas::matrix_column<boost::numeric::ublas::triangular_matrix<DBL, boost::numeric::ublas::lower, boost::numeric::ublas::basic_row_major<size_t, ptrdiff_t>, boost::numeric::ublas::unbounded_array<DBL, std::allocator<DBL> > > >]'
cholesky_test.cpp:119: instantiated from here
/home/a11aguwi/include/boost/numeric/ublas/detail/temporary.hpp:26: error: no
   type named `vector_temporary_type' in `const class
   boost::numeric::ublas::matrix_column<boost::numeric::ublas::triangular_matrix<DBL,
   boost::numeric::ublas::lower, boost::numeric::ublas::basic_row_major<size_t,
   ptrdiff_t>, boost::numeric::ublas::unbounded_array<DBL, std::allocator<DBL>
> > >'
/home/a11aguwi/include/boost/numeric/ublas/vector_proxy.hpp: In member function
   `boost::numeric::ublas::vector_range<E>&
   boost::numeric::ublas::vector_range<E>::operator=(const
   boost::numeric::ublas::vector_range<E>&) [with V = const
   boost::numeric::ublas::matrix_column<boost::numeric::ublas::triangular_matrix<DBL,
   boost::numeric::ublas::lower, boost::numeric::ublas::basic_row_major<size_t,
   ptrdiff_t>, boost::numeric::ublas::unbounded_array<DBL, std::allocator<DBL>
> > >]':
cholesky_test.cpp:119: instantiated from here
/home/a11aguwi/include/boost/numeric/ublas/vector_proxy.hpp:135: error: no type
   named `type' in `struct boost::numeric::ublas::vector_temporary_traits<const
   boost::numeric::ublas::matrix_column<boost::numeric::ublas::triangular_matrix<DBL,
   boost::numeric::ublas::lower, boost::numeric::ublas::basic_row_major<size_t,
   ptrdiff_t>, boost::numeric::ublas::unbounded_array<DBL, std::allocator<DBL>
> > > >'

mfg
Gunter