[go: up one dir, main page]

isApprox methods of certain classes should take const RealScalar& instead of RealScalar as precision argument

Submitted by twa..@..il.com

Assigned to Nobody

Link to original bugzilla bug (#1156)
Version: 3.2

Description

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

Edited by Eigen Bugzilla