uBlas matrix - storage class
Is there a performance difference between the different storage classes for matrix and vector? If so, which one is the most performant? I could not find any reference to this in the documentation ... :^( Many thanks - Geert
--- geert_ceuppens
Is there a performance difference between the different storage classes for matrix and vector? If so, which one is the most performant? I could not find any reference to this in the documentation ... :^(
Many thanks - Geert
Hi Geert, There is little basic differance in speed whether you store a matrix in row major or column major fashon. The problem is when you want to read it out. It is always much faster to read out the same way you wrote it in. So if you store a matrix in row major fashion you should read it out in the same way. And avoid all algorithms that want to read it down the columns. The reason, of coarse, is that each row element is right next to the following one in memory and the memory caching and look ahead schemes read in a block of memory all at once, So you have seveal rows all at once. But if you read down the columns you are hopping all over memory and the caching doesn't work as well. Fortran guys store column major C++ guys store row major their algorithms if coded right take approx the same time. Bill Shortall
------------------------ Yahoo! Groups Sponsor
Info: http://www.boost.org Wiki:
http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl
Unsubscribe: mailto:boost-users-unsubscribe@yahoogroups.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
__________________________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo http://search.yahoo.com
participants (2)
-
geert_ceuppens
-
william shortall