Boost logo

Ublas :

From: Markus Weimer (markus.weimer_at_[hidden])
Date: 2007-05-23 01:03:46

Hi all,

> However, this is not what I want. I want to be sure that a matrix of
> double is passed, but that matrix can be of arbitrary type (sparse /
> dense). How can I achieve that?

I answered my own question and came up with the following definition:

// This code will accept any matrix of type double
template < template < class DataType > class MatrixType >
void printDimensions(const matrix_expression< MatrixType <double> > & m){
   cout << (m()).size1() << "x" << (m()).size2() << endl;

Is this the easiest way to achive a matrix-type agnostiv parameter in uBLAS?

Thanks in advance,