This bugzilla service is closed. All entries have been migrated to
Bug 1330 - m_shiftOffset in CholmodBase should be double not RealScalar
Summary: m_shiftOffset in CholmodBase should be double not RealScalar
Alias: None
Product: Eigen
Classification: Unclassified
Component: Sparse (show other bugs)
Version: 3.2
Hardware: x86 - 64-bit Linux
: Normal Compilation Problem
Assignee: Nobody
Depends on:
Blocks: 3.3
  Show dependency treegraph
Reported: 2016-10-18 13:15 UTC by philip.avery
Modified: 2019-12-04 16:26 UTC (History)
3 users (show)

example program that exposes the issue (199 bytes, text/x-c++src)
2016-10-18 13:15 UTC, philip.avery
no flags Details

Description philip.avery 2016-10-18 13:15:29 UTC
Created attachment 748 [details]
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.
Comment 1 Christoph Hertzberg 2016-10-20 13:50:50 UTC
Just a small update: I confirm that this is obviously wrong and changing it as suggested makes it compile.
However, I tried extending the unit tests to float afterwards, and I always get failed decompositions for float or complex<float>.
I'm on Ubuntu 14.10 with libsuitesparse 3.1.0 -- maybe that is already the reason for the failure. (I'll try again on an ubuntu 16.10, as soon as I find the time)

I also tested RowMajor and StorageIndex=long matrices which fail (for reasons I think I know how to fix, however).
Comment 2 Gael Guennebaud 2016-11-03 09:31:32 UTC
Changeset:   462c06acd766
User:        ggael
Date:        2016-11-03 09:21:59+00:00
Summary:     Bug 1330: Cholmod supports double precision only, so let's trigger a static assertion if the scalar type does not match this requirement.

Comment 3 Nobody 2019-12-04 16:26:57 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance:

Note You need to log in before you can comment on or make changes to this bug.