|[eigen] merged the eigen-strides fork|
[ Thread Index |
| More lists.tuxfamily.org/eigen Archives
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: [eigen] merged the eigen-strides fork
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Fri, 26 Feb 2010 22:14:09 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=14u/RZ5BKoNoFPCYgR4on9RSaEVaMQwAqqltuPb1CMY=; b=Sf5avQ8VNLL5HXnShBNMULOnxhUpaeb/VlKj9f360s01nKeB8oCKtcw+PThv0UKWi9 /NDlg9Fqs9xCeHSel+D25B+oqdTTDztJOrR9okuWFSVy9+hfcoUybw0tlaaFkGm9rVs4 QsTgF9yLgVQooo2Bym7k7SXzAZJjH060EmVno=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=x1vY0A6Sr/j/ygR8YYg6AnynorFx/WfkwXUMqkwOF2JaQoWuGyD72eqqJj/7l5sTnu pGTIN1h7diek5rcM65tlFO2vkNoE9iyjtHDfkGl7kPRl0rX9Gdvc+I0+MvgKkRZHfN+v swe4BX9KDt1tkJJ87WTbiF147GYYqU6/EmOJ4=
I just merged my "strides" fork. Here's a quick summary of some
1) ByOuterInner accessors
- 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
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
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.