Big rewrite in the Sparse module: SparseMatrixBase no longer inherits MatrixBase.

That means a lot of features which were available for sparse matrices
via the dense (and super slow) implemention are no longer available.
All features which make sense for sparse matrices (aka can be implemented efficiently) will be
implemented soon, but don't expect to see an API as rich as for the dense path.
Other changes:
* no block(), row(), col() anymore.
* instead use .innerVector() to get a col or row vector of a matrix.
* .segment(), start(), end() will be back soon, not sure for block()
* faster cwise product
This commit is contained in:
Gael Guennebaud
2009-01-14 14:24:10 +00:00
parent ee87f5ee49
commit c4c70669d1
31 changed files with 1920 additions and 200 deletions

View File

@@ -56,14 +56,14 @@ class SparseMatrix
: public SparseMatrixBase<SparseMatrix<_Scalar, _Flags> >
{
public:
EIGEN_GENERIC_PUBLIC_INTERFACE(SparseMatrix)
EIGEN_SPARSE_GENERIC_PUBLIC_INTERFACE(SparseMatrix)
protected:
public:
typedef SparseMatrixBase<SparseMatrix> SparseBase;
enum {
RowMajor = SparseBase::RowMajor
RowMajor = SparseBase::IsRowMajor
};
typedef SparseMatrix<Scalar,(Flags&~RowMajorBit)|(RowMajor?RowMajorBit:0)> TransposedSparseMatrix;
@@ -267,7 +267,7 @@ class SparseMatrix
}
template<typename OtherDerived>
inline SparseMatrix(const MatrixBase<OtherDerived>& other)
inline SparseMatrix(const SparseMatrixBase<OtherDerived>& other)
: m_outerSize(0), m_innerSize(0), m_outerIndex(0)
{
*this = other.derived();
@@ -305,7 +305,7 @@ class SparseMatrix
}
template<typename OtherDerived>
inline SparseMatrix& operator=(const MatrixBase<OtherDerived>& other)
inline SparseMatrix& operator=(const SparseMatrixBase<OtherDerived>& other)
{
const bool needToTranspose = (Flags & RowMajorBit) != (OtherDerived::Flags & RowMajorBit);
if (needToTranspose)