Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpSubRowVector Class Reference

#include <vpSubRowVector.h>

Inheritance diagram for vpSubRowVector:

Public Member Functions

 vpSubRowVector ()
 vpSubRowVector (vpRowVector &v, const unsigned int &offset, const unsigned int &ncols)
virtual ~vpSubRowVector () VP_OVERRIDE
void checkParentStatus () const
void init (vpRowVector &v, const unsigned int &offset, const unsigned int &ncols)
vpSubRowVectoroperator= (const vpSubRowVector &B)
vpSubRowVectoroperator= (const vpRowVector &B)
vpSubRowVectoroperator= (const vpMatrix &B)
vpSubRowVectoroperator= (const double &x)
void clear ()
std::ostream & cppPrint (std::ostream &os, const std::string &matrixName="A", bool octet=false) const
std::ostream & csvPrint (std::ostream &os) const
void deg2rad ()
vpRowVector extract (unsigned int c, unsigned int rowsize) const
double frobeniusNorm () const
vpRowVector hadamard (const vpRowVector &v) const
void init (const vpRowVector &v, unsigned int c, unsigned int ncols)
void insert (unsigned int i, const vpRowVector &v)
std::ostream & maplePrint (std::ostream &os) const
std::ostream & matlabPrint (std::ostream &os) const
vpRowVectornormalize ()
vpRowVectornormalize (vpRowVector &x) const
double & operator[] (unsigned int n)
const double & operator[] (unsigned int n) const
bool operator== (const vpRowVector &v) const
bool operator!= (const vpRowVector &v) const
double operator* (const vpColVector &x) const
vpRowVector operator* (const vpMatrix &M) const
vpRowVector operator* (double x) const
vpRowVectoroperator*= (double x)
vpRowVector operator/ (double x) const
vpRowVectoroperator/= (double x)
vpRowVector operator+ (const vpRowVector &v) const
vpRowVectoroperator+= (vpRowVector v)
vpRowVector operator- (const vpRowVector &v) const
vpRowVector operator- () const
vpRowVectoroperator-= (vpRowVector v)
vpRowVectoroperator<< (const vpRowVector &v)
vpRowVectoroperator<< (double val)
vpRowVectoroperator, (double val)
int print (std::ostream &s, unsigned int length, char const *intro=nullptr) const
void 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 vpRowVector &v)
double sum () const
double sumSquare () const
vpColVector t () const
std::vector< double > toStdVector () const
vpColVector transpose () const
void transpose (vpColVector &v) const
Inherited functionalities from vpArray2D
vpArray2D< double > hadamard (const vpArray2D< double > &m) const
void insert (const vpArray2D< double > &A, unsigned int r, unsigned int c)
bool operator!= (const vpArray2D< double > &A) const
void resize (unsigned int nrows, unsigned int ncols, bool flagNullify=true, bool recopy_=true)
unsigned int getCols () const
double getMaxValue () const
double getMinValue () const
unsigned int getRows () const
unsigned int size () const

Static Public Member Functions

static vpRowVector view (double *raw_data, unsigned int ncols)
static vpArray2D< double > view (const vpArray2D< double > &A)
static vpRowVector stack (const vpRowVector &A, const vpRowVector &B)
static void stack (const vpRowVector &A, const vpRowVector &B, vpRowVector &C)
static double mean (const vpRowVector &v)
static double median (const vpRowVector &v)
static double stdev (const vpRowVector &v, bool useBesselCorrection=false)

Public Attributes

double * data

Protected Attributes

unsigned int m_pColNum
vpRowVectorm_parent

(Note that these are not member symbols.)

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)
enum  vpGEMMmethod

Inherited I/O from vpArray2D with Static Public Member Functions

unsigned int rowNum
unsigned int colNum
double ** rowPtrs
unsigned int dsize
bool isMemoryOwner
bool isRowPtrsOwner
static bool load (const std::string &filename, vpArray2D< double > &A, bool binary=false, char *header=nullptr)
static bool loadYAML (const std::string &filename, vpArray2D< double > &A, char *header=nullptr)
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 bool isFinite (const vpArray2D< double > &A)

Deprecated functions

VP_DEPRECATED void init ()
VP_DEPRECATED void stackMatrices (const vpRowVector &r)
VP_DEPRECATED void setIdentity (const double &val=1.0)
VP_DEPRECATED double euclideanNorm () const
static VP_DEPRECATED vpRowVector stackMatrices (const vpRowVector &A, const vpRowVector &B)
static VP_DEPRECATED void stackMatrices (const vpRowVector &A, const vpRowVector &B, vpRowVector &C)

Detailed Description

This class provides a mask on a vpRowVector. It has internally a pointer to the parent vpRowVector. All properties of vpRowVector are available with a vpSubRowVector.

See also
vpMatrix vpColVector vpRowVector

Definition at line 57 of file vpSubRowVector.h.

Constructor & Destructor Documentation

◆ vpSubRowVector() [1/2]

BEGIN_VISP_NAMESPACE vpSubRowVector::vpSubRowVector ( )

Default constructor that creates an empty vector.

Definition at line 41 of file vpSubRowVector.cpp.

References m_parent, m_pColNum, and vpRowVector::vpRowVector().

Referenced by operator=(), operator=(), operator=(), and operator=().

◆ vpSubRowVector() [2/2]

vpSubRowVector::vpSubRowVector ( vpRowVector & v,
const unsigned int & offset,
const unsigned int & ncols )

Construct a sub-row vector from a parent row vector.

Parameters
v: parent row vector.
offset: offset where the sub-row vector starts in the parent row vector.
ncols: size of the sub-row vector.

Definition at line 49 of file vpSubRowVector.cpp.

References vpRowVector::init(), m_parent, m_pColNum, and vpRowVector::vpRowVector().

◆ ~vpSubRowVector()

vpSubRowVector::~vpSubRowVector ( )
virtual

Destructor that set the pointer to the parent row vector to nullptr.

Definition at line 97 of file vpSubRowVector.cpp.

References vpArray2D< double >::data.

Member Function Documentation

◆ checkParentStatus()

void vpSubRowVector::checkParentStatus ( ) const

This method can be used to detect if the parent row vector always exits or its size have not changed. If this not the case an exception is thrown.

Definition at line 104 of file vpSubRowVector.cpp.

References vpArray2D< double >::data, vpException::dimensionError, vpException::fatalError, m_parent, and m_pColNum.

◆ clear()

◆ conv2()

vpArray2D< double > vpArray2D< double >::conv2 ( const vpArray2D< double > & M,
const vpArray2D< double > & kernel,
const std::string & mode )
staticinherited

Perform a 2D convolution similar to Matlab conv2 function: $ M \star kernel $.

Parameters
M: First matrix.
kernel: Second matrix.
mode: Convolution mode: "full" (default), "same", "valid".
Convolution mode: full, same, valid (image credit: Theano doc).
Note
This is a very basic implementation that does not use FFT.

Definition at line 1142 of file vpArray2D.h.

References vpArray2D().

◆ cppPrint()

std::ostream & vpRowVector::cppPrint ( std::ostream & os,
const std::string & matrixName = "A",
bool octet = false ) const
inherited

Print to be used as part of a C++ code later.

Parameters
os: the stream to be printed in.
matrixName: name of the row 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:

#include <visp3/core/vpRowVector.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
for (unsigned int i=0; i<r.size(); i++)
r[i] = i;
r.cppPrint(std::cout, "r");
}
vpRowVector()
Basic constructor that creates an empty 0-size row vector.

It produces the following output that could be copy/paste in a C++ code:

r[0] = 0;
r[1] = 1;
r[2] = 2;

Definition at line 1246 of file vpRowVector.cpp.

References vpArray2D< double >::getCols().

◆ csvPrint()

std::ostream & vpRowVector::csvPrint ( std::ostream & os) const
inherited

Print/save a row vector in csv format.

The following code

