[eigen] merged the eigen-strides fork

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


Hi,

I just merged my "strides" fork. Here's a quick summary of some
important changes.

============================
1) ByOuterInner accessors

New methods:
- matrix.coeffByOuterInner(int outer, int inner)
- same for packets, coeffRef, copyCoeff, etc

This means that it's now super easy to iterate over coefficients of a
matrix in the "right" order for contiguous memory access:

for(int i = 0; i < matrix.outerSize(); ++i)
  for(int j = 0; j < matrix.innerSize(); ++j)
    result += matrix.coeffByOuterInner(i,j);

This led to big simplifications in files like Assign.h and Redux.h.

============================
2) New Inner/Outer strides

Inner stride means the "increment" in LAPACK language
Outer stride means the "leading dimension" in LAPACK language

The corresponding methods are outerStride() and innerStride() in all
DirectAccess expressions.

The old method stride() is kept alive for now, as a transitional measure.
---> Gael: the products code is still using it. Please port to
outerStride() / innerStride(): it's actually not obvious to me as some
products functions handle vectors :)

============================
3) Map with Stride

Map can now map non-contiguous arrays with inner and/or outer stride.

This is documented with several code examples in the documentation of
Map and of Stride.

============================
4) Row-vectors are row-major, col-vectors are col-major, regardless of
the RowMajorBit

And to implement this logic once and for all, we now have an enum
DenseBase::IsRowMajor. In the case of vectors, the RowMajorBit is
overridden by the orientation of the vector.

This means in particular that vectors always have outerSize==1.  (It's
actually an equivalent definition of a vector).

============================
5) Unit tests: new VERIFY_IS_EQUAL

Somehow we only had VERIFY_IS_APPROX, as most of the time we do fuzzy
compares. However, when no arithmetic is performed, e.g. as is common
in memory/map tests, exact comparisons are quicker to compile and are
what we want.

============================
6) ei_int_if_dynamic constructor now asserts that the size is the correct one.

Cheers,
Benoit



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