Visual Servoing Platform
version 3.5.1 under development (2023-09-22)
|
#include <visp3/core/vpColVector.h>
Public Member Functions | |
vpColVector () | |
vpColVector (unsigned int n) | |
vpColVector (unsigned int n, double val) | |
vpColVector (const vpColVector &v) | |
vpColVector (const vpColVector &v, unsigned int r, unsigned int nrows) | |
vpColVector (const vpRotationVector &v) | |
vpColVector (const vpPoseVector &p) | |
vpColVector (const vpTranslationVector &t) | |
vpColVector (const vpMatrix &M) | |
vpColVector (const vpMatrix &M, unsigned int j) | |
vpColVector (const std::vector< double > &v) | |
vpColVector (const std::vector< float > &v) | |
vpColVector (vpColVector &&v) | |
vpColVector (const std::initializer_list< double > &list) | |
virtual | ~vpColVector () |
void | clear () |
std::ostream & | cppPrint (std::ostream &os, const std::string &matrixName="A", bool octet=false) const |
std::ostream & | csvPrint (std::ostream &os) const |
vpColVector & | deg2rad () |
vpColVector | extract (unsigned int r, unsigned int colsize) const |
double | frobeniusNorm () const |
vpColVector | hadamard (const vpColVector &v) const |
double | infinityNorm () const |
void | init (const vpColVector &v, unsigned int r, unsigned int nrows) |
void | insert (unsigned int i, const vpColVector &v) |
void | insert (const vpColVector &v, unsigned int i) |
std::ostream & | maplePrint (std::ostream &os) const |
std::ostream & | matlabPrint (std::ostream &os) const |
vpColVector & | normalize () |
vpColVector & | normalize (vpColVector &x) const |
double & | operator[] (unsigned int n) |
const double & | operator[] (unsigned int n) const |
vpColVector & | operator= (const vpColVector &v) |
vpColVector & | operator= (const vpPoseVector &p) |
vpColVector & | operator= (const vpRotationVector &rv) |
vpColVector & | operator= (const vpTranslationVector &tv) |
vpColVector & | operator= (const vpMatrix &M) |
vpColVector & | operator= (const std::vector< double > &v) |
vpColVector & | operator= (const std::vector< float > &v) |
vpColVector & | operator= (double x) |
vpColVector & | operator= (vpColVector &&v) |
vpColVector & | operator= (const std::initializer_list< double > &list) |
bool | operator== (const vpColVector &v) const |
bool | operator== (double v) const |
bool | operator!= (const vpColVector &v) const |
bool | operator!= (double v) const |
double | operator* (const vpColVector &x) const |
vpMatrix | operator* (const vpRowVector &v) const |
vpColVector | operator* (double x) const |
vpColVector & | operator*= (double x) |
vpColVector | operator/ (double x) const |
vpColVector & | operator/= (double x) |
vpColVector | operator+ (const vpColVector &v) const |
vpTranslationVector | operator+ (const vpTranslationVector &t) const |
vpColVector & | operator+= (vpColVector v) |
vpColVector | operator- (const vpColVector &v) const |
vpColVector & | operator-= (vpColVector v) |
vpColVector | operator- () const |
vpColVector & | operator<< (const vpColVector &v) |
vpColVector & | operator<< (double *) |
vpColVector & | operator<< (double val) |
vpColVector & | operator, (double val) |
int | print (std::ostream &s, unsigned int length, char const *intro=0) const |
vpColVector & | rad2deg () |
void | reshape (vpMatrix &M, const unsigned int &nrows, const unsigned int &ncols) |
vpMatrix | reshape (unsigned int nrows, unsigned int ncols) |
void | resize (unsigned int i, bool flagNullify=true) |
void | resize (unsigned int nrows, unsigned int ncols, bool flagNullify) |
void | stack (double d) |
void | stack (const vpColVector &v) |
double | sum () const |
double | sumSquare () const |
vpRowVector | t () const |
std::vector< double > | toStdVector () const |
vpRowVector | transpose () const |
void | transpose (vpRowVector &v) const |
Inherited functionalities from vpArray2D | |
unsigned int | getCols () const |
double | getMaxValue () const |
double | getMinValue () const |
unsigned int | getRows () const |
unsigned int | size () const |
void | resize (unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true) |
void | insert (const vpArray2D< double > &A, unsigned int r, unsigned int c) |
bool | operator== (const vpArray2D< double > &A) const |
bool | operator!= (const vpArray2D< double > &A) const |
vpArray2D< double > | hadamard (const vpArray2D< double > &m) const |
Static Public Member Functions | |
static vpColVector | cross (const vpColVector &a, const vpColVector &b) |
static vpColVector | crossProd (const vpColVector &a, const vpColVector &b) |
static double | dotProd (const vpColVector &a, const vpColVector &b) |
static vpColVector | invSort (const vpColVector &v) |
static double | median (const vpColVector &v) |
static double | mean (const vpColVector &v) |
static vpMatrix | skew (const vpColVector &v) |
static vpColVector | sort (const vpColVector &v) |
static vpColVector | stack (const vpColVector &A, const vpColVector &B) |
static void | stack (const vpColVector &A, const vpColVector &B, vpColVector &C) |
static double | stdev (const vpColVector &v, bool useBesselCorrection=false) |
Public Attributes | |
double * | data |
Protected Attributes | |
unsigned int | rowNum |
unsigned int | colNum |
double ** | rowPtrs |
unsigned int | dsize |
Friends | |
class | vpMatrix |
void | to_json (nlohmann::json &j, const vpColVector &cam) |
void | from_json (const nlohmann::json &j, vpColVector &cam) |
Related Functions | |
(Note that these are not member functions.) | |
vpColVector | operator* (const double &x, const vpColVector &v) |
enum | vpGEMMmethod |
bool | operator== (const vpArray2D< double > &A) const |
bool | operator== (const vpArray2D< float > &A) const |
void | vpGEMM (const vpArray2D< double > &A, const vpArray2D< double > &B, const double &alpha, const vpArray2D< double > &C, const double &beta, vpArray2D< double > &D, const unsigned int &ops=0) |
Deprecated functions | |
vp_deprecated void | init () |
vp_deprecated vpColVector | rows (unsigned int first_row, unsigned int last_row) const |
vp_deprecated void | setIdentity (const double &val=1.0) |
vp_deprecated void | stackMatrices (const vpColVector &r) |
vp_deprecated void | insert (const vpColVector &v, unsigned int r, unsigned int c=0) |
vp_deprecated double | euclideanNorm () const |
static vp_deprecated vpColVector | stackMatrices (const vpColVector &A, const vpColVector &B) |
static vp_deprecated void | stackMatrices (const vpColVector &A, const vpColVector &B, vpColVector &C) |
Inherited I/O from vpArray2D with Static Public Member Functions | |
vpArray2D< double > | insert (const vpArray2D< double > &A, const vpArray2D< double > &B, unsigned int r, unsigned int c) |
static bool | load (const std::string &filename, vpArray2D< double > &A, bool binary=false, char *header=NULL) |
static bool | loadYAML (const std::string &filename, vpArray2D< double > &A, char *header=NULL) |
static bool | save (const std::string &filename, const vpArray2D< double > &A, bool binary=false, const char *header="") |
static bool | saveYAML (const std::string &filename, const vpArray2D< double > &A, const char *header="") |
static vpArray2D< double > | conv2 (const vpArray2D< double > &M, const vpArray2D< double > &kernel, const std::string &mode) |
static void | conv2 (const vpArray2D< double > &M, const vpArray2D< double > &kernel, vpArray2D< double > &res, const std::string &mode) |
static void | insert (const vpArray2D< double > &A, const vpArray2D< double > &B, vpArray2D< double > &C, unsigned int r, unsigned int c) |
Implementation of column vector and the associated operations.
This class provides a data structure for a column vector that contains values of double. It contains also some functions to achieve a set of operations on these vectors.
The vpColVector class is derived from vpArray2D<double>.
The code below shows how to create a 3-element column vector of doubles, set the element values and access them:
Once build, this previous code produces the following output:
You can also use operator<< to initialize a column vector as previously:
If ViSP is build with c++11 enabled, you can do the same using:
The vector could also be initialized using operator=(const std::initializer_list< double > &)
JSON serialization
Since ViSP 3.6.0, if ViSP is build with JSON for modern C++ 3rd-party we introduce JSON serialization capabilities for vpColVector. The following sample code shows how to save a pose vector in a file named col-vector.json
and reload the values from this JSON file.
If you build and execute the sample code, it will produce the following output:
The content of the pose-vector.json
file is the following:
Definition at line 166 of file vpColVector.h.
|
inline |
Basic constructor that creates an empty 0-size column vector.
Definition at line 172 of file vpColVector.h.
|
inlineexplicit |
Construct a column vector of size n.
Definition at line 176 of file vpColVector.h.
|
inline |
Construct a column vector of size n. Each element is set to val.
Definition at line 178 of file vpColVector.h.
|
inline |
Copy constructor that allows to construct a column vector from an other one.
Definition at line 181 of file vpColVector.h.
vpColVector::vpColVector | ( | const vpColVector & | v, |
unsigned int | r, | ||
unsigned int | nrows | ||
) |
Construct a column vector from a part of an input column vector v.
v | : Input column vector used for initialization. |
r | : row index in v that corresponds to the first element of the column vector to contruct. |
nrows | : Number of rows of the constructed column vector. |
The sub-vector starting from v[r] element and ending on v[r+nrows-1] element is used to initialize the contructed column vector.
Definition at line 204 of file vpColVector.cpp.
References init().
vpColVector::vpColVector | ( | const vpRotationVector & | v | ) |
Constructor that initialize a column vector from a 3-dim (Euler or ) or 4-dim (quaternion) rotation vector.
Definition at line 261 of file vpColVector.cpp.
References vpArray2D< Type >::size().
vpColVector::vpColVector | ( | const vpPoseVector & | p | ) |
Constructor that initialize a column vector from a 6-dim pose vector.
Definition at line 267 of file vpColVector.cpp.
References vpArray2D< Type >::size().
vpColVector::vpColVector | ( | const vpTranslationVector & | t | ) |
Constructor that initialize a column vector from a 3-dim translation vector.
Definition at line 273 of file vpColVector.cpp.
References vpArray2D< Type >::size().
vpColVector::vpColVector | ( | const vpMatrix & | M | ) |
Constructor that creates a column vector from a m-by-1 matrix M.
vpException::dimensionError | If the matrix is not a m-by-1 matrix. |
Definition at line 292 of file vpColVector.cpp.
References vpException::dimensionError, vpArray2D< Type >::getCols(), and vpArray2D< Type >::getRows().
vpColVector::vpColVector | ( | const vpMatrix & | M, |
unsigned int | j | ||
) |
Constructor that take column j of matrix M.
Definition at line 280 of file vpColVector.cpp.
References vpArray2D< Type >::getCols().
vpColVector::vpColVector | ( | const std::vector< double > & | v | ) |
Constructor that creates a column vector from a std vector of double.
Definition at line 306 of file vpColVector.cpp.
vpColVector::vpColVector | ( | const std::vector< float > & | v | ) |
Constructor that creates a column vector from a std vector of float.
Definition at line 314 of file vpColVector.cpp.
vpColVector::vpColVector | ( | vpColVector && | v | ) |
Move constructor that take rvalue.
Definition at line 324 of file vpColVector.cpp.
References vpArray2D< double >::colNum, vpArray2D< double >::data, vpArray2D< double >::dsize, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
|
inline |
Definition at line 197 of file vpColVector.h.
References vpArray2D< double >::data.
|
inlinevirtual |
Destructor.
Definition at line 205 of file vpColVector.h.
|
inline |
Removes all elements from the vector (which are destroyed), leaving the container with a size of 0.
Definition at line 211 of file vpColVector.h.
References vpArray2D< double >::colNum, vpArray2D< double >::data, vpArray2D< double >::dsize, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
Referenced by vpMbTracker::createCylinderBBox().
|
staticinherited |
Perform a 2D convolution similar to Matlab conv2 function: .
M | : First matrix. |
kernel | : Second matrix. |
mode | : Convolution mode: "full" (default), "same", "valid". |
Definition at line 956 of file vpArray2D.h.
|
staticinherited |
Perform a 2D convolution similar to Matlab conv2 function: .
M | : First array. |
kernel | : Second array. |
res | : Result. |
mode | : Convolution mode: "full" (default), "same", "valid". |
Definition at line 970 of file vpArray2D.h.
std::ostream & vpColVector::cppPrint | ( | std::ostream & | os, |
const std::string & | matrixName = "A" , |
||
bool | octet = false |
||
) | const |
Print to be used as part of a C++ code later.
os | : the stream to be printed in. |
matrixName | : name of the column vector, "A" by default. |
octet | : if false, print using double, if true, print byte per byte each bytes of the double array. |
The following code shows how to use this function:
It produces the following output that could be copy/paste in a C++ code:
Definition at line 1580 of file vpColVector.cpp.
References vpArray2D< double >::getRows().
|
inlinestatic |
Compute and return the cross product of two 3-dimension vectors: .
a | : 3-dimension column vector. |
b | : 3-dimension column vector. |
vpException::dimensionError | If the vectors dimension is not equal to 3. |
Definition at line 391 of file vpColVector.h.
Referenced by vpMbtDistanceLine::buildFrom(), and vpPlane::init().
|
static |
Compute and return the cross product of two vectors .
[in] | a | : 3-dimension column vector. |
[in] | b | : 3-dimension column vector. |
vpException::dimensionError | If the vectors dimension is not equal to 3. |
Definition at line 1225 of file vpColVector.cpp.
References vpException::dimensionError, vpArray2D< Type >::getRows(), and skew().
Referenced by vpMbTracker::addPolygon(), vpMbTracker::addProjectionErrorPolygon(), vpPose::coplanar(), vpMbTracker::createCylinderBBox(), vpMath::lookAt(), vpThetaUVector::operator*(), vpPose::poseLagrangePlan(), and vpImageSimulator::setCameraPosition().
std::ostream & vpColVector::csvPrint | ( | std::ostream & | os | ) | const |
Print/save a column vector in csv format.
The following code
produces log.csv file that contains:
Definition at line 1626 of file vpColVector.cpp.
References vpArray2D< double >::getRows().
|
inline |
Converts a column vector containing angles in degrees into radians and returns a reference to the vector.
Definition at line 233 of file vpColVector.h.
Referenced by vpRobotViper650::getPosition(), vpRobotViper850::getPosition(), vpRobotViper650::getVelocity(), vpRobotViper850::getVelocity(), vpRobotViper650::init(), vpRobotViper850::init(), vpRobotViper650::readPosFile(), vpRobotViper850::readPosFile(), vpSimulatorViper850::readPosFile(), vpRobotBiclops::readPositionFile(), vpRobotPtu46::readPositionFile(), vpRobotViper650::setPosition(), and vpRobotViper850::setPosition().
|
static |
Compute end return the dot product of two column vectors:
where n is the dimension of both vectors.
vpException::dimensionError | If the vector dimension differ. |
Definition at line 846 of file vpColVector.cpp.
References vpArray2D< Type >::data, vpException::dimensionError, vpException::fatalError, vpArray2D< Type >::getRows(), and vpArray2D< Type >::size().
Referenced by vpMbtFaceDepthNormal::computeNormalVisibility(), vpMbtPolygon::isVisible(), vpThetaUVector::operator*(), and vpImageSimulator::setCameraPosition().
double vpColVector::euclideanNorm | ( | ) | const |
Compute and return the Euclidean norm also called Frobenius norm .
Definition at line 1756 of file vpColVector.cpp.
References frobeniusNorm().
|
inline |
Extract a sub-column vector from a column vector.
r | : Index of the row corresponding to the first element of the vector to extract. |
colsize | : Size of the vector to extract. |
vpException::fatalError | If the vector to extract is not contained in the original one. |
Definition at line 257 of file vpColVector.h.
References vpException::fatalError, and vpArray2D< double >::rowNum.
Referenced by vpLinProg::colReduction(), vpRobotUniversalRobots::setPosition(), vpLinProg::simplex(), vpLinProg::solveLP(), and vpQuadProg::solveQPi().
double vpColVector::frobeniusNorm | ( | ) | const |
Compute and return the Frobenius norm .
Definition at line 1502 of file vpColVector.cpp.
References sumSquare().
Referenced by vpServo::computeProjectionOperators(), vpMbTracker::createCylinderBBox(), euclideanNorm(), and vpSimulatorAfma6::setPosition().
|
inlineinherited |
Return the number of columns of the 2D array.
Definition at line 280 of file vpArray2D.h.
|
inherited |
Return the array max value.
Definition at line 282 of file vpArray2D.h.
|
inherited |
Return the array min value.
Definition at line 284 of file vpArray2D.h.
|
inlineinherited |
Return the number of rows of the 2D array.
Definition at line 290 of file vpArray2D.h.
Compute the Hadamard product (element wise matrix multiplication).
m | : Second matrix; |
Definition at line 554 of file vpArray2D.h.
vpColVector vpColVector::hadamard | ( | const vpColVector & | v | ) | const |
Compute the Hadamard product (element wise vector multiplication).
v | : Second vector; |
Definition at line 1515 of file vpColVector.cpp.
References vpArray2D< double >::colNum, vpArray2D< double >::data, vpArray2D< Type >::data, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), resize(), and vpArray2D< double >::rowNum.
double vpColVector::infinityNorm | ( | ) | const |
Compute and return the infinity norm with where m is the vector size and an element of the vector.
Definition at line 1540 of file vpColVector.cpp.
References vpArray2D< double >::rowNum.
Referenced by vpLinProg::colReduction(), vpAdaptiveGain::operator()(), and vpLinProg::rowReduction().
|
inline |
Definition at line 422 of file vpColVector.h.
Referenced by vpColVector(), and vpSubColVector::vpSubColVector().
void vpColVector::init | ( | const vpColVector & | v, |
unsigned int | r, | ||
unsigned int | nrows | ||
) |
Initialize the column vector from a part of an input column vector v.
v | : Input column vector used for initialization. |
r | : row index in v that corresponds to the first element of the column vector to contruct. |
nrows | : Number of rows of the constructed column vector. |
The sub-vector starting from v[r] element and ending on v[r+nrows-1] element is used to initialize the contructed column vector.
The following code shows how to use this function:
It produces the following output:
Definition at line 246 of file vpColVector.cpp.
References vpException::dimensionError, vpArray2D< Type >::getRows(), resize(), and vpArray2D< double >::rowPtrs.
|
inherited |
Insert array B in array A at the given position.
A | : Main array. |
B | : Array to insert. |
r | : Index of the row where to add the array. |
c | : Index of the column where to add the array. |
Definition at line 984 of file vpArray2D.h.
|
inlineinherited |
Insert array A at the given position in the current array.
A | : The array to insert. |
r | : The index of the row to begin to insert data. |
c | : The index of the column to begin to insert data. |
Definition at line 417 of file vpArray2D.h.
void vpColVector::insert | ( | const vpColVector & | v, |
unsigned int | i | ||
) |
Definition at line 1362 of file vpColVector.cpp.
References vpArray2D< Type >::data, vpArray2D< double >::data, vpException::dimensionError, vpArray2D< Type >::rowNum, and vpArray2D< Type >::size().
void vpColVector::insert | ( | const vpColVector & | v, |
unsigned int | r, | ||
unsigned int | c = 0 |
||
) |
Insert column vector v at the given position r in the current column vector.
v | : The column vector to insert. |
r | : The index of the row to begin to insert data. |
c | : Not used. |
Definition at line 1740 of file vpColVector.cpp.
References insert().
void vpColVector::insert | ( | unsigned int | i, |
const vpColVector & | v | ||
) |
Insert a column vector.
i | : Index of the first element to introduce. This index starts from 0. |
v | : Column vector to insert. |
The following example shows how to use this function:
It produces the following output:
Definition at line 1353 of file vpColVector.cpp.
References vpArray2D< Type >::data, vpArray2D< double >::data, vpException::dimensionError, vpArray2D< Type >::rowNum, and vpArray2D< Type >::size().
Referenced by vpMbEdgeKltTracker::computeVVS(), vpMbDepthDenseTracker::computeVVSInteractionMatrixAndResidu(), vpMbDepthNormalTracker::computeVVSInteractionMatrixAndResidu(), vpMbGenericTracker::computeVVSInteractionMatrixAndResidu(), vpMbEdgeTracker::computeVVSWeights(), vpMbGenericTracker::computeVVSWeights(), and insert().
|
static |
Return a column vector with elements of v that are reverse sorted with values going from greatest to lowest.
Example:
Output:
Definition at line 941 of file vpColVector.cpp.
References vpArray2D< Type >::data, vpException::fatalError, and vpArray2D< Type >::getRows().
|
inlinestaticinherited |
Load a matrix from a file.
filename | : Absolute file name. |
A | : Array to be loaded |
binary | : If true the matrix is loaded from a binary file, else from a text file. |
header | : Header of the file is loaded in this parameter. |
Definition at line 582 of file vpArray2D.h.
|
inlinestaticinherited |
Load an array from a YAML-formatted file.
filename | : absolute file name. |
A | : array to be loaded from the file. |
header | : header of the file is loaded in this parameter. |
Definition at line 696 of file vpArray2D.h.
std::ostream & vpColVector::maplePrint | ( | std::ostream & | os | ) | const |
Print using Maple syntax, to copy/paste in Maple later.
The following code
produces this output:
that could be copy/paste in Maple.
Definition at line 1661 of file vpColVector.cpp.
References vpArray2D< double >::getRows().
std::ostream & vpColVector::matlabPrint | ( | std::ostream & | os | ) | const |
Print using Matlab syntax, to copy/paste in Matlab later.
The following code
produces this output:
that could be copy/paste in Matlab:
Definition at line 1709 of file vpColVector.cpp.
References vpArray2D< double >::getRows().
|
static |
Compute the mean value of all the elements of the vector.
Definition at line 1137 of file vpColVector.cpp.
References vpArray2D< Type >::data, vpException::dimensionError, vpArray2D< Type >::getRows(), vpArray2D< Type >::size(), and sum().
|
static |
Compute the median value of all the elements of the vector.
Definition at line 1157 of file vpColVector.cpp.
References vpArray2D< Type >::data, vpException::dimensionError, vpMath::getMedian(), vpArray2D< Type >::rowNum, and vpArray2D< Type >::size().
vpColVector & vpColVector::normalize | ( | ) |
Normalize the column vector.
Considering the n-dim column vector normalize each vector element :
Definition at line 900 of file vpColVector.cpp.
References sumSquare().
Referenced by vpCameraParameters::computeFov(), vpMbtFaceDepthNormal::computeNormalVisibility(), vpMbTracker::createCylinderBBox(), vpMbtDistanceKltPoints::init(), vpMbtPolygon::isVisible(), vpMath::lookAt(), and vpMbKltTracker::setPose().
vpColVector & vpColVector::normalize | ( | vpColVector & | x | ) | const |
Normalize a column vector.
Considering the n-dim column vector normalize each vector element :
[in,out] | x | : As input, the vector to normalize, as output the normalized vector. |
Definition at line 883 of file vpColVector.cpp.
References sumSquare().
|
inherited |
Not equal to comparison operator of a 2D array.
Definition at line 442 of file vpArray2D.h.
bool vpColVector::operator!= | ( | const vpColVector & | v | ) | const |
Compare two column vectors.
v | : Vector to compare with. |
Definition at line 796 of file vpColVector.cpp.
bool vpColVector::operator!= | ( | double | v | ) | const |
Compare a column vector to a floating point value.
v | : Floating point value to compare with. |
v
. false when all the vector values are equal to v
. Definition at line 804 of file vpColVector.cpp.
double vpColVector::operator* | ( | const vpColVector & | v | ) | const |
Operator that performs the dot product between two column vectors.
vpException::dimensionError | If the vector dimension differ. |
Definition at line 140 of file vpColVector.cpp.
References vpException::dimensionError, vpArray2D< double >::rowNum, vpArray2D< Type >::size(), and vpArray2D< double >::size().
vpMatrix vpColVector::operator* | ( | const vpRowVector & | v | ) | const |
Multiply a column vector by a row vector.
v | : Row vector. |
Definition at line 164 of file vpColVector.cpp.
References vpArray2D< Type >::getCols(), and vpArray2D< double >::rowNum.
vpColVector vpColVector::operator* | ( | double | x | ) | const |
Operator that allows to multiply each element of a column vector by a scalar.
x | : The scalar. |
Definition at line 384 of file vpColVector.cpp.
References vpArray2D< Type >::data, vpArray2D< double >::data, and vpArray2D< double >::rowNum.
vpColVector & vpColVector::operator*= | ( | double | x | ) |
Operator that allows to multiply each element of a column vector by a scalar.
x | : The scalar. |
Definition at line 414 of file vpColVector.cpp.
References vpArray2D< double >::rowNum.
vpColVector vpColVector::operator+ | ( | const vpColVector & | v | ) | const |
Operator that allows to add two column vectors.
Definition at line 61 of file vpColVector.cpp.
References vpException::dimensionError, vpArray2D< Type >::getRows(), vpArray2D< double >::getRows(), and vpArray2D< double >::rowNum.
vpTranslationVector vpColVector::operator+ | ( | const vpTranslationVector & | t | ) | const |
Operator that allows to add a column vector to a translation vector.
t | : 3-dimension translation vector to add. |
Definition at line 94 of file vpColVector.cpp.
References vpException::dimensionError, vpArray2D< double >::getRows(), and t().
vpColVector & vpColVector::operator+= | ( | vpColVector | v | ) |
Operator that allows to add two column vectors.
Definition at line 109 of file vpColVector.cpp.
References vpException::dimensionError, vpArray2D< Type >::getRows(), vpArray2D< double >::getRows(), and vpArray2D< double >::rowNum.
vpColVector & vpColVector::operator, | ( | double | val | ) |
This operator could be used to set column vector elements:
It produces the following printings:
Definition at line 669 of file vpColVector.cpp.
References vpArray2D< double >::data, resize(), and vpArray2D< double >::rowNum.
vpColVector vpColVector::operator- | ( | ) | const |
Operator that allows to negate all the column vector elements.
Definition at line 350 of file vpColVector.cpp.
References vpArray2D< Type >::data, vpArray2D< double >::data, resize(), and vpArray2D< double >::rowNum.
vpColVector vpColVector::operator- | ( | const vpColVector & | v | ) | const |
operator subtraction of two vectors V = A-v
Definition at line 176 of file vpColVector.cpp.
References vpException::dimensionError, vpArray2D< Type >::getRows(), vpArray2D< double >::getRows(), and vpArray2D< double >::rowNum.
vpColVector & vpColVector::operator-= | ( | vpColVector | v | ) |
Operator that allows to subtract two column vectors.
Definition at line 121 of file vpColVector.cpp.
References vpException::dimensionError, vpArray2D< Type >::getRows(), vpArray2D< double >::getRows(), and vpArray2D< double >::rowNum.
vpColVector vpColVector::operator/ | ( | double | x | ) | const |
Operator that allows to divide each element of a column vector by a scalar.
x | : The scalar. |
Definition at line 464 of file vpColVector.cpp.
References vpArray2D< Type >::data, vpArray2D< double >::data, and vpArray2D< double >::rowNum.
vpColVector & vpColVector::operator/= | ( | double | x | ) |
Operator that allows to divide each element of a column vector by a scalar.
x | : The scalar. |
Definition at line 438 of file vpColVector.cpp.
References vpArray2D< double >::rowNum.
vpColVector & vpColVector::operator<< | ( | const vpColVector & | v | ) |
Copy operator. Allows operation such as A << v
In column vector A we get:
Definition at line 586 of file vpColVector.cpp.
vpColVector & vpColVector::operator<< | ( | double * | x | ) |
Assignment operator. Allow operation such as A = *v
The following example shows how to use this operator.
It produces the following output:
Definition at line 616 of file vpColVector.cpp.
References vpArray2D< double >::colNum, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
vpColVector & vpColVector::operator<< | ( | double | val | ) |
This operator could be used to set column vector elements:
It produces the following printings:
Definition at line 644 of file vpColVector.cpp.
References vpArray2D< double >::data, and resize().
vpColVector & vpColVector::operator= | ( | const std::initializer_list< double > & | list | ) |
Set vector elements and size from a list of values.
list | : List of double. Vector size matches the number of elements. |
Definition at line 748 of file vpColVector.cpp.
References vpArray2D< double >::data, and resize().
vpColVector & vpColVector::operator= | ( | const std::vector< double > & | v | ) |
Initialize a row vector from a standard vector of double.
Definition at line 497 of file vpColVector.cpp.
References resize().
vpColVector & vpColVector::operator= | ( | const std::vector< float > & | v | ) |
Initialize a row vector from a standard vector of double.
Definition at line 507 of file vpColVector.cpp.
References resize().
vpColVector & vpColVector::operator= | ( | const vpColVector & | v | ) |
Copy operator. Allow operation such as A = v.
Definition at line 515 of file vpColVector.cpp.
References vpArray2D< Type >::data, vpArray2D< double >::data, resize(), vpArray2D< double >::rowNum, and vpArray2D< Type >::rowNum.
vpColVector & vpColVector::operator= | ( | const vpMatrix & | M | ) |
Transform a m-by-1 matrix into a column vector.
vpException::dimensionError | If the matrix has more than 1 column. |
Definition at line 481 of file vpColVector.cpp.
References vpArray2D< Type >::data, vpArray2D< double >::data, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), resize(), and vpArray2D< double >::rowNum.
vpColVector & vpColVector::operator= | ( | const vpPoseVector & | p | ) |
Operator that allows to convert a pose vector into a column vector.
Definition at line 555 of file vpColVector.cpp.
References vpArray2D< double >::data, vpArray2D< Type >::data, vpArray2D< Type >::getRows(), resize(), and vpArray2D< double >::rowNum.
vpColVector & vpColVector::operator= | ( | const vpRotationVector & | rv | ) |
Operator that allows to convert a rotation vector into a column vector.
Definition at line 542 of file vpColVector.cpp.
References vpArray2D< double >::data, vpArray2D< Type >::data, vpArray2D< Type >::getRows(), resize(), and vpArray2D< double >::rowNum.
vpColVector & vpColVector::operator= | ( | const vpTranslationVector & | tv | ) |
Operator that allows to convert a translation vector into a column vector.
Definition at line 529 of file vpColVector.cpp.
References vpArray2D< double >::data, vpArray2D< Type >::data, vpArray2D< Type >::getRows(), resize(), and vpArray2D< double >::rowNum.
vpColVector & vpColVector::operator= | ( | double | x | ) |
Set each element of the column vector to x.
Definition at line 677 of file vpColVector.cpp.
References vpArray2D< double >::data, and vpArray2D< double >::rowNum.
vpColVector & vpColVector::operator= | ( | vpColVector && | other | ) |
Overloaded move assignment operator taking rvalue.
Definition at line 703 of file vpColVector.cpp.
References vpArray2D< double >::colNum, vpArray2D< double >::data, vpArray2D< double >::dsize, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
Equal to comparison operator of a 2D array.
Definition at line 438 of file vpArray2D.h.
bool vpColVector::operator== | ( | const vpColVector & | v | ) | const |
Comparison operator.
Compare two column vectors.
v | : Vector to compare with. |
Definition at line 762 of file vpColVector.cpp.
References vpArray2D< Type >::colNum, vpArray2D< double >::colNum, vpArray2D< Type >::data, vpArray2D< double >::data, vpMath::equal(), vpArray2D< Type >::rowNum, and vpArray2D< double >::rowNum.
bool vpColVector::operator== | ( | double | v | ) | const |
Compare a column vector to a floating point value.
v | : Floating point value to compare with. |
v
, false otherwise. Definition at line 781 of file vpColVector.cpp.
References vpArray2D< double >::data, vpMath::equal(), and vpArray2D< double >::rowNum.
|
inline |
Operator that allows to set a value of an element : v[i] = x.
Definition at line 284 of file vpColVector.h.
References vpArray2D< double >::data.
|
inline |
Operator that allows to get the value of an element : x = v[i].
Definition at line 286 of file vpColVector.h.
References vpArray2D< double >::data.
int vpColVector::print | ( | std::ostream & | s, |
unsigned int | length, | ||
char const * | intro = 0 |
||
) | const |
Pretty print a column vector. The data are tabulated. The common widths before and after the decimal point are set with respect to the parameter maxlen.
s | Stream used for the printing. |
length | The suggested width of each vector element. The actual width grows in order to accomodate the whole integral part, and shrinks if the whole extent is not needed for all the numbers. |
intro | The introduction which is printed before the vector. Can be set to zero (or omitted), in which case the introduction is not printed. |
Definition at line 1391 of file vpColVector.cpp.
References vpArray2D< double >::getRows(), and vpMath::maximum().
|
inline |
Converts a column vector containing angles in radians into degrees and returns a reference to the vector.
Definition at line 334 of file vpColVector.h.
Referenced by vpRobotViper650::setPosition(), vpRobotViper850::setPosition(), vpRobotViper650::setVelocity(), and vpRobotViper850::setVelocity().
vpMatrix vpColVector::reshape | ( | unsigned int | nrows, |
unsigned int | ncols | ||
) |
Reshape the column vector in a matrix.
nrows | : number of rows of the matrix |
ncols | : number of columns of the matrix |
Definition at line 1245 of file vpColVector.cpp.
References reshape().
void vpColVector::reshape | ( | vpMatrix & | M, |
const unsigned int & | nrows, | ||
const unsigned int & | ncols | ||
) |
Reshape the column vector in a matrix.
M | : the reshaped matrix. |
nrows | : number of rows of the matrix. |
ncols | : number of columns of the matrix. |
vpException::dimensionError | If the matrix and the column vector have not the same size. |
The following example shows how to use this method.
If you run the previous example, you get:
Definition at line 1307 of file vpColVector.cpp.
References vpArray2D< double >::data, vpException::dimensionError, vpArray2D< double >::dsize, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< Type >::resize(), and vpArray2D< double >::rowNum.
Referenced by reshape().
|
inline |
Modify the size of the column vector.
i | : Size of the vector. This value corresponds to the vector number of rows. |
flagNullify | : If true, set the data to zero. |
vpException::fatalError | When ncols is not equal to 1. |
Definition at line 351 of file vpColVector.h.
References vpArray2D< Type >::resize().
Referenced by vpRealSense2::acquire(), vpMatrix::add2Matrices(), vpCylinder::changeFrame(), vpLine::changeFrame(), vpPoint::changeFrame(), vpSphere::changeFrame(), vpCircle::changeFrame(), vpRobotAfma6::checkJointLimits(), vpLinProg::colReduction(), vpMbtFaceDepthNormal::computeDesiredFeaturesPCL(), vpMbtFaceDepthNormal::computeDesiredFeaturesSVD(), vpServo::computeError(), vpMbtFaceDepthNormal::computeInteractionMatrix(), vpMbtFaceDepthDense::computeInteractionMatrixAndResidu(), vpMbTracker::computeJTR(), vpMbtFaceDepthNormal::computeNormalVisibility(), vpPose::computeResidual(), vpMbEdgeKltTracker::computeVVS(), vpMbDepthDenseTracker::computeVVSInit(), vpMbDepthNormalTracker::computeVVSInit(), vpMbEdgeTracker::computeVVSInit(), vpMbKltTracker::computeVVSInit(), vpMbGenericTracker::computeVVSInit(), vpMatrix::cond(), vpFeatureMoment::duplicate(), vp::eigen2visp(), vpMatrix::eigenValues(), vpFeatureLuminance::error(), vpMbtFaceDepthNormal::estimateFeatures(), vpMbtFaceDepthNormal::estimatePlaneEquationSVD(), vpThetaUVector::extract(), vpRobotFranka::getCoriolis(), vpQbSoftHand::getCurrent(), vpSimulatorAfma6::getDisplacement(), vpSimulatorViper850::getDisplacement(), vpRobotAfma4::getDisplacement(), vpRobotAfma6::getDisplacement(), vpRobotViper650::getDisplacement(), vpRobotViper850::getDisplacement(), vpRobotFranka::getForceTorque(), vpRobotViper650::getForceTorque(), vpRobotViper850::getForceTorque(), vpRobotFranka::getGravity(), vpOccipitalStructure::getIMUAcceleration(), vpRealSense2::getIMUAcceleration(), vpRealSense2::getIMUData(), vpOccipitalStructure::getIMUData(), vpOccipitalStructure::getIMUVelocity(), vpRealSense2::getIMUVelocity(), vpAfma6::getInverseKinematics(), vpViper::getInverseKinematicsWrist(), vpRobotFlirPtu::getJointPosition(), vpRobotKinova::getJointPosition(), vpPlane::getNormal(), vpRealSense2::getOdometryData(), vpTemplateTrackerWarpHomography::getParam(), vpRobotFranka::getPosition(), vpRobotKinova::getPosition(), vpRobotUniversalRobots::getPosition(), vpRobotAfma4::getPosition(), vpRobotAfma6::getPosition(), vpRobotViper650::getPosition(), vpRobotViper850::getPosition(), vpRobotBiclops::getPosition(), vpRobotCamera::getPosition(), vpRobotPtu46::getPosition(), vpSimulatorAfma6::getPosition(), vpSimulatorCamera::getPosition(), vpSimulatorPioneer::getPosition(), vpSimulatorPioneerPan::getPosition(), vpSimulatorViper850::getPosition(), vpQbSoftHand::getPosition(), vpRobotFranka::getVelocity(), vpSimulatorAfma6::getVelocity(), vpSimulatorViper850::getVelocity(), vpRobotBiclops::getVelocity(), vpRobotPtu46::getVelocity(), vpRobotPioneer::getVelocity(), vpRobotAfma4::getVelocity(), vpRobotAfma6::getVelocity(), vpRobotViper650::getVelocity(), vpRobotViper850::getVelocity(), vpPoint::getWorldCoordinates(), hadamard(), vpCircle::init(), vpCylinder::init(), vpLine::init(), vpPoint::init(), vpSphere::init(), vpRobotBiclops::init(), vpSimulatorAfma6::init(), vpSimulatorViper850::init(), vpMeTracker::init(), vpFeatureDepth::init(), vpFeatureEllipse::init(), vpFeatureLine::init(), vpFeaturePoint::init(), vpFeaturePoint3D::init(), vpFeaturePointPolar::init(), vpFeatureSegment::init(), vpFeatureThetaU::init(), vpFeatureTranslation::init(), vpFeatureVanishingPoint::init(), init(), vpImageSimulator::init(), vpTemplateTrackerTriangle::init(), vpFeatureLuminance::init(), vpKalmanFilter::init(), vpRobotAfma4::init(), vpRobotAfma6::init(), vpRobotViper650::init(), vpRobotViper850::init(), vpFeatureMoment::init(), vpTemplateTrackerMIESM::initCompInverse(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), vpMbtDistanceCircle::initInteractionMatrixError(), vpMbtDistanceCylinder::initInteractionMatrixError(), vpMbtDistanceLine::initInteractionMatrixError(), vpMatrix::kernel(), vpRobust::MEstimator(), vpMatrix::multMatrixVector(), vpMatrix::nullSpace(), operator,(), operator-(), operator<<(), operator=(), vpSubColVector::operator=(), vpPose::poseVirtualVSrobust(), vpPoint::projection(), vpCircle::projection(), vpCylinder::projection(), vpLine::projection(), vpSphere::projection(), vpRobotAfma4::readPosFile(), vpRobotAfma6::readPosFile(), vpRobotFranka::readPosFile(), vpRobotUniversalRobots::readPosFile(), vpRobotViper650::readPosFile(), vpRobotViper850::readPosFile(), vpSimulatorAfma6::readPosFile(), vpSimulatorViper850::readPosFile(), vpRobotBiclops::readPositionFile(), vpRobotPtu46::readPositionFile(), vpLinProg::rowReduction(), vpLinProg::simplex(), vpLinProg::solveLP(), vpQuadProg::solveQPi(), stack(), vpMatrix::stackColumns(), vpMatrix::sub2Matrices(), vpMatrix::svdEigen3(), vpMatrix::svdLapack(), vpMatrix::svdOpenCV(), vpMbEdgeKltTracker::trackFirstLoop(), vpFeatureMoment::update(), vpGenericFeature::vpGenericFeature(), vpImageSimulator::vpImageSimulator(), vpMeEllipse::vpMeEllipse(), vpRobotWireFrameSimulator::vpRobotWireFrameSimulator(), vpRobust::vpRobust(), vpSickLDMRS::vpSickLDMRS(), vpTemplateTracker::vpTemplateTracker(), vpTemplateTrackerMI::vpTemplateTrackerMI(), vpTemplateTrackerSSD::vpTemplateTrackerSSD(), vpTemplateTrackerSSDESM::vpTemplateTrackerSSDESM(), vpTemplateTrackerZNCC::vpTemplateTrackerZNCC(), and vpViper::vpViper().
|
inline |
Resize the column vector to a nrows-dimension vector. This function can only be used with ncols = 1.
nrows | : Vector number of rows. This value corresponds to the size of the vector. |
ncols | : Vector number of columns. This value should be set to 1. |
flagNullify | : If true, set the data to zero. |
vpException::fatalError | When ncols is not equal to 1. |
Definition at line 362 of file vpColVector.h.
References vpException::fatalError, and vpArray2D< Type >::resize().
|
inlineinherited |
Set the size of the array and initialize all the values to zero.
nrows | : number of rows. |
ncols | : number of column. |
flagNullify | : if true, then the array is re-initialized to 0 after resize. If false, the initial values from the common part of the array (common part between old and new version of the array) are kept. Default value is true. |
recopy_ | : if true, will perform an explicit recopy of the old data. |
Definition at line 305 of file vpArray2D.h.
|
inline |
Definition at line 426 of file vpColVector.h.
|
inlinestaticinherited |
Save a matrix to a file.
filename | : Absolute file name. |
A | : Array to be saved. |
binary | : If true the matrix is saved in a binary file, else a text file. |
header | : Optional line that will be saved at the beginning of the file. |
Warning : If you save the matrix as in a text file the precision is less than if you save it in a binary file.
Definition at line 784 of file vpArray2D.h.
|
inlinestaticinherited |
Save an array in a YAML-formatted file.
filename | : absolute file name. |
A | : array to be saved in the file. |
header | : optional lines that will be saved at the beginning of the file. Should be YAML-formatted and will adapt to the indentation if any. |
Here is an example of outputs.
Content of matrix.yml:
Content of matrixIndent.yml:
Definition at line 877 of file vpArray2D.h.
vp_deprecated void vpColVector::setIdentity | ( | const double & | val = 1.0 | ) |
|
inlineinherited |
Return the number of elements of the 2D array.
Definition at line 292 of file vpArray2D.h.
|
static |
Compute the skew symmetric matrix of vector v.
v | : Input vector used to compute the skew symmetric matrix. |
Definition at line 1194 of file vpColVector.cpp.
References vpException::dimensionError, vpArray2D< Type >::getRows(), and vpArray2D< Type >::resize().
Referenced by crossProd(), and vpFeatureThetaU::interaction().
|
static |
Return a column vector with elements of v that are sorted with values going from lowest to geatest.
Example:
Output:
Definition at line 993 of file vpColVector.cpp.
References vpArray2D< Type >::data, vpException::fatalError, and vpArray2D< Type >::getRows().
|
static |
Stack column vectors.
A | : Initial vector. |
B | : Vector to stack at the end of A. |
Definition at line 1079 of file vpColVector.cpp.
References stack().
|
static |
Stack column vectors.
A | : Initial vector. |
B | : Vector to stack at the end of A. |
C | : Resulting stacked vector . |
Definition at line 1104 of file vpColVector.cpp.
References vpArray2D< Type >::getRows(), and resize().
void vpColVector::stack | ( | const vpColVector & | v | ) |
Stack column vectors.
v | : Vector to stack to the existing one. |
Definition at line 1059 of file vpColVector.cpp.
References stack().
void vpColVector::stack | ( | double | d | ) |
Stack column vector with a new element at the end of the vector.
d | : Element to stack to the existing vector. |
Definition at line 1034 of file vpColVector.cpp.
References resize(), and vpArray2D< double >::rowNum.
Referenced by vpFeatureVanishingPoint::error(), vpFeatureEllipse::error(), vpFeatureLine::error(), vpFeatureMomentAlpha::error(), vpFeaturePoint::error(), vpFeaturePoint3D::error(), vpFeaturePointPolar::error(), vpFeatureSegment::error(), vpFeatureThetaU::error(), vpFeatureTranslation::error(), vpGenericFeature::error(), vpBasicFeature::get_s(), stack(), and vpMatrix::stackMatrices().
|
inlinestatic |
Definition at line 442 of file vpColVector.h.
References vpMatrix::stack().
|
inlinestatic |
Definition at line 447 of file vpColVector.h.
References vpMatrix::stack().
|
inline |
Definition at line 437 of file vpColVector.h.
References vpMatrix::stack().
|
static |
Compute the standard deviation value of all the elements of the vector.
Definition at line 1171 of file vpColVector.cpp.
References vpArray2D< Type >::data, vpException::dimensionError, vpArray2D< Type >::rowNum, and vpArray2D< Type >::size().
double vpColVector::sum | ( | ) | const |
Return the sum of all the elements of the column vector v(m).
.
Definition at line 1482 of file vpColVector.cpp.
References vpArray2D< double >::data, and vpArray2D< double >::rowNum.
Referenced by mean().
double vpColVector::sumSquare | ( | ) | const |
Return the sum square of all the elements of the column vector v(m).
.
Definition at line 1490 of file vpColVector.cpp.
References vpArray2D< double >::data, and vpArray2D< double >::rowNum.
Referenced by vpMbTracker::computeVVSCheckLevenbergMarquardt(), vpPose::coplanar(), vpFeatureDepth::error(), vpFeatureThetaU::error(), vpFeatureTranslation::error(), vpMbTracker::extractCylinders(), frobeniusNorm(), vpFeatureThetaU::interaction(), vpMatrix::kernel(), normalize(), vpPose::poseFromRectangle(), vpPose::poseLagrangeNonPlan(), vpPose::poseLagrangePlan(), vpPose::poseVirtualVS(), vpPose::poseVirtualVSrobust(), vpPose::poseVirtualVSWithDepth(), vpServoData::save(), vpSimulatorAfma6::setPosition(), and vpSimulatorViper850::setPosition().
vpRowVector vpColVector::t | ( | ) | const |
Transpose the column vector. The resulting vector becomes a row vector.
Definition at line 809 of file vpColVector.cpp.
References vpArray2D< Type >::data, vpArray2D< double >::data, and vpArray2D< double >::rowNum.
Referenced by vpMbtFaceDepthDense::computeInteractionMatrixAndResidu(), vpServo::computeProjectionOperators(), vpRobotBiclops::getPosition(), vpRobotBiclops::getVelocity(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), vpSimulatorAfma6::initialiseCameraRelativeToObject(), vpSimulatorViper850::initialiseCameraRelativeToObject(), operator+(), vpPose::poseDementhonPlan(), vpForwardProjection::print(), vpServo::print(), vpMeEllipse::printParameters(), vpPose::printPoint(), vpServoData::save(), vpRobotKinova::setPosition(), vpRobotBiclops::setVelocity(), vpLinProg::simplex(), vpTemplateTrackerSSDForwardAdditional::trackNoPyr(), vpTemplateTrackerMIForwardAdditional::trackNoPyr(), vpTemplateTrackerMIInverseCompositional::trackNoPyr(), and transpose().
std::vector< double > vpColVector::toStdVector | ( | ) | const |
Converts the vpColVector to a std::vector.
Definition at line 690 of file vpColVector.cpp.
References vpArray2D< double >::data, and vpArray2D< double >::size().
Referenced by vpRobotUniversalRobots::get_fMe(), vpRobotUniversalRobots::setPosition(), and vpRobotUniversalRobots::setVelocity().
vpRowVector vpColVector::transpose | ( | ) | const |
Transpose the column vector. The resulting vector becomes a row vector.
Definition at line 820 of file vpColVector.cpp.
References t().
void vpColVector::transpose | ( | vpRowVector & | v | ) | const |
Transpose the column vector. The resulting vector v becomes a row vector.
Definition at line 826 of file vpColVector.cpp.
References t().
|
friend |
Definition at line 470 of file vpColVector.h.
|
related |
Insert array B in array A at the given position.
A | : Main array. |
B | : Array to insert. |
C | : Result array. |
r | : Index of the row where to insert array B. |
c | : Index of the column where to insert array B. |
Definition at line 999 of file vpArray2D.h.
|
related |
Allows to multiply a scalar by a column vector.
Definition at line 832 of file vpColVector.cpp.
|
related |
Definition at line 1191 of file vpArray2D.h.
|
related |
Definition at line 1209 of file vpArray2D.h.
|
friend |
Definition at line 464 of file vpColVector.h.
|
related |
This function performs generalized matrix multiplication: D = alpha*op(A)*op(B) + beta*op(C), where op(X) is X or X^T. Operation on A, B and C matrices is described by enumeration vpGEMMmethod().
For example, to compute D = alpha*A^T*B^T+beta*C we need to call :
If C is not used, vpGEMM must be called using an empty array null. Thus to compute D = alpha*A^T*B, we have to call:
vpException::incorrectMatrixSizeError | if the sizes of the matrices do not allow the operations. |
A | : An array that could be a vpMatrix. |
B | : An array that could be a vpMatrix. |
alpha | : A scalar. |
C | : An array that could be a vpMatrix. |
beta | : A scalar. |
D | : The resulting array that could be a vpMatrix. |
ops | : A scalar describing operation applied on the matrices. Possible values are the one defined in vpGEMMmethod(): VP_GEMM_A_T, VP_GEMM_B_T, VP_GEMM_C_T. |
|
related |
Enumeration of the operations applied on matrices in vpGEMM() function.
Operations are :
|
friend |
Definition at line 168 of file vpColVector.h.
|
protectedinherited |
Number of columns in the array.
Definition at line 136 of file vpArray2D.h.
|
inherited |
Address of the first element of the data array.
Definition at line 144 of file vpArray2D.h.
|
protectedinherited |
Current array size (rowNum * colNum)
Definition at line 140 of file vpArray2D.h.
|
protectedinherited |
Number of rows in the array.
Definition at line 134 of file vpArray2D.h.
|
protectedinherited |
Address of the first element of each rows.
Definition at line 138 of file vpArray2D.h.