#include <visp3/core/vpRowVector.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
std::ofstream ofs("log.csv", std::ofstream::out);
for (unsigned int i=0; i<r.size(); i++)
r[i] = i;
r.csvPrint(ofs);
ofs.close();
}

produces log.csv file that contains:

0, 1, 2

Definition at line 1294 of file vpRowVector.cpp.

References vpArray2D< double >::getCols().

◆ deg2rad()

void vpRowVector::deg2rad ( )
inlineinherited

Convert a column vector containing angles in degrees into radians.

See also
rad2deg()

Definition at line 178 of file vpRowVector.h.

◆ euclideanNorm()

double vpRowVector::euclideanNorm ( ) const
inherited
Deprecated
This function is deprecated. You should rather use frobeniusNorm().

Compute and return the Euclidean norm also called Frobenius norm $ ||v|| = \sqrt{ \sum{v_{i}^2}} $.

Returns
The Euclidean norm if the vector is initialized, 0 otherwise.
See also
frobeniusNorm()

Definition at line 1154 of file vpRowVector.cpp.

References frobeniusNorm().

Referenced by setIdentity().

◆ extract()

vpRowVector vpRowVector::extract ( unsigned int c,
unsigned int rowsize ) const
inlineinherited

Extract a sub-row vector from a row vector.

Parameters
c: Index of the column corresponding to the first element of the vector to extract.
rowsize: Size of the vector to extract.
Exceptions
vpException::fatalErrorIf the vector to extract is not contained in the original one.
for (unsigned int i=0; i<4; ++i)
r1.stack(i);
// r1 is equal to [0 1 2 3]
vpRowVector r2 = r1.extract(1, 3);
// r2 is equal to [1 2 3]
void stack(double d)
vpRowVector extract(unsigned int c, unsigned int rowsize) const
Examples
testRowVector.cpp.

Definition at line 202 of file vpRowVector.h.

References vpArray2D< double >::colNum, vpException::fatalError, and vpRowVector().

◆ frobeniusNorm()

double vpRowVector::frobeniusNorm ( ) const
inherited

Compute and return the Frobenius norm $ ||v|| = \sqrt{ \sum{v_{i}^2}} $.

Returns
The Frobenius norm if the vector is initialized, 0 otherwise.

Definition at line 1137 of file vpRowVector.cpp.

References sumSquare().

Referenced by euclideanNorm().

◆ getCols()

unsigned int vpArray2D< double >::getCols ( ) const
inlineinherited

Return the number of columns of the 2D array.

See also
getRows(), size()
Examples
catchLuminanceMapping.cpp, catchMatrixCholesky.cpp, catchPoseVector.cpp, perfMatrixMultiplication.cpp, perfMatrixTranspose.cpp, servoViper850Point2DArtVelocity-jointAvoidance-basic.cpp, testDisplacement.cpp, testMatrix.cpp, testMatrixConditionNumber.cpp, testMatrixConvolution.cpp, testMatrixDeterminant.cpp, testMatrixInitialization.cpp, testMatrixInverse.cpp, testMatrixPseudoInverse.cpp, and testSvd.cpp.

Definition at line 423 of file vpArray2D.h.

Referenced by vpMatrix::choleskyByEigen3(), vpMatrix::choleskyByLapack(), vpMatrix::choleskyByOpenCV(), vpMatrix::cond(), vpMatrix::cppPrint(), vpRowVector::cppPrint(), vpMatrix::csvPrint(), vpRowVector::csvPrint(), vpMatrix::detByLUEigen3(), vpMatrix::extract(), vpHomogeneousMatrix::getCol(), vpMatrix::getCol(), vpRotationMatrix::getCol(), vpMatrix::inducedL2Norm(), vpMatrix::inverseByLUEigen3(), vpMatrix::inverseByQRLapack(), vpRotationMatrix::isARotationMatrix(), vpMatrix::kernel(), vpMatrix::maplePrint(), vpRowVector::maplePrint(), vpMatrix::matlabPrint(), vpRowVector::matlabPrint(), vpMatrix::nullSpace(), vpMatrix::nullSpace(), vpRowVector::operator*(), vpRowVector::operator+(), vpRowVector::operator+=(), vpRowVector::operator-(), vpRowVector::operator-=(), vpForceTwistMatrix::print(), vpMatrix::print(), vpRowVector::print(), vpVelocityTwistMatrix::print(), vpMatrix::row(), vpMatrix::svdEigen3(), vpMatrix::svdLapack(), vpMatrix::svdOpenCV(), vpRowVector::vpRowVector(), and vpRowVector::vpRowVector().

◆ getMaxValue()

double vpArray2D< double >::getMaxValue ( ) const
inherited

Return the array max value.

Examples
servoMomentImage.cpp.

Definition at line 425 of file vpArray2D.h.

◆ getMinValue()

double vpArray2D< double >::getMinValue ( ) const
inherited

Return the array min value.

Examples
servoMomentImage.cpp.

Definition at line 427 of file vpArray2D.h.

◆ getRows()

unsigned int vpArray2D< double >::getRows ( ) const
inlineinherited

Return the number of rows of the 2D array.

See also
getCols(), size()
Examples
catchLuminanceMapping.cpp, catchMatrixCholesky.cpp, catchParticleFilter.cpp, catchPoseVector.cpp, perfMatrixMultiplication.cpp, perfMatrixTranspose.cpp, testDisplacement.cpp, testMatrix.cpp, testMatrixConditionNumber.cpp, testMatrixConvolution.cpp, testMatrixDeterminant.cpp, testMatrixInitialization.cpp, testMatrixInverse.cpp, testMatrixPseudoInverse.cpp, and testSvd.cpp.

Definition at line 433 of file vpArray2D.h.

Referenced by vpMatrix::choleskyByEigen3(), vpMatrix::choleskyByLapack(), vpMatrix::choleskyByOpenCV(), vpMatrix::column(), vpMatrix::cond(), vpColVector::cppPrint(), vpMatrix::cppPrint(), vpColVector::csvPrint(), vpMatrix::csvPrint(), vpMatrix::detByLUEigen3(), vpMatrix::extract(), vpHomogeneousMatrix::getCol(), vpMatrix::getCol(), vpRotationMatrix::getCol(), vpMatrix::inducedL2Norm(), vpMatrix::inverseByCholeskyLapack(), vpMatrix::inverseByLUEigen3(), vpMatrix::inverseByQRLapack(), vpRotationMatrix::isARotationMatrix(), vpMatrix::kernel(), vpColVector::maplePrint(), vpMatrix::maplePrint(), vpColVector::matlabPrint(), vpMatrix::matlabPrint(), vpMatrix::nullSpace(), vpMatrix::nullSpace(), vpColVector::operator*(), vpColVector::operator+(), vpColVector::operator+(), vpColVector::operator+=(), vpColVector::operator+=(), vpColVector::operator-(), vpColVector::operator-=(), vpColVector::operator-=(), vpColVector::print(), vpForceTwistMatrix::print(), vpMatrix::print(), vpPoseVector::print(), vpVelocityTwistMatrix::print(), vpMatrix::svdEigen3(), vpMatrix::svdLapack(), vpMatrix::svdOpenCV(), vpColVector::vpColVector(), and vpColVector::vpColVector().

◆ hadamard() [1/2]

vpArray2D< double > vpArray2D< double >::hadamard ( const vpArray2D< double > & m) const
inherited

Compute the Hadamard product (element wise matrix multiplication).

Parameters
m: Second matrix;
Returns
m1.hadamard(m2) The Hadamard product : $ m1 \circ m2 = (m1 \circ
m2)_{i,j} = (m1)_{i,j} (m2)_{i,j} $

Definition at line 732 of file vpArray2D.h.

References vpArray2D().

◆ hadamard() [2/2]

vpRowVector vpRowVector::hadamard ( const vpRowVector & v) const
inherited

Compute the Hadamard product (element wise vector multiplication).

