mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-18 14:34:17 +08:00
precision ---> dummy_precision
This commit is contained in:
parent
5923bcb1b9
commit
4b1aca2288
@ -30,7 +30,7 @@ template<typename T> inline typename NumTraits<T>::Real epsilon()
|
||||
return std::numeric_limits<typename NumTraits<T>::Real>::epsilon();
|
||||
}
|
||||
|
||||
template<typename T> inline typename NumTraits<T>::Real precision();
|
||||
template<typename T> inline typename NumTraits<T>::Real dummy_precision();
|
||||
|
||||
template<typename T> inline T ei_random(T a, T b);
|
||||
template<typename T> inline T ei_random();
|
||||
@ -55,7 +55,7 @@ template<typename T> inline typename NumTraits<T>::Real ei_hypot(T x, T y)
|
||||
*** int ***
|
||||
**************/
|
||||
|
||||
template<> inline int precision<int>() { return 0; }
|
||||
template<> inline int dummy_precision<int>() { return 0; }
|
||||
inline int ei_real(int x) { return x; }
|
||||
inline int& ei_real_ref(int& x) { return x; }
|
||||
inline int ei_imag(int) { return 0; }
|
||||
@ -92,15 +92,15 @@ template<> inline int ei_random()
|
||||
{
|
||||
return ei_random<int>(-ei_random_amplitude<int>(), ei_random_amplitude<int>());
|
||||
}
|
||||
inline bool ei_isMuchSmallerThan(int a, int, int = precision<int>())
|
||||
inline bool ei_isMuchSmallerThan(int a, int, int = dummy_precision<int>())
|
||||
{
|
||||
return a == 0;
|
||||
}
|
||||
inline bool ei_isApprox(int a, int b, int = precision<int>())
|
||||
inline bool ei_isApprox(int a, int b, int = dummy_precision<int>())
|
||||
{
|
||||
return a == b;
|
||||
}
|
||||
inline bool ei_isApproxOrLessThan(int a, int b, int = precision<int>())
|
||||
inline bool ei_isApproxOrLessThan(int a, int b, int = dummy_precision<int>())
|
||||
{
|
||||
return a <= b;
|
||||
}
|
||||
@ -109,7 +109,7 @@ inline bool ei_isApproxOrLessThan(int a, int b, int = precision<int>())
|
||||
*** float ***
|
||||
**************/
|
||||
|
||||
template<> inline float precision<float>() { return 1e-5f; }
|
||||
template<> inline float dummy_precision<float>() { return 1e-5f; }
|
||||
inline float ei_real(float x) { return x; }
|
||||
inline float& ei_real_ref(float& x) { return x; }
|
||||
inline float ei_imag(float) { return 0.f; }
|
||||
@ -140,15 +140,15 @@ template<> inline float ei_random()
|
||||
{
|
||||
return ei_random<float>(-ei_random_amplitude<float>(), ei_random_amplitude<float>());
|
||||
}
|
||||
inline bool ei_isMuchSmallerThan(float a, float b, float prec = precision<float>())
|
||||
inline bool ei_isMuchSmallerThan(float a, float b, float prec = dummy_precision<float>())
|
||||
{
|
||||
return ei_abs(a) <= ei_abs(b) * prec;
|
||||
}
|
||||
inline bool ei_isApprox(float a, float b, float prec = precision<float>())
|
||||
inline bool ei_isApprox(float a, float b, float prec = dummy_precision<float>())
|
||||
{
|
||||
return ei_abs(a - b) <= std::min(ei_abs(a), ei_abs(b)) * prec;
|
||||
}
|
||||
inline bool ei_isApproxOrLessThan(float a, float b, float prec = precision<float>())
|
||||
inline bool ei_isApproxOrLessThan(float a, float b, float prec = dummy_precision<float>())
|
||||
{
|
||||
return a <= b || ei_isApprox(a, b, prec);
|
||||
}
|
||||
@ -157,7 +157,7 @@ inline bool ei_isApproxOrLessThan(float a, float b, float prec = precision<float
|
||||
*** double ***
|
||||
**************/
|
||||
|
||||
template<> inline double precision<double>() { return 1e-12; }
|
||||
template<> inline double dummy_precision<double>() { return 1e-12; }
|
||||
|
||||
inline double ei_real(double x) { return x; }
|
||||
inline double& ei_real_ref(double& x) { return x; }
|
||||
@ -189,15 +189,15 @@ template<> inline double ei_random()
|
||||
{
|
||||
return ei_random<double>(-ei_random_amplitude<double>(), ei_random_amplitude<double>());
|
||||
}
|
||||
inline bool ei_isMuchSmallerThan(double a, double b, double prec = precision<double>())
|
||||
inline bool ei_isMuchSmallerThan(double a, double b, double prec = dummy_precision<double>())
|
||||
{
|
||||
return ei_abs(a) <= ei_abs(b) * prec;
|
||||
}
|
||||
inline bool ei_isApprox(double a, double b, double prec = precision<double>())
|
||||
inline bool ei_isApprox(double a, double b, double prec = dummy_precision<double>())
|
||||
{
|
||||
return ei_abs(a - b) <= std::min(ei_abs(a), ei_abs(b)) * prec;
|
||||
}
|
||||
inline bool ei_isApproxOrLessThan(double a, double b, double prec = precision<double>())
|
||||
inline bool ei_isApproxOrLessThan(double a, double b, double prec = dummy_precision<double>())
|
||||
{
|
||||
return a <= b || ei_isApprox(a, b, prec);
|
||||
}
|
||||
@ -206,7 +206,7 @@ inline bool ei_isApproxOrLessThan(double a, double b, double prec = precision<do
|
||||
*** complex<float> ***
|
||||
*********************/
|
||||
|
||||
template<> inline float precision<std::complex<float> >() { return precision<float>(); }
|
||||
template<> inline float dummy_precision<std::complex<float> >() { return dummy_precision<float>(); }
|
||||
inline float ei_real(const std::complex<float>& x) { return std::real(x); }
|
||||
inline float ei_imag(const std::complex<float>& x) { return std::imag(x); }
|
||||
inline float& ei_real_ref(std::complex<float>& x) { return reinterpret_cast<float*>(&x)[0]; }
|
||||
@ -224,15 +224,15 @@ template<> inline std::complex<float> ei_random()
|
||||
{
|
||||
return std::complex<float>(ei_random<float>(), ei_random<float>());
|
||||
}
|
||||
inline bool ei_isMuchSmallerThan(const std::complex<float>& a, const std::complex<float>& b, float prec = precision<float>())
|
||||
inline bool ei_isMuchSmallerThan(const std::complex<float>& a, const std::complex<float>& b, float prec = dummy_precision<float>())
|
||||
{
|
||||
return ei_abs2(a) <= ei_abs2(b) * prec * prec;
|
||||
}
|
||||
inline bool ei_isMuchSmallerThan(const std::complex<float>& a, float b, float prec = precision<float>())
|
||||
inline bool ei_isMuchSmallerThan(const std::complex<float>& a, float b, float prec = dummy_precision<float>())
|
||||
{
|
||||
return ei_abs2(a) <= ei_abs2(b) * prec * prec;
|
||||
}
|
||||
inline bool ei_isApprox(const std::complex<float>& a, const std::complex<float>& b, float prec = precision<float>())
|
||||
inline bool ei_isApprox(const std::complex<float>& a, const std::complex<float>& b, float prec = dummy_precision<float>())
|
||||
{
|
||||
return ei_isApprox(ei_real(a), ei_real(b), prec)
|
||||
&& ei_isApprox(ei_imag(a), ei_imag(b), prec);
|
||||
@ -243,7 +243,7 @@ inline bool ei_isApprox(const std::complex<float>& a, const std::complex<float>&
|
||||
*** complex<double> ***
|
||||
**********************/
|
||||
|
||||
template<> inline double precision<std::complex<double> >() { return precision<double>(); }
|
||||
template<> inline double dummy_precision<std::complex<double> >() { return dummy_precision<double>(); }
|
||||
inline double ei_real(const std::complex<double>& x) { return std::real(x); }
|
||||
inline double ei_imag(const std::complex<double>& x) { return std::imag(x); }
|
||||
inline double& ei_real_ref(std::complex<double>& x) { return reinterpret_cast<double*>(&x)[0]; }
|
||||
@ -261,15 +261,15 @@ template<> inline std::complex<double> ei_random()
|
||||
{
|
||||
return std::complex<double>(ei_random<double>(), ei_random<double>());
|
||||
}
|
||||
inline bool ei_isMuchSmallerThan(const std::complex<double>& a, const std::complex<double>& b, double prec = precision<double>())
|
||||
inline bool ei_isMuchSmallerThan(const std::complex<double>& a, const std::complex<double>& b, double prec = dummy_precision<double>())
|
||||
{
|
||||
return ei_abs2(a) <= ei_abs2(b) * prec * prec;
|
||||
}
|
||||
inline bool ei_isMuchSmallerThan(const std::complex<double>& a, double b, double prec = precision<double>())
|
||||
inline bool ei_isMuchSmallerThan(const std::complex<double>& a, double b, double prec = dummy_precision<double>())
|
||||
{
|
||||
return ei_abs2(a) <= ei_abs2(b) * prec * prec;
|
||||
}
|
||||
inline bool ei_isApprox(const std::complex<double>& a, const std::complex<double>& b, double prec = precision<double>())
|
||||
inline bool ei_isApprox(const std::complex<double>& a, const std::complex<double>& b, double prec = dummy_precision<double>())
|
||||
{
|
||||
return ei_isApprox(ei_real(a), ei_real(b), prec)
|
||||
&& ei_isApprox(ei_imag(a), ei_imag(b), prec);
|
||||
@ -281,7 +281,7 @@ inline bool ei_isApprox(const std::complex<double>& a, const std::complex<double
|
||||
*** long double ***
|
||||
******************/
|
||||
|
||||
template<> inline long double precision<long double>() { return precision<double>(); }
|
||||
template<> inline long double dummy_precision<long double>() { return dummy_precision<double>(); }
|
||||
inline long double ei_real(long double x) { return x; }
|
||||
inline long double& ei_real_ref(long double& x) { return x; }
|
||||
inline long double ei_imag(long double) { return 0.; }
|
||||
@ -304,15 +304,15 @@ template<> inline long double ei_random()
|
||||
{
|
||||
return ei_random<double>(-ei_random_amplitude<double>(), ei_random_amplitude<double>());
|
||||
}
|
||||
inline bool ei_isMuchSmallerThan(long double a, long double b, long double prec = precision<long double>())
|
||||
inline bool ei_isMuchSmallerThan(long double a, long double b, long double prec = dummy_precision<long double>())
|
||||
{
|
||||
return ei_abs(a) <= ei_abs(b) * prec;
|
||||
}
|
||||
inline bool ei_isApprox(long double a, long double b, long double prec = precision<long double>())
|
||||
inline bool ei_isApprox(long double a, long double b, long double prec = dummy_precision<long double>())
|
||||
{
|
||||
return ei_abs(a - b) <= std::min(ei_abs(a), ei_abs(b)) * prec;
|
||||
}
|
||||
inline bool ei_isApproxOrLessThan(long double a, long double b, long double prec = precision<long double>())
|
||||
inline bool ei_isApproxOrLessThan(long double a, long double b, long double prec = dummy_precision<long double>())
|
||||
{
|
||||
return a <= b || ei_isApprox(a, b, prec);
|
||||
}
|
||||
@ -321,7 +321,7 @@ inline bool ei_isApproxOrLessThan(long double a, long double b, long double prec
|
||||
*** bool ***
|
||||
**************/
|
||||
|
||||
template<> inline bool precision<bool>() { return 0; }
|
||||
template<> inline bool dummy_precision<bool>() { return 0; }
|
||||
inline bool ei_real(bool x) { return x; }
|
||||
inline bool& ei_real_ref(bool& x) { return x; }
|
||||
inline bool ei_imag(bool) { return 0; }
|
||||
@ -334,15 +334,15 @@ template<> inline bool ei_random()
|
||||
{
|
||||
return (ei_random<int>(0,1) == 1);
|
||||
}
|
||||
inline bool ei_isMuchSmallerThan(bool a, bool, bool = precision<bool>())
|
||||
inline bool ei_isMuchSmallerThan(bool a, bool, bool = dummy_precision<bool>())
|
||||
{
|
||||
return !a;
|
||||
}
|
||||
inline bool ei_isApprox(bool a, bool b, bool = precision<bool>())
|
||||
inline bool ei_isApprox(bool a, bool b, bool = dummy_precision<bool>())
|
||||
{
|
||||
return a == b;
|
||||
}
|
||||
inline bool ei_isApproxOrLessThan(bool a, bool b, bool = precision<bool>())
|
||||
inline bool ei_isApproxOrLessThan(bool a, bool b, bool = dummy_precision<bool>())
|
||||
{
|
||||
return int(a) <= int(b);
|
||||
}
|
||||
|
@ -558,27 +558,27 @@ template<typename Derived> class MatrixBase
|
||||
|
||||
template<typename OtherDerived>
|
||||
bool isApprox(const MatrixBase<OtherDerived>& other,
|
||||
RealScalar prec = precision<Scalar>()) const;
|
||||
RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
bool isMuchSmallerThan(const RealScalar& other,
|
||||
RealScalar prec = precision<Scalar>()) const;
|
||||
RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
template<typename OtherDerived>
|
||||
bool isMuchSmallerThan(const MatrixBase<OtherDerived>& other,
|
||||
RealScalar prec = precision<Scalar>()) const;
|
||||
RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
|
||||
bool isApproxToConstant(const Scalar& value, RealScalar prec = precision<Scalar>()) const;
|
||||
bool isConstant(const Scalar& value, RealScalar prec = precision<Scalar>()) const;
|
||||
bool isZero(RealScalar prec = precision<Scalar>()) const;
|
||||
bool isOnes(RealScalar prec = precision<Scalar>()) const;
|
||||
bool isIdentity(RealScalar prec = precision<Scalar>()) const;
|
||||
bool isDiagonal(RealScalar prec = precision<Scalar>()) const;
|
||||
bool isApproxToConstant(const Scalar& value, RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
bool isConstant(const Scalar& value, RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
bool isZero(RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
bool isOnes(RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
bool isIdentity(RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
bool isDiagonal(RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
|
||||
bool isUpperTriangular(RealScalar prec = precision<Scalar>()) const;
|
||||
bool isLowerTriangular(RealScalar prec = precision<Scalar>()) const;
|
||||
bool isUpperTriangular(RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
bool isLowerTriangular(RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
|
||||
template<typename OtherDerived>
|
||||
bool isOrthogonal(const MatrixBase<OtherDerived>& other,
|
||||
RealScalar prec = precision<Scalar>()) const;
|
||||
bool isUnitary(RealScalar prec = precision<Scalar>()) const;
|
||||
RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
bool isUnitary(RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
|
||||
template<typename OtherDerived>
|
||||
inline bool operator==(const MatrixBase<OtherDerived>& other) const
|
||||
@ -722,13 +722,13 @@ template<typename Derived> class MatrixBase
|
||||
ResultType& inverse,
|
||||
typename ResultType::Scalar& determinant,
|
||||
bool& invertible,
|
||||
const RealScalar& absDeterminantThreshold = precision<Scalar>()
|
||||
const RealScalar& absDeterminantThreshold = dummy_precision<Scalar>()
|
||||
) const;
|
||||
template<typename ResultType>
|
||||
void computeInverseWithCheck(
|
||||
ResultType& inverse,
|
||||
bool& invertible,
|
||||
const RealScalar& absDeterminantThreshold = precision<Scalar>()
|
||||
const RealScalar& absDeterminantThreshold = dummy_precision<Scalar>()
|
||||
) const;
|
||||
Scalar determinant() const;
|
||||
|
||||
|
@ -171,7 +171,7 @@ EIGEN_MAKE_ALIGNED_OPERATOR_NEW_IF_VECTORIZABLE_FIXED_SIZE(_Scalar,_AmbientDim)
|
||||
* determined by \a prec.
|
||||
*
|
||||
* \sa MatrixBase::isApprox() */
|
||||
bool isApprox(const AlignedBox& other, typename NumTraits<Scalar>::Real prec = precision<Scalar>()) const
|
||||
bool isApprox(const AlignedBox& other, typename NumTraits<Scalar>::Real prec = dummy_precision<Scalar>()) const
|
||||
{ return m_min.isApprox(other.m_min, prec) && m_max.isApprox(other.m_max, prec); }
|
||||
|
||||
protected:
|
||||
|
@ -146,7 +146,7 @@ public:
|
||||
* determined by \a prec.
|
||||
*
|
||||
* \sa MatrixBase::isApprox() */
|
||||
bool isApprox(const AngleAxis& other, typename NumTraits<Scalar>::Real prec = precision<Scalar>()) const
|
||||
bool isApprox(const AngleAxis& other, typename NumTraits<Scalar>::Real prec = dummy_precision<Scalar>()) const
|
||||
{ return m_axis.isApprox(other.m_axis, prec) && ei_isApprox(m_angle,other.m_angle, prec); }
|
||||
};
|
||||
|
||||
@ -165,7 +165,7 @@ template<typename QuatDerived>
|
||||
AngleAxis<Scalar>& AngleAxis<Scalar>::operator=(const QuaternionBase<QuatDerived>& q)
|
||||
{
|
||||
Scalar n2 = q.vec().squaredNorm();
|
||||
if (n2 < precision<Scalar>()*precision<Scalar>())
|
||||
if (n2 < dummy_precision<Scalar>()*dummy_precision<Scalar>())
|
||||
{
|
||||
m_angle = 0;
|
||||
m_axis << 1, 0, 0;
|
||||
|
@ -50,7 +50,7 @@ MatrixBase<Derived>::eulerAngles(int a0, int a1, int a2) const
|
||||
|
||||
Matrix<Scalar,3,1> res;
|
||||
typedef Matrix<typename Derived::Scalar,2,1> Vector2;
|
||||
const Scalar epsilon = precision<Scalar>();
|
||||
const Scalar epsilon = dummy_precision<Scalar>();
|
||||
|
||||
const int odd = ((a0+1)%3 == a1) ? 0 : 1;
|
||||
const int i = a0;
|
||||
|
@ -257,7 +257,7 @@ public:
|
||||
* determined by \a prec.
|
||||
*
|
||||
* \sa MatrixBase::isApprox() */
|
||||
bool isApprox(const Hyperplane& other, typename NumTraits<Scalar>::Real prec = precision<Scalar>()) const
|
||||
bool isApprox(const Hyperplane& other, typename NumTraits<Scalar>::Real prec = dummy_precision<Scalar>()) const
|
||||
{ return m_coeffs.isApprox(other.m_coeffs, prec); }
|
||||
|
||||
protected:
|
||||
|
@ -123,7 +123,7 @@ public:
|
||||
* determined by \a prec.
|
||||
*
|
||||
* \sa MatrixBase::isApprox() */
|
||||
bool isApprox(const ParametrizedLine& other, typename NumTraits<Scalar>::Real prec = precision<Scalar>()) const
|
||||
bool isApprox(const ParametrizedLine& other, typename NumTraits<Scalar>::Real prec = dummy_precision<Scalar>()) const
|
||||
{ return m_origin.isApprox(other.m_origin, prec) && m_direction.isApprox(other.m_direction, prec); }
|
||||
|
||||
protected:
|
||||
|
@ -163,7 +163,7 @@ public:
|
||||
*
|
||||
* \sa MatrixBase::isApprox() */
|
||||
template<class OtherDerived>
|
||||
bool isApprox(const QuaternionBase<OtherDerived>& other, RealScalar prec = precision<Scalar>()) const
|
||||
bool isApprox(const QuaternionBase<OtherDerived>& other, RealScalar prec = dummy_precision<Scalar>()) const
|
||||
{ return coeffs().isApprox(other.coeffs(), prec); }
|
||||
|
||||
/** return the result vector of \a v through the rotation*/
|
||||
@ -514,7 +514,7 @@ inline Derived& QuaternionBase<Derived>::setFromTwoVectors(const MatrixBase<Deri
|
||||
// under the constraint:
|
||||
// ||x|| = 1
|
||||
// which yields a singular value problem
|
||||
if (c < Scalar(-1)+precision<Scalar>())
|
||||
if (c < Scalar(-1)+dummy_precision<Scalar>())
|
||||
{
|
||||
c = std::max<Scalar>(c,-1);
|
||||
Matrix<Scalar,2,3> m; m << v0.transpose(), v1.transpose();
|
||||
@ -590,7 +590,7 @@ template <class OtherDerived>
|
||||
Quaternion<typename ei_traits<Derived>::Scalar>
|
||||
QuaternionBase<Derived>::slerp(Scalar t, const QuaternionBase<OtherDerived>& other) const
|
||||
{
|
||||
static const Scalar one = Scalar(1) - precision<Scalar>();
|
||||
static const Scalar one = Scalar(1) - dummy_precision<Scalar>();
|
||||
Scalar d = this->dot(other);
|
||||
Scalar absD = ei_abs(d);
|
||||
if (absD>=one)
|
||||
|
@ -121,7 +121,7 @@ public:
|
||||
* determined by \a prec.
|
||||
*
|
||||
* \sa MatrixBase::isApprox() */
|
||||
bool isApprox(const Rotation2D& other, typename NumTraits<Scalar>::Real prec = precision<Scalar>()) const
|
||||
bool isApprox(const Rotation2D& other, typename NumTraits<Scalar>::Real prec = dummy_precision<Scalar>()) const
|
||||
{ return ei_isApprox(m_angle,other.m_angle, prec); }
|
||||
};
|
||||
|
||||
|
@ -107,7 +107,7 @@ public:
|
||||
* determined by \a prec.
|
||||
*
|
||||
* \sa MatrixBase::isApprox() */
|
||||
bool isApprox(const UniformScaling& other, typename NumTraits<Scalar>::Real prec = precision<Scalar>()) const
|
||||
bool isApprox(const UniformScaling& other, typename NumTraits<Scalar>::Real prec = dummy_precision<Scalar>()) const
|
||||
{ return ei_isApprox(m_factor, other.factor(), prec); }
|
||||
|
||||
};
|
||||
|
@ -424,7 +424,7 @@ public:
|
||||
* determined by \a prec.
|
||||
*
|
||||
* \sa MatrixBase::isApprox() */
|
||||
bool isApprox(const Transform& other, typename NumTraits<Scalar>::Real prec = precision<Scalar>()) const
|
||||
bool isApprox(const Transform& other, typename NumTraits<Scalar>::Real prec = dummy_precision<Scalar>()) const
|
||||
{ return m_matrix.isApprox(other.m_matrix, prec); }
|
||||
|
||||
/** Sets the last row to [0 ... 0 1]
|
||||
|
@ -154,7 +154,7 @@ public:
|
||||
* determined by \a prec.
|
||||
*
|
||||
* \sa MatrixBase::isApprox() */
|
||||
bool isApprox(const Translation& other, typename NumTraits<Scalar>::Real prec = precision<Scalar>()) const
|
||||
bool isApprox(const Translation& other, typename NumTraits<Scalar>::Real prec = dummy_precision<Scalar>()) const
|
||||
{ return m_coeffs.isApprox(other.m_coeffs, prec); }
|
||||
|
||||
};
|
||||
|
@ -193,7 +193,7 @@ SVD<MatrixType>& SVD<MatrixType>::compute(const MatrixType& matrix)
|
||||
int i,its,j,k,l,nm;
|
||||
Scalar anorm, c, f, g, h, s, scale, x, y, z;
|
||||
bool convergence = true;
|
||||
Scalar eps = precision<Scalar>();
|
||||
Scalar eps = dummy_precision<Scalar>();
|
||||
|
||||
Matrix<Scalar,Dynamic,1> rv1(n);
|
||||
g = scale = anorm = 0;
|
||||
|
@ -300,7 +300,7 @@ class AmbiVector<_Scalar>::Iterator
|
||||
* In practice, all coefficients having a magnitude smaller than \a epsilon
|
||||
* are skipped.
|
||||
*/
|
||||
Iterator(const AmbiVector& vec, RealScalar epsilon = RealScalar(0.1)*precision<RealScalar>())
|
||||
Iterator(const AmbiVector& vec, RealScalar epsilon = RealScalar(0.1)*dummy_precision<RealScalar>())
|
||||
: m_vector(vec)
|
||||
{
|
||||
m_epsilon = epsilon;
|
||||
|
@ -185,7 +185,7 @@ class CompressedStorage
|
||||
return m_values[id];
|
||||
}
|
||||
|
||||
void prune(Scalar reference, RealScalar epsilon = precision<RealScalar>())
|
||||
void prune(Scalar reference, RealScalar epsilon = dummy_precision<RealScalar>())
|
||||
{
|
||||
size_t k = 0;
|
||||
size_t n = size();
|
||||
|
@ -208,7 +208,7 @@ class DynamicSparseMatrix
|
||||
|
||||
inline void finalize() {}
|
||||
|
||||
void prune(Scalar reference, RealScalar epsilon = precision<RealScalar>())
|
||||
void prune(Scalar reference, RealScalar epsilon = dummy_precision<RealScalar>())
|
||||
{
|
||||
for (int j=0; j<outerSize(); ++j)
|
||||
m_data[j].prune(reference,epsilon);
|
||||
|
@ -94,7 +94,7 @@ class SparseLDLT
|
||||
: m_flags(flags), m_status(0)
|
||||
{
|
||||
ei_assert((MatrixType::Flags&RowMajorBit)==0);
|
||||
m_precision = RealScalar(0.1) * Eigen::precision<RealScalar>();
|
||||
m_precision = RealScalar(0.1) * Eigen::dummy_precision<RealScalar>();
|
||||
}
|
||||
|
||||
/** Creates a LDLT object and compute the respective factorization of \a matrix using
|
||||
@ -103,7 +103,7 @@ class SparseLDLT
|
||||
: m_matrix(matrix.rows(), matrix.cols()), m_flags(flags), m_status(0)
|
||||
{
|
||||
ei_assert((MatrixType::Flags&RowMajorBit)==0);
|
||||
m_precision = RealScalar(0.1) * Eigen::precision<RealScalar>();
|
||||
m_precision = RealScalar(0.1) * Eigen::dummy_precision<RealScalar>();
|
||||
compute(matrix);
|
||||
}
|
||||
|
||||
|
@ -54,7 +54,7 @@ class SparseLLT
|
||||
SparseLLT(int flags = 0)
|
||||
: m_flags(flags), m_status(0)
|
||||
{
|
||||
m_precision = RealScalar(0.1) * Eigen::precision<RealScalar>();
|
||||
m_precision = RealScalar(0.1) * Eigen::dummy_precision<RealScalar>();
|
||||
}
|
||||
|
||||
/** Creates a LLT object and compute the respective factorization of \a matrix using
|
||||
@ -62,7 +62,7 @@ class SparseLLT
|
||||
SparseLLT(const MatrixType& matrix, int flags = 0)
|
||||
: m_matrix(matrix.rows(), matrix.cols()), m_flags(flags), m_status(0)
|
||||
{
|
||||
m_precision = RealScalar(0.1) * Eigen::precision<RealScalar>();
|
||||
m_precision = RealScalar(0.1) * Eigen::dummy_precision<RealScalar>();
|
||||
compute(matrix);
|
||||
}
|
||||
|
||||
|
@ -59,7 +59,7 @@ class SparseLU
|
||||
SparseLU(int flags = 0)
|
||||
: m_flags(flags), m_status(0)
|
||||
{
|
||||
m_precision = RealScalar(0.1) * Eigen::precision<RealScalar>();
|
||||
m_precision = RealScalar(0.1) * Eigen::dummy_precision<RealScalar>();
|
||||
}
|
||||
|
||||
/** Creates a LU object and compute the respective factorization of \a matrix using
|
||||
@ -67,7 +67,7 @@ class SparseLU
|
||||
SparseLU(const MatrixType& matrix, int flags = 0)
|
||||
: /*m_matrix(matrix.rows(), matrix.cols()),*/ m_flags(flags), m_status(0)
|
||||
{
|
||||
m_precision = RealScalar(0.1) * Eigen::precision<RealScalar>();
|
||||
m_precision = RealScalar(0.1) * Eigen::dummy_precision<RealScalar>();
|
||||
compute(matrix);
|
||||
}
|
||||
|
||||
|
@ -341,7 +341,7 @@ class SparseMatrix
|
||||
}
|
||||
}
|
||||
|
||||
void prune(Scalar reference, RealScalar epsilon = precision<RealScalar>())
|
||||
void prune(Scalar reference, RealScalar epsilon = dummy_precision<RealScalar>())
|
||||
{
|
||||
int k = 0;
|
||||
for (int j=0; j<m_outerSize; ++j)
|
||||
|
@ -467,32 +467,32 @@ template<typename Derived> class SparseMatrixBase : public AnyMatrixBase<Derived
|
||||
|
||||
template<typename OtherDerived>
|
||||
bool isApprox(const SparseMatrixBase<OtherDerived>& other,
|
||||
RealScalar prec = precision<Scalar>()) const
|
||||
RealScalar prec = dummy_precision<Scalar>()) const
|
||||
{ return toDense().isApprox(other.toDense(),prec); }
|
||||
|
||||
template<typename OtherDerived>
|
||||
bool isApprox(const MatrixBase<OtherDerived>& other,
|
||||
RealScalar prec = precision<Scalar>()) const
|
||||
RealScalar prec = dummy_precision<Scalar>()) const
|
||||
{ return toDense().isApprox(other,prec); }
|
||||
// bool isMuchSmallerThan(const RealScalar& other,
|
||||
// RealScalar prec = precision<Scalar>()) const;
|
||||
// RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
// template<typename OtherDerived>
|
||||
// bool isMuchSmallerThan(const MatrixBase<OtherDerived>& other,
|
||||
// RealScalar prec = precision<Scalar>()) const;
|
||||
// RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
|
||||
// bool isApproxToConstant(const Scalar& value, RealScalar prec = precision<Scalar>()) const;
|
||||
// bool isZero(RealScalar prec = precision<Scalar>()) const;
|
||||
// bool isOnes(RealScalar prec = precision<Scalar>()) const;
|
||||
// bool isIdentity(RealScalar prec = precision<Scalar>()) const;
|
||||
// bool isDiagonal(RealScalar prec = precision<Scalar>()) const;
|
||||
// bool isApproxToConstant(const Scalar& value, RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
// bool isZero(RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
// bool isOnes(RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
// bool isIdentity(RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
// bool isDiagonal(RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
|
||||
// bool isUpperTriangular(RealScalar prec = precision<Scalar>()) const;
|
||||
// bool isLowerTriangular(RealScalar prec = precision<Scalar>()) const;
|
||||
// bool isUpperTriangular(RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
// bool isLowerTriangular(RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
|
||||
// template<typename OtherDerived>
|
||||
// bool isOrthogonal(const MatrixBase<OtherDerived>& other,
|
||||
// RealScalar prec = precision<Scalar>()) const;
|
||||
// bool isUnitary(RealScalar prec = precision<Scalar>()) const;
|
||||
// RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
// bool isUnitary(RealScalar prec = dummy_precision<Scalar>()) const;
|
||||
|
||||
// template<typename OtherDerived>
|
||||
// inline bool operator==(const MatrixBase<OtherDerived>& other) const
|
||||
|
@ -201,7 +201,7 @@ class SparseVector
|
||||
EIGEN_DEPRECATED void endFill() {}
|
||||
inline void finalize() {}
|
||||
|
||||
void prune(Scalar reference, RealScalar epsilon = precision<RealScalar>())
|
||||
void prune(Scalar reference, RealScalar epsilon = dummy_precision<RealScalar>())
|
||||
{
|
||||
m_data.prune(reference,epsilon);
|
||||
}
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <Eigen/QR>
|
||||
|
||||
template<typename Derived1, typename Derived2>
|
||||
bool areNotApprox(const MatrixBase<Derived1>& m1, const MatrixBase<Derived2>& m2, typename Derived1::RealScalar epsilon = precision<typename Derived1::RealScalar>())
|
||||
bool areNotApprox(const MatrixBase<Derived1>& m1, const MatrixBase<Derived2>& m2, typename Derived1::RealScalar epsilon = dummy_precision<typename Derived1::RealScalar>())
|
||||
{
|
||||
return !((m1-m2).cwise().abs2().maxCoeff() < epsilon * epsilon
|
||||
* std::max(m1.cwise().abs2().maxCoeff(), m2.cwise().abs2().maxCoeff()));
|
||||
|
@ -188,7 +188,7 @@ template<typename _Scalar> class AlignedVector3
|
||||
}
|
||||
|
||||
template<typename Derived>
|
||||
inline bool isApprox(const MatrixBase<Derived>& other, RealScalar eps=precision<Scalar>()) const
|
||||
inline bool isApprox(const MatrixBase<Derived>& other, RealScalar eps=dummy_precision<Scalar>()) const
|
||||
{
|
||||
return m_coeffs.template start<3>().isApprox(other,eps);
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ public:
|
||||
* flags \a flags. */
|
||||
SkylineInplaceLU(MatrixType& matrix, int flags = 0)
|
||||
: /*m_matrix(matrix.rows(), matrix.cols()),*/ m_flags(flags), m_status(0), m_lu(matrix) {
|
||||
m_precision = RealScalar(0.1) * Eigen::precision<RealScalar > ();
|
||||
m_precision = RealScalar(0.1) * Eigen::dummy_precision<RealScalar > ();
|
||||
m_lu.IsRowMajor ? computeRowMajor() : compute();
|
||||
}
|
||||
|
||||
|
@ -589,7 +589,7 @@ public:
|
||||
m_data.squeeze();
|
||||
}
|
||||
|
||||
void prune(Scalar reference, RealScalar epsilon = precision<RealScalar > ()) {
|
||||
void prune(Scalar reference, RealScalar epsilon = dummy_precision<RealScalar > ()) {
|
||||
//TODO
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ public:
|
||||
memset(m_lowerProfile, 0, m_diagSize * sizeof (int));
|
||||
}
|
||||
|
||||
void prune(Scalar reference, RealScalar epsilon = precision<RealScalar>()) {
|
||||
void prune(Scalar reference, RealScalar epsilon = dummy_precision<RealScalar>()) {
|
||||
//TODO
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user