evaluate 1D sparse expressions into SparseVector and make the sparse operator<< and dot honor nested types

This commit is contained in:
Gael Guennebaud
2011-12-22 14:01:06 +01:00
parent 7f04845023
commit 2c03e6fccc
5 changed files with 56 additions and 16 deletions

View File

@@ -47,7 +47,7 @@ struct traits<SparseVector<_Scalar, _Options, _Index> >
typedef Sparse StorageKind;
typedef MatrixXpr XprKind;
enum {
IsColVector = _Options & RowMajorBit ? 0 : 1,
IsColVector = (_Options & RowMajorBit) ? 0 : 1,
RowsAtCompileTime = IsColVector ? Dynamic : 1,
ColsAtCompileTime = IsColVector ? 1 : Dynamic,
@@ -320,7 +320,7 @@ protected:
const bool needToTranspose = (Flags & RowMajorBit) != (OtherDerived::Flags & RowMajorBit);
if(needToTranspose)
{
Index size = other.innerSize();
Index size = other.size();
Index nnz = other.nonZeros();
resize(size);
reserve(nnz);