mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
reduce float warnings (comparisons and implicit conversions)
This commit is contained in:
committed by
Rasmus Munk Larsen
parent
51311ec651
commit
d271a7d545
@@ -234,13 +234,13 @@ void JacobiRotation<Scalar>::makeGivens(const Scalar& p, const Scalar& q, Scalar
|
||||
{
|
||||
using std::sqrt;
|
||||
using std::abs;
|
||||
if(q==Scalar(0))
|
||||
if(numext::is_exactly_zero(q))
|
||||
{
|
||||
m_c = p<Scalar(0) ? Scalar(-1) : Scalar(1);
|
||||
m_s = Scalar(0);
|
||||
if(r) *r = abs(p);
|
||||
}
|
||||
else if(p==Scalar(0))
|
||||
else if(numext::is_exactly_zero(p))
|
||||
{
|
||||
m_c = Scalar(0);
|
||||
m_s = q<Scalar(0) ? Scalar(1) : Scalar(-1);
|
||||
@@ -468,7 +468,7 @@ void /*EIGEN_DONT_INLINE*/ apply_rotation_in_the_plane(DenseBase<VectorX>& xpr_x
|
||||
|
||||
OtherScalar c = j.c();
|
||||
OtherScalar s = j.s();
|
||||
if (c==OtherScalar(1) && s==OtherScalar(0))
|
||||
if (numext::is_exactly_one(c) && numext::is_exactly_zero(s))
|
||||
return;
|
||||
|
||||
apply_rotation_in_the_plane_selector<
|
||||
|
||||
Reference in New Issue
Block a user