Parameters
v: Second vector;
Returns
v1.hadamard(v2) The kronecker product : $ v1 \circ v2 = (v1 \circ v2)_{i} = (v1)_{i} (v2)_{i} $
Examples
catchArray2D.cpp.

Definition at line 1403 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, vpArray2D< Type >::data, vpArray2D< double >::data, vpException::dimensionError, vpArray2D< double >::dsize, resize(), vpArray2D< double >::rowNum, and vpRowVector().

◆ init() [1/3]

VP_DEPRECATED void vpRowVector::init ( )
inlineinherited
Deprecated
Provided only for compat with previous releases. This function does nothing.

Definition at line 340 of file vpRowVector.h.

Referenced by vpRowVector(), and vpSubRowVector::vpSubRowVector().

◆ init() [2/3]

void vpRowVector::init ( const vpRowVector & v,
unsigned int c,
unsigned int ncols )
inherited

Initialize the row vector from a part of an input row vector v.

Parameters
v: Input row vector used for initialization.
c: column index in v that corresponds to the first element of the row vector to construct.
ncols: Number of columns of the constructed row vector.

The sub-vector starting from v[c] element and ending on v[c+ncols-1] element is used to initialize the constructed row vector.

The following code shows how to use this function:

#include <visp3/core/vpRowVector.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
int val = 0;
for(size_t i=0; i<v.getCols(); i++) {
v[i] = val++;
}
std::cout << "v: " << v << std::endl;
w.init(v, 1, 2);
std::cout << "w: " << w << std::endl;
}
Implementation of row vector and the associated operations.

It produces the following output:

v: 0 1 2 3
w: 1 2

Definition at line 1196 of file vpRowVector.cpp.

References vpException::dimensionError, resize(), vpArray2D< double >::rowPtrs, and vpRowVector().

◆ init() [3/3]

void vpSubRowVector::init ( vpRowVector & v,
const unsigned int & offset,
const unsigned int & ncols )

Initialize a sub-row vector from a parent row vector.

Parameters
v: parent row vector.
offset: offset where the sub-row vector starts in the parent row vector.
ncols: size of the sub-row vector.

Definition at line 61 of file vpSubRowVector.cpp.

References vpArray2D< double >::colNum, vpArray2D< double >::data, vpException::dimensionError, vpArray2D< double >::dsize, vpException::fatalError, m_parent, m_pColNum, vpArray2D< double >::rowNum, vpArray2D< double >::rowPtrs, and vpRowVector::vpRowVector().

◆ insert() [1/2]

void vpArray2D< double >::insert ( const vpArray2D< double > & A,
unsigned int r,
unsigned int c )
inlineinherited

Insert array A at the given position in the current array.

Warning
Throw vpException::dimensionError if the dimensions of the matrices do not allow the operation.
Parameters
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 586 of file vpArray2D.h.

◆ insert() [2/2]

void vpRowVector::insert ( unsigned int i,
const vpRowVector & v )
inherited

Insert a row vector.

Parameters
i: Index of the first element to introduce. This index starts from 0.
v: Row vector to insert.

The following example shows how to use this function:

#include <visp3/core/vpRowVector.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
for (unsigned int i=0; i < v.size(); i++)
v[i] = i;
std::cout << "v: " << v << std::endl;
for (unsigned int i=0; i < w.size(); i++)
w[i] = i+10;
std::cout << "w: " << w << std::endl;
v.insert(1, w);
std::cout << "v: " << v << std::endl;
}

It produces the following output:

v: 0 1 2 3
w: 10 11
v: 0 10 11 3

Definition at line 784 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, vpException::dimensionError, and vpRowVector().

◆ isFinite()

bool vpArray2D< double >::isFinite ( const vpArray2D< double > & A)
inlinestaticinherited

Definition at line 1188 of file vpArray2D.h.

◆ load()

bool vpArray2D< double >::load ( const std::string & filename,
vpArray2D< double > & A,
bool binary = false,
char * header = nullptr )
inlinestaticinherited

Load a matrix from a file.

Parameters
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.
Returns
Returns true if success.
See also
save()

Definition at line 760 of file vpArray2D.h.

◆ loadYAML()

bool vpArray2D< double >::loadYAML ( const std::string & filename,
vpArray2D< double > & A,
char * header = nullptr )
inlinestaticinherited

◆ maplePrint()

std::ostream & vpRowVector::maplePrint ( std::ostream & os) const
inherited

Print using Maple syntax, to copy/paste in Maple later.

The following code

#include <visp3/core/vpRowVector.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
for (unsigned int i=0; i<r.size(); i++)
r[i] = i;
std::cout << "r = "; r.maplePrint(std::cout);
}

produces this output:

r = ([
[0, 1, 2, ],
])

that could be copy/paste in Maple.

Definition at line 1334 of file vpRowVector.cpp.

References vpArray2D< double >::getCols().

◆ matlabPrint()

std::ostream & vpRowVector::matlabPrint ( std::ostream & os) const
inherited

Print using Matlab syntax, to copy/paste in Matlab later.

The following code

#include <visp3/core/vpRowVector.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
for (unsigned int i=0; i<r.size(); i++)
r[i] = i;
std::cout << "r = "; r.matlabPrint(std::cout);
}

produces this output:

r = [ 0, 1, 2, ]

that could be copy/paste in Matlab:

>> r = [ 0, 1, 2, ]
r =
0 1 2
>>

Definition at line 1381 of file vpRowVector.cpp.

References vpArray2D< double >::getCols().

◆ mean()

double vpRowVector::mean ( const vpRowVector & v)
staticinherited

Compute the mean value of all the elements of the vector.

Examples
testRowVector.cpp.

Definition at line 938 of file vpRowVector.cpp.

References vpException::dimensionError, mean(), and vpRowVector().

Referenced by mean(), and stdev().

◆ median()

double vpRowVector::median ( const vpRowVector & v)
staticinherited

Compute the median value of all the elements of the vector.

Examples
testRowVector.cpp.

Definition at line 957 of file vpRowVector.cpp.

References vpException::dimensionError, vpMath::getMedian(), and vpRowVector().

◆ normalize() [1/2]

vpRowVector & vpRowVector::normalize ( )
inherited

Normalise the vector modifying the vector as:

\‍[{\bf x} = \frac{{\bf x}}{\sqrt{\sum_{i=1}^{n}x^2_i}}
\‍]

where $x_i$ is an element of the row vector $\bf x$.

Definition at line 651 of file vpRowVector.cpp.

References sumSquare(), and vpRowVector().

◆ normalize() [2/2]

vpRowVector & vpRowVector::normalize ( vpRowVector & x) const
inherited

Normalize the vector given as input parameter and return the normalized vector:

\‍[{\bf x} = \frac{{\bf x}}{\sqrt{\sum_{i=1}^{n}x^2_i}}
\‍]

where $x_i$ is an element of the row vector $\bf x$.

Definition at line 636 of file vpRowVector.cpp.

References vpRowVector().

◆ operator!=() [1/2]

bool operator!= ( const vpArray2D< double > & A) const
inherited

Not equal to comparison operator of a 2D array.

Definition at line 612 of file vpArray2D.h.

References vpArray2D().

◆ operator!=() [2/2]

bool vpRowVector::operator!= ( const vpRowVector & v) const
inherited

Definition at line 202 of file vpRowVector.cpp.

References vpRowVector().

◆ operator*() [1/3]

double vpRowVector::operator* ( const vpColVector & x) const
inherited

Multiply a row vector by a column vector.

Parameters
x: Column vector.
Warning
The number of elements of the two vectors must be equal.
Exceptions
vpException::dimensionError: If the number of elements of the two vectors is not the same.
Returns
A scalar.

Definition at line 218 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, vpException::dimensionError, and vpArray2D< double >::getCols().

◆ operator*() [2/3]

vpRowVector vpRowVector::operator* ( const vpMatrix & M) const
inherited

Multiply a row vector by a matrix.

