Skip to content
Snippets Groups Projects
Commit 6b4eb1f9 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[T] Use std::sqrt. Fix namespace.

parent 53a9cb2d
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,7 @@ std::unique_ptr<MeshLib::Mesh> createY() ...@@ -51,7 +51,7 @@ std::unique_ptr<MeshLib::Mesh> createY()
std::unique_ptr<MeshLib::Mesh> createXY() std::unique_ptr<MeshLib::Mesh> createXY()
{ {
// 45degree inclined // 45degree inclined
return createLine({{0.0, 0.0, 0.0}}, {{2./sqrt(2), 2./sqrt(2), 0.0}}); return createLine({{0.0, 0.0, 0.0}}, {{2./std::sqrt(2), 2./std::sqrt(2), 0.0}});
} }
const double eps = std::numeric_limits<double>::epsilon(); const double eps = std::numeric_limits<double>::epsilon();
...@@ -102,15 +102,15 @@ TEST(LIE, rotationMatrixXY) ...@@ -102,15 +102,15 @@ TEST(LIE, rotationMatrixXY)
auto e(msh->getElement(0)); auto e(msh->getElement(0));
Eigen::Vector3d nv; Eigen::Vector3d nv;
ProcessLib::LIE::computeNormalVector(*e, 2, nv); ProcessLib::LIE::computeNormalVector(*e, 2, nv);
ASSERT_NEAR(-1./sqrt(2), nv[0], eps); ASSERT_NEAR(-1./std::sqrt(2), nv[0], eps);
ASSERT_NEAR(1./sqrt(2), nv[1], eps); ASSERT_NEAR(1./std::sqrt(2), nv[1], eps);
ASSERT_EQ(0., nv[2]); ASSERT_EQ(0., nv[2]);
Eigen::MatrixXd R(2,2); Eigen::MatrixXd R(2,2);
ProcessLib::LIE::computeRotationMatrix(*e, nv, 2, R); ProcessLib::LIE::computeRotationMatrix(*e, nv, 2, R);
ASSERT_NEAR(1./sqrt(2), R(0,0), eps); ASSERT_NEAR(1./std::sqrt(2), R(0,0), eps);
ASSERT_NEAR(1./sqrt(2), R(0,1), eps); ASSERT_NEAR(1./std::sqrt(2), R(0,1), eps);
ASSERT_NEAR(-1./sqrt(2), R(1,0), eps); ASSERT_NEAR(-1./std::sqrt(2), R(1,0), eps);
ASSERT_NEAR(1./sqrt(2), R(1,1), eps); ASSERT_NEAR(1./std::sqrt(2), R(1,1), eps);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment