New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!

Bug 1156

Summary: isApprox methods of certain classes should take const RealScalar& instead of RealScalar as precision argument
Product: Eigen Reporter: twan_koolen
Component: GeometryAssignee: Nobody <eigen.nobody>
Status: RESOLVED FIXED    
Severity: Unknown CC: chtz, gael.guennebaud, hauke.heibel, jacob.benoit.1
Priority: Normal    
Version: 3.2   
Hardware: All   
OS: All   
Whiteboard:

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!