44 #include <visp3/core/vpArray2D.h> 45 #include <visp3/core/vpColVector.h> 46 #include <visp3/core/vpMath.h> 47 #include <visp3/core/vpMatrix.h> 133 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) 153 if (rowPtrs != NULL) {
157 rowNum = colNum = dsize = 0;
160 std::ostream &cppPrint(std::ostream &os,
const std::string &matrixName =
"A",
bool octet =
false)
const;
161 std::ostream &csvPrint(std::ostream &os)
const;
169 double d2r = M_PI / 180.0;
174 vp_deprecated
double euclideanNorm()
const;
193 if (c >= colNum || c + rowsize > colNum) {
195 "Cannot extract a (1x%d) row vector from a (1x%d) " 196 "row vector starting at index %d",
197 rowsize, colNum, c));
203 double frobeniusNorm()
const;
204 void init(
const vpRowVector &v,
unsigned int c,
unsigned int ncols);
207 std::ostream &maplePrint(std::ostream &os)
const;
208 std::ostream &matlabPrint(std::ostream &os)
const;
214 inline double &
operator[](
unsigned int n) {
return *(data + n); }
216 inline const double &
operator[](
unsigned int n)
const {
return *(data + n); }
224 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11) 251 int print(std::ostream &s,
unsigned int length,
char const *intro = 0)
const;
258 double r2d = 180.0 / M_PI;
263 void reshape(
vpMatrix &M,
const unsigned int &nrows,
const unsigned int &ncols);
271 inline void resize(
unsigned int i,
bool flagNullify =
true)
286 void resize(
unsigned int nrows,
unsigned int ncols,
bool flagNullify)
290 "Cannot resize a row vector to a (%dx%d) dimension " 291 "vector that has more than one row",
296 void stack(
double d);
300 double sumSquare()
const;
302 std::vector<double> toStdVector()
const;
310 static double stdev(
const vpRowVector &v,
bool useBesselCorrection =
false);
312 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) 343 vp_deprecated
void setIdentity(
const double &val = 1.0);
Implementation of a matrix and operations on matrices.
static vp_deprecated vpRowVector stackMatrices(const vpRowVector &A, const vpRowVector &B)
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
vpArray2D< Type > & operator=(Type x)
Set all the elements of the array to x.
vpRowVector(const vpRowVector &v)
bool operator!=(const vpArray2D< Type > &A) const
Implementation of row vector and the associated operations.
static vp_deprecated void stackMatrices(const vpRowVector &A, const vpRowVector &B, vpRowVector &C)
vp_deprecated void stackMatrices(const vpRowVector &r)
error that can be emited by ViSP classes.
vp_deprecated void init()
Implementation of a generic 2D array used as base class for matrices and vectors. ...
vpRowVector(const std::initializer_list< double > &list)
vpColVector operator*(const double &x, const vpColVector &v)
double & operator[](unsigned int n)
Operator that allows to set a value of an element : v[i] = x.
vpRowVector extract(unsigned int c, unsigned int rowsize) const
bool operator==(const vpArray2D< Type > &A) const
friend std::ostream & operator<<(std::ostream &s, const vpArray2D< Type > &A)
Implementation of column vector and the associated operations.
vpRowVector(unsigned int n, double val)
Construct a row vector of size n. Each element is set to val.
void resize(unsigned int i, bool flagNullify=true)
void reshape(unsigned int nrows, unsigned int ncols)
const double & operator[](unsigned int n) const
Operator that allows to get the value of an element : x = v[i].
vpRowVector(unsigned int n)
vpRowVector()
Basic constructor that creates an empty 0-size row vector.
void resize(unsigned int nrows, unsigned int ncols, bool flagNullify)