Enable to view a SparseVector as a Ref<SparseMatrix>

This commit is contained in:
Gael Guennebaud
2015-10-06 11:53:19 +02:00
parent 1b43860bc1
commit 9a070638de
2 changed files with 21 additions and 2 deletions

View File

@@ -72,6 +72,18 @@ protected:
{
::new (static_cast<Base*>(this)) Base(expr.rows(), expr.cols(), expr.nonZeros(), expr.outerIndexPtr(), expr.innerIndexPtr(), expr.valuePtr(), expr.innerNonZeroPtr());
}
template<int ExprOptions>
void construct(const SparseVector<Scalar,ExprOptions,StorageIndex>& expr)
{
::new (static_cast<Base*>(this)) Base(expr.size(), expr.nonZeros(), expr.innerIndexPtr(), expr.valuePtr());
}
template<int ExprOptions>
void construct(SparseVector<Scalar,ExprOptions,StorageIndex>& expr)
{
::new (static_cast<Base*>(this)) Base(expr.size(), expr.nonZeros(), expr.innerIndexPtr(), expr.valuePtr());
}
};
} // namespace internal