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>
195 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
199 std::copy(list.begin(), list.end(),
data);
225 std::ostream &
cppPrint(std::ostream &os,
const std::string &matrixName =
"A",
bool octet =
false)
const;
226 std::ostream &
csvPrint(std::ostream &os)
const;
235 double d2r = M_PI / 180.0;
261 "Cannot extract a (%dx1) column vector from a (%dx1) "
262 "column vector starting at index %d",
277 std::ostream &
maplePrint(std::ostream &os)
const;
296 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
327 int print(std::ostream &s,
unsigned int length,
char const *intro = 0)
const;
336 double r2d = 180.0 / M_PI;
342 void reshape(
vpMatrix &M,
const unsigned int &nrows,
const unsigned int &ncols);
362 void resize(
unsigned int nrows,
unsigned int ncols,
bool flagNullify)
366 "Cannot resize a column vector to a (%dx%d) "
367 "dimension vector that has more than one column",
373 void stack(
double d);
379 std::vector<double> toStdVector()
const;
406 static double stdev(
const vpColVector &v,
bool useBesselCorrection =
false);
408 #ifdef VISP_HAVE_NLOHMANN_JSON
413 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
428 return vpColVector(*
this, first_row - 1, last_row - first_row + 1);
452 vp_deprecated
void insert(
const vpColVector &v,
unsigned int r,
unsigned int c = 0);
458 #ifndef DOXYGEN_SHOULD_SKIP_THIS
463 #ifdef VISP_HAVE_NLOHMANN_JSON
468 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)
Construct a column vector of size n. Each element is set to 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)
Operator that allows to set a value of an element : v[i] = x.
vpColVector(const vpColVector &v)
const double & operator[](unsigned int n) const
Operator that allows to get the value of an element : x = v[i].
vp_deprecated void init()
vpColVector()
Basic constructor that creates an empty 0-size column vector.
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify)
vp_deprecated void setIdentity(const double &val=1.0)
vp_deprecated vpColVector rows(unsigned int first_row, unsigned int last_row) const
vpColVector(const std::initializer_list< double > &list)
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.
VISP_EXPORT vpImagePoint operator*(const vpImagePoint &ip1, double scale)
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.