diff options
Diffstat (limited to 'extern/Eigen3/Eigen/src/SparseCore/SparseUtil.h')
-rw-r--r-- | extern/Eigen3/Eigen/src/SparseCore/SparseUtil.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/extern/Eigen3/Eigen/src/SparseCore/SparseUtil.h b/extern/Eigen3/Eigen/src/SparseCore/SparseUtil.h index 6062a086ff7..05023858b16 100644 --- a/extern/Eigen3/Eigen/src/SparseCore/SparseUtil.h +++ b/extern/Eigen3/Eigen/src/SparseCore/SparseUtil.h @@ -73,7 +73,6 @@ template<typename _Scalar, int _Flags = 0, typename _Index = int> class Dynamic template<typename _Scalar, int _Flags = 0, typename _Index = int> class SparseVector; template<typename _Scalar, int _Flags = 0, typename _Index = int> class MappedSparseMatrix; -template<typename MatrixType, int Size> class SparseInnerVectorSet; template<typename MatrixType, int Mode> class SparseTriangularView; template<typename MatrixType, unsigned int UpLo> class SparseSelfAdjointView; template<typename Lhs, typename Rhs> class SparseDiagonalProduct; @@ -99,23 +98,24 @@ template<typename T> struct eval<T,Sparse> template<typename T,int Cols> struct sparse_eval<T,1,Cols> { typedef typename traits<T>::Scalar _Scalar; - enum { _Flags = traits<T>::Flags| RowMajorBit }; + typedef typename traits<T>::Index _Index; public: - typedef SparseVector<_Scalar, _Flags> type; + typedef SparseVector<_Scalar, RowMajor, _Index> type; }; template<typename T,int Rows> struct sparse_eval<T,Rows,1> { typedef typename traits<T>::Scalar _Scalar; - enum { _Flags = traits<T>::Flags & (~RowMajorBit) }; + typedef typename traits<T>::Index _Index; public: - typedef SparseVector<_Scalar, _Flags> type; + typedef SparseVector<_Scalar, ColMajor, _Index> type; }; template<typename T,int Rows,int Cols> struct sparse_eval { typedef typename traits<T>::Scalar _Scalar; - enum { _Flags = traits<T>::Flags }; + typedef typename traits<T>::Index _Index; + enum { _Options = ((traits<T>::Flags&RowMajorBit)==RowMajorBit) ? RowMajor : ColMajor }; public: - typedef SparseMatrix<_Scalar, _Flags> type; + typedef SparseMatrix<_Scalar, _Options, _Index> type; }; template<typename T> struct sparse_eval<T,1,1> { @@ -127,12 +127,10 @@ template<typename T> struct sparse_eval<T,1,1> { template<typename T> struct plain_matrix_type<T,Sparse> { typedef typename traits<T>::Scalar _Scalar; - enum { - _Flags = traits<T>::Flags - }; - + typedef typename traits<T>::Index _Index; + enum { _Options = ((traits<T>::Flags&RowMajorBit)==RowMajorBit) ? RowMajor : ColMajor }; public: - typedef SparseMatrix<_Scalar, _Flags> type; + typedef SparseMatrix<_Scalar, _Options, _Index> type; }; } // end namespace internal @@ -145,7 +143,7 @@ template<typename T> struct plain_matrix_type<T,Sparse> * * \sa SparseMatrix::setFromTriplets() */ -template<typename Scalar, typename Index=unsigned int> +template<typename Scalar, typename Index=typename SparseMatrix<Scalar>::Index > class Triplet { public: |