aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/CholmodSupport/CholmodSupport.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-01-29 23:02:22 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-01-29 23:02:22 +0100
commit699634890afdce914553862464450966ead40ad0 (patch)
tree838370fb6b12da205b630eadaa34e2c0faad1d47 /Eigen/src/CholmodSupport/CholmodSupport.h
parent15084cf1ac1f58085cd0635676aa1d28efb268de (diff)
bug #946: generalize Cholmod::solve to handle any rhs expression
Diffstat (limited to 'Eigen/src/CholmodSupport/CholmodSupport.h')
-rw-r--r--Eigen/src/CholmodSupport/CholmodSupport.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/Eigen/src/CholmodSupport/CholmodSupport.h b/Eigen/src/CholmodSupport/CholmodSupport.h
index c7c521b95..b8020a92c 100644
--- a/Eigen/src/CholmodSupport/CholmodSupport.h
+++ b/Eigen/src/CholmodSupport/CholmodSupport.h
@@ -273,9 +273,10 @@ class CholmodBase : public SparseSolverBase<Derived>
const Index size = m_cholmodFactor->n;
EIGEN_UNUSED_VARIABLE(size);
eigen_assert(size==b.rows());
+
+ // Cholmod needs column-major stoarge without inner-stride, which corresponds to the default behavior of Ref.
+ Ref<const Matrix<typename Rhs::Scalar,Dynamic,Dynamic,ColMajor> > b_ref(b.derived());
- // note: cd stands for Cholmod Dense
- Rhs& b_ref(b.const_cast_derived());
cholmod_dense b_cd = viewAsCholmod(b_ref);
cholmod_dense* x_cd = cholmod_solve(CHOLMOD_A, m_cholmodFactor, &b_cd, &m_cholmod);
if(!x_cd)