Parameters
M: Matrix.
Warning
The number of elements of the row vector must be equal to the number of rows of the matrix.
Exceptions
vpException::dimensionErrorIf the number of elements of the row vector is not equal to the number of rows of the matrix.
Returns
The resulting row vector.

Definition at line 248 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, vpArray2D< double >::data, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), and vpRowVector().

◆ operator*() [3/3]

vpRowVector vpRowVector::operator* ( double x) const
inherited

Operator that allows to multiply each element of a row vector by a scalar.

Parameters
x: The scalar.
Returns
The row vector multiplied by the scalar. The current row vector (*this) is unchanged.
v[0] = 1;
v[1] = 2;
v[2] = 3;
vpRowVector w = v * 3;
// v is unchanged
// w is now equal to : [3 6 9]

Definition at line 289 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, vpArray2D< double >::data, and vpRowVector().

◆ operator*=()

vpRowVector & vpRowVector::operator*= ( double x)
inherited

Operator that allows to multiply each element of a row vector by a scalar.

Parameters
x: The scalar.
Returns
The row vector multiplied by the scalar.
v[0] = 1;
v[1] = 2;
v[2] = 3;
v *= 3;
// v is now equal to : [3 6 9]

Definition at line 320 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, and vpRowVector().

◆ operator+()

vpRowVector vpRowVector::operator+ ( const vpRowVector & v) const
inherited

Operator that allows to add to row vectors that have the same size.

Exceptions
vpException::dimensionErrorIf the vectors size differ.

Definition at line 435 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, vpException::dimensionError, vpArray2D< double >::getCols(), and vpRowVector().

◆ operator+=()

vpRowVector & vpRowVector::operator+= ( vpRowVector v)
inherited

Operator that allows to add two row vectors that have the same size.

Exceptions
vpException::dimensionErrorIf the size of the two vectors differ.

Definition at line 455 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, vpException::dimensionError, vpArray2D< double >::getCols(), and vpRowVector().

◆ operator,()

vpRowVector & vpRowVector::operator, ( double val)
inherited

◆ operator-() [1/2]

vpRowVector vpRowVector::operator- ( ) const
inherited

Operator that allows to negate all the row vector elements.

vpRowVector r(3, 1);
// r contains [1 1 1]
vpRowVector v = -r;
// v contains [-1 -1 -1]

Definition at line 397 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, vpArray2D< Type >::data, vpArray2D< double >::data, and vpRowVector().

◆ operator-() [2/2]

vpRowVector vpRowVector::operator- ( const vpRowVector & m) const
inherited

Operator that allows to subtract to row vectors that have the same size.

Exceptions
vpException::dimensionErrorIf the vectors size differ.

Definition at line 416 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< double >::getCols(), and vpRowVector().

◆ operator-=()

vpRowVector & vpRowVector::operator-= ( vpRowVector v)
inherited

Operator that allows to subtract two row vectors that have the same size.

Exceptions
vpException::dimensionErrorIf the size of the two vectors differ.

Definition at line 473 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, vpException::dimensionError, vpArray2D< double >::getCols(), and vpRowVector().

◆ operator/()

vpRowVector vpRowVector::operator/ ( double x) const
inherited

Operator that allows to divide each element of a row vector by a scalar.

Parameters
x: The scalar.
Returns
The row vector divided by the scalar. The current row vector (*this) is unchanged.
v[0] = 8;
v[1] = 4;
v[2] = 2;
vpRowVector w = v / 2;
// v is equal to : [8 4 2]
// w is equal to : [4 2 1]

Definition at line 347 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, vpArray2D< double >::data, and vpRowVector().

◆ operator/=()

vpRowVector & vpRowVector::operator/= ( double x)
inherited

Operator that allows to divide each element of a row vector by a scalar.

Parameters
x: The scalar.
Returns
The row vector divided by the scalar.
v[0] = 8;
v[1] = 4;
v[2] = 2;
// v is equal to : [8 4 2]
v /= 2;
// v is equal to : [4 2 1]

Definition at line 379 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, and vpRowVector().

◆ operator<<() [1/2]

vpRowVector & vpRowVector::operator<< ( const vpRowVector & v)
inherited

Copy operator. Allows operation such as A << v

#include <visp3/core/vpRowVector.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
vpRowVector A, B(5);
for (unsigned int i=0; i<B.size(); i++)
B[i] = i;
A << B;
std::cout << "A: " << A << std::endl;
}

In row vector A we get:

A: 0 1 2 3 4

Definition at line 511 of file vpRowVector.cpp.

References vpRowVector().

◆ operator<<() [2/2]

vpRowVector & vpRowVector::operator<< ( double val)
inherited

Definition at line 517 of file vpRowVector.cpp.

References vpArray2D< double >::data, resize(), and vpRowVector().

◆ operator=() [1/4]

vpSubRowVector & vpSubRowVector::operator= ( const double & x)

Set all the elements of the sub-row vector to x.

Parameters
x: a scalar value.

Definition at line 178 of file vpSubRowVector.cpp.

References vpArray2D< double >::data, vpArray2D< double >::rowNum, and vpSubRowVector().

◆ operator=() [2/4]

vpSubRowVector & vpSubRowVector::operator= ( const vpMatrix & B)

Allow to initialize a sub-row vector from a matrix using operation A = B. Notice that the sub-row vector is not resized to the dimension of B.

Parameters
B: a matrix of size 1-by-n.

Definition at line 161 of file vpSubRowVector.cpp.

References vpArray2D< double >::colNum, vpArray2D< double >::data, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< double >::rowNum, and vpSubRowVector().

◆ operator=() [3/4]

vpSubRowVector & vpSubRowVector::operator= ( const vpRowVector & B)

Allow to initialize a sub-row vector from a row vector using operation A = B. Notice that the sub-row vector is not resized to the dimension of B.

Parameters
B: a row vector.

Definition at line 141 of file vpSubRowVector.cpp.

References vpArray2D< double >::colNum, vpArray2D< double >::data, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< double >::rowNum, vpRowVector::vpRowVector(), and vpSubRowVector().

◆ operator=() [4/4]

vpSubRowVector & vpSubRowVector::operator= ( const vpSubRowVector & B)

Allow to initialize a sub-row vector from an other one using operation A = B. Notice that the sub-row vector is not resized to the dimension of B.

Parameters
B: a sub-row vector.

Definition at line 120 of file vpSubRowVector.cpp.

References vpArray2D< double >::colNum, vpArray2D< double >::data, vpException::dimensionError, vpArray2D< Type >::getCols(), m_parent, m_pColNum, vpArray2D< double >::rowNum, and vpSubRowVector().

◆ operator==()

bool vpRowVector::operator== ( const vpRowVector & v) const
inherited

◆ operator[]() [1/2]

double & vpRowVector::operator[] ( unsigned int n)
inlineinherited

Operator that allows to set a value of an element $v_i$: v[i] = x.

Definition at line 235 of file vpRowVector.h.

References vpArray2D< double >::data.

◆ operator[]() [2/2]

const double & vpRowVector::operator[] ( unsigned int n) const
inlineinherited

Operator that allows to get the value of an element $v_i$: x = v[i].

Definition at line 237 of file vpRowVector.h.

References vpArray2D< double >::data.

◆ print()

int vpRowVector::print ( std::ostream & s,
unsigned int length,
char const * intro = nullptr ) const
inherited

Pretty print a row vector. The data are tabulated. The common widths before and after the decimal point are set with respect to the parameter maxlen.

Parameters
sStream used for the printing.
lengthThe suggested width of each row vector element. The actual width grows in order to accommodate the whole integral part, and shrinks if the whole extent is not needed for all the numbers.
introThe introduction which is printed before the vector. Can be set to zero (or omitted), in which case the introduction is not printed.
Returns
Returns the common total width for all vector elements.
See also
std::ostream &operator<<(std::ostream &s, const vpArray2D<Type> &A)

Definition at line 1011 of file vpRowVector.cpp.

References vpArray2D< double >::getCols(), and vpMath::maximum().

◆ rad2deg()

void vpRowVector::rad2deg ( )
inlineinherited

Convert a column vector containing angles in radians into degrees.

See also
deg2rad()

Definition at line 277 of file vpRowVector.h.

◆ reshape() [1/2]

vpMatrix vpRowVector::reshape ( unsigned int nrows,
unsigned int ncols )
inherited

Reshape the row vector in a matrix.

Parameters
nrows: number of rows of the matrix.
ncols: number of columns of the matrix.
Returns
The resulting matrix.
Exceptions
vpException::dimensionErrorIf the matrix and the row vector have not the same size.
See also
reshape(vpMatrix &, const unsigned int &, const unsigned int &)

Definition at line 673 of file vpRowVector.cpp.

References reshape().

◆ reshape() [2/2]

void vpRowVector::reshape ( vpMatrix & M,
const unsigned int & nrows,
const unsigned int & ncols )
inherited

Reshape the row vector in a matrix.

Parameters
M: the reshaped matrix.
nrows: number of rows of the matrix.
ncols: number of columns of the matrix.
Exceptions
vpException::dimensionErrorIf the matrix and the row vector have not the same size.

The following example shows how to use this method.

#include <visp3/core/vpRowVector.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace VISP_NAMESPACE_NAME;
#endif
int main()
{
int var=0;
vpMatrix mat(3, 4);
for (int i = 0; i < 3; i++)
for (int j = 0; j < 4; j++)
mat[i][j] = ++var;
std::cout << "mat: \n" << mat << std::endl;
vpRowVector row = mat.stackRows();
std::cout << "row vector: " << row << std::endl;
vpMatrix remat = row.reshape(3, 4);
std::cout << "remat: \n" << remat << std::endl;
}
Implementation of a matrix and operations on matrices.
Definition vpMatrix.h:175
void reshape(vpMatrix &M, const unsigned int &nrows, const unsigned int &ncols)

If you run the previous example, you get:

mat:
1 2 3 4
5 6 7 8
9 10 11 12
row vector: 1 2 3 4 5 6 7 8 9 10 11 12
remat:
1 2 3 4
5 6 7 8
9 10 11 12

Definition at line 727 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, vpArray2D< double >::data, vpException::dimensionError, vpArray2D< double >::dsize, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), and vpArray2D< Type >::resize().

Referenced by reshape().

◆ resize() [1/3]

void vpArray2D< double >::resize ( unsigned int nrows,
unsigned int ncols,
bool flagNullify = true,
bool recopy_ = true )
inlineinherited

Set the size of the array and initialize all the values to zero.

Parameters
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.
Examples
catchParticleFilter.cpp, perfMatrixMultiplication.cpp, perfMatrixTranspose.cpp, testMatrix.cpp, testMatrixConditionNumber.cpp, testMatrixDeterminant.cpp, testMatrixInverse.cpp, testMatrixPseudoInverse.cpp, and testSvd.cpp.

Definition at line 448 of file vpArray2D.h.

