Boost logo

Boost Users :

From: william shortall (pecos_outwest_at_[hidden])
Date: 2003-04-23 20:16:43


--- geert_ceuppens <gceuppens_at_[hidden]> wrote:
> 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_at_[hidden]>
>
>
> 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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net