New user self-registration is currently disabled. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Bug 1156 - isApprox methods of certain classes should take const RealScalar& instead of RealScalar as precision argument
isApprox methods of certain classes should take const RealScalar& instead of ...
Status: RESOLVED FIXED
Product: Eigen
Classification: Unclassified
Component: Geometry
3.2
All All
: Normal Unknown
Assigned To: Nobody
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2016-01-26 22:34 UTC by twan_koolen
Modified: 2016-01-27 23:17 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!

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