Referenced by vpMatrix::diag(), vpMatrix::eye(), vpMatrix::init(), vpMatrix::operator,(), vpMatrix::operator<<(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::stack(), vpMatrix::stack(), vpMatrix::stack(), vpMatrix::svdEigen3(), and vpMatrix::svdOpenCV().

◆ resize() [2/3]

void vpRowVector::resize ( unsigned int i,
bool flagNullify = true )
inlineinherited

Modify the size of the row vector.

Parameters
i: Size of the vector. This value corresponds to the vector number of columns.
flagNullify: If true, set the data to zero.
Examples
testMatrix.cpp, and testMatrixInitialization.cpp.

Definition at line 292 of file vpRowVector.h.

References vpArray2D< Type >::resize().

Referenced by vpImageTools::columnMean(), VISP_NAMESPACE_NAME::eigen2visp(), hadamard(), init(), operator,(), operator<<(), operator=(), operator=(), operator=(), operator=(), operator=(), stack(), stack(), and vpMatrix::stackRows().

◆ resize() [3/3]

void vpRowVector::resize ( unsigned int nrows,
unsigned int ncols,
bool flagNullify )
inlineinherited

Resize the row vector to a ncols-dimension vector. This function can only be used with nrows = 1.

Parameters
nrows: Vector number of rows. This value should be set to 1.
ncols: Vector number of columns. This value corresponds to the size of the vector.
flagNullify: If true, set the data to zero.
Exceptions
vpException::fatalErrorWhen nrows is not equal to 1.

Definition at line 304 of file vpRowVector.h.

References vpException::fatalError, and vpArray2D< Type >::resize().

◆ save()

bool vpArray2D< double >::save ( const std::string & filename,
const vpArray2D< double > & A,
bool binary = false,
const char * header = "" )
inlinestaticinherited

Save a matrix to a file.

Parameters
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.
Returns
Returns true if success.

Warning : If you save the matrix as in a text file the precision is less than if you save it in a binary file.

See also
load()

Definition at line 965 of file vpArray2D.h.

◆ saveYAML()

bool vpArray2D< double >::saveYAML ( const std::string & filename,
const vpArray2D< double > & A,
const char * header = "" )
inlinestaticinherited

Save an array in a YAML-formatted file.

Parameters
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.
Returns
Returns true if success.

Here is an example of outputs.

vpArray2D::saveYAML("matrix.yml", M, "example: a YAML-formatted header");
vpArray2D::saveYAML("matrixIndent.yml", M, "example:\n - a YAML-formatted \
header\n - with inner indentation");
static bool saveYAML(const std::string &filename, const vpArray2D< Type > &A, const char *header="")
Definition vpArray2D.h:1061

Content of matrix.yml:

example: a YAML-formatted header
rows: 3
cols: 4
- [0, 0, 0, 0]
- [0, 0, 0, 0]
- [0, 0, 0, 0]

Content of matrixIndent.yml:

example:
- a YAML-formatted header
- with inner indentation
rows: 3
cols: 4
- [0, 0, 0, 0]
- [0, 0, 0, 0]
- [0, 0, 0, 0]
See also
loadYAML()
Examples
visp-acquire-franka-calib-data.cpp, and visp-acquire-universal-robots-calib-data.cpp.

Definition at line 1061 of file vpArray2D.h.

◆ setIdentity()

VP_DEPRECATED void vpRowVector::setIdentity ( const double & val = 1.0)
inherited
Deprecated
You should rather use eye()

References euclideanNorm().

◆ size()

◆ stack() [1/4]

vpRowVector vpRowVector::stack ( const vpRowVector & A,
const vpRowVector & B )
staticinherited

Stack row vectors.

Parameters
A: Initial vector.
B: Vector to stack at the end of A.
Returns
Stacked vector $[A B]$.
vpRowVector r1(3, 1);
// r1 is equal to [1 1 1]
vpRowVector r2(2, 3);
// r2 is equal to [3 3]
v = vpRowVector::stack(r1, r2);
// v is equal to [1 1 1 3 3]
See also
stack(const vpRowVector &)
stack(const vpRowVector &, const vpRowVector &, vpRowVector &)

Definition at line 876 of file vpRowVector.cpp.

References stack(), and vpRowVector().

◆ stack() [2/4]

void vpRowVector::stack ( const vpRowVector & A,
const vpRowVector & B,
vpRowVector & C )
staticinherited

Stack row vectors.

Parameters
A: Initial vector.
B: Vector to stack at the end of A.
C: Resulting stacked vector $C = [A B]$.
vpRowVector r1(3, 1);
// r1 is equal to [1 1 1]
vpRowVector r2(2, 3);
// r2 is equal to [3 3]
vpRowVector::stack(r1, r2, v);
// v is equal to [1 1 1 3 3]
See also
stack(const vpRowVector &)
stack(const vpRowVector &, const vpRowVector &)

Definition at line 903 of file vpRowVector.cpp.

References vpArray2D< Type >::getCols(), resize(), and vpRowVector().

◆ stack() [3/4]

void vpRowVector::stack ( const vpRowVector & v)
inherited

Stack row vectors.

Parameters
v: Vector to stack to the existing one.
vpRowVector v1(3, 1);
// v1 is equal to [1 1 1]
vpRowVector v2(2, 3);
// v2 is equal to [3 3]
v1.stack(v2);
// v1 is equal to [1 1 1 3 3]
See also
stack(const vpRowVector &, const double &)
stack(const vpRowVector &, const vpRowVector &)
stack(const vpRowVector &, const vpRowVector &, vpRowVector &)

Definition at line 854 of file vpRowVector.cpp.

References stack(), and vpRowVector().

◆ stack() [4/4]

void vpRowVector::stack ( double d)
inherited

Stack row vector with a new element at the end of the vector.

Parameters
d: Element to stack to the existing one.
vpRowVector v(3, 1);
// v is equal to [1 1 1]
v.stack(-2);
// v is equal to [1 1 1 -2]
See also
stack(const vpRowVector &, const vpRowVector &)
stack(const vpRowVector &, const vpRowVector &, vpRowVector &)
Examples
testRowVector.cpp.

Definition at line 829 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, and resize().

Referenced by stack(), stack(), stackMatrices(), stackMatrices(), and stackMatrices().

◆ stackMatrices() [1/3]

VP_DEPRECATED vpRowVector vpRowVector::stackMatrices ( const vpRowVector & A,
const vpRowVector & B )
inlinestaticinherited
Deprecated
You should rather use stack(const vpRowVector &A, const vpRowVector &B)

Definition at line 349 of file vpRowVector.h.

References stack(), and vpRowVector().

◆ stackMatrices() [2/3]

VP_DEPRECATED void vpRowVector::stackMatrices ( const vpRowVector & A,
const vpRowVector & B,
vpRowVector & C )
inlinestaticinherited

◆ stackMatrices() [3/3]

VP_DEPRECATED void vpRowVector::stackMatrices ( const vpRowVector & r)
inlineinherited
Deprecated
You should rather use stack(const vpRowVector &)

Definition at line 344 of file vpRowVector.h.

References stack(), and vpRowVector().

◆ stdev()

double vpRowVector::stdev ( const vpRowVector & v,
bool useBesselCorrection = false )
staticinherited

Compute the standard deviation value of all the elements of the vector.

Examples
testRowVector.cpp.

Definition at line 971 of file vpRowVector.cpp.

References vpException::dimensionError, mean(), and vpRowVector().

◆ sum()

double vpRowVector::sum ( ) const
inherited

Return the sum of all the elements $v_{i}$ of the row vector v(n).

Returns
The sum square value: $\sum_{j=0}^{n} v_j$.

Definition at line 1103 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, vpArray2D< double >::rowPtrs, and sum().

Referenced by sum().

◆ sumSquare()

double vpRowVector::sumSquare ( ) const
inherited

Return the sum square of all the elements $v_{i}$ of the row vector v(n).

Returns
The sum square value: $\sum_{j=0}^{n} v_j^{2}$.
Examples
catchLuminanceMapping.cpp, and servoBiclopsPoint2DArtVelocity.cpp.

Definition at line 1120 of file vpRowVector.cpp.

References vpArray2D< double >::colNum, and vpArray2D< double >::rowPtrs.

Referenced by frobeniusNorm(), and normalize().

◆ t()

◆ toStdVector()

std::vector< double > vpRowVector::toStdVector ( ) const
inherited

Converts the vpRowVector to a std::vector.

Returns
The corresponding std::vector<double>.

Definition at line 802 of file vpRowVector.cpp.

References vpArray2D< double >::data, and vpArray2D< double >::size().

◆ transpose() [1/2]

vpColVector vpRowVector::transpose ( ) const
inherited

Transpose the row vector. The resulting vector becomes a column vector.

See also
t()

Definition at line 545 of file vpRowVector.cpp.

References t().

Referenced by vpUKSigmaDrawerMerwe::drawSigmaPoints().

◆ transpose() [2/2]

void vpRowVector::transpose ( vpColVector & v) const
inherited

Transpose the row vector. The resulting vector v becomes a column vector.

See also
t()

Definition at line 550 of file vpRowVector.cpp.

References t().

◆ view() [1/2]

vpArray2D< double > vpArray2D< double >::view ( const vpArray2D< double > & A)
inlinestaticinherited

Creates a view of the Matrix A. A view shares the same underlying memory as the original array. It can be written into, modifying the original data. However, the array cannot be resized.

When you use this method, it is your responsibility to ensure that the lifespan of the view does not exceed the lifespan of the original array.

Parameters
Athe array to view
Returns
vpArray2D<T>

Definition at line 324 of file vpArray2D.h.

◆ view() [2/2]

BEGIN_VISP_NAMESPACE vpRowVector vpRowVector::view ( double * raw_data,
unsigned int ncols )
staticinherited

Create a row vector view of a raw data array. The view can modify the contents of the raw data array, but may not resize it and does not own it : the memory is not released by the vector and it should be freed by the user after the view is released.

Parameters
[in]raw_dataThe raw data.
[in]ncols: Number of columns of the raw data.
Returns
The row vector view.

Definition at line 67 of file vpRowVector.cpp.

References vpArray2D< Type >::view(), and vpRowVector().

◆ operator==() [1/2]

bool operator== ( const vpArray2D< double > & A) const
related

◆ operator==() [2/2]

bool operator== ( const vpArray2D< float > & A) const
related

◆ vpGEMM()

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 )
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 :

vpGEMM(A, B, alpha, C, beta, D, VP_GEMM_A_T + VP_GEMM_B_T);
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)
Definition vpGEMM.h:414

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:

vpGEMM(A, B, alpha, null, 0, D, VP_GEMM_B_T);
Exceptions
vpException::incorrectMatrixSizeErrorif the sizes of the matrices do not allow the operations.
Parameters
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.

Definition at line 414 of file vpGEMM.h.

References vpException::functionNotImplementedError, and vpArray2D().

◆ vpGEMMmethod

enum vpGEMMmethod
related

Enumeration of the operations applied on matrices in vpGEMM() function.

Operations are :

  • VP_GEMM_A_T to use the transpose matrix of A instead of the matrix A
  • VP_GEMM_B_T to use the transpose matrix of B instead of the matrix B
  • VP_GEMM_C_T to use the transpose matrix of C instead of the matrix C

Definition at line 53 of file vpGEMM.h.

Member Data Documentation

◆ colNum

unsigned int vpArray2D< double >::colNum
protectedinherited

Number of columns in the array.

Definition at line 1203 of file vpArray2D.h.

