diff options
author | 2012-06-28 02:08:59 +0200 | |
---|---|---|
committer | 2012-06-28 02:08:59 +0200 | |
commit | a2ace4b79ad7a496ca22221ecad48f1c2748f261 (patch) | |
tree | 5e657b48e936b5c50a88acda5ba61d058aae9c2c /Eigen/src/Geometry/Rotation2D.h | |
parent | cc964b6cafab1a28ba0b5773c4a1bf7d037ff051 (diff) |
bug #482: pass scalar arguments by const references. This changeset only concerns the Core and Geometry modules
Diffstat (limited to 'Eigen/src/Geometry/Rotation2D.h')
-rw-r--r-- | Eigen/src/Geometry/Rotation2D.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Eigen/src/Geometry/Rotation2D.h b/Eigen/src/Geometry/Rotation2D.h index 4339e0f0f..154c3d853 100644 --- a/Eigen/src/Geometry/Rotation2D.h +++ b/Eigen/src/Geometry/Rotation2D.h @@ -74,7 +74,7 @@ protected: public: /** Construct a 2D counter clock wise rotation from the angle \a a in radian. */ - inline Rotation2D(Scalar a) : m_angle(a) {} + inline Rotation2D(const Scalar& a) : m_angle(a) {} /** \returns the rotation angle */ inline Scalar angle() const { return m_angle; } @@ -104,7 +104,7 @@ public: /** \returns the spherical interpolation between \c *this and \a other using * parameter \a t. It is in fact equivalent to a linear interpolation. */ - inline Rotation2D slerp(Scalar t, const Rotation2D& other) const + inline Rotation2D slerp(const Scalar& t, const Rotation2D& other) const { return m_angle * (1-t) + other.angle() * t; } /** \returns \c *this with scalar type casted to \a NewScalarType @@ -129,7 +129,7 @@ public: * determined by \a prec. * * \sa MatrixBase::isApprox() */ - bool isApprox(const Rotation2D& other, typename NumTraits<Scalar>::Real prec = NumTraits<Scalar>::dummy_precision()) const + bool isApprox(const Rotation2D& other, const typename NumTraits<Scalar>::Real& prec = NumTraits<Scalar>::dummy_precision()) const { return internal::isApprox(m_angle,other.m_angle, prec); } }; |