38 #include <visp3/core/vpTranslationVector.h>
115 "Cannot construct a translation vector from a "
116 "%d-dimension column vector",
168 "Cannot build a translation vector from a %d-dimension column vector", v.
size()));
226 for (
unsigned int i = 0; i < 3; ++i) {
227 s[i] = (*this)[i] + tv[i];
261 for (
unsigned int i = 0; i < 3; ++i) {
262 s[i] = (*this)[i] + v[i];
290 for (
unsigned int i = 0; i < 3; ++i) {
291 sub[i] = (*this)[i] - tv[i];
314 for (
unsigned int i = 0; i <
dsize; ++i) {
340 for (
unsigned int i = 0; i <
dsize; ++i) {
359 unsigned int v_col = v.
getCols();
360 for (
unsigned int i = 0; i <
rowNum; ++i) {
361 for (
unsigned int j = 0; j < v_col; ++j) {
362 M[i][j] = (*this)[i] * v[j];
378 for (
unsigned int i = 0; i <
rowNum; ++i) {
393 for (
unsigned int i = 0; i <
rowNum; ++i) {
418 for (
unsigned int i = 0; i <
dsize; ++i) {
443 if (tv.
size() != 3) {
445 "Cannot initialize a translation vector from a "
446 "%d-dimension col vector",
449 unsigned int k = tv.
size();
478 unsigned int k = tv.
rowNum;
508 for (
int i = 0; i < 3; ++i) {
515 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
535 if (list.size() >
size()) {
538 "Cannot set translation vector out of bounds. It has only %d values while you try to initialize with %d values",
539 size(), list.size()));
541 std::copy(list.begin(), list.end(),
data);
605 "Cannot set translation vector out of bounds. It has only %d values while you try to initialize with %d values",
718 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
754 double sum_square = 0.0;
756 for (
unsigned int i = 0; i <
rowNum; ++i) {
775 size_t vec_m_size = vec_M.size();
776 for (
size_t i = 0; i < vec_m_size; ++i) {
777 meanT +=
static_cast<vpColVector>(vec_M[i].getTranslationVector());
779 meanT /=
static_cast<double>(vec_M.size());
796 size_t l_vec_t_size = vec_t.size();
797 for (
size_t i = 0; i < l_vec_t_size; ++i) {
800 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)