diff options
author | Gael Guennebaud <g.gael@free.fr> | 2014-07-22 12:54:03 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2014-07-22 12:54:03 +0200 |
commit | 4aac87251f16094c01e9c5c8bbf094cd471a2306 (patch) | |
tree | 3f5f2e5d0f0dd73a07fe15e652b8f4c35d930830 /Eigen/src | |
parent | 6daa6a0d164ac3c225645e47f55238e9ba2a32cc (diff) |
Re-enable a couple of unit tests with evaluators.
Diffstat (limited to 'Eigen/src')
-rw-r--r-- | Eigen/src/Core/SelfAdjointView.h | 2 | ||||
-rw-r--r-- | Eigen/src/SparseCore/SparseMatrix.h | 12 |
2 files changed, 11 insertions, 3 deletions
diff --git a/Eigen/src/Core/SelfAdjointView.h b/Eigen/src/Core/SelfAdjointView.h index c8bdec5d4..546f61252 100644 --- a/Eigen/src/Core/SelfAdjointView.h +++ b/Eigen/src/Core/SelfAdjointView.h @@ -35,7 +35,7 @@ struct traits<SelfAdjointView<MatrixType, UpLo> > : traits<MatrixType> typedef typename nested<MatrixType>::type MatrixTypeNested; typedef typename remove_all<MatrixTypeNested>::type MatrixTypeNestedCleaned; typedef MatrixType ExpressionType; - typedef typename MatrixType::PlainObject DenseMatrixType; + typedef typename MatrixType::PlainObject FullMatrixType; enum { Mode = UpLo | SelfAdjoint, Flags = MatrixTypeNestedCleaned::Flags & (HereditaryBits) diff --git a/Eigen/src/SparseCore/SparseMatrix.h b/Eigen/src/SparseCore/SparseMatrix.h index 5f0c3d0a7..6080c272a 100644 --- a/Eigen/src/SparseCore/SparseMatrix.h +++ b/Eigen/src/SparseCore/SparseMatrix.h @@ -52,7 +52,9 @@ struct traits<SparseMatrix<_Scalar, _Options, _Index> > MaxRowsAtCompileTime = Dynamic, MaxColsAtCompileTime = Dynamic, Flags = _Options | NestByRefBit | LvalueBit, +#ifndef EIGEN_TEST_EVALUATORS CoeffReadCost = NumTraits<Scalar>::ReadCost, +#endif SupportedAccessPatterns = InnerRandomAccessPattern }; }; @@ -74,8 +76,10 @@ struct traits<Diagonal<const SparseMatrix<_Scalar, _Options, _Index>, DiagIndex> ColsAtCompileTime = 1, MaxRowsAtCompileTime = Dynamic, MaxColsAtCompileTime = 1, - Flags = 0, - CoeffReadCost = _MatrixTypeNested::CoeffReadCost*10 + Flags = 0 +#ifndef EIGEN_TEST_EVALUATORS + , CoeffReadCost = _MatrixTypeNested::CoeffReadCost*10 +#endif }; }; @@ -1343,6 +1347,8 @@ template<typename _Scalar, int _Options, typename _Index> struct evaluator<SparseMatrix<_Scalar,_Options,_Index> > : evaluator_base<SparseMatrix<_Scalar,_Options,_Index> > { + typedef _Scalar Scalar; + typedef _Index Index; typedef SparseMatrix<_Scalar,_Options,_Index> SparseMatrixType; typedef typename SparseMatrixType::InnerIterator InnerIterator; typedef typename SparseMatrixType::ReverseInnerIterator ReverseInnerIterator; @@ -1358,6 +1364,8 @@ struct evaluator<SparseMatrix<_Scalar,_Options,_Index> > operator SparseMatrixType&() { return m_matrix->const_cast_derived(); } operator const SparseMatrixType&() const { return *m_matrix; } + Scalar coeff(Index row, Index col) const { return m_matrix->coeff(row,col); } + const SparseMatrixType *m_matrix; }; |