sparse matrix multiplication: did I beat MTL?

Irek Szczesniak <[email protected]> Thu, 11 May 2006 10:38:35 -0700
Newsgroups gmane.comp.lib.mtl.devel
Message-ID <[email protected]>
Hi,

I have two versions of my code: one that uses MTL, the other that uses
my small matrix implementation.  In both codes I multiply a dense
vector with a sparse matrix, where elements are polynomials.  In my
sample codes the matrix is 1000000x1000000 and has only 3 elements.
The vector has 1000000 elements.  It turns out that MTL takes much
longer to multiply a vector with a matrix.

I run the MTL version:

 > time ./mtl
multiplication time = 2.22875s

real    0m2.861s
user    0m2.720s
sys     0m0.118s

I run my implementation:

 > time ./my
multiplication time = 0.075815s

real    0m0.434s
user    0m0.342s
sys     0m0.092s

Therefore my version is 2.2287 / 0.0758 = 29.4 times faster.  It seems
that I'm doing something wrong.

I'm sending you as an attachment the sources.  They work with GCC
3.4.3, Linux 2.6.10 and GNU Make.

Thanks for reading.


Best,
Irek

_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/
mtl.tar.gz (application/x-gzip, 1.5 KB) - not displayed