Boost logo

Ublas :

Subject: [ublas] prod(trans(M),M) performance?
From: W Eryk Wolski (wewolski_at_[hidden])
Date: 2009-10-26 04:54:06

hope you can give me some advice.
I tried different types of matrices matrix, mapped_matrix etc.
The best performance for matrix matrix multiplication I am getting with
ublas::matrix type. However, even with this type the computation time in
release mode for a 1000x1000 band matrix, measured with boost::timer is
tremendous: 111.4 s.

I am new to ublas so I am wondering how I can improve to code/compiler
settings etc to speed up the computation.

Preporcessor settings: NDEBUG;_CONSOLE;BOOST_UBLAS_NDEBUG, VS2008, Boost

namespace bubla = boost::numeric::ublas;
typedef double value_type;
typedef bubla::matrix<value_type> SparseMatrix;
unsigned int m = 1000;
SparseMatrix D(m,m,3*m), X;

bubla::matrix_vector_range<SparseMatrix > mvr(
                    D, bubla::range (0, m ), bubla::range(0, m )
bubla::matrix_vector_range<SparseMatrix > mvr2
                    D, bubla::range (0, m-1 ), bubla::range(1, m )
bubla::matrix_vector_range<SparseMatrix > mvr3
                    D, bubla::range (1, m ), bubla::range(0, m )
boost::timer t1;
X = bubla::trans( D );
X = bubla::prod( X , D ) ;
std::cout << t1.elapsed() << std::endl;


Witold Eryk Wolski
Heidmark str 5
D-28329 Bremen
tel.: 04215261837