Boost logo

Ublas :

From: Markus Weimer (markus.weimer_at_[hidden])
Date: 2007-05-20 18:53:43


Hi,

I still seem unable to mix&match the different matrix types at will.
The following code does not compile:

void printDimension(const matrix_expression<double>& m){
        cout << m().size1() << endl;
}

The error message is:

error: request for member 'size1' in '(+
m)->boost::numeric::ublas::matrix_expression<E>::operator() [with E =
double]()', which is of non-class type 'const double'
./boost/numeric/ublas/expression_types.hpp: In member function 'const
E& boost::numeric::ublas::matrix_expression<E>::operator()() const
[with E = double]':
testBoost.cpp:11: instantiated from here
./boost/numeric/ublas/expression_types.hpp:308: error: invalid
static_cast from type 'const
boost::numeric::ublas::matrix_expression<double>* const' to type
'const double*'

I think I am missing something dead obvious, as polymorphism has been
around for a loong time ;-)

Any hints?

Thanks,

Markus