This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen

Bug 1330

Summary: m_shiftOffset in CholmodBase should be double not RealScalar
Product: Eigen Reporter: philip.avery
Component: SparseAssignee: Nobody <eigen.nobody>
Status: RESOLVED FIXED    
Severity: Compilation Problem CC: chtz, gael.guennebaud, philip.avery
Priority: Normal    
Version: 3.2   
Hardware: x86 - 64-bit   
OS: Linux   
Whiteboard:
Bug Depends on:    
Bug Blocks: 558    
Attachments:
Description Flags
example program that exposes the issue none

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
https://bitbucket.org/eigen/eigen/commits/462c06acd766/
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.

3.2: https://bitbucket.org/eigen/eigen/commits/41cd950313bc/
Comment 3 Nobody 2019-12-04 16:26:57 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com'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: https://gitlab.com/libeigen/eigen/issues/1330.