m_shiftOffset in CholmodBase should be double not RealScalar
Submitted by phi..@..il.com
Assigned to Nobody
Link to original bugzilla bug (#1330)
Version: 3.2
Operating system: Linux
Description
Created attachment 748
example program that exposes the issue
I have attached a small program in which the cholmod support module is used with single precision floating point. This does not compile with gcc 6.2. The error message is:
eigen/Eigen/src/CholmodSupport/CholmodSupport.h:279:26: error: cannot convert ‘Eigen::CholmodBase<Eigen::SparseMatrix<float>, 2, Eigen::CholmodSimplicialLLT<Eigen::SparseMatrix<float>, 2> >::RealScalar* {aka float*}’ to ‘double*’ for argument ‘2’ to ‘int cholmod_factorize_p(cholmod_sparse*, double*, int*, std::size_t, cholmod_factor*, cholmod_common*)’
cholmod_factorize_p(&A, m_shiftOffset, 0, 0, m_cholmodFactor, &m_cholmod);
~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The issue can be fixed by changing m_shiftOffset to double rather than RealScalar. I am using version 4.5.3 of the suitesparse library from the ubuntu 16.10 repository.
Attachment 748, "example program that exposes the issue":
cholmod.cpp