From 1e6f53e070ffb3d386bea3cda5e37569c0f11b37 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 1 Jul 2014 17:52:58 +0200 Subject: Use DiagonalShape as the storage kind of DiagonalBase<>. --- Eigen/src/Core/DiagonalMatrix.h | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'Eigen/src/Core/DiagonalMatrix.h') 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 > : traits > { 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 > typedef _DiagonalVectorType DiagonalVectorType; typedef typename DiagonalVectorType::Scalar Scalar; typedef typename DiagonalVectorType::Index Index; - typedef typename DiagonalVectorType::StorageKind StorageKind; + typedef DiagonalShape StorageKind; typedef typename traits::XprKind XprKind; enum { RowsAtCompileTime = DiagonalVectorType::SizeAtCompileTime, @@ -364,23 +364,8 @@ bool MatrixBase::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 -struct evaluator_traits > -{ - typedef typename storage_kind_to_evaluator_kind::Kind Kind; - typedef DiagonalShape Shape; - static const int AssumeAliasing = 0; -}; -template -struct evaluator_traits > -{ - typedef typename storage_kind_to_evaluator_kind::Kind Kind; - typedef DiagonalShape Shape; - static const int AssumeAliasing = 0; -}; + +template<> struct storage_kind_to_shape { typedef DiagonalShape Shape; }; struct Diagonal2Dense {}; -- cgit v1.2.3