39 #include <visp3/core/vpArray2D.h>
40 #include <visp3/core/vpColVector.h>
41 #include <visp3/core/vpMath.h>
42 #include <visp3/core/vpMatrix.h>
124 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
135 if (data !=
nullptr) {
140 if (rowPtrs !=
nullptr) {
144 rowNum = colNum = dsize = 0;
147 std::ostream &cppPrint(std::ostream &os,
const std::string &matrixName =
"A",
bool octet =
false)
const;
148 std::ostream &csvPrint(std::ostream &os)
const;
156 double d2r = M_PI / 180.0;
181 if (c >= colNum || c + rowsize > colNum) {
183 "Cannot extract a (1x%d) row vector from a (1x%d) "
184 "row vector starting at index %d",
185 rowsize, colNum, c));
191 double frobeniusNorm()
const;
192 void init(
const vpRowVector &v,
unsigned int c,
unsigned int ncols);
195 std::ostream &maplePrint(std::ostream &os)
const;
196 std::ostream &matlabPrint(std::ostream &os)
const;
202 inline double &
operator[](
unsigned int n) {
return *(data + n); }
204 inline const double &
operator[](
unsigned int n)
const {
return *(data + n); }
212 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
239 int print(std::ostream &s,
unsigned int length,
char const *intro = 0)
const;
246 double r2d = 180.0 / M_PI;
251 void reshape(
vpMatrix &M,
const unsigned int &nrows,
const unsigned int &ncols);
271 void resize(
unsigned int nrows,
unsigned int ncols,
bool flagNullify)
275 "Cannot resize a row vector to a (%dx%d) dimension "
276 "vector that has more than one row",
281 void stack(
double d);
285 double sumSquare()
const;
287 std::vector<double> toStdVector()
const;
295 static double stdev(
const vpRowVector &v,
bool useBesselCorrection =
false);
297 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
329 vp_deprecated
double euclideanNorm()
const;
Implementation of a generic 2D array used as base class for matrices and vectors.
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)
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
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.
void reshape(unsigned int nrows, unsigned int ncols)
bool operator==(const vpArray2D< Type > &A) const
Implementation of column vector and the associated operations.
vpColVector operator*(const double &x, const vpColVector &v)
error that can be emitted by ViSP classes.
Implementation of a matrix and operations on matrices.
Implementation of row vector and the associated operations.
vp_deprecated void setIdentity(const double &val=1.0)
vpRowVector(const vpRowVector &v)
vpRowVector(unsigned int n, double val)
Construct a row vector of size n. Each element is set to val.
double & operator[](unsigned int n)
Operator that allows to set a value of an element : v[i] = x.
vpRowVector(unsigned int n)
static vp_deprecated vpRowVector stackMatrices(const vpRowVector &A, const vpRowVector &B)
vp_deprecated void stackMatrices(const vpRowVector &r)
void resize(unsigned int i, bool flagNullify=true)
vpRowVector()
Basic constructor that creates an empty 0-size row vector.
vpRowVector(const std::initializer_list< double > &list)
vp_deprecated void init()
static vp_deprecated void stackMatrices(const vpRowVector &A, const vpRowVector &B, vpRowVector &C)
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify)
const double & operator[](unsigned int n) const
Operator that allows to get the value of an element : x = v[i].
vpRowVector extract(unsigned int c, unsigned int rowsize) const
vpMatrix operator*(const double &x, const vpMatrix &A)