Sparse module: add a more flexible SparseMatrix::fillrand() function

which allows to fill a matrix with random inner coordinates (makes sense
only when a very few coeffs are inserted per col/row)
This commit is contained in:
Gael Guennebaud
2008-12-11 18:26:24 +00:00
parent beabf008b0
commit 5015e48361
4 changed files with 68 additions and 5 deletions

View File

@@ -63,8 +63,8 @@ class SparseMatrixBase : public MatrixBase<Derived>
inline Derived& operator=(const MatrixBase<OtherDerived>& other)
{
// std::cout << "Derived& operator=(const MatrixBase<OtherDerived>& other)\n";
const bool transpose = (Flags & RowMajorBit) != (OtherDerived::Flags & RowMajorBit);
ei_assert((!transpose) && "the transpose operation is supposed to be handled in SparseMatrix::operator=");
//const bool transpose = (Flags & RowMajorBit) != (OtherDerived::Flags & RowMajorBit);
ei_assert((!((Flags & RowMajorBit) != (OtherDerived::Flags & RowMajorBit))) && "the transpose operation is supposed to be handled in SparseMatrix::operator=");
const int outerSize = other.outerSize();
//typedef typename ei_meta_if<transpose, LinkedVectorMatrix<Scalar,Flags&RowMajorBit>, Derived>::ret TempType;
// thanks to shallow copies, we always eval to a tempary