mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-14 12:46:00 +08:00
fix msvc warnings (useful ones again) reported by gael on CDash
This commit is contained in:
parent
062d6bd47a
commit
874ff5a0b4
@ -67,6 +67,7 @@ template<typename MatrixType> void array(const MatrixType& m)
|
|||||||
template<typename MatrixType> void comparisons(const MatrixType& m)
|
template<typename MatrixType> void comparisons(const MatrixType& m)
|
||||||
{
|
{
|
||||||
typedef typename MatrixType::Scalar Scalar;
|
typedef typename MatrixType::Scalar Scalar;
|
||||||
|
typedef typename NumTraits<Scalar>::Real RealScalar;
|
||||||
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
|
typedef Matrix<Scalar, MatrixType::RowsAtCompileTime, 1> VectorType;
|
||||||
|
|
||||||
int rows = m.rows();
|
int rows = m.rows();
|
||||||
@ -113,9 +114,9 @@ template<typename MatrixType> void comparisons(const MatrixType& m)
|
|||||||
VERIFY_IS_APPROX( (m1.cwise().abs().cwise()<mid).select(0,m1), m3);
|
VERIFY_IS_APPROX( (m1.cwise().abs().cwise()<mid).select(0,m1), m3);
|
||||||
|
|
||||||
// count
|
// count
|
||||||
VERIFY(((m1.cwise().abs().cwise()+1).cwise()>0.5).count() == rows*cols);
|
VERIFY(((m1.cwise().abs().cwise()+1).cwise()>RealScalar(0.1)).count() == rows*cols);
|
||||||
VERIFY_IS_APPROX(((m1.cwise().abs().cwise()+1).cwise()>0.5).colwise().count(), RowVectorXi::Constant(cols,rows));
|
VERIFY_IS_APPROX(((m1.cwise().abs().cwise()+1).cwise()>RealScalar(0.1)).colwise().count(), RowVectorXi::Constant(cols,rows));
|
||||||
VERIFY_IS_APPROX(((m1.cwise().abs().cwise()+1).cwise()>0.5).rowwise().count(), VectorXi::Constant(rows, cols));
|
VERIFY_IS_APPROX(((m1.cwise().abs().cwise()+1).cwise()>RealScalar(0.1)).rowwise().count(), VectorXi::Constant(rows, cols));
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename VectorType> void lpNorm(const VectorType& v)
|
template<typename VectorType> void lpNorm(const VectorType& v)
|
||||||
|
@ -106,10 +106,10 @@ template<typename MatrixType> void cwiseops(const MatrixType& m)
|
|||||||
VERIFY_IS_APPROX(m1.cwise().abs().cwise().log().cwise().exp() , m1.cwise().abs());
|
VERIFY_IS_APPROX(m1.cwise().abs().cwise().log().cwise().exp() , m1.cwise().abs());
|
||||||
|
|
||||||
VERIFY_IS_APPROX(m1.cwise().pow(2), m1.cwise().square());
|
VERIFY_IS_APPROX(m1.cwise().pow(2), m1.cwise().square());
|
||||||
m3 = (m1.cwise().abs().cwise()<0.01).select(mones,m1);
|
m3 = (m1.cwise().abs().cwise()<=RealScalar(0.01)).select(mones,m1);
|
||||||
VERIFY_IS_APPROX(m3.cwise().pow(-1), m3.cwise().inverse());
|
VERIFY_IS_APPROX(m3.cwise().pow(-1), m3.cwise().inverse());
|
||||||
m3 = m1.cwise().abs();
|
m3 = m1.cwise().abs();
|
||||||
VERIFY_IS_APPROX(m3.cwise().pow(0.5), m3.cwise().sqrt());
|
VERIFY_IS_APPROX(m3.cwise().pow(RealScalar(0.5)), m3.cwise().sqrt());
|
||||||
|
|
||||||
// VERIFY_IS_APPROX(m1.cwise().tan(), m1.cwise().sin().cwise() / m1.cwise().cos());
|
// VERIFY_IS_APPROX(m1.cwise().tan(), m1.cwise().sin().cwise() / m1.cwise().cos());
|
||||||
VERIFY_IS_APPROX(mones, m1.cwise().sin().cwise().square() + m1.cwise().cos().cwise().square());
|
VERIFY_IS_APPROX(mones, m1.cwise().sin().cwise().square() + m1.cwise().cos().cwise().square());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user