Commit 7fdb22d9 authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

Merge pull request #10 from jmirabel/devel

Add Eigen wrapping
parents 77eb79e4 a32b7540
......@@ -37,6 +37,9 @@
#define BOOST_TEST_MODULE "FCL_MATH"
#include <boost/test/included/unit_test.hpp>
#if FCL_HAVE_EIGEN
#include <hpp/fcl/eigen/math_details.h>
#endif
#if FCL_HAVE_SSE
#include <hpp/fcl/simd/math_simd_details.h>
#endif
......@@ -163,6 +166,471 @@ BOOST_AUTO_TEST_CASE(vec_test_basic_vec64)
BOOST_CHECK(v1.dot(v2) == 26);
}
#if FCL_HAVE_EIGEN
BOOST_AUTO_TEST_CASE(vec_test_eigen_vec32)
{
typedef Vec3fX<details::eigen_wrapper_v3 <float> > Vec3f32;
Vec3f32 v1(1.0f, 2.0f, 3.0f);
BOOST_CHECK(v1[0] == 1.0f);
BOOST_CHECK(v1[1] == 2.0f);
BOOST_CHECK(v1[2] == 3.0f);
Vec3f32 v2 = v1;
Vec3f32 v3(3.3f, 4.3f, 5.3f);
v1 += v3;
BOOST_CHECK(v1.equal(v2 + v3));
v1 -= v3;
BOOST_CHECK(v1.equal(v2));
v1 -= v3;
BOOST_CHECK(v1.equal(v2 - v3));
v1 += v3;
v1 *= v3;
BOOST_CHECK(v1.equal(v2 * v3));
v1 /= v3;
BOOST_CHECK(v1.equal(v2));
v1 /= v3;
BOOST_CHECK(v1.equal(v2 / v3));
v1 *= v3;
v1 *= 2.0f;
BOOST_CHECK(v1.equal(v2 * 2.0f));
v1 /= 2.0f;
BOOST_CHECK(v1.equal(v2));
v1 /= 2.0f;
BOOST_CHECK(v1.equal(v2 / 2.0f));
v1 *= 2.0f;
v1 += 2.0f;
BOOST_CHECK(v1.equal(v2 + 2.0f));
v1 -= 2.0f;
BOOST_CHECK(v1.equal(v2));
v1 -= 2.0f;
BOOST_CHECK(v1.equal(v2 - 2.0f));
v1 += 2.0f;
BOOST_CHECK((-Vec3f32(1.0f, 2.0f, 3.0f)).equal(Vec3f32(-1.0f, -2.0f, -3.0f)));
v1 = Vec3f32(1.0f, 2.0f, 3.0f);
v2 = Vec3f32(3.0f, 4.0f, 5.0f);
BOOST_CHECK((v1.cross(v2)).equal(Vec3f32(-2.0f, 4.0f, -2.0f)));
BOOST_CHECK(std::abs(v1.dot(v2) - 26) < 1e-5);
v1 = Vec3f32(3.0f, 4.0f, 5.0f);
BOOST_CHECK(std::abs(v1.sqrLength() - 50) < 1e-5);
BOOST_CHECK(std::abs(v1.length() - sqrt(50)) < 1e-5);
BOOST_CHECK(normalize(v1).equal(v1 / v1.length()));
}
BOOST_AUTO_TEST_CASE(vec_test_eigen_vec64)
{
typedef Vec3fX<details::eigen_wrapper_v3<double> > Vec3f64;
Vec3f64 v1(1.0, 2.0, 3.0);
BOOST_CHECK(v1[0] == 1.0);
BOOST_CHECK(v1[1] == 2.0);
BOOST_CHECK(v1[2] == 3.0);
Vec3f64 v2 = v1;
Vec3f64 v3(3.3, 4.3, 5.3);
v1 += v3;
BOOST_CHECK(v1.equal(v2 + v3));
v1 -= v3;
BOOST_CHECK(v1.equal(v2));
v1 -= v3;
BOOST_CHECK(v1.equal(v2 - v3));
v1 += v3;
v1 *= v3;
BOOST_CHECK(v1.equal(v2 * v3));
v1 /= v3;
BOOST_CHECK(v1.equal(v2));
v1 /= v3;
BOOST_CHECK(v1.equal(v2 / v3));
v1 *= v3;
v1 *= 2.0;
BOOST_CHECK(v1.equal(v2 * 2.0));
v1 /= 2.0;
BOOST_CHECK(v1.equal(v2));
v1 /= 2.0;
BOOST_CHECK(v1.equal(v2 / 2.0));
v1 *= 2.0;
v1 += 2.0;
BOOST_CHECK(v1.equal(v2 + 2.0));
v1 -= 2.0;
BOOST_CHECK(v1.equal(v2));
v1 -= 2.0;
BOOST_CHECK(v1.equal(v2 - 2.0));
v1 += 2.0;
BOOST_CHECK((-Vec3f64(1.0, 2.0, 3.0)).equal(Vec3f64(-1.0, -2.0, -3.0)));
v1 = Vec3f64(1.0, 2.0, 3.0);
v2 = Vec3f64(3.0, 4.0, 5.0);
BOOST_CHECK((v1.cross(v2)).equal(Vec3f64(-2.0, 4.0, -2.0)));
BOOST_CHECK(std::abs(v1.dot(v2) - 26) < 1e-5);
v1 = Vec3f64(3.0, 4.0, 5.0);
BOOST_CHECK(std::abs(v1.sqrLength() - 50) < 1e-5);
BOOST_CHECK(std::abs(v1.length() - sqrt(50)) < 1e-5);
BOOST_CHECK(normalize(v1).equal(v1 / v1.length()));
v1 = Vec3f64(1.0, 2.0, 3.0);
v2 = Vec3f64(3.0, 4.0, 5.0);
BOOST_CHECK((v1.cross(v2)).equal(Vec3f64(-2.0, 4.0, -2.0)));
BOOST_CHECK(v1.dot(v2) == 26);
}
BOOST_AUTO_TEST_CASE(eigen_mat32_consistent)
{
typedef Vec3fX<details::Vec3Data<float> > Vec3f32;
typedef Vec3fX<details::eigen_wrapper_v3 <float> > Vec3f32Eigen;
typedef Matrix3fX<details::Matrix3Data<details::Vec3Data<float> > > Matrix3f32;
typedef Matrix3fX<details::eigen_wrapper_m3<details::eigen_wrapper_v3<float> > > Matrix3f32Eigen;
Vec3f32 v1(1, 2, 3);
Vec3f32Eigen v2(1, 2, 3);
Matrix3f32 m1(-1, 3, -3, 0, -6, 6, -5, -3, 1);
Matrix3f32Eigen m2(-1, 3, -3, 0, -6, 6, -5, -3, 1);
for(size_t i = 0; i < 3; ++i)
for(size_t j = 0; j < 3; ++j)
BOOST_CHECK((m1(i, j) - m2(i, j) < 1e-1));
Matrix3f32 m3(transpose(m1));
Matrix3f32Eigen m4(transpose(m2));
for(size_t i = 0; i < 3; ++i)
for(size_t j = 0; j < 3; ++j)
BOOST_CHECK((m3(i, j) - m4(i, j) < 1e-1));
m3 = m1; m3.transpose();
m4 = m2; m4.transpose();
for(size_t i = 0; i < 3; ++i)
for(size_t j = 0; j < 3; ++j)
BOOST_CHECK((m3(i, j) - m4(i, j) < 1e-1));
m3 = inverse(m1);
m4 = inverse(m2);
for(size_t i = 0; i < 3; ++i)
for(size_t j = 0; j < 3; ++j)
BOOST_CHECK((m3(i, j) - m4(i, j) < 1e-1));
m3 = m1; m3.inverse();
m4 = m2; m4.inverse();
for(size_t i = 0; i < 3; ++i)
for(size_t j = 0; j < 3; ++j)
BOOST_CHECK((m3(i, j) - m4(i, j) < 1e-1));
}
BOOST_AUTO_TEST_CASE(vec_test_eigen_vec32_consistent)
{
typedef Vec3fX<details::Vec3Data<float> > Vec3f32;
typedef Vec3fX<details::eigen_wrapper_v3<float> > Vec3f32Eigen;
Vec3f32 v1(3.4f, 4.2f, 10.5f), v2(3.1f, 0.1f, -50.4f);
Vec3f32Eigen v3(3.4f, 4.2f, 10.5f), v4(3.1f, 0.1f, -50.4f);
Vec3f32 v12 = v1 + v2;
Vec3f32Eigen v34 = v3 + v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1 - v2;
v34 = v3 - v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1 * v2;
v34 = v3 * v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1 / v2;
v34 = v3 / v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
float t = 1234.433f;
v12 = v1 + t;
v34 = v3 + t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1 - t;
v34 = v3 - t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1 * t;
v34 = v3 * t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1 / t;
v34 = v3 / t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 += v2;
v34 = v3; v34 += v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 -= v2;
v34 = v3; v34 -= v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 *= v2;
v34 = v3; v34 *= v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 /= v2;
v34 = v3; v34 /= v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 += t;
v34 = v3; v34 += t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 -= t;
v34 = v3; v34 -= t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 *= t;
v34 = v3; v34 *= t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 /= t;
v34 = v3; v34 /= t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = -v1;
v34 = -v3;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1.cross(v2);
v34 = v3.cross(v4);
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
// Difference if about 6e-5
BOOST_CHECK(std::abs(v1.dot(v2) - v3.dot(v4)) < 1e-4);
v12 = min(v1, v2);
v34 = min(v3, v4);
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = max(v1, v2);
v34 = max(v3, v4);
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = abs(v2);
v34 = abs(v4);
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
Vec3f32 delta1(1e-9f, 1e-9f, 1e-9f);
Vec3f32Eigen delta2(1e-9f, 1e-9f, 1e-9f);
BOOST_CHECK((v1 + delta1).equal(v1));
BOOST_CHECK((v3 + delta2).equal(v3));
BOOST_CHECK(std::abs(v1.length() - v3.length()) < 1e-5);
BOOST_CHECK(std::abs(v1.sqrLength() - v3.sqrLength()) < 1e-5);
v12 = v1; v12.negate();
v34 = v3; v34.negate();
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12.normalize();
v34 = v3; v34.normalize();
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = normalize(v1);
v34 = normalize(v3);
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
}
BOOST_AUTO_TEST_CASE(vec_test_eigen_vec64_consistent)
{
typedef Vec3fX<details::Vec3Data<double> > Vec3f64;
typedef Vec3fX<details::eigen_wrapper_v3<double> > Vec3f64Eigen;
Vec3f64 v1(3.4, 4.2, 10.5), v2(3.1, 0.1, -50.4);
Vec3f64Eigen v3(3.4, 4.2, 10.5), v4(3.1, 0.1, -50.4);
Vec3f64 v12 = v1 + v2;
Vec3f64Eigen v34 = v3 + v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1 - v2;
v34 = v3 - v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1 * v2;
v34 = v3 * v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1 / v2;
v34 = v3 / v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
double t = 1234.433;
v12 = v1 + t;
v34 = v3 + t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1 - t;
v34 = v3 - t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1 * t;
v34 = v3 * t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1 / t;
v34 = v3 / t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 += v2;
v34 = v3; v34 += v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 -= v2;
v34 = v3; v34 -= v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 *= v2;
v34 = v3; v34 *= v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 /= v2;
v34 = v3; v34 /= v4;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 += t;
v34 = v3; v34 += t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 -= t;
v34 = v3; v34 -= t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 *= t;
v34 = v3; v34 *= t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12 /= t;
v34 = v3; v34 /= t;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = -v1;
v34 = -v3;
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1.cross(v2);
v34 = v3.cross(v4);
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
BOOST_CHECK(std::abs(v1.dot(v2) - v3.dot(v4)) < 1e-5);
v12 = min(v1, v2);
v34 = min(v3, v4);
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = max(v1, v2);
v34 = max(v3, v4);
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = abs(v2);
v34 = abs(v4);
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
Vec3f64 delta1(1e-15, 1e-15, 1e-15);
Vec3f64Eigen delta2(1e-15, 1e-15, 1e-15);
BOOST_CHECK((v1 + delta1).equal(v1));
BOOST_CHECK((v3 + delta2).equal(v3));
BOOST_CHECK(std::abs(v1.length() - v3.length()) < 1e-5);
BOOST_CHECK(std::abs(v1.sqrLength() - v3.sqrLength()) < 1e-5);
v12 = v1; v12.negate();
v34 = v3; v34.negate();
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = v1; v12.normalize();
v34 = v3; v34.normalize();
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
v12 = normalize(v1);
v34 = normalize(v3);
BOOST_CHECK(std::abs(v12[0] - v34[0]) < 1e-5);
BOOST_CHECK(std::abs(v12[1] - v34[1]) < 1e-5);
BOOST_CHECK(std::abs(v12[2] - v34[2]) < 1e-5);
}
#endif
#if FCL_HAVE_SSE
BOOST_AUTO_TEST_CASE(vec_test_sse_vec32)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment