fix bug #219: Map Flags AlignedBit was miscomputed, didn't account for EIGEN_ALIGN

This commit is contained in:
Benoit Jacob 2011-03-10 10:17:17 -05:00
parent 9a47fb289b
commit dc36efbb8f
2 changed files with 6 additions and 1 deletions

View File

@ -95,7 +95,7 @@ struct traits<Map<PlainObjectType, MapOptions, StrideType> >
HasNoInnerStride = InnerStrideAtCompileTime == 1,
HasNoOuterStride = StrideType::OuterStrideAtCompileTime == 0,
HasNoStride = HasNoInnerStride && HasNoOuterStride,
IsAligned = int(int(MapOptions)&Aligned)==Aligned,
IsAligned = bool(EIGEN_ALIGN) && ((int(MapOptions)&Aligned)==Aligned),
IsDynamicSize = PlainObjectType::SizeAtCompileTime==Dynamic,
KeepsPacketAccess = bool(HasNoInnerStride)
&& ( bool(IsDynamicSize)

View File

@ -53,6 +53,11 @@ void dontalign(const MatrixType& m)
v = square * v;
v = a.adjoint() * v;
VERIFY(square.determinant() != Scalar(0));
// bug 219: MapAligned() was giving an assert with EIGEN_DONT_ALIGN, because Map Flags were miscomputed
Scalar* array = internal::aligned_new<Scalar>(rows);
v = VectorType::MapAligned(array, rows);
internal::aligned_delete(array, rows);
}
void test_dontalign()