* Refactoring of the class hierarchy: introduction of DenseDirectAccessBase, removal of extra _Base/_Options template parameters.

* Introduction of strides-at-compile-time so for example the optimized code really knows when it needs to evaluate to a temporary
* StorageKind / XprKind
* Quaternion::setFromTwoVectors: use JacobiSVD instead of SVD
* ComplexSchur: support the 1x1 case
This commit is contained in:
Benoit Jacob
2010-04-16 10:13:32 -04:00
parent 1803db6e84
commit ff6a46105d
43 changed files with 269 additions and 229 deletions

View File

@@ -79,33 +79,31 @@ struct ei_traits<Map<MatrixType, Options, StrideType> >
{
typedef typename MatrixType::Scalar Scalar;
enum {
InnerStride = StrideType::InnerStrideAtCompileTime,
OuterStride = StrideType::OuterStrideAtCompileTime,
HasNoInnerStride = InnerStride <= 1,
HasNoOuterStride = OuterStride == 0,
InnerStrideAtCompileTime = StrideType::InnerStrideAtCompileTime,
OuterStrideAtCompileTime = StrideType::OuterStrideAtCompileTime,
HasNoInnerStride = InnerStrideAtCompileTime <= 1,
HasNoOuterStride = OuterStrideAtCompileTime == 0,
HasNoStride = HasNoInnerStride && HasNoOuterStride,
IsAligned = int(int(Options)&Aligned)==Aligned,
IsDynamicSize = MatrixType::SizeAtCompileTime==Dynamic,
KeepsPacketAccess = bool(HasNoInnerStride)
&& ( bool(IsDynamicSize)
|| HasNoOuterStride
|| ( OuterStride!=Dynamic && ((int(OuterStride)*sizeof(Scalar))%16)==0 ) ),
|| ( OuterStrideAtCompileTime!=Dynamic
&& ((int(OuterStrideAtCompileTime)*sizeof(Scalar))%16)==0 ) ),
Flags0 = ei_traits<MatrixType>::Flags,
Flags1 = IsAligned ? int(Flags0) | AlignedBit : int(Flags0) & ~AlignedBit,
Flags1 = IsAligned ? int(Flags0) | AlignedBit : int(Flags0) & ~AlignedBit,
Flags2 = HasNoStride ? int(Flags1) : int(Flags1 & ~LinearAccessBit),
Flags = KeepsPacketAccess ? int(Flags2) : (int(Flags2) & ~PacketAccessBit)
};
};
template<typename MatrixType, int Options, typename StrideType> class Map
: public MapBase<Map<MatrixType, Options, StrideType>,
typename MatrixType::template MakeBase<
Map<MatrixType, Options, StrideType>
>::Type>
: public MapBase<Map<MatrixType, Options, StrideType> >
{
public:
typedef MapBase<Map,typename MatrixType::template MakeBase<Map>::Type> Base;
typedef MapBase<Map> Base;
EIGEN_DENSE_PUBLIC_INTERFACE(Map)