Re: [eigen] Should I care about col major vs. row major for dense matrices

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Rohit Garg wrote:
> This is unlikely to be a major issue. Matrix algorithms, AFAIK, can be
> written to favor both row major and column major storage styles. I
> don't know how it is done in eigen (ie, whether both styles are
> implemented). Otherwise it may involve silent transposes, which are
> going to be costly if your matrices are big.

By big you mean, if they don't fit into the cache? Actually, I don't see
how transposing can help. Accessing the memory linearly is optimal, I
guess. In case of accessing a column of a row major matrix the cache
will hold rows. But I will only access one value of an entire row.
Transposing results in a col major matrix but I need to access a row
resulting in the same problem.
I tested my code and storage order seems have no impact. But in my
algorithms I access both columns and rows. But could be that the
matrices are too small to see some kind of effect. Or that because of
accessing both columns and rows changing the storage has no effect.

Regards,
Jens



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/