MCPcopy Create free account
hub / github.com/dartsim/dart / TEST

Function TEST

tests/unit/math/test_Math.cpp:737–796  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

735}
736
737TEST(MATH, ARTICULATED_INERTIA_TRANSFORM)
738{
739 const int iterations = 100000;
740
741 Affine3d A1
742 = Translation3d(0.1, 0.2, 0.3)
743 * AngleAxisd(0.5, Vector3d(1.0 / sqrt(2.0), 1.0 / sqrt(2.0), 0.0));
744 Matrix<double, 6, 6> a1 = Matrix<double, 6, 6>::Identity();
745 Matrix<double, 6, 6> a2;
746
747 Isometry3d I1;
748 I1.matrix() = A1.matrix();
749 Matrix<double, 6, 6> i1 = Matrix<double, 6, 6>::Identity();
750 Matrix<double, 6, 6> i2;
751
752 Matrix4d M1;
753 M1 = A1.matrix();
754 Matrix<double, 6, 6> m1 = Matrix<double, 6, 6>::Identity();
755 Matrix<double, 6, 6> m2;
756
757 clock_t start = clock();
758 for (int i = 0; i < iterations; i++) {
759 a2 = Transform_Affine3d(A1, a1);
760 }
761 std::cout << "Transform_Affine3d: "
762 << (double)(clock() - start) / CLOCKS_PER_SEC << " s\n";
763 // cout << "result: " << a2 << endl;
764
765 start = clock();
766 for (int i = 0; i < iterations; i++) {
767 i2 = Transform_Isometry3d(I1, i1);
768 }
769 std::cout << "Transform_Isometry3d: "
770 << (double)(clock() - start) / CLOCKS_PER_SEC << " s\n";
771 // cout << "result: " << i2 << endl;
772
773 start = clock();
774 for (int i = 0; i < iterations; i++) {
775 i2 = Transform_Isometry3d_2(I1, i1);
776 }
777 std::cout << "Transform_Isometry3d_2: "
778 << (double)(clock() - start) / CLOCKS_PER_SEC << " s\n";
779 // cout << "result: " << i2 << endl;
780
781 start = clock();
782 for (int i = 0; i < iterations; i++) {
783 i2 = Transform_Isometry3d_3(I1, i1);
784 }
785 std::cout << "Transform_Isometry3d_3: "
786 << (double)(clock() - start) / CLOCKS_PER_SEC << " s\n";
787 // cout << "result: " << i2 << endl;
788
789 start = clock();
790 for (int i = 0; i < iterations; i++) {
791 m2 = Transform_Matrix4d(M1, m1);
792 }
793 std::cout << "Transform_Matrix4d: "
794 << (double)(clock() - start) / CLOCKS_PER_SEC << " s\n";

Callers

nothing calls this directly

Calls 15

prodFunction · 0.85
concatenateFunction · 0.85
invFunction · 0.85
inv_se3Function · 0.85
expToQuatFunction · 0.85
quatToExpFunction · 0.85
matrixToEulerXYZFunction · 0.85
eulerXYZToMatrixFunction · 0.85
expMapFunction · 0.85
AdTJac1Function · 0.85
AdTJac2Function · 0.85
AdTJac3Function · 0.85

Tested by

no test coverage detected