This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 1156 - isApprox methods of certain classes should take const RealScalar& instead of RealScalar as precision argument
Summary: isApprox methods of certain classes should take const RealScalar& instead of ...
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: Geometry (show other bugs)
Version: 3.2
Hardware: All All
: Normal Unknown
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-26 22:34 UTC by twan_koolen
Modified: 2019-12-04 15:23 UTC (History)
4 users (show)



Attachments

Description twan_koolen 2016-01-26 22:34:45 UTC
While DenseBase::isApprox already takes a const RealScalar& argument as the prec argument, some classes take a RealScalar by value. This can cause alignment issues similar to http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1006, as well as being potentially expensive for certain custom scalar types.

Specifically, it looks like the following classes are affected:
./Eigen/src/Geometry/ParametrizedLine.h:  bool isApprox(const ParametrizedLine& other, typename NumTraits<Scalar>::Real prec = NumTraits<Scalar>::dummy_precision()) const
./Eigen/src/Geometry/Translation.h:  bool isApprox(const Translation& other, typename NumTraits<Scalar>::Real prec = NumTraits<Scalar>::dummy_precision()) const
./unsupported/Eigen/AlignedVector3:    inline bool isApprox(const MatrixBase<Derived>& other, RealScalar eps=NumTraits<Scalar>::dummy_precision()) const
Comment 1 Gael Guennebaud 2016-01-27 17:37:57 UTC
Thanks for the report, I found a few more:
devel: https://bitbucket.org/eigen/eigen/commits/7dfca64a4f83/
3.2:   https://bitbucket.org/eigen/eigen/commits/a0f1f2a625d2/
Comment 2 twan_koolen 2016-01-27 23:17:12 UTC
Awesome, thank you!
Comment 3 Nobody 2019-12-04 15:23:14 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/1156.

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