46 #include <visp3/core/vpTranslationVector.h>
48 bool test(
const std::string &s,
const vpArray2D<double> &A,
const std::vector<double> &bench)
50 static unsigned int cpt = 0;
51 std::cout <<
"** Test " << ++cpt << std::endl;
52 std::cout << s <<
"(" << A.
getRows() <<
"," << A.
getCols() <<
") =" << A << std::endl;
53 if (bench.size() != A.
size()) {
54 std::cout <<
"Test fails: bad size wrt bench" << std::endl;
57 for (
unsigned int i = 0; i < A.
size(); i++) {
58 if (std::fabs(A.
data[i] - bench[i]) > std::fabs(A.
data[i]) * std::numeric_limits<double>::epsilon()) {
59 std::cout <<
"Test fails: bad content" << std::endl;
71 std::vector<double> bench(3, 0);
72 if (test(
"t", t, bench) ==
false)
77 std::vector<double> bench(3);
81 if (test(
"t1", t1, bench) ==
false)
88 if (test(
"t2", t2, bench) ==
false)
95 if (test(
"t3", t3, bench) ==
false)
99 std::vector<double> bench1(9, 0);
106 if (test(
"skew", skew, bench1) ==
false)
114 if (test(
"t4", t4, bench) ==
false)
121 if (test(
"t5", t5, bench) ==
false)
128 if (test(
"t6", t6, bench) ==
false)
131 std::cout <<
"All tests succeed" << std::endl;
unsigned int getCols() 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 getRows() const
Implementation of a matrix and operations on matrices.
Class that consider the case of a translation vector.
void set(double tx, double ty, double tz)
static vpTranslationVector cross(const vpTranslationVector &a, const vpTranslationVector &b)