Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2005-02-04 09:18:36


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Friday 04 February 2005 15:01, Thomas Lemaire wrote:
> In ublas, the default for the matrix is row_major, does it mean there
> are optimization for this storage layout ?? Is it less efficient to use
> column_major layout ?

No. All operations work for row major and column major data. The speed
difference results only from the data distribution. Thus both layout are
efficient.

> I start using bindings to lapack, so I understand I need to use
> column_major matrix.

If your algorithms are designed for column major data this is no disadvantage
and ublas does its best, too.

But a large matrix vector multiplication using row major matrix is always
faster than using a column major matrix, because the latter has a worse
memory access pattern. (Except you call a specialized dgemm() )

mfg
Gunter
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFCA4RDghsXb/J0PcERAkLtAKCW39hDeyn5ArG01IUiXvkUbUgCkgCgsxIV
59A3k788NffM18x+wPBCcb4=
=4Svj
-----END PGP SIGNATURE-----