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



Attachments

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

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

best
Angelos


@@ -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) {
         ++mid;
         swap(row(mid), row(j));
         swap(ind(mid), ind(j));
Comment 1 Christoph Hertzberg 2013-04-03 16:34:34 UTC
Fixed here:
https://bitbucket.org/eigen/eigen/commits/744cea6ac6c32b8b83c68814438261f21bf68c36

Thanks for the patch. If you have more sophisticated patches, please check how to make proper patches here:
http://eigen.tuxfamily.org/index.php?title=Mercurial


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 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/578.

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