add experimental code for sparse matrix:

- uses the common "Compressed Column Storage" scheme
 - supports every unary and binary operators with xpr template
   assuming binaryOp(0,0) == 0 and unaryOp(0) = 0 (otherwise a sparse
   matrix doesnot make sense)
 - this is the first commit, so of course, there are still several shorcommings !
This commit is contained in:
Gael Guennebaud
2008-06-23 13:25:22 +00:00
parent 03d19f3bae
commit ea1990ef3d
8 changed files with 728 additions and 0 deletions

View File

@@ -84,6 +84,8 @@ class CwiseBinaryOp : ei_no_assignment_operator,
typedef typename ei_traits<CwiseBinaryOp>::LhsNested LhsNested;
typedef typename ei_traits<CwiseBinaryOp>::RhsNested RhsNested;
class InnerIterator;
inline CwiseBinaryOp(const Lhs& lhs, const Rhs& rhs, const BinaryOp& func = BinaryOp())
: m_lhs(lhs), m_rhs(rhs), m_functor(func)
{

View File

@@ -69,6 +69,8 @@ class CwiseUnaryOp : ei_no_assignment_operator,
EIGEN_GENERIC_PUBLIC_INTERFACE(CwiseUnaryOp)
class InnerIterator;
inline CwiseUnaryOp(const MatrixType& mat, const UnaryOp& func = UnaryOp())
: m_matrix(mat), m_functor(func) {}

View File

@@ -55,6 +55,8 @@ template<typename Derived> class MatrixBase
public:
class InnerIterator;
typedef typename ei_traits<Derived>::Scalar Scalar;
typedef typename ei_packet_traits<Scalar>::type PacketScalar;