This bugzilla service is closed. All entries have been migrated to

Bug 1480

Summary: Sparse routines do not properly support AD scalar types
Product: Eigen Reporter: Brad Bell <bradbell>
Component: SparseAssignee: Nobody <eigen.nobody>
Status: NEW ---    
Severity: Feature Request CC: chtz, gael.guennebaud
Priority: Normal    
Version: 3.3 (current stable)   
Hardware: All   
OS: All   
Description Flags
Demonstrates problem using eigens AutoDiffScalar type. none

Description Brad Bell 2017-10-28 02:47:09 UTC
Created attachment 799 [details]
Demonstrates problem using eigens AutoDiffScalar type.

In some cases Eigen drops entires from a sparse matrix that have value zero. For  an example, see the attached program which demonstrates the problem using the unsupported AutoDiffScalar type.

In the context of AD, even though a value is zero, its derivative may be non-zero. CppAD has the notation of a value being identically zero, so that certain optimizations can be done in that case.

In the case where the scalar type was double, equal to zero and identically equal to zero would be the same, so any related optimizations would take place.

I would like to suggest that custom scalar type could define a function IdenticalZero(x) which would return true if the value is zero, and cannot changes in any way. Then Eigen would only drop entries that are Identicaly zero.
Comment 1 Nobody 2019-12-04 17:15:19 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: