Sparse module:

* several fixes (transpose, matrix product, etc...)
 * Added a basic cholesky factorization
 * Added a low level hybrid dense/sparse vector class
   to help writing code involving intensive read/write
   in a fixed vector. It is currently used to implement
   the matrix product itself as well as in the Cholesky
   factorization.
This commit is contained in:
Gael Guennebaud
2008-10-04 14:23:00 +00:00
parent 1fc503e3ce
commit 068ff3370d
8 changed files with 859 additions and 103 deletions

View File

@@ -51,6 +51,7 @@ class SparseMatrixBase : public MatrixBase<Derived>
inline Derived& operator=(const Derived& other)
{
// std::cout << "Derived& operator=(const Derived& other)\n";
if (other.isRValue())
derived().swap(other.const_cast_derived());
else
@@ -61,7 +62,9 @@ class SparseMatrixBase : public MatrixBase<Derived>
template<typename OtherDerived>
inline Derived& operator=(const MatrixBase<OtherDerived>& other)
{
// std::cout << "Derived& operator=(const MatrixBase<OtherDerived>& other)\n";
const bool transpose = (Flags & RowMajorBit) != (OtherDerived::Flags & RowMajorBit);
// std::cout << "eval transpose = " << transpose << "\n";
const int outerSize = other.outerSize();
typedef typename ei_meta_if<transpose, LinkedVectorMatrix<Scalar,Flags&RowMajorBit>, Derived>::ret TempType;
TempType temp(other.rows(), other.cols());
@@ -88,6 +91,8 @@ class SparseMatrixBase : public MatrixBase<Derived>
template<typename OtherDerived>
inline Derived& operator=(const SparseMatrixBase<OtherDerived>& other)
{
// std::cout << typeid(OtherDerived).name() << "\n";
// std::cout << Flags << " " << OtherDerived::Flags << "\n";
const bool transpose = (Flags & RowMajorBit) != (OtherDerived::Flags & RowMajorBit);
// std::cout << "eval transpose = " << transpose << "\n";
const int outerSize = (int(OtherDerived::Flags) & RowMajorBit) ? other.rows() : other.cols();