mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Replace all M_PI by EIGEN_PI and add a check to the testsuite.
This commit is contained in:
@@ -113,8 +113,8 @@ void testMatrixLogarithm(const MatrixType& A)
|
||||
|
||||
MatrixType scaledA;
|
||||
RealScalar maxImagPartOfSpectrum = A.eigenvalues().imag().cwiseAbs().maxCoeff();
|
||||
if (maxImagPartOfSpectrum >= 0.9 * M_PI)
|
||||
scaledA = A * 0.9 * M_PI / maxImagPartOfSpectrum;
|
||||
if (maxImagPartOfSpectrum >= 0.9 * EIGEN_PI)
|
||||
scaledA = A * 0.9 * EIGEN_PI / maxImagPartOfSpectrum;
|
||||
else
|
||||
scaledA = A;
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ void test2dRotation(double tol)
|
||||
s = std::sin(angle);
|
||||
B << c, s, -s, c;
|
||||
|
||||
C = Apow(std::ldexp(angle,1) / M_PI);
|
||||
C = Apow(std::ldexp(angle,1) / EIGEN_PI);
|
||||
std::cout << "test2dRotation: i = " << i << " error powerm = " << relerr(C,B) << '\n';
|
||||
VERIFY(C.isApprox(B, tol));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user