This bugzilla service is closed. All entries have been migrated to
Bug 578 - Avoid std::abs for mpfr compatibility
Summary: Avoid std::abs for mpfr compatibility
Alias: None
Product: Eigen
Classification: Unclassified
Component: Sparse (show other bugs)
Version: 3.2
Hardware: All All
: Normal Unknown
Assignee: Nobody
Depends on:
Reported: 2013-04-03 16:06 UTC by Angelos
Modified: 2019-12-04 12:13 UTC (History)
1 user (show)


Description Angelos 2013-04-03 16:06:17 UTC

Here is a small patch for src/IterativeLinearSolvers/IncompleteLUT.h
that restores mpfr compatibility.


@@ -29,6 +29,8 @@
   typedef typename VectorV::RealScalar RealScalar;
   using std::swap;
+  using std::abs;
   int mid;
   int n = row.size(); /* length of the vector */
   int first, last ; 
@@ -40,9 +42,9 @@
   do {
     mid = first; 
-    RealScalar abskey = std::abs(row(mid)); 
+    RealScalar abskey = abs(row(mid)); 
     for (int j = first + 1; j <= last; j++) {
-      if ( std::abs(row(j)) > abskey) {
+      if ( abs(row(j)) > abskey) {
         swap(row(mid), row(j));
         swap(ind(mid), ind(j));
Comment 1 Christoph Hertzberg 2013-04-03 16:34:34 UTC
Fixed here:

Thanks for the patch. If you have more sophisticated patches, please check how to make proper patches here:

The class might require most int replaced by Index, but I guess there is no urgent need at the moment.
Comment 2 Nobody 2019-12-04 12:13: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:

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