34 #ifndef _vpColVector_h_
35 #define _vpColVector_h_
37 #include <visp3/core/vpArray2D.h>
38 #include <visp3/core/vpMath.h>
39 #include <visp3/core/vpPoseVector.h>
40 #include <visp3/core/vpRotationVector.h>
41 #include <visp3/core/vpRowVector.h>
244 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
251 #if ((__cplusplus >= 201103L) || (defined(_MSVC_LANG) && (_MSVC_LANG >= 201103L)))
252 vpColVector(
const std::initializer_list<double> &list) :
vpArray2D<double>(static_cast<unsigned int>(list.
size()), 1)
254 std::copy(list.begin(), list.end(),
data);
264 if (
data !=
nullptr) {
306 std::ostream &
cppPrint(std::ostream &os,
const std::string &matrixName =
"A",
bool octet =
false)
const;
334 std::ostream &
csvPrint(std::ostream &os)
const;
344 double d2r = M_PI / 180.0;
371 "Cannot extract a (%dx1) column vector from a (%dx1) "
372 "column vector starting at index %d",
511 std::ostream &
maplePrint(std::ostream &os)
const;
635 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
962 int print(std::ostream &s,
unsigned int length,
char const *intro = 0)
const;
972 double r2d = 180.0 / M_PI;
1034 void reshape(
vpMatrix &M,
const unsigned int &nrows,
const unsigned int &ncols);
1056 void resize(
unsigned int i,
bool flagNullify =
true)
1072 void resize(
unsigned int nrows,
unsigned int ncols,
bool flagNullify)
1076 "Cannot resize a column vector to a (%dx%d) "
1077 "dimension vector that has more than one column",
1098 void stack(
double d);
1145 std::vector<double> toStdVector()
const;
1326 static double stdev(
const vpColVector &v,
bool useBesselCorrection =
false);
1328 #ifdef VISP_HAVE_NLOHMANN_JSON
1346 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
1399 return vpColVector(*
this, first_row - 1, last_row - first_row + 1);
1433 vp_deprecated
void insert(
const vpColVector &v,
unsigned int r,
unsigned int c = 0);
1453 #ifndef DOXYGEN_SHOULD_SKIP_THIS
1458 #ifdef VISP_HAVE_NLOHMANN_JSON
1463 j[
"type"] =
"vpColVector";
Implementation of a generic 2D array used as base class for matrices and vectors.
unsigned int getCols() const
double * data
Address of the first element of the data array.
double ** rowPtrs
Address of the first element of each rows.
void insert(const vpArray2D< Type > &A, unsigned int r, unsigned int c)
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
unsigned int rowNum
Number of rows in the array.
friend void to_json(nlohmann::json &j, const vpArray2D< T > &array)
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
unsigned int dsize
Current array size (rowNum * colNum)
unsigned int size() const
Return the number of elements of the 2D array.
vpArray2D< Type > t() const
Compute the transpose of the array.
bool operator!=(const vpArray2D< Type > &A) const
vpArray2D< Type > & operator=(Type x)
Set all the elements of the array to x.
vpArray2D< Type > hadamard(const vpArray2D< Type > &m) const
friend void from_json(const nlohmann::json &j, vpArray2D< T > &array)
void reshape(unsigned int nrows, unsigned int ncols)
unsigned int colNum
Number of columns in the array.
bool operator==(const vpArray2D< Type > &A) const
Implementation of column vector and the associated operations.
vpColVector extract(unsigned int r, unsigned int colsize) const
vpColVector(unsigned int n, double val)
vpColVector(unsigned int n)
static vp_deprecated vpColVector stackMatrices(const vpColVector &A, const vpColVector &B)
static vp_deprecated void stackMatrices(const vpColVector &A, const vpColVector &B, vpColVector &C)
double & operator[](unsigned int n)
vpColVector(const vpColVector &v)
const double & operator[](unsigned int n) const
vp_deprecated void init()
vpColVector operator*(const double &x, const vpColVector &v)
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify)
vp_deprecated vpColVector rows(unsigned int first_row, unsigned int last_row) const
static vpColVector cross(const vpColVector &a, const vpColVector &b)
vp_deprecated void stackMatrices(const vpColVector &r)
void resize(unsigned int i, bool flagNullify=true)
error that can be emitted by ViSP classes.
@ badValue
Used to indicate that a value is not in the allowed range.
Implementation of a matrix and operations on matrices.
std::ostream & cppPrint(std::ostream &os, const std::string &matrixName="A", bool octet=false) const
vpMatrix operator-() const
vpMatrix & operator/=(double x)
Divide all the element of the matrix by x : Aij = Aij / x.
int print(std::ostream &s, unsigned int length, const std::string &intro="") const
std::ostream & maplePrint(std::ostream &os) const
vpMatrix operator*(const vpMatrix &B) const
vpMatrix operator/(double x) const
Cij = Aij / x (A is unchanged)
void stack(const vpMatrix &A)
vpMatrix & operator-=(const vpMatrix &B)
Operation A = A - B.
vpMatrix & operator*=(double x)
Multiply all the element of the matrix by x : Aij = Aij * x.
vp_deprecated double euclideanNorm() const
vpMatrix operator+(const vpMatrix &B) const
vpMatrix & operator+=(const vpMatrix &B)
Operation A = A + B.
double infinityNorm() const
double frobeniusNorm() const
vpMatrix & operator,(double val)
vp_deprecated void init()
vpMatrix transpose() const
std::ostream & csvPrint(std::ostream &os) const
std::ostream & matlabPrint(std::ostream &os) const
Implementation of a pose vector and operations on poses.
Implementation of a generic rotation vector.
Implementation of row vector and the associated operations.
Class that consider the case of a translation vector.