48 #include <visp3/core/vpTranslationVector.h>
50 bool test(
const std::string &s,
const vpArray2D<double> &A,
const std::vector<double> &bench)
52 static unsigned int cpt = 0;
53 std::cout <<
"** Test " << ++cpt << std::endl;
54 std::cout << s <<
"(" << A.
getRows() <<
"," << A.
getCols() <<
") =" << A << std::endl;
55 if(bench.size() != A.
size()) {
56 std::cout <<
"Test fails: bad size wrt bench" << std::endl;
59 for (
unsigned int i=0; i<A.
size(); i++) {
60 if (std::fabs(A.
data[i]-bench[i]) > std::fabs(A.
data[i])*std::numeric_limits<double>::epsilon()) {
61 std::cout <<
"Test fails: bad content" << std::endl;
73 std::vector<double> bench(3,0);
74 if (test(
"t", t, bench) ==
false)
79 std::vector<double> bench(3);
83 if (test(
"t1", t1, bench) ==
false)
90 if (test(
"t2", t2, bench) ==
false)
97 if (test(
"t3", t3, bench) ==
false)
101 std::vector<double> bench1(9, 0);
108 if (test(
"skew", skew, bench1) ==
false)
116 if (test(
"t4", t4, bench) ==
false)
123 if (test(
"t5", t5, bench) ==
false)
130 if (test(
"t6", t6, bench) ==
false)
133 std::cout <<
"All tests succeed" << std::endl;
Implementation of a matrix and operations on matrices.
static vpTranslationVector cross(const vpTranslationVector &a, const vpTranslationVector &b)
Type * data
Address of the first element of the data array.
unsigned int size() const
Return the number of elements of the 2D array.
unsigned int getCols() const
Return the number of columns of the 2D array.
unsigned int getRows() const
Return the number of rows of the 2D array.
void set(const double tx, const double ty, const double tz)
Class that consider the case of a translation vector.