add a flexible sparse matrix class designed for fast matrix assembly

This commit is contained in:
Gael Guennebaud
2009-01-19 15:20:45 +00:00
parent 385fd3d918
commit 178858f1bd
12 changed files with 512 additions and 117 deletions

View File

@@ -102,30 +102,36 @@ enum {
template<typename Derived> class SparseMatrixBase;
template<typename _Scalar, int _Flags = 0> class SparseMatrix;
template<typename _Scalar, int _Flags = 0> class DynamicSparseMatrix;
template<typename _Scalar, int _Flags = 0> class SparseVector;
template<typename _Scalar, int _Flags = 0> class MappedSparseMatrix;
template<typename MatrixType> class SparseTranspose;
template<typename MatrixType> class SparseInnerVector;
template<typename Derived> class SparseCwise;
template<typename UnaryOp, typename MatrixType> class SparseCwiseUnaryOp;
template<typename BinaryOp, typename Lhs, typename Rhs> class SparseCwiseBinaryOp;
template<typename ExpressionType, unsigned int Added, unsigned int Removed> class SparseFlagged;
template<typename MatrixType> class SparseTranspose;
template<typename MatrixType> class SparseInnerVector;
template<typename Derived> class SparseCwise;
template<typename UnaryOp, typename MatrixType> class SparseCwiseUnaryOp;
template<typename BinaryOp, typename Lhs, typename Rhs> class SparseCwiseBinaryOp;
template<typename ExpressionType,
unsigned int Added, unsigned int Removed> class SparseFlagged;
template<typename Lhs, typename Rhs> struct ei_sparse_product_mode;
template<typename Lhs, typename Rhs, int ProductMode = ei_sparse_product_mode<Lhs,Rhs>::value> struct SparseProductReturnType;
const int AccessPatternNotSupported = 0x0;
const int AccessPatternSupported = 0x1;
const int CoherentAccessPattern = 0x1;
const int InnerRandomAccessPattern = 0x2 | CoherentAccessPattern;
const int OuterRandomAccessPattern = 0x4 | CoherentAccessPattern;
const int RandomAccessPattern = 0x8 | OuterRandomAccessPattern | InnerRandomAccessPattern;
template<typename MatrixType, int AccessPattern> struct ei_support_access_pattern
{
enum { ret = (int(ei_traits<MatrixType>::SupportedAccessPatterns) & AccessPattern) == AccessPattern
? AccessPatternSupported
: AccessPatternNotSupported
};
};
// const int AccessPatternNotSupported = 0x0;
// const int AccessPatternSupported = 0x1;
//
// template<typename MatrixType, int AccessPattern> struct ei_support_access_pattern
// {
// enum { ret = (int(ei_traits<MatrixType>::SupportedAccessPatterns) & AccessPattern) == AccessPattern
// ? AccessPatternSupported
// : AccessPatternNotSupported
// };
// };
template<typename T> class ei_eval<T,IsSparse>
{