|
Ublas : |
From: Neal Becker (ndbecker2_at_[hidden])
Date: 2007-05-16 07:22:41
I can't figure this one out. How can vector_expression not have a
member 'size'?
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/matrix_proxy.hpp>
namespace ublas = boost::numeric::ublas;
template<typename AE>
void F (ublas::vector_expression<AE> const& mag) {
int i = mag.size();
}
template<typename T>
void G (ublas::matrix<T> const& mag) {
for (int r = 0; r < mag.size1(); ++r) {
F (row (mag, r));
}
}
int main() {
ublas::matrix<double> A;
G (A);
}
g++ -I /usr/local/src/boost.hg -fsyntax-only bug.cc
bug.cc: In function âvoid F(const
boost::numeric::ublas::vector_expression<E>&) [with AE =
boost::numeric::ublas::matrix_row<const
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<long unsigned int, long int>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> > >
>]â:
bug.cc:15: instantiated from âvoid G(const
boost::numeric::ublas::matrix<T,
boost::numeric::ublas::basic_row_major<long unsigned int, long int>,
boost::numeric::ublas::unbounded_array<T, std::allocator<_CharT> > >&)
[with T = double]â
bug.cc:21: instantiated from here
bug.cc:9: error: âconst class
boost::numeric::ublas::vector_expression<boost::numeric::ublas::matrix_row<const
boost::numeric::ublas::matrix<double,
boost::numeric::ublas::basic_row_major<long unsigned int, long int>,
boost::numeric::ublas::unbounded_array<double, std::allocator<double> > > >
>â has no member named âsizeâ