Referenced by vpMatrix::AAt(), vpMatrix::AtA(), vpMatrix::choleskyByLapack(), vpMatrix::choleskyByOpenCV(), vpColVector::clear(), vpMatrix::clear(), vpRowVector::clear(), vpMatrix::dampedInverse(), vpMatrix::detByLU(), vpMatrix::detByLUEigen3(), vpMatrix::detByLULapack(), vpMatrix::detByLUOpenCV(), vpMatrix::diag(), vpMatrix::eigenValues(), vpMatrix::eigenValues(), vpMatrix::expm(), vpRowVector::extract(), vpMatrix::eye(), vpMatrix::getDiag(), vpMatrix::getRow(), vpMatrix::getRow(), vpColVector::hadamard(), vpMatrix::hadamard(), vpRowVector::hadamard(), vpMatrix::infinityNorm(), vpSubColVector::init(), vpSubMatrix::init(), vpSubRowVector::init(), vpMatrix::insert(), vpRowVector::insert(), vpMatrix::inverseByCholeskyLapack(), vpMatrix::inverseByCholeskyOpenCV(), vpMatrix::inverseByLU(), vpMatrix::inverseByLUEigen3(), vpMatrix::inverseByLULapack(), vpMatrix::inverseByLUOpenCV(), vpMatrix::inverseByQRLapack(), vpMatrix::inverseTriangular(), vpMatrix::operator*(), vpMatrix::operator*(), vpMatrix::operator*(), vpMatrix::operator*(), vpMatrix::operator*(), vpMatrix::operator*(), vpRotationMatrix::operator*(), vpRotationMatrix::operator*(), vpRowVector::operator*(), vpRowVector::operator*(), vpRowVector::operator*(), vpMatrix::operator*=(), vpRotationMatrix::operator*=(), vpRowVector::operator*=(), vpRowVector::operator+(), vpMatrix::operator+=(), vpMatrix::operator+=(), vpRowVector::operator+=(), vpMatrix::operator,(), vpRowVector::operator,(), vpRowVector::operator-(), vpRowVector::operator-(), vpMatrix::operator-=(), vpMatrix::operator-=(), vpRowVector::operator-=(), vpMatrix::operator/(), vpRowVector::operator/(), vpMatrix::operator/=(), vpRowVector::operator/=(), vpColVector::operator<<(), vpMatrix::operator<<(), vpMatrix::operator=(), vpRowVector::operator=(), vpRowVector::operator=(), vpRowVector::operator=(), vpSubMatrix::operator=(), vpSubMatrix::operator=(), vpSubMatrix::operator=(), vpSubRowVector::operator=(), vpSubRowVector::operator=(), vpSubRowVector::operator=(), operator==(), operator==(), vpColVector::operator==(), vpRowVector::operator==(), vpMatrix::qr(), vpRowVector::reshape(), vpMatrix::setIdentity(), vpMatrix::solveByQR(), vpMatrix::solveByQR(), vpMatrix::solveBySVD(), vpMatrix::stack(), vpMatrix::stack(), vpMatrix::stack(), vpRowVector::stack(), vpMatrix::stackColumns(), vpMatrix::stackColumns(), vpMatrix::stackRows(), vpMatrix::stackRows(), vpMatrix::sum(), vpRowVector::sum(), vpMatrix::sumSquare(), vpRowVector::sumSquare(), vpMatrix::svdEigen3(), vpMatrix::svdLapack(), vpRowVector::t(), and vpMatrix::transpose().

◆ data

double* vpArray2D< double >::data
inherited

Address of the first element of the data array.

Examples
catchQuaternion.cpp, catchRotation.cpp, perfMatrixMultiplication.cpp, testDisplacement.cpp, testMatrix.cpp, testMatrixInitialization.cpp, testUniversalRobotsGetData.cpp, and tutorial-bridge-opencv-matrix.cpp.

Definition at line 149 of file vpArray2D.h.

Referenced by vpMatrix::AAt(), vpMatrix::AtA(), vpHomogeneousMatrix::buildFrom(), vpHomogeneousMatrix::buildFrom(), vpQuaternionVector::buildFrom(), vpQuaternionVector::buildFrom(), vpRxyzVector::buildFrom(), vpRxyzVector::buildFrom(), vpRxyzVector::buildFrom(), vpRzyxVector::buildFrom(), vpRzyxVector::buildFrom(), vpRzyxVector::buildFrom(), vpRzyzVector::buildFrom(), vpRzyzVector::buildFrom(), vpRzyzVector::buildFrom(), vpThetaUVector::buildFrom(), vpThetaUVector::buildFrom(), vpThetaUVector::buildFrom(), vpThetaUVector::buildFrom(), vpThetaUVector::buildFrom(), vpSubColVector::checkParentStatus(), vpSubMatrix::checkParentStatus(), vpSubRowVector::checkParentStatus(), vpColVector::clear(), vpMatrix::clear(), vpRowVector::clear(), vpHomogeneousMatrix::convert(), vpHomogeneousMatrix::convert(), vpMatrix::detByLUEigen3(), vpMatrix::detByLUOpenCV(), vpMatrix::expm(), vpThetaUVector::extract(), vpMatrix::frobeniusNorm(), vpMatrix::getRow(), vpThetaUVector::getTheta(), vpThetaUVector::getU(), vpColVector::hadamard(), vpMatrix::hadamard(), vpRowVector::hadamard(), vpSubColVector::init(), vpSubMatrix::init(), vpSubRowVector::init(), vpColVector::insert(), vpMatrix::insert(), vpMatrix::inverseByCholeskyOpenCV(), vpMatrix::inverseByLUEigen3(), vpMatrix::inverseByLUOpenCV(), vpHomogeneousMatrix::isValid(), vpColVector::operator*(), vpHomography::operator*(), vpMatrix::operator*(), vpMatrix::operator*(), vpRowVector::operator*(), vpRowVector::operator*(), vpTranslationVector::operator*(), vpColVector::operator,(), vpHomogeneousMatrix::operator,(), vpRotationMatrix::operator,(), vpRotationVector::operator,(), vpRowVector::operator,(), vpTranslationVector::operator,(), vpColVector::operator-(), vpRowVector::operator-(), vpTranslationVector::operator-(), vpColVector::operator/(), vpHomography::operator/(), vpRowVector::operator/(), vpTranslationVector::operator/(), vpHomography::operator/=(), vpColVector::operator<<(), vpHomogeneousMatrix::operator<<(), vpRotationMatrix::operator<<(), vpRotationVector::operator<<(), vpRowVector::operator<<(), vpTranslationVector::operator<<(), vpColVector::operator=(), vpColVector::operator=(), vpColVector::operator=(), vpColVector::operator=(), vpColVector::operator=(), vpColVector::operator=(), vpColVector::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpQuaternionVector::operator=(), vpQuaternionVector::operator=(), vpRotationMatrix::operator=(), vpRotationVector::operator=(), vpRowVector::operator=(), vpRowVector::operator=(), vpRowVector::operator=(), vpRxyzVector::operator=(), vpRxyzVector::operator=(), vpRxyzVector::operator=(), vpRzyxVector::operator=(), vpRzyxVector::operator=(), vpRzyxVector::operator=(), vpRzyzVector::operator=(), vpRzyzVector::operator=(), vpRzyzVector::operator=(), vpSubColVector::operator=(), vpSubColVector::operator=(), vpSubColVector::operator=(), vpSubColVector::operator=(), vpSubColVector::operator=(), vpSubColVector::operator=(), vpSubColVector::operator=(), vpSubRowVector::operator=(), vpSubRowVector::operator=(), vpSubRowVector::operator=(), vpSubRowVector::operator=(), vpThetaUVector::operator=(), vpThetaUVector::operator=(), vpThetaUVector::operator=(), vpTranslationVector::operator=(), vpTranslationVector::operator=(), vpTranslationVector::operator=(), vpTranslationVector::operator=(), operator==(), operator==(), vpColVector::operator==(), vpColVector::operator==(), vpRowVector::operator==(), vpColVector::operator[](), vpColVector::operator[](), vpPoseVector::operator[](), vpPoseVector::operator[](), vpRotationVector::operator[](), vpRotationVector::operator[](), vpRowVector::operator[](), vpRowVector::operator[](), vpTranslationVector::operator[](), vpTranslationVector::operator[](), vpRotationMatrix::orthogonalize(), vpMatrix::qr(), vpColVector::reshape(), vpRowVector::reshape(), vpQuaternionVector::set(), vpMatrix::stack(), vpMatrix::stack(), vpMatrix::stackRows(), vpColVector::sum(), vpColVector::sumSquare(), vpMatrix::svdEigen3(), vpMatrix::svdLapack(), vpMatrix::svdOpenCV(), vpColVector::t(), vpPoseVector::t(), vpRotationVector::t(), vpRowVector::t(), vpTranslationVector::t(), vpColVector::toStdVector(), vpPoseVector::toStdVector(), vpRotationVector::toStdVector(), vpRowVector::toStdVector(), vpMatrix::transpose(), vpColVector::view(), vpMatrix::view(), vpColVector::vpColVector(), vpHomogeneousMatrix::vpHomogeneousMatrix(), vpQuaternionVector::w(), vpQuaternionVector::w(), vpQuaternionVector::x(), vpQuaternionVector::x(), vpQuaternionVector::y(), vpQuaternionVector::y(), vpQuaternionVector::z(), vpQuaternionVector::z(), vpSubColVector::~vpSubColVector(), vpSubMatrix::~vpSubMatrix(), and vpSubRowVector::~vpSubRowVector().

◆ dsize

◆ isMemoryOwner

bool vpArray2D< double >::isMemoryOwner
protectedinherited

Whether this array owns the memory it points to.

Definition at line 1209 of file vpArray2D.h.

Referenced by vpColVector::clear(), and vpRowVector::clear().

◆ isRowPtrsOwner

bool vpArray2D< double >::isRowPtrsOwner
protectedinherited

Whether this array owns the row pointers.

Definition at line 1211 of file vpArray2D.h.

◆ m_parent

vpRowVector* vpSubRowVector::m_parent
protected

Parent vpColVector.

Definition at line 78 of file vpSubRowVector.h.

Referenced by checkParentStatus(), init(), operator=(), vpSubRowVector(), and vpSubRowVector().

◆ m_pColNum

unsigned int vpSubRowVector::m_pColNum
protected

Number of row of parent vpColVector at initialization.

Definition at line 76 of file vpSubRowVector.h.

Referenced by checkParentStatus(), init(), operator=(), vpSubRowVector(), and vpSubRowVector().

◆ rowNum

unsigned int vpArray2D< double >::rowNum
protectedinherited

Number of rows in the array.

Definition at line 1201 of file vpArray2D.h.

Referenced by vpMatrix::AAt(), vpMatrix::AtA(), vpMatrix::choleskyByLapack(), vpMatrix::choleskyByOpenCV(), vpColVector::clear(), vpMatrix::clear(), vpRowVector::clear(), vpMatrix::detByLU(), vpMatrix::detByLUEigen3(), vpMatrix::detByLULapack(), vpMatrix::detByLUOpenCV(), vpMatrix::diag(), vpMatrix::eigenValues(), vpMatrix::eigenValues(), vpMatrix::expm(), vpColVector::extract(), vpMatrix::eye(), vpMatrix::getCol(), vpMatrix::getDiag(), vpMatrix::getRow(), vpColVector::hadamard(), vpMatrix::hadamard(), vpRowVector::hadamard(), vpColVector::infinityNorm(), vpMatrix::infinityNorm(), vpSubColVector::init(), vpSubMatrix::init(), vpSubRowVector::init(), vpMatrix::insert(), vpMatrix::inverseByCholeskyLapack(), vpMatrix::inverseByCholeskyOpenCV(), vpMatrix::inverseByLU(), vpMatrix::inverseByLUEigen3(), vpMatrix::inverseByLULapack(), vpMatrix::inverseByLUOpenCV(), vpMatrix::inverseByQRLapack(), vpMatrix::inverseTriangular(), vpColVector::operator*(), vpColVector::operator*(), vpColVector::operator*(), vpColVector::operator*(), vpHomogeneousMatrix::operator*(), vpMatrix::operator*(), vpMatrix::operator*(), vpMatrix::operator*(), vpMatrix::operator*(), vpMatrix::operator*(), vpMatrix::operator*(), vpRotationMatrix::operator*(), vpRotationMatrix::operator*(), vpTranslationVector::operator*(), vpColVector::operator*=(), vpMatrix::operator*=(), vpRotationMatrix::operator*=(), vpTranslationVector::operator*=(), vpColVector::operator+(), vpColVector::operator+=(), vpColVector::operator+=(), vpMatrix::operator+=(), vpMatrix::operator+=(), vpColVector::operator,(), vpColVector::operator-(), vpColVector::operator-(), vpColVector::operator-=(), vpColVector::operator-=(), vpMatrix::operator-=(), vpMatrix::operator-=(), vpColVector::operator/(), vpMatrix::operator/(), vpColVector::operator/=(), vpMatrix::operator/=(), vpTranslationVector::operator/=(), vpColVector::operator<<(), vpMatrix::operator<<(), vpColVector::operator=(), vpColVector::operator=(), vpColVector::operator=(), vpColVector::operator=(), vpColVector::operator=(), vpColVector::operator=(), vpMatrix::operator=(), vpMatrix::operator=(), vpRowVector::operator=(), vpSubColVector::operator=(), vpSubColVector::operator=(), vpSubColVector::operator=(), vpSubColVector::operator=(), vpSubColVector::operator=(), vpSubColVector::operator=(), vpSubColVector::operator=(), vpSubMatrix::operator=(), vpSubMatrix::operator=(), vpSubMatrix::operator=(), vpSubRowVector::operator=(), vpSubRowVector::operator=(), vpSubRowVector::operator=(), vpSubRowVector::operator=(), vpTranslationVector::operator=(), vpTranslationVector::operator=(), operator==(), operator==(), vpColVector::operator==(), vpColVector::operator==(), vpRowVector::operator==(), vpMatrix::qr(), vpColVector::reshape(), vpMatrix::setIdentity(), vpColVector::stack(), vpMatrix::stack(), vpMatrix::stack(), vpMatrix::stack(), vpMatrix::stackColumns(), vpMatrix::stackColumns(), vpMatrix::stackRows(), vpMatrix::stackRows(), vpColVector::sum(), vpMatrix::sum(), vpColVector::sumSquare(), vpMatrix::sumSquare(), vpRotationVector::sumSquare(), vpTranslationVector::sumSquare(), vpMatrix::svdEigen3(), vpMatrix::svdLapack(), vpColVector::t(), vpPoseVector::t(), vpTranslationVector::t(), and vpMatrix::transpose().

◆ rowPtrs

double** vpArray2D< double >::rowPtrs
protectedinherited

Address of the first element of each rows.

Definition at line 1205 of file vpArray2D.h.

Referenced by vpMatrix::AAt(), vpColVector::clear(), vpMatrix::clear(), vpRowVector::clear(), vpMatrix::infinityNorm(), vpColVector::init(), vpMatrix::init(), vpRowVector::init(), vpSubColVector::init(), vpSubMatrix::init(), vpSubRowVector::init(), vpForceTwistMatrix::operator*(), vpForceTwistMatrix::operator*(), vpForceTwistMatrix::operator*(), vpHomogeneousMatrix::operator*(), vpMatrix::operator*(), vpMatrix::operator*(), vpMatrix::operator*(), vpMatrix::operator*(), vpMatrix::operator*(), vpMatrix::operator*(), vpRotationMatrix::operator*(), vpRotationMatrix::operator*(), vpRotationMatrix::operator*(), vpRotationMatrix::operator*(), vpVelocityTwistMatrix::operator*(), vpVelocityTwistMatrix::operator*(), vpVelocityTwistMatrix::operator*(), vpMatrix::operator*=(), vpRotationMatrix::operator*=(), vpMatrix::operator+=(), vpMatrix::operator+=(), vpMatrix::operator,(), vpMatrix::operator-=(), vpMatrix::operator-=(), vpMatrix::operator/(), vpMatrix::operator/=(), vpColVector::operator<<(), vpMatrix::operator<<(), vpMatrix::operator<<(), vpForceTwistMatrix::operator=(), vpHomogeneousMatrix::operator=(), vpMatrix::operator=(), vpRotationMatrix::operator=(), vpRowVector::operator=(), vpSubMatrix::operator=(), vpSubMatrix::operator=(), vpSubMatrix::operator=(), vpVelocityTwistMatrix::operator=(), vpMatrix::stack(), vpMatrix::stackColumns(), vpMatrix::sum(), vpRowVector::sum(), vpMatrix::sumSquare(), vpRotationVector::sumSquare(), vpRowVector::sumSquare(), and vpTranslationVector::sumSquare().