39 #include <visp3/core/vpTranslationVector.h>
116 "Cannot construct a translation vector from a "
117 "%d-dimension column vector",
169 "Cannot build a translation vector from a %d-dimension column vector", v.
size()));
227 for (
unsigned int i = 0; i < 3; i++)
228 s[i] = (*
this)[i] + tv[i];
261 for (
unsigned int i = 0; i < 3; i++)
262 s[i] = (*
this)[i] + v[i];
289 for (
unsigned int i = 0; i < 3; i++)
290 sub[i] = (*
this)[i] - tv[i];
312 for (
unsigned int i = 0; i <
dsize; i++) {
338 for (
unsigned int i = 0; i <
dsize; i++) {
357 for (
unsigned int i = 0; i <
rowNum; i++) {
358 for (
unsigned int j = 0; j < v.
getCols(); j++) {
359 M[i][j] = (*this)[i] * v[j];
375 for (
unsigned int i = 0; i <
rowNum; i++)
389 for (
unsigned int i = 0; i <
rowNum; i++)
413 for (
unsigned int i = 0; i <
dsize; i++) {
438 if (tv.
size() != 3) {
440 "Cannot initialize a translation vector from a "
441 "%d-dimension col vector",
444 unsigned int k = tv.
size();
473 unsigned int k = tv.
rowNum;
503 for (
int i = 0; i < 3; i++)
509 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
529 if (list.size() >
size()) {
532 "Cannot set translation vector out of bounds. It has only %d values while you try to initialize with %d values",
533 size(), list.size()));
535 std::copy(list.begin(), list.end(),
data);
599 "Cannot set translation vector out of bounds. It has only %d values while you try to initialize with %d values",
712 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
748 double sum_square = 0.0;
750 for (
unsigned int i = 0; i <
rowNum; i++) {
769 for (
size_t i = 0; i < vec_M.size(); i++) {
770 meanT += (
vpColVector)vec_M[i].getTranslationVector();
772 meanT /=
static_cast<double>(vec_M.size());
789 for (
size_t i = 0; i < vec_t.size(); i++) {
792 meanT /=
static_cast<double>(vec_t.size());
Implementation of a generic 2D array used as base class for matrices and vectors.
unsigned int getCols() const
Type * data
Address of the first element of the data array.
double ** rowPtrs
Address of the first element of each rows.
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
unsigned int rowNum
Number of rows in the array.
unsigned int dsize
Current array size (rowNum * colNum)
unsigned int size() const
Return the number of elements of the 2D array.
Implementation of column vector and the associated operations.
error that can be emitted by ViSP classes.
@ dimensionError
Bad dimension.
Implementation of an homogeneous matrix and operations on such kind of matrices.
void extract(vpRotationMatrix &R) const
Implementation of a matrix and operations on matrices.
Implementation of a pose vector and operations on poses.
Implementation of row vector and the associated operations.
Class that consider the case of a translation vector.
void set(double tx, double ty, double tz)
vpTranslationVector & operator=(const vpColVector &tv)
static vpTranslationVector mean(const std::vector< vpHomogeneousMatrix > &vec_M)
vp_deprecated double euclideanNorm() const
vpTranslationVector operator/(double x) const
vpTranslationVector & operator/=(double x)
vpTranslationVector & operator*=(double x)
vpMatrix operator*(const vpRowVector &v) const
double frobeniusNorm() const
vpTranslationVector operator-() const
vpTranslationVector operator+(const vpTranslationVector &tv) const
vpTranslationVector & operator<<(double val)
vpTranslationVector & operator,(double val)
static vpTranslationVector cross(const vpTranslationVector &a, const vpTranslationVector &b)
vpTranslationVector buildFrom(double tx, double ty, double tz)
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true)