aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/SparseCore/SparseRef.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2015-10-06 11:53:19 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2015-10-06 11:53:19 +0200
commit9a070638de607a3bb46ae777da8cf9757f527fd8 (patch)
tree2c4ed077f5ce017474eb86f27d68404e3e880124 /Eigen/src/SparseCore/SparseRef.h
parent1b43860bc164056834c106378d35c9e62a228010 (diff)
Enable to view a SparseVector as a Ref<SparseMatrix>
Diffstat (limited to 'Eigen/src/SparseCore/SparseRef.h')
-rw-r--r--Eigen/src/SparseCore/SparseRef.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/Eigen/src/SparseCore/SparseRef.h b/Eigen/src/SparseCore/SparseRef.h
index 8df62a119..08268b9e1 100644
--- a/Eigen/src/SparseCore/SparseRef.h
+++ b/Eigen/src/SparseCore/SparseRef.h
@@ -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