49 #include <visp3/core/vpTranslationVector.h> 51 bool test(
const std::string &s,
const vpArray2D<double> &A,
const std::vector<double> &bench)
53 static unsigned int cpt = 0;
54 std::cout <<
"** Test " << ++cpt << std::endl;
55 std::cout << s <<
"(" << A.
getRows() <<
"," << A.
getCols() <<
") =" << A << std::endl;
56 if (bench.size() != A.
size()) {
57 std::cout <<
"Test fails: bad size wrt bench" << std::endl;
60 for (
unsigned int i = 0; i < A.
size(); i++) {
61 if (std::fabs(A.
data[i] - bench[i]) > std::fabs(A.
data[i]) * std::numeric_limits<double>::epsilon()) {
62 std::cout <<
"Test fails: bad content" << std::endl;
74 std::vector<double> bench(3, 0);
75 if (test(
"t", t, bench) ==
false)
80 std::vector<double> bench(3);
84 if (test(
"t1", t1, bench) ==
false)
91 if (test(
"t2", t2, bench) ==
false)
98 if (test(
"t3", t3, bench) ==
false)
102 std::vector<double> bench1(9, 0);
109 if (test(
"skew", skew, bench1) ==
false)
117 if (test(
"t4", t4, bench) ==
false)
124 if (test(
"t5", t5, bench) ==
false)
131 if (test(
"t6", t6, bench) ==
false)
134 std::cout <<
"All tests succeed" << std::endl;
Implementation of a matrix and operations on matrices.
static vpTranslationVector cross(const vpTranslationVector &a, const vpTranslationVector &b)
unsigned int getRows() const
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
void set(double tx, double ty, double tz)
Class that consider the case of a translation vector.