43 #include <visp3/core/vpTranslationVector.h>
45 #ifdef ENABLE_VISP_NAMESPACE
49 bool test(
const std::string &s,
const vpArray2D<double> &A,
const std::vector<double> &bench)
51 static unsigned int cpt = 0;
52 std::cout <<
"** Test " << ++cpt << std::endl;
53 std::cout << s <<
"(" << A.
getRows() <<
"," << A.
getCols() <<
") =" << A << std::endl;
54 if (bench.size() != A.
size()) {
55 std::cout <<
"Test fails: bad size wrt bench" << std::endl;
58 for (
unsigned int i = 0; i < A.
size(); i++) {
59 if (std::fabs(A.
data[i] - bench[i]) > std::fabs(A.
data[i]) * std::numeric_limits<double>::epsilon()) {
60 std::cout <<
"Test fails: bad content" << std::endl;
72 std::vector<double> bench(3, 0);
73 if (test(
"t", t, bench) ==
false)
78 std::vector<double> bench(3);
82 if (test(
"t1", t1, bench) ==
false)
89 if (test(
"t2", t2, bench) ==
false)
96 if (test(
"t3", t3, bench) ==
false)
100 std::vector<double> bench1(9, 0);
107 if (test(
"skew", skew, bench1) ==
false)
115 if (test(
"t4", t4, bench) ==
false)
122 if (test(
"t5", t5, bench) ==
false)
129 if (test(
"t6", t6, bench) ==
false)
132 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)