diff options
author | Gael Guennebaud <g.gael@free.fr> | 2014-07-01 17:52:58 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2014-07-01 17:52:58 +0200 |
commit | 1e6f53e070ffb3d386bea3cda5e37569c0f11b37 (patch) | |
tree | b5ca62bf0b856313391ce4026ecb53824ccf9eb3 /Eigen/src/Core/DiagonalMatrix.h | |
parent | 6f846ef9c6ef3e838d1361a30dc11f65ddff967d (diff) |
Use DiagonalShape as the storage kind of DiagonalBase<>.
Diffstat (limited to 'Eigen/src/Core/DiagonalMatrix.h')
-rw-r--r-- | Eigen/src/Core/DiagonalMatrix.h | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/Eigen/src/Core/DiagonalMatrix.h b/Eigen/src/Core/DiagonalMatrix.h index 7a0b736f1..e26d24eb2 100644 --- a/Eigen/src/Core/DiagonalMatrix.h +++ b/Eigen/src/Core/DiagonalMatrix.h @@ -156,7 +156,7 @@ struct traits<DiagonalMatrix<_Scalar,SizeAtCompileTime,MaxSizeAtCompileTime> > : traits<Matrix<_Scalar,SizeAtCompileTime,SizeAtCompileTime,0,MaxSizeAtCompileTime,MaxSizeAtCompileTime> > { typedef Matrix<_Scalar,SizeAtCompileTime,1,0,MaxSizeAtCompileTime,1> DiagonalVectorType; - typedef Dense StorageKind; + typedef DiagonalShape StorageKind; typedef DenseIndex Index; enum { Flags = LvalueBit | NoPreferredStorageOrderBit @@ -280,7 +280,7 @@ struct traits<DiagonalWrapper<_DiagonalVectorType> > typedef _DiagonalVectorType DiagonalVectorType; typedef typename DiagonalVectorType::Scalar Scalar; typedef typename DiagonalVectorType::Index Index; - typedef typename DiagonalVectorType::StorageKind StorageKind; + typedef DiagonalShape StorageKind; typedef typename traits<DiagonalVectorType>::XprKind XprKind; enum { RowsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, @@ -364,23 +364,8 @@ bool MatrixBase<Derived>::isDiagonal(const RealScalar& prec) const #ifdef EIGEN_ENABLE_EVALUATORS namespace internal { - -// TODO currently a diagonal expression has the form DiagonalMatrix<> or DiagonalWrapper -// in the future diagonal-ness should be defined by the expression traits -template<typename _Scalar, int SizeAtCompileTime, int MaxSizeAtCompileTime> -struct evaluator_traits<DiagonalMatrix<_Scalar,SizeAtCompileTime,MaxSizeAtCompileTime> > -{ - typedef typename storage_kind_to_evaluator_kind<Dense>::Kind Kind; - typedef DiagonalShape Shape; - static const int AssumeAliasing = 0; -}; -template<typename Derived> -struct evaluator_traits<DiagonalWrapper<Derived> > -{ - typedef typename storage_kind_to_evaluator_kind<typename Derived::StorageKind>::Kind Kind; - typedef DiagonalShape Shape; - static const int AssumeAliasing = 0; -}; + +template<> struct storage_kind_to_shape<DiagonalShape> { typedef DiagonalShape Shape; }; struct Diagonal2Dense {}; |