mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-13 04:09:10 +08:00
bug #482: pass scalar arguments by const references. This changeset only concerns the Core and Geometry modules
This commit is contained in:
parent
cc964b6caf
commit
a2ace4b79a
@ -310,7 +310,7 @@ DenseBase<Derived>::LinSpaced(const Scalar& low, const Scalar& high)
|
|||||||
/** \returns true if all coefficients in this matrix are approximately equal to \a value, to within precision \a prec */
|
/** \returns true if all coefficients in this matrix are approximately equal to \a value, to within precision \a prec */
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
bool DenseBase<Derived>::isApproxToConstant
|
bool DenseBase<Derived>::isApproxToConstant
|
||||||
(const Scalar& val, RealScalar prec) const
|
(const Scalar& val, const RealScalar& prec) const
|
||||||
{
|
{
|
||||||
for(Index j = 0; j < cols(); ++j)
|
for(Index j = 0; j < cols(); ++j)
|
||||||
for(Index i = 0; i < rows(); ++i)
|
for(Index i = 0; i < rows(); ++i)
|
||||||
@ -324,7 +324,7 @@ bool DenseBase<Derived>::isApproxToConstant
|
|||||||
* \returns true if all coefficients in this matrix are approximately equal to \a value, to within precision \a prec */
|
* \returns true if all coefficients in this matrix are approximately equal to \a value, to within precision \a prec */
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
bool DenseBase<Derived>::isConstant
|
bool DenseBase<Derived>::isConstant
|
||||||
(const Scalar& val, RealScalar prec) const
|
(const Scalar& val, const RealScalar& prec) const
|
||||||
{
|
{
|
||||||
return isApproxToConstant(val, prec);
|
return isApproxToConstant(val, prec);
|
||||||
}
|
}
|
||||||
@ -494,7 +494,7 @@ DenseBase<Derived>::Zero()
|
|||||||
* \sa class CwiseNullaryOp, Zero()
|
* \sa class CwiseNullaryOp, Zero()
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
bool DenseBase<Derived>::isZero(RealScalar prec) const
|
bool DenseBase<Derived>::isZero(const RealScalar& prec) const
|
||||||
{
|
{
|
||||||
for(Index j = 0; j < cols(); ++j)
|
for(Index j = 0; j < cols(); ++j)
|
||||||
for(Index i = 0; i < rows(); ++i)
|
for(Index i = 0; i < rows(); ++i)
|
||||||
@ -624,7 +624,7 @@ DenseBase<Derived>::Ones()
|
|||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
bool DenseBase<Derived>::isOnes
|
bool DenseBase<Derived>::isOnes
|
||||||
(RealScalar prec) const
|
(const RealScalar& prec) const
|
||||||
{
|
{
|
||||||
return isApproxToConstant(Scalar(1), prec);
|
return isApproxToConstant(Scalar(1), prec);
|
||||||
}
|
}
|
||||||
@ -729,7 +729,7 @@ MatrixBase<Derived>::Identity()
|
|||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
bool MatrixBase<Derived>::isIdentity
|
bool MatrixBase<Derived>::isIdentity
|
||||||
(RealScalar prec) const
|
(const RealScalar& prec) const
|
||||||
{
|
{
|
||||||
for(Index j = 0; j < cols(); ++j)
|
for(Index j = 0; j < cols(); ++j)
|
||||||
{
|
{
|
||||||
|
@ -363,17 +363,17 @@ template<typename Derived> class DenseBase
|
|||||||
|
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
bool isApprox(const DenseBase<OtherDerived>& other,
|
bool isApprox(const DenseBase<OtherDerived>& other,
|
||||||
RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
|
const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||||
bool isMuchSmallerThan(const RealScalar& other,
|
bool isMuchSmallerThan(const RealScalar& other,
|
||||||
RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
|
const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
bool isMuchSmallerThan(const DenseBase<OtherDerived>& other,
|
bool isMuchSmallerThan(const DenseBase<OtherDerived>& other,
|
||||||
RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
|
const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||||
|
|
||||||
bool isApproxToConstant(const Scalar& value, RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
|
bool isApproxToConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||||
bool isConstant(const Scalar& value, RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
|
bool isConstant(const Scalar& value, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||||
bool isZero(RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
|
bool isZero(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||||
bool isOnes(RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
|
bool isOnes(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||||
|
|
||||||
inline Derived& operator*=(const Scalar& other);
|
inline Derived& operator*=(const Scalar& other);
|
||||||
inline Derived& operator/=(const Scalar& other);
|
inline Derived& operator/=(const Scalar& other);
|
||||||
|
@ -287,7 +287,7 @@ MatrixBase<Derived>::asDiagonal() const
|
|||||||
* \sa asDiagonal()
|
* \sa asDiagonal()
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
bool MatrixBase<Derived>::isDiagonal(RealScalar prec) const
|
bool MatrixBase<Derived>::isDiagonal(const RealScalar& prec) const
|
||||||
{
|
{
|
||||||
if(cols() != rows()) return false;
|
if(cols() != rows()) return false;
|
||||||
RealScalar maxAbsOnDiagonal = static_cast<RealScalar>(-1);
|
RealScalar maxAbsOnDiagonal = static_cast<RealScalar>(-1);
|
||||||
|
@ -238,7 +238,7 @@ MatrixBase<Derived>::lpNorm() const
|
|||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
bool MatrixBase<Derived>::isOrthogonal
|
bool MatrixBase<Derived>::isOrthogonal
|
||||||
(const MatrixBase<OtherDerived>& other, RealScalar prec) const
|
(const MatrixBase<OtherDerived>& other, const RealScalar& prec) const
|
||||||
{
|
{
|
||||||
typename internal::nested<Derived,2>::type nested(derived());
|
typename internal::nested<Derived,2>::type nested(derived());
|
||||||
typename internal::nested<OtherDerived,2>::type otherNested(other.derived());
|
typename internal::nested<OtherDerived,2>::type otherNested(other.derived());
|
||||||
@ -257,7 +257,7 @@ bool MatrixBase<Derived>::isOrthogonal
|
|||||||
* Output: \verbinclude MatrixBase_isUnitary.out
|
* Output: \verbinclude MatrixBase_isUnitary.out
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
bool MatrixBase<Derived>::isUnitary(RealScalar prec) const
|
bool MatrixBase<Derived>::isUnitary(const RealScalar& prec) const
|
||||||
{
|
{
|
||||||
typename Derived::Nested nested(derived());
|
typename Derived::Nested nested(derived());
|
||||||
for(Index i = 0; i < cols(); ++i)
|
for(Index i = 0; i < cols(); ++i)
|
||||||
|
@ -34,7 +34,7 @@ namespace internal
|
|||||||
template<typename Derived, typename OtherDerived, bool is_integer = NumTraits<typename Derived::Scalar>::IsInteger>
|
template<typename Derived, typename OtherDerived, bool is_integer = NumTraits<typename Derived::Scalar>::IsInteger>
|
||||||
struct isApprox_selector
|
struct isApprox_selector
|
||||||
{
|
{
|
||||||
static bool run(const Derived& x, const OtherDerived& y, typename Derived::RealScalar prec)
|
static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar& prec)
|
||||||
{
|
{
|
||||||
using std::min;
|
using std::min;
|
||||||
typename internal::nested<Derived,2>::type nested(x);
|
typename internal::nested<Derived,2>::type nested(x);
|
||||||
@ -46,7 +46,7 @@ struct isApprox_selector
|
|||||||
template<typename Derived, typename OtherDerived>
|
template<typename Derived, typename OtherDerived>
|
||||||
struct isApprox_selector<Derived, OtherDerived, true>
|
struct isApprox_selector<Derived, OtherDerived, true>
|
||||||
{
|
{
|
||||||
static bool run(const Derived& x, const OtherDerived& y, typename Derived::RealScalar)
|
static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar&)
|
||||||
{
|
{
|
||||||
return x.matrix() == y.matrix();
|
return x.matrix() == y.matrix();
|
||||||
}
|
}
|
||||||
@ -55,7 +55,7 @@ struct isApprox_selector<Derived, OtherDerived, true>
|
|||||||
template<typename Derived, typename OtherDerived, bool is_integer = NumTraits<typename Derived::Scalar>::IsInteger>
|
template<typename Derived, typename OtherDerived, bool is_integer = NumTraits<typename Derived::Scalar>::IsInteger>
|
||||||
struct isMuchSmallerThan_object_selector
|
struct isMuchSmallerThan_object_selector
|
||||||
{
|
{
|
||||||
static bool run(const Derived& x, const OtherDerived& y, typename Derived::RealScalar prec)
|
static bool run(const Derived& x, const OtherDerived& y, const typename Derived::RealScalar& prec)
|
||||||
{
|
{
|
||||||
return x.cwiseAbs2().sum() <= abs2(prec) * y.cwiseAbs2().sum();
|
return x.cwiseAbs2().sum() <= abs2(prec) * y.cwiseAbs2().sum();
|
||||||
}
|
}
|
||||||
@ -64,7 +64,7 @@ struct isMuchSmallerThan_object_selector
|
|||||||
template<typename Derived, typename OtherDerived>
|
template<typename Derived, typename OtherDerived>
|
||||||
struct isMuchSmallerThan_object_selector<Derived, OtherDerived, true>
|
struct isMuchSmallerThan_object_selector<Derived, OtherDerived, true>
|
||||||
{
|
{
|
||||||
static bool run(const Derived& x, const OtherDerived&, typename Derived::RealScalar)
|
static bool run(const Derived& x, const OtherDerived&, const typename Derived::RealScalar&)
|
||||||
{
|
{
|
||||||
return x.matrix() == Derived::Zero(x.rows(), x.cols()).matrix();
|
return x.matrix() == Derived::Zero(x.rows(), x.cols()).matrix();
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ struct isMuchSmallerThan_object_selector<Derived, OtherDerived, true>
|
|||||||
template<typename Derived, bool is_integer = NumTraits<typename Derived::Scalar>::IsInteger>
|
template<typename Derived, bool is_integer = NumTraits<typename Derived::Scalar>::IsInteger>
|
||||||
struct isMuchSmallerThan_scalar_selector
|
struct isMuchSmallerThan_scalar_selector
|
||||||
{
|
{
|
||||||
static bool run(const Derived& x, const typename Derived::RealScalar& y, typename Derived::RealScalar prec)
|
static bool run(const Derived& x, const typename Derived::RealScalar& y, const typename Derived::RealScalar& prec)
|
||||||
{
|
{
|
||||||
return x.cwiseAbs2().sum() <= abs2(prec * y);
|
return x.cwiseAbs2().sum() <= abs2(prec * y);
|
||||||
}
|
}
|
||||||
@ -82,7 +82,7 @@ struct isMuchSmallerThan_scalar_selector
|
|||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
struct isMuchSmallerThan_scalar_selector<Derived, true>
|
struct isMuchSmallerThan_scalar_selector<Derived, true>
|
||||||
{
|
{
|
||||||
static bool run(const Derived& x, const typename Derived::RealScalar&, typename Derived::RealScalar)
|
static bool run(const Derived& x, const typename Derived::RealScalar&, const typename Derived::RealScalar&)
|
||||||
{
|
{
|
||||||
return x.matrix() == Derived::Zero(x.rows(), x.cols()).matrix();
|
return x.matrix() == Derived::Zero(x.rows(), x.cols()).matrix();
|
||||||
}
|
}
|
||||||
@ -112,7 +112,7 @@ template<typename Derived>
|
|||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
bool DenseBase<Derived>::isApprox(
|
bool DenseBase<Derived>::isApprox(
|
||||||
const DenseBase<OtherDerived>& other,
|
const DenseBase<OtherDerived>& other,
|
||||||
RealScalar prec
|
const RealScalar& prec
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return internal::isApprox_selector<Derived, OtherDerived>::run(derived(), other.derived(), prec);
|
return internal::isApprox_selector<Derived, OtherDerived>::run(derived(), other.derived(), prec);
|
||||||
@ -134,7 +134,7 @@ bool DenseBase<Derived>::isApprox(
|
|||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
bool DenseBase<Derived>::isMuchSmallerThan(
|
bool DenseBase<Derived>::isMuchSmallerThan(
|
||||||
const typename NumTraits<Scalar>::Real& other,
|
const typename NumTraits<Scalar>::Real& other,
|
||||||
RealScalar prec
|
const RealScalar& prec
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return internal::isMuchSmallerThan_scalar_selector<Derived>::run(derived(), other, prec);
|
return internal::isMuchSmallerThan_scalar_selector<Derived>::run(derived(), other, prec);
|
||||||
@ -154,7 +154,7 @@ template<typename Derived>
|
|||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
bool DenseBase<Derived>::isMuchSmallerThan(
|
bool DenseBase<Derived>::isMuchSmallerThan(
|
||||||
const DenseBase<OtherDerived>& other,
|
const DenseBase<OtherDerived>& other,
|
||||||
RealScalar prec
|
const RealScalar& prec
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return internal::isMuchSmallerThan_object_selector<Derived, OtherDerived>::run(derived(), other.derived(), prec);
|
return internal::isMuchSmallerThan_object_selector<Derived, OtherDerived>::run(derived(), other.derived(), prec);
|
||||||
|
@ -270,7 +270,7 @@ template<typename Derived> class MatrixBase
|
|||||||
template<unsigned int UpLo> typename ConstSelfAdjointViewReturnType<UpLo>::Type selfadjointView() const;
|
template<unsigned int UpLo> typename ConstSelfAdjointViewReturnType<UpLo>::Type selfadjointView() const;
|
||||||
|
|
||||||
const SparseView<Derived> sparseView(const Scalar& m_reference = Scalar(0),
|
const SparseView<Derived> sparseView(const Scalar& m_reference = Scalar(0),
|
||||||
typename NumTraits<Scalar>::Real m_epsilon = NumTraits<Scalar>::dummy_precision()) const;
|
const typename NumTraits<Scalar>::Real& m_epsilon = NumTraits<Scalar>::dummy_precision()) const;
|
||||||
static const IdentityReturnType Identity();
|
static const IdentityReturnType Identity();
|
||||||
static const IdentityReturnType Identity(Index rows, Index cols);
|
static const IdentityReturnType Identity(Index rows, Index cols);
|
||||||
static const BasisReturnType Unit(Index size, Index i);
|
static const BasisReturnType Unit(Index size, Index i);
|
||||||
@ -286,16 +286,16 @@ template<typename Derived> class MatrixBase
|
|||||||
Derived& setIdentity();
|
Derived& setIdentity();
|
||||||
Derived& setIdentity(Index rows, Index cols);
|
Derived& setIdentity(Index rows, Index cols);
|
||||||
|
|
||||||
bool isIdentity(RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
|
bool isIdentity(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||||
bool isDiagonal(RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
|
bool isDiagonal(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||||
|
|
||||||
bool isUpperTriangular(RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
|
bool isUpperTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||||
bool isLowerTriangular(RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
|
bool isLowerTriangular(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||||
|
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
bool isOrthogonal(const MatrixBase<OtherDerived>& other,
|
bool isOrthogonal(const MatrixBase<OtherDerived>& other,
|
||||||
RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
|
const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||||
bool isUnitary(RealScalar prec = NumTraits<Scalar>::dummy_precision()) const;
|
bool isUnitary(const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const;
|
||||||
|
|
||||||
/** \returns true if each coefficients of \c *this and \a other are all exactly equal.
|
/** \returns true if each coefficients of \c *this and \a other are all exactly equal.
|
||||||
* \warning When using floating point scalar values you probably should rather use a
|
* \warning When using floating point scalar values you probably should rather use a
|
||||||
|
@ -216,7 +216,7 @@ operator*(const ProductBase<Derived,Lhs,Rhs>& prod, typename Derived::Scalar x)
|
|||||||
template<typename Derived,typename Lhs,typename Rhs>
|
template<typename Derived,typename Lhs,typename Rhs>
|
||||||
typename internal::enable_if<!internal::is_same<typename Derived::Scalar,typename Derived::RealScalar>::value,
|
typename internal::enable_if<!internal::is_same<typename Derived::Scalar,typename Derived::RealScalar>::value,
|
||||||
const ScaledProduct<Derived> >::type
|
const ScaledProduct<Derived> >::type
|
||||||
operator*(const ProductBase<Derived,Lhs,Rhs>& prod, typename Derived::RealScalar x)
|
operator*(const ProductBase<Derived,Lhs,Rhs>& prod, const typename Derived::RealScalar& x)
|
||||||
{ return ScaledProduct<Derived>(prod.derived(), x); }
|
{ return ScaledProduct<Derived>(prod.derived(), x); }
|
||||||
|
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ operator*(typename Derived::Scalar x,const ProductBase<Derived,Lhs,Rhs>& prod)
|
|||||||
template<typename Derived,typename Lhs,typename Rhs>
|
template<typename Derived,typename Lhs,typename Rhs>
|
||||||
typename internal::enable_if<!internal::is_same<typename Derived::Scalar,typename Derived::RealScalar>::value,
|
typename internal::enable_if<!internal::is_same<typename Derived::Scalar,typename Derived::RealScalar>::value,
|
||||||
const ScaledProduct<Derived> >::type
|
const ScaledProduct<Derived> >::type
|
||||||
operator*(typename Derived::RealScalar x,const ProductBase<Derived,Lhs,Rhs>& prod)
|
operator*(const typename Derived::RealScalar& x,const ProductBase<Derived,Lhs,Rhs>& prod)
|
||||||
{ return ScaledProduct<Derived>(prod.derived(), x); }
|
{ return ScaledProduct<Derived>(prod.derived(), x); }
|
||||||
|
|
||||||
namespace internal {
|
namespace internal {
|
||||||
|
@ -793,7 +793,7 @@ MatrixBase<Derived>::triangularView() const
|
|||||||
* \sa isLowerTriangular()
|
* \sa isLowerTriangular()
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
bool MatrixBase<Derived>::isUpperTriangular(RealScalar prec) const
|
bool MatrixBase<Derived>::isUpperTriangular(const RealScalar& prec) const
|
||||||
{
|
{
|
||||||
RealScalar maxAbsOnUpperPart = static_cast<RealScalar>(-1);
|
RealScalar maxAbsOnUpperPart = static_cast<RealScalar>(-1);
|
||||||
for(Index j = 0; j < cols(); ++j)
|
for(Index j = 0; j < cols(); ++j)
|
||||||
@ -818,7 +818,7 @@ bool MatrixBase<Derived>::isUpperTriangular(RealScalar prec) const
|
|||||||
* \sa isUpperTriangular()
|
* \sa isUpperTriangular()
|
||||||
*/
|
*/
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
bool MatrixBase<Derived>::isLowerTriangular(RealScalar prec) const
|
bool MatrixBase<Derived>::isLowerTriangular(const RealScalar& prec) const
|
||||||
{
|
{
|
||||||
RealScalar maxAbsOnLowerPart = static_cast<RealScalar>(-1);
|
RealScalar maxAbsOnLowerPart = static_cast<RealScalar>(-1);
|
||||||
for(Index j = 0; j < cols(); ++j)
|
for(Index j = 0; j < cols(); ++j)
|
||||||
|
@ -91,7 +91,7 @@ public:
|
|||||||
* \warning If the \a axis vector is not normalized, then the angle-axis object
|
* \warning If the \a axis vector is not normalized, then the angle-axis object
|
||||||
* represents an invalid rotation. */
|
* represents an invalid rotation. */
|
||||||
template<typename Derived>
|
template<typename Derived>
|
||||||
inline AngleAxis(Scalar angle, const MatrixBase<Derived>& axis) : m_axis(axis), m_angle(angle) {}
|
inline AngleAxis(const Scalar& angle, const MatrixBase<Derived>& axis) : m_axis(axis), m_angle(angle) {}
|
||||||
/** Constructs and initialize the angle-axis rotation from a quaternion \a q. */
|
/** Constructs and initialize the angle-axis rotation from a quaternion \a q. */
|
||||||
template<typename QuatDerived> inline explicit AngleAxis(const QuaternionBase<QuatDerived>& q) { *this = q; }
|
template<typename QuatDerived> inline explicit AngleAxis(const QuaternionBase<QuatDerived>& q) { *this = q; }
|
||||||
/** Constructs and initialize the angle-axis rotation from a 3x3 rotation matrix. */
|
/** Constructs and initialize the angle-axis rotation from a 3x3 rotation matrix. */
|
||||||
@ -152,7 +152,7 @@ public:
|
|||||||
* determined by \a prec.
|
* determined by \a prec.
|
||||||
*
|
*
|
||||||
* \sa MatrixBase::isApprox() */
|
* \sa MatrixBase::isApprox() */
|
||||||
bool isApprox(const AngleAxis& other, typename NumTraits<Scalar>::Real prec = NumTraits<Scalar>::dummy_precision()) const
|
bool isApprox(const AngleAxis& other, const typename NumTraits<Scalar>::Real& prec = NumTraits<Scalar>::dummy_precision()) const
|
||||||
{ return m_axis.isApprox(other.m_axis, prec) && internal::isApprox(m_angle,other.m_angle, prec); }
|
{ return m_axis.isApprox(other.m_axis, prec) && internal::isApprox(m_angle,other.m_angle, prec); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ public:
|
|||||||
* such that the algebraic equation of the plane is \f$ n \cdot x + d = 0 \f$.
|
* such that the algebraic equation of the plane is \f$ n \cdot x + d = 0 \f$.
|
||||||
* \warning the vector normal is assumed to be normalized.
|
* \warning the vector normal is assumed to be normalized.
|
||||||
*/
|
*/
|
||||||
inline Hyperplane(const VectorType& n, Scalar d)
|
inline Hyperplane(const VectorType& n, const Scalar& d)
|
||||||
: m_coeffs(n.size()+1)
|
: m_coeffs(n.size()+1)
|
||||||
{
|
{
|
||||||
normal() = n;
|
normal() = n;
|
||||||
@ -271,7 +271,7 @@ public:
|
|||||||
*
|
*
|
||||||
* \sa MatrixBase::isApprox() */
|
* \sa MatrixBase::isApprox() */
|
||||||
template<int OtherOptions>
|
template<int OtherOptions>
|
||||||
bool isApprox(const Hyperplane<Scalar,AmbientDimAtCompileTime,OtherOptions>& other, typename NumTraits<Scalar>::Real prec = NumTraits<Scalar>::dummy_precision()) const
|
bool isApprox(const Hyperplane<Scalar,AmbientDimAtCompileTime,OtherOptions>& other, const typename NumTraits<Scalar>::Real& prec = NumTraits<Scalar>::dummy_precision()) const
|
||||||
{ return m_coeffs.isApprox(other.m_coeffs, prec); }
|
{ return m_coeffs.isApprox(other.m_coeffs, prec); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -108,7 +108,7 @@ public:
|
|||||||
VectorType projection(const VectorType& p) const
|
VectorType projection(const VectorType& p) const
|
||||||
{ return origin() + direction().dot(p-origin()) * direction(); }
|
{ return origin() + direction().dot(p-origin()) * direction(); }
|
||||||
|
|
||||||
VectorType pointAt( Scalar t ) const;
|
VectorType pointAt(const Scalar& t) const;
|
||||||
|
|
||||||
template <int OtherOptions>
|
template <int OtherOptions>
|
||||||
Scalar intersectionParameter(const Hyperplane<_Scalar, _AmbientDim, OtherOptions>& hyperplane) const;
|
Scalar intersectionParameter(const Hyperplane<_Scalar, _AmbientDim, OtherOptions>& hyperplane) const;
|
||||||
@ -169,7 +169,7 @@ inline ParametrizedLine<_Scalar, _AmbientDim,_Options>::ParametrizedLine(const H
|
|||||||
*/
|
*/
|
||||||
template <typename _Scalar, int _AmbientDim, int _Options>
|
template <typename _Scalar, int _AmbientDim, int _Options>
|
||||||
inline typename ParametrizedLine<_Scalar, _AmbientDim,_Options>::VectorType
|
inline typename ParametrizedLine<_Scalar, _AmbientDim,_Options>::VectorType
|
||||||
ParametrizedLine<_Scalar, _AmbientDim,_Options>::pointAt( _Scalar t ) const
|
ParametrizedLine<_Scalar, _AmbientDim,_Options>::pointAt(const _Scalar& t) const
|
||||||
{
|
{
|
||||||
return origin() + (direction()*t);
|
return origin() + (direction()*t);
|
||||||
}
|
}
|
||||||
|
@ -176,7 +176,7 @@ public:
|
|||||||
*
|
*
|
||||||
* \sa MatrixBase::isApprox() */
|
* \sa MatrixBase::isApprox() */
|
||||||
template<class OtherDerived>
|
template<class OtherDerived>
|
||||||
bool isApprox(const QuaternionBase<OtherDerived>& other, RealScalar prec = NumTraits<Scalar>::dummy_precision()) const
|
bool isApprox(const QuaternionBase<OtherDerived>& other, const RealScalar& prec = NumTraits<Scalar>::dummy_precision()) const
|
||||||
{ return coeffs().isApprox(other.coeffs(), prec); }
|
{ return coeffs().isApprox(other.coeffs(), prec); }
|
||||||
|
|
||||||
/** return the result vector of \a v through the rotation*/
|
/** return the result vector of \a v through the rotation*/
|
||||||
@ -263,7 +263,7 @@ public:
|
|||||||
* while internally the coefficients are stored in the following order:
|
* while internally the coefficients are stored in the following order:
|
||||||
* [\c x, \c y, \c z, \c w]
|
* [\c x, \c y, \c z, \c w]
|
||||||
*/
|
*/
|
||||||
inline Quaternion(Scalar w, Scalar x, Scalar y, Scalar z) : m_coeffs(x, y, z, w){}
|
inline Quaternion(const Scalar& w, const Scalar& x, const Scalar& y, const Scalar& z) : m_coeffs(x, y, z, w){}
|
||||||
|
|
||||||
/** Constructs and initialize a quaternion from the array data */
|
/** Constructs and initialize a quaternion from the array data */
|
||||||
inline Quaternion(const Scalar* data) : m_coeffs(data) {}
|
inline Quaternion(const Scalar* data) : m_coeffs(data) {}
|
||||||
|
@ -74,7 +74,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
/** Construct a 2D counter clock wise rotation from the angle \a a in radian. */
|
/** 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 */
|
/** \returns the rotation angle */
|
||||||
inline Scalar angle() const { return m_angle; }
|
inline Scalar angle() const { return m_angle; }
|
||||||
@ -104,7 +104,7 @@ public:
|
|||||||
/** \returns the spherical interpolation between \c *this and \a other using
|
/** \returns the spherical interpolation between \c *this and \a other using
|
||||||
* parameter \a t. It is in fact equivalent to a linear interpolation.
|
* 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; }
|
{ return m_angle * (1-t) + other.angle() * t; }
|
||||||
|
|
||||||
/** \returns \c *this with scalar type casted to \a NewScalarType
|
/** \returns \c *this with scalar type casted to \a NewScalarType
|
||||||
@ -129,7 +129,7 @@ public:
|
|||||||
* determined by \a prec.
|
* determined by \a prec.
|
||||||
*
|
*
|
||||||
* \sa MatrixBase::isApprox() */
|
* \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); }
|
{ return internal::isApprox(m_angle,other.m_angle, prec); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ public:
|
|||||||
* determined by \a prec.
|
* determined by \a prec.
|
||||||
*
|
*
|
||||||
* \sa MatrixBase::isApprox() */
|
* \sa MatrixBase::isApprox() */
|
||||||
bool isApprox(const UniformScaling& other, typename NumTraits<Scalar>::Real prec = NumTraits<Scalar>::dummy_precision()) const
|
bool isApprox(const UniformScaling& other, const typename NumTraits<Scalar>::Real& prec = NumTraits<Scalar>::dummy_precision()) const
|
||||||
{ return internal::isApprox(m_factor, other.factor(), prec); }
|
{ return internal::isApprox(m_factor, other.factor(), prec); }
|
||||||
|
|
||||||
};
|
};
|
||||||
@ -132,11 +132,11 @@ static inline UniformScaling<std::complex<RealScalar> > Scaling(const std::compl
|
|||||||
|
|
||||||
/** Constructs a 2D axis aligned scaling */
|
/** Constructs a 2D axis aligned scaling */
|
||||||
template<typename Scalar>
|
template<typename Scalar>
|
||||||
static inline DiagonalMatrix<Scalar,2> Scaling(Scalar sx, Scalar sy)
|
static inline DiagonalMatrix<Scalar,2> Scaling(const Scalar& sx, const Scalar& sy)
|
||||||
{ return DiagonalMatrix<Scalar,2>(sx, sy); }
|
{ return DiagonalMatrix<Scalar,2>(sx, sy); }
|
||||||
/** Constructs a 3D axis aligned scaling */
|
/** Constructs a 3D axis aligned scaling */
|
||||||
template<typename Scalar>
|
template<typename Scalar>
|
||||||
static inline DiagonalMatrix<Scalar,3> Scaling(Scalar sx, Scalar sy, Scalar sz)
|
static inline DiagonalMatrix<Scalar,3> Scaling(const Scalar& sx, const Scalar& sy, const Scalar& sz)
|
||||||
{ return DiagonalMatrix<Scalar,3>(sx, sy, sz); }
|
{ return DiagonalMatrix<Scalar,3>(sx, sy, sz); }
|
||||||
|
|
||||||
/** Constructs an axis aligned scaling expression from vector expression \a coeffs
|
/** Constructs an axis aligned scaling expression from vector expression \a coeffs
|
||||||
|
@ -521,8 +521,8 @@ public:
|
|||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
inline Transform& prescale(const MatrixBase<OtherDerived> &other);
|
inline Transform& prescale(const MatrixBase<OtherDerived> &other);
|
||||||
|
|
||||||
inline Transform& scale(Scalar s);
|
inline Transform& scale(const Scalar& s);
|
||||||
inline Transform& prescale(Scalar s);
|
inline Transform& prescale(const Scalar& s);
|
||||||
|
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
inline Transform& translate(const MatrixBase<OtherDerived> &other);
|
inline Transform& translate(const MatrixBase<OtherDerived> &other);
|
||||||
@ -536,8 +536,8 @@ public:
|
|||||||
template<typename RotationType>
|
template<typename RotationType>
|
||||||
inline Transform& prerotate(const RotationType& rotation);
|
inline Transform& prerotate(const RotationType& rotation);
|
||||||
|
|
||||||
Transform& shear(Scalar sx, Scalar sy);
|
Transform& shear(const Scalar& sx, const Scalar& sy);
|
||||||
Transform& preshear(Scalar sx, Scalar sy);
|
Transform& preshear(const Scalar& sx, const Scalar& sy);
|
||||||
|
|
||||||
inline Transform& operator=(const TranslationType& t);
|
inline Transform& operator=(const TranslationType& t);
|
||||||
inline Transform& operator*=(const TranslationType& t) { return translate(t.vector()); }
|
inline Transform& operator*=(const TranslationType& t) { return translate(t.vector()); }
|
||||||
@ -594,7 +594,7 @@ public:
|
|||||||
* determined by \a prec.
|
* determined by \a prec.
|
||||||
*
|
*
|
||||||
* \sa MatrixBase::isApprox() */
|
* \sa MatrixBase::isApprox() */
|
||||||
bool isApprox(const Transform& other, typename NumTraits<Scalar>::Real prec = NumTraits<Scalar>::dummy_precision()) const
|
bool isApprox(const Transform& other, const typename NumTraits<Scalar>::Real& prec = NumTraits<Scalar>::dummy_precision()) const
|
||||||
{ return m_matrix.isApprox(other.m_matrix, prec); }
|
{ return m_matrix.isApprox(other.m_matrix, prec); }
|
||||||
|
|
||||||
/** Sets the last row to [0 ... 0 1]
|
/** Sets the last row to [0 ... 0 1]
|
||||||
@ -804,7 +804,7 @@ Transform<Scalar,Dim,Mode,Options>::scale(const MatrixBase<OtherDerived> &other)
|
|||||||
* \sa prescale(Scalar)
|
* \sa prescale(Scalar)
|
||||||
*/
|
*/
|
||||||
template<typename Scalar, int Dim, int Mode, int Options>
|
template<typename Scalar, int Dim, int Mode, int Options>
|
||||||
inline Transform<Scalar,Dim,Mode,Options>& Transform<Scalar,Dim,Mode,Options>::scale(Scalar s)
|
inline Transform<Scalar,Dim,Mode,Options>& Transform<Scalar,Dim,Mode,Options>::scale(const Scalar& s)
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
|
EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
|
||||||
linearExt() *= s;
|
linearExt() *= s;
|
||||||
@ -831,7 +831,7 @@ Transform<Scalar,Dim,Mode,Options>::prescale(const MatrixBase<OtherDerived> &oth
|
|||||||
* \sa scale(Scalar)
|
* \sa scale(Scalar)
|
||||||
*/
|
*/
|
||||||
template<typename Scalar, int Dim, int Mode, int Options>
|
template<typename Scalar, int Dim, int Mode, int Options>
|
||||||
inline Transform<Scalar,Dim,Mode,Options>& Transform<Scalar,Dim,Mode,Options>::prescale(Scalar s)
|
inline Transform<Scalar,Dim,Mode,Options>& Transform<Scalar,Dim,Mode,Options>::prescale(const Scalar& s)
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
|
EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
|
||||||
m_matrix.template topRows<Dim>() *= s;
|
m_matrix.template topRows<Dim>() *= s;
|
||||||
@ -919,7 +919,7 @@ Transform<Scalar,Dim,Mode,Options>::prerotate(const RotationType& rotation)
|
|||||||
*/
|
*/
|
||||||
template<typename Scalar, int Dim, int Mode, int Options>
|
template<typename Scalar, int Dim, int Mode, int Options>
|
||||||
Transform<Scalar,Dim,Mode,Options>&
|
Transform<Scalar,Dim,Mode,Options>&
|
||||||
Transform<Scalar,Dim,Mode,Options>::shear(Scalar sx, Scalar sy)
|
Transform<Scalar,Dim,Mode,Options>::shear(const Scalar& sx, const Scalar& sy)
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(int(Dim)==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
|
EIGEN_STATIC_ASSERT(int(Dim)==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
|
||||||
EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
|
EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
|
||||||
@ -935,7 +935,7 @@ Transform<Scalar,Dim,Mode,Options>::shear(Scalar sx, Scalar sy)
|
|||||||
*/
|
*/
|
||||||
template<typename Scalar, int Dim, int Mode, int Options>
|
template<typename Scalar, int Dim, int Mode, int Options>
|
||||||
Transform<Scalar,Dim,Mode,Options>&
|
Transform<Scalar,Dim,Mode,Options>&
|
||||||
Transform<Scalar,Dim,Mode,Options>::preshear(Scalar sx, Scalar sy)
|
Transform<Scalar,Dim,Mode,Options>::preshear(const Scalar& sx, const Scalar& sy)
|
||||||
{
|
{
|
||||||
EIGEN_STATIC_ASSERT(int(Dim)==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
|
EIGEN_STATIC_ASSERT(int(Dim)==2, YOU_MADE_A_PROGRAMMING_MISTAKE)
|
||||||
EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
|
EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user