Re: [eigen] Question about ColMajor vs. RowMajor

[ Thread Index | Date Index | More Archives ]

On 17.12.2011 01:27, Michael Dixon wrote:
My colleagues and I were recently playing around with changing the
default for matrices from ColMajor to RowMajor, and we found that
doing so changed the behavior of the () operator.  Specifically, when
accessing a two-dimensional matrix with a single index (e.g., mat(i)

I assume you compiled with -DNDEBUG or something similar?
IIRC operator() with single argument should only be used for single-dimensional matrices (i.e. vectors).

Actually (question to Gael/Benoit): Shouldn't there be a compile-time check/static assertion for operator(), making it work only on matrices which are known at compile-time to have (at least) one dimension fixed to 1?

Or is operator()(int) supposed to mime the MATLAB behavior of mat(i) now (i.e. viewing the matrix data as a vector)?


Dipl.-Inf. Christoph Hertzberg
Cartesium 0.051
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: (+49) 421-218-64252

Mail converted by MHonArc 2.6.19+