Visual Servoing Platform
version 3.0.0
|
#include <visp3/core/vpSubMatrix.h>
Public Types | |
enum | vpDetMethod { LU_DECOMPOSITION } |
Public Member Functions | |
vpSubMatrix () | |
vpSubMatrix (vpMatrix &m, const unsigned int &row, const unsigned int &col, const unsigned int &nrows, const unsigned int &ncols) | |
~vpSubMatrix () | |
void | init (vpMatrix &m, const unsigned int &row, const unsigned int &col, const unsigned int &nrows, const unsigned int &ncols) |
void | checkParentStatus () const |
vpSubMatrix & | operator= (const vpSubMatrix &B) |
vpSubMatrix & | operator= (const vpMatrix &B) |
vpSubMatrix & | operator= (const double &x) |
void | clear () |
Setting a diagonal matrix | |
void | diag (const double &val=1.0) |
void | diag (const vpColVector &A) |
void | eye () |
Assignment operators | |
vpMatrix & | operator<< (double *) |
Stacking | |
void | stack (const vpMatrix &A) |
void | stack (const vpRowVector &r) |
void | stackColumns (vpColVector &out) |
vpColVector | stackColumns () |
void | stackRows (vpRowVector &out) |
vpRowVector | stackRows () |
Matrix insertion | |
void | insert (const vpMatrix &A, const unsigned int r, const unsigned int c) |
Columns, rows, sub-matrices extraction | |
vpRowVector | getRow (const unsigned int i) const |
vpRowVector | getRow (const unsigned int i, const unsigned int j_begin, const unsigned int size) const |
vpColVector | getCol (const unsigned int j) const |
vpColVector | getCol (const unsigned int j, const unsigned int i_begin, const unsigned int size) const |
void | init (const vpMatrix &M, unsigned int r, unsigned int c, unsigned int nrows, unsigned int ncols) |
Matrix operations | |
vpMatrix & | operator+= (const vpMatrix &B) |
vpMatrix & | operator+= (const double x) |
vpMatrix & | operator-= (const vpMatrix &B) |
vpMatrix & | operator-= (const double x) |
vpMatrix | operator* (const vpMatrix &B) const |
vpMatrix | operator* (const vpRotationMatrix &R) const |
vpMatrix | operator* (const vpVelocityTwistMatrix &V) const |
vpMatrix | operator* (const vpForceTwistMatrix &V) const |
vpTranslationVector | operator* (const vpTranslationVector &tv) const |
vpColVector | operator* (const vpColVector &v) const |
vpMatrix | operator* (const double x) const |
vpMatrix | operator+ (const vpMatrix &B) const |
vpMatrix | operator- (const vpMatrix &B) const |
vpMatrix | operator- () const |
vpMatrix & | operator*= (const double x) |
vpMatrix & | operator/= (double x) |
vpMatrix | operator/ (const double x) const |
double | sum () const |
double | sumSquare () const |
double | det (vpDetMethod method=LU_DECOMPOSITION) const |
vpMatrix | expm () const |
Kronecker product | |
void | kron (const vpMatrix &m1, vpMatrix &out) const |
vpMatrix | kron (const vpMatrix &m1) const |
Transpose | |
vpMatrix | t () const |
vpMatrix | transpose () const |
void | transpose (vpMatrix &C) const |
vpMatrix | AAt () const |
void | AAt (vpMatrix &B) const |
vpMatrix | AtA () const |
void | AtA (vpMatrix &B) const |
Matrix inversion | |
vpMatrix | inverseByLU () const |
vpMatrix | inverseByCholesky () const |
vpMatrix | inverseByCholeskyLapack () const |
vpMatrix | inverseByQR () const |
vpMatrix | inverseByQRLapack () const |
vpMatrix | pseudoInverse (double svThreshold=1e-6) const |
unsigned int | pseudoInverse (vpMatrix &Ap, double svThreshold=1e-6) const |
unsigned int | pseudoInverse (vpMatrix &Ap, vpColVector &sv, double svThreshold=1e-6) const |
unsigned int | pseudoInverse (vpMatrix &Ap, vpColVector &sv, double svThreshold, vpMatrix &ImA, vpMatrix &ImAt) const |
unsigned int | pseudoInverse (vpMatrix &Ap, vpColVector &sv, double svThreshold, vpMatrix &ImA, vpMatrix &ImAt, vpMatrix &kerA) const |
SVD decomposition | |
void | svd (vpColVector &w, vpMatrix &v) |
void | solveBySVD (const vpColVector &B, vpColVector &x) const |
vpColVector | solveBySVD (const vpColVector &B) const |
unsigned int | kernel (vpMatrix &KerA, double svThreshold=1e-6) const |
double | cond () const |
Eigen values | |
vpColVector | eigenValues () const |
void | eigenValues (vpColVector &evalue, vpMatrix &evector) const |
Norms | |
double | euclideanNorm () const |
double | infinityNorm () const |
Printing | |
int | print (std::ostream &s, unsigned int length, char const *intro=0) const |
std::ostream & | matlabPrint (std::ostream &os) const |
std::ostream & | maplePrint (std::ostream &os) const |
std::ostream & | csvPrint (std::ostream &os) const |
std::ostream & | cppPrint (std::ostream &os, const char *matrixName=NULL, bool octet=false) const |
void | printSize () const |
Inherited functionalities from vpArray2D | |
double | getMinValue () const |
double | getMaxValue () const |
unsigned int | getRows () const |
unsigned int | getCols () const |
unsigned int | size () const |
void | resize (const unsigned int nrows, const unsigned int ncols, const bool flagNullify=true) |
double * | operator[] (unsigned int i) |
double * | operator[] (unsigned int i) const |
Static Public Member Functions | |
Stacking with Static Public Member Functions | |
static vpMatrix | stack (const vpMatrix &A, const vpMatrix &B) |
static vpMatrix | stack (const vpMatrix &A, const vpRowVector &r) |
static void | stack (const vpMatrix &A, const vpMatrix &B, vpMatrix &C) |
static void | stack (const vpMatrix &A, const vpRowVector &r, vpMatrix &C) |
static vpMatrix | juxtaposeMatrices (const vpMatrix &A, const vpMatrix &B) |
static void | juxtaposeMatrices (const vpMatrix &A, const vpMatrix &B, vpMatrix &C) |
Matrix insertion with Static Public Member Functions | |
static vpMatrix | insert (const vpMatrix &A, const vpMatrix &B, const unsigned int r, const unsigned int c) |
static void | insert (const vpMatrix &A, const vpMatrix &B, vpMatrix &C, const unsigned int r, const unsigned int c) |
Kronecker product with Static Public Member Functions | |
static void | kron (const vpMatrix &m1, const vpMatrix &m2, vpMatrix &out) |
static vpMatrix | kron (const vpMatrix &m1, const vpMatrix &m2) |
Setting a diagonal matrix with Static Public Member Functions | |
static void | createDiagonalMatrix (const vpColVector &A, vpMatrix &DA) |
Matrix operations with Static Public Member Functions | |
static void | add2Matrices (const vpMatrix &A, const vpMatrix &B, vpMatrix &C) |
static void | add2Matrices (const vpColVector &A, const vpColVector &B, vpColVector &C) |
static void | add2WeightedMatrices (const vpMatrix &A, const double &wA, const vpMatrix &B, const double &wB, vpMatrix &C) |
static void | computeHLM (const vpMatrix &H, const double &alpha, vpMatrix &HLM) |
static void | mult2Matrices (const vpMatrix &A, const vpMatrix &B, vpMatrix &C) |
static void | mult2Matrices (const vpMatrix &A, const vpMatrix &B, vpRotationMatrix &C) |
static void | mult2Matrices (const vpMatrix &A, const vpMatrix &B, vpHomogeneousMatrix &C) |
static void | mult2Matrices (const vpMatrix &A, const vpColVector &B, vpColVector &C) |
static void | multMatrixVector (const vpMatrix &A, const vpColVector &v, vpColVector &w) |
static void | negateMatrix (const vpMatrix &A, vpMatrix &C) |
static void | sub2Matrices (const vpMatrix &A, const vpMatrix &B, vpMatrix &C) |
static void | sub2Matrices (const vpColVector &A, const vpColVector &B, vpColVector &C) |
Covariance computation with Static Public Member Functions | |
static vpMatrix | computeCovarianceMatrix (const vpMatrix &A, const vpColVector &x, const vpColVector &b) |
static vpMatrix | computeCovarianceMatrix (const vpMatrix &A, const vpColVector &x, const vpColVector &b, const vpMatrix &w) |
static vpMatrix | computeCovarianceMatrixVVS (const vpHomogeneousMatrix &cMo, const vpColVector &deltaS, const vpMatrix &Ls, const vpMatrix &W) |
static vpMatrix | computeCovarianceMatrixVVS (const vpHomogeneousMatrix &cMo, const vpColVector &deltaS, const vpMatrix &Ls) |
Matrix I/O with Static Public Member Functions | |
static bool | loadMatrix (const std::string &filename, vpArray2D< double > &M, const bool binary=false, char *header=NULL) |
static bool | loadMatrixYAML (const std::string &filename, vpArray2D< double > &M, char *header=NULL) |
static bool | saveMatrix (const std::string &filename, const vpArray2D< double > &M, const bool binary=false, const char *header="") |
static bool | saveMatrixYAML (const std::string &filename, const vpArray2D< double > &M, const char *header="") |
Inherited I/O from vpArray2D with Static Public Member Functions | |
static bool | load (const std::string &filename, vpArray2D< double > &A, const 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, const bool binary=false, const char *header="") |
static bool | saveYAML (const std::string &filename, const vpArray2D< double > &A, const char *header="") |
Public Attributes | |
double * | data |
Protected Attributes | |
unsigned int | pRowNum |
unsigned int | pColNum |
vpMatrix * | parent |
unsigned int | rowNum |
unsigned int | colNum |
double ** | rowPtrs |
unsigned int | dsize |
Related Functions | |
(Note that these are not member functions.) | |
vpMatrix | operator* (const double &x, const vpMatrix &B) |
enum | vpGEMMmethod |
Deprecated functions | |
vp_deprecated void | init () |
vp_deprecated void | stackMatrices (const vpMatrix &A) |
vp_deprecated void | setIdentity (const double &val=1.0) |
static vp_deprecated vpMatrix | stackMatrices (const vpMatrix &A, const vpMatrix &B) |
static vp_deprecated void | stackMatrices (const vpMatrix &A, const vpMatrix &B, vpMatrix &C) |
static vp_deprecated vpMatrix | stackMatrices (const vpMatrix &A, const vpRowVector &B) |
static vp_deprecated void | stackMatrices (const vpMatrix &A, const vpRowVector &B, vpMatrix &C) |
static vp_deprecated vpMatrix | stackMatrices (const vpColVector &A, const vpColVector &B) |
static vp_deprecated void | stackMatrices (const vpColVector &A, const vpColVector &B, vpColVector &C) |
Definition of the vpSubMatrix vpSubMatrix class provides a mask on a vpMatrix all properties of vpMatrix are available with a vpSubMatrix.
Definition at line 62 of file vpSubMatrix.h.
|
inherited |
Method used to compute the determinant of a square matrix.
Enumerator | |
---|---|
LU_DECOMPOSITION |
LU decomposition method. |
Definition at line 99 of file vpMatrix.h.
vpSubMatrix::vpSubMatrix | ( | ) |
Default constructor.
Definition at line 44 of file vpSubMatrix.cpp.
vpSubMatrix::vpSubMatrix | ( | vpMatrix & | m, |
const unsigned int & | row_offset, | ||
const unsigned int & | col_offset, | ||
const unsigned int & | nrows, | ||
const unsigned int & | ncols | ||
) |
Constructor.
m | : parent matrix |
row_offset | : row offset |
col_offset | : col offset |
nrows | : number of rows of the sub matrix |
ncols | : number of columns of the sub matrix |
Definition at line 57 of file vpSubMatrix.cpp.
References vpMatrix::init().
vpSubMatrix::~vpSubMatrix | ( | ) |
|
inherited |
Computes the operation
Definition at line 286 of file vpMatrix.cpp.
|
inherited |
Compute the AAt operation such as .
The result is placed in the parameter B and not returned.
A new matrix won't be allocated for every use of the function. This results in a speed gain if used many times with the same result matrix size.
Definition at line 306 of file vpMatrix.cpp.
References vpArray2D< Type >::colNum, vpArray2D< double >::colNum, vpArray2D< Type >::resize(), vpArray2D< double >::rowNum, vpArray2D< Type >::rowNum, and vpArray2D< double >::rowPtrs.
|
staticinherited |
Operation C = A + B.
The result is placed in the third parameter C and not returned. A new matrix won't be allocated for every use of the function (speed gain if used many times with the same result matrix size).
Definition at line 930 of file vpMatrix.cpp.
References vpArray2D< Type >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< Type >::resize(), vpArray2D< Type >::rowNum, and vpArray2D< Type >::rowPtrs.
Referenced by vpMatrix::operator+().
|
staticinherited |
Operation C = A + B.
The result is placed in the third parameter C and not returned. A new vector won't be allocated for every use of the function (speed gain if used many times with the same result matrix size).
Definition at line 968 of file vpMatrix.cpp.
References vpArray2D< Type >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpColVector::resize(), vpArray2D< Type >::rowNum, and vpArray2D< Type >::rowPtrs.
|
staticinherited |
Operation C = A*wA + B*wB
The result is placed in the third parameter C and not returned. A new matrix won't be allocated for every use of the function (Speed gain if used many times with the same result matrix size).
Definition at line 897 of file vpMatrix.cpp.
References vpArray2D< Type >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< Type >::resize(), vpArray2D< Type >::rowNum, and vpArray2D< Type >::rowPtrs.
|
inherited |
Compute the AtA operation such as
Definition at line 391 of file vpMatrix.cpp.
Referenced by vpCalibration::calibrationTsai(), vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), vpMbEdgeTracker::computeVVS(), vpTemplateTrackerWarpHomographySL3::findWarp(), and vpNurbs::globalCurveApprox().
|
inherited |
Compute the AtA operation such as .
The result is placed in the parameter B and not returned.
A new matrix won't be allocated for every use of the function. This results in a speed gain if used many times with the same result matrix size.
Definition at line 345 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< Type >::colNum, vpArray2D< double >::data, vpArray2D< Type >::resize(), vpArray2D< double >::rowNum, and vpArray2D< Type >::rowNum.
void vpSubMatrix::checkParentStatus | ( | ) | const |
Check is parent vpRowVector has changed since initialization.
This method can be used to detect if the parent matrix always exits or its size have not changed and throw an exception is not.
Definition at line 106 of file vpSubMatrix.cpp.
References vpArray2D< double >::data, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpMatrixException::incorrectMatrixSizeError, parent, pColNum, pRowNum, and vpERROR_TRACE.
|
inlineinherited |
Removes all elements from the matrix (which are destroyed), leaving the container with a size of 0.
Definition at line 145 of file vpMatrix.h.
|
staticinherited |
Compute the covariance matrix of the parameters x from a least squares minimisation defined as: Ax = b
A | : Matrix A from Ax = b. |
x | : Vector x from Ax = b corresponding to the parameters to estimate. |
b | : Vector b from Ax = b. |
Definition at line 59 of file vpMatrix_covariance.cpp.
References vpException::divideByZeroError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpMatrix::pseudoInverse(), and vpMatrix::t().
Referenced by vpMatrix::computeCovarianceMatrixVVS(), and vpPose::poseVirtualVSrobust().
|
staticinherited |
Compute the covariance matrix of the parameters x from a least squares minimisation defined as: WAx = Wb
A | : Matrix A from WAx = Wb. |
x | : Vector x from WAx = Wb corresponding to the parameters to estimate. |
b | : Vector b from WAx = Wb. |
W | : Diagonal weigths matrix from WAx = Wb. |
Definition at line 87 of file vpMatrix_covariance.cpp.
References vpException::divideByZeroError, vpArray2D< Type >::getCols(), and vpMatrix::t().
|
staticinherited |
Compute the covariance matrix of an image-based virtual visual servoing. This assumes the optimization has been done via v = (W * Ls).pseudoInverse() * W * DeltaS.
cMo | : Pose matrix that has been computed with the v. |
deltaS | : Error vector used in v = (W * Ls).pseudoInverse() * W * DeltaS. |
Ls | : interaction matrix used in v = (W * Ls).pseudoInverse() * W * DeltaS. |
W | : Weight matrix used in v = (W * Ls).pseudoInverse() * W * DeltaS. |
Definition at line 139 of file vpMatrix_covariance.cpp.
References vpMatrix::computeCovarianceMatrix().
Referenced by vpMatrix::computeCovarianceMatrixVVS(), vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), vpMbEdgeTracker::computeVVS(), and vpPose::poseVirtualVS().
|
staticinherited |
Compute the covariance matrix of an image-based virtual visual servoing. This assumes the optimization has been done via v = Ls.pseudoInverse() * DeltaS.
cMo | : Pose matrix that has been computed with the v. |
deltaS | : Error vector used in v = Ls.pseudoInverse() * DeltaS |
Ls | : interaction matrix used in v = Ls.pseudoInverse() * DeltaS |
Definition at line 117 of file vpMatrix_covariance.cpp.
References vpMatrix::computeCovarianceMatrix(), and vpMatrix::computeCovarianceMatrixVVS().
|
staticinherited |
Compute
H | : input Matrix . This matrix should be square. |
alpha | : Scalar |
HLM | : Resulting operation. |
Definition at line 3470 of file vpMatrix.cpp.
References vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), and vpArray2D< Type >::resize().
Referenced by vpTemplateTrackerWarpHomographySL3::findWarp(), vpTemplateTrackerSSDESM::initCompInverse(), vpTemplateTrackerSSDInverseCompositional::initCompInverse(), vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), vpTemplateTrackerMIForwardCompositional::initHessienDesired(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), vpTemplateTrackerMIESM::initHessienDesired(), vpTemplateTrackerMIForwardAdditional::initHessienDesired(), vpTemplateTrackerMIInverseCompositional::initHessienDesired(), vpTemplateTracker::setHDes(), vpTemplateTrackerSSDForwardCompositional::trackNoPyr(), vpTemplateTrackerMIForwardCompositional::trackNoPyr(), vpTemplateTrackerSSDESM::trackNoPyr(), vpTemplateTrackerSSDForwardAdditional::trackNoPyr(), vpTemplateTrackerMIESM::trackNoPyr(), vpTemplateTrackerMIForwardAdditional::trackNoPyr(), and vpTemplateTrackerMIInverseCompositional::trackNoPyr().
|
inherited |
Definition at line 3445 of file vpMatrix.cpp.
References vpArray2D< Type >::getCols(), and vpMatrix::svd().
Referenced by vpTemplateTrackerMIForwardCompositional::trackNoPyr(), vpTemplateTrackerMIESM::trackNoPyr(), vpTemplateTrackerMIForwardAdditional::trackNoPyr(), and vpTemplateTrackerMIInverseCompositional::trackNoPyr().
|
inherited |
Print to be used as part of a C++ code later.
Print under the following form:
os | the stream to be printed in. |
matrixName | name of the matrix, "A" by default, to be used for the line vpMatrix A(6,7) (see example). |
octet | if false, print using double, if true, print byte per byte each bytes of the double array. |
Definition at line 2824 of file vpMatrix.cpp.
References vpArray2D< double >::getRows().
|
staticinherited |
Create a diagonal matrix with the element of a vector .
A | : Vector which element will be put in the diagonal. |
DA | : Diagonal matrix DA[i][i] = A[i] |
Definition at line 560 of file vpMatrix.cpp.
References vpArray2D< Type >::getRows(), and vpArray2D< Type >::resize().
|
inherited |
Print matrix in csv format.
Print as comma separated values so that this output can be imported into any program which has a csv data import option:
Definition at line 2794 of file vpMatrix.cpp.
References vpArray2D< double >::getCols(), and vpArray2D< double >::getRows().
|
inherited |
Compute the determinant of a n-by-n matrix.
method | : Method used to compute the determinant. Default LU decomposition methos is faster than the method based on Gaussian elimination. |
Definition at line 3297 of file vpMatrix.cpp.
References vpMatrix::LU_DECOMPOSITION.
Referenced by vpTemplateTrackerTriangle::init().
|
inherited |
Set the matrix as a diagonal matrix where each element on the diagonal is set to val. Elements that are not on the diagonal are set to 0.
val | : Value to set. |
Matrix A is now equal to:
Definition at line 539 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, and vpArray2D< double >::rowNum.
Referenced by vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), and vpMbEdgeTracker::computeVVS().
|
inherited |
Create a diagonal matrix with the element of a vector.
A | : Vector which element will be put in the diagonal. |
Matrix A is now equal to:
Definition at line 493 of file vpMatrix.cpp.
References vpArray2D< Type >::getRows(), and vpArray2D< double >::resize().
|
inherited |
Compute the eigenvalues of a n-by-n real symmetric matrix.
vpException::dimensionError | If the matrix is not square. |
vpException::fatalError | If the matrix is not symmetric. |
vpException::functionNotImplementedError | If the GSL library is not detected. |
Here an example:
Definition at line 3008 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpException::dimensionError, vpException::fatalError, vpException::functionNotImplementedError, vpArray2D< double >::rowNum, and vpMatrix::t().
|
inherited |
Compute the eigenvalues of a n-by-n real symmetric matrix.
evalue | : Eigenvalues of the matrix. |
evector | : Eigenvector of the matrix. |
vpException::dimensionError | If the matrix is not square. |
vpException::fatalError | If the matrix is not symmetric. |
vpException::functionNotImplementedError | If the GSL library is not detected. |
Here an example:
Definition at line 3120 of file vpMatrix.cpp.
References vpException::dimensionError, vpException::fatalError, vpException::functionNotImplementedError, vpArray2D< Type >::resize(), and vpMatrix::t().
|
inherited |
Compute and return the Euclidean norm .
Definition at line 3497 of file vpMatrix.cpp.
References vpArray2D< double >::data, and vpArray2D< double >::dsize.
|
inherited |
Compute the exponential matrix of a square matrix.
Definition at line 3317 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< double >::data, vpArray2D< Type >::data, vpException::dimensionError, vpMatrix::eye(), vpMatrix::inverseByLU(), vpArray2D< double >::rowNum, and vpMatrix::sum().
Referenced by vpTemplateTrackerWarpHomographySL3::computeCoeff().
|
inherited |
Set an m-by-n matrix to identity with ones on the diagonal and zeros else where.
Definition at line 194 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, and vpArray2D< double >::rowNum.
Referenced by vpServo::computeControlLaw(), vpServo::computeProjectionOperators(), vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), vpMbEdgeTracker::computeVVS(), vpMatrix::expm(), vpMatrix::eye(), vpTemplateTrackerWarpHomographySL3::getdW0(), vpTemplateTrackerWarpHomographySL3::getdWdp0(), vpFeatureThetaU::interaction(), vpMeLine::leastSquare(), vpPose::poseFromRectangle(), vpServo::setServo(), and vpMbTracker::vpMbTracker().
|
inherited |
Extract a column vector from a matrix.
j | : Index of the column to extract. If j=0, the first column is extracted. |
The following example shows how to use this function:
It produces the following output:
Definition at line 2250 of file vpMatrix.cpp.
References vpException::dimensionError, vpArray2D< double >::getCols(), and vpArray2D< double >::getRows().
Referenced by vpHomography::DLT(), vpMatrix::kernel(), vpPose::poseDementhonPlan(), vpPose::poseFromRectangle(), and vpServo::secondaryTaskJointLimitAvoidance().
|
inherited |
Extract a column vector from a matrix.
j | : Index of the column to extract. If col=0, the first column is extracted. |
i_begin | : Index of the row that gives the location of the first element of the column vector to extract. |
column_size | : Size of the column vector to extract. |
The following example shows how to use this function:
It produces the following output:
Definition at line 2200 of file vpMatrix.cpp.
References vpException::dimensionError, vpArray2D< double >::getCols(), and vpArray2D< double >::getRows().
|
inlineinherited |
Return the number of columns of the 2D array.
Definition at line 154 of file vpArray2D.h.
References vpArray2D< Type >::colNum.
Referenced by vpMatrix::csvPrint(), vpRotationMatrix::getCol(), vpHomogeneousMatrix::getCol(), vpMatrix::getCol(), vpMatrix::getRow(), vpMatrix::inverseByQRLapack(), vpMatrix::kernel(), vpMatrix::maplePrint(), vpRowVector::operator*(), vpRowVector::operator+(), vpRowVector::operator+=(), vpRowVector::operator-(), vpRowVector::operator-=(), vpForceTwistMatrix::print(), vpVelocityTwistMatrix::print(), vpRowVector::print(), vpMatrix::print(), vpMatrix::pseudoInverse(), and vpMatrix::svd().
|
inherited |
Return the array max value.
|
inherited |
Return the array min value.
|
inherited |
Extract a row vector from a matrix.
i | : Index of the row to extract. If i=0, the first row is extracted. |
The following example shows how to use this function:
It produces the following output:
Definition at line 2297 of file vpMatrix.cpp.
References vpException::dimensionError, vpArray2D< double >::getCols(), and vpArray2D< double >::getRows().
Referenced by vpMatrix::pseudoInverse().
|
inherited |
Extract a row vector from a matrix.
i | : Index of the row to extract. If i=0, the first row is extracted. |
j_begin | : Index of the column that gives the location of the first element of the row vector to extract. |
row_size | : Size of the row vector to extract. |
The following example shows how to use this function:
It produces the following output:
Definition at line 2346 of file vpMatrix.cpp.
References vpException::dimensionError, vpArray2D< double >::getCols(), and vpArray2D< double >::getRows().
|
inlineinherited |
Return the number of rows of the 2D array.
Definition at line 152 of file vpArray2D.h.
References vpArray2D< Type >::rowNum.
Referenced by vpMatrix::cppPrint(), vpMatrix::csvPrint(), vpRotationMatrix::getCol(), vpHomogeneousMatrix::getCol(), vpMatrix::getCol(), vpMatrix::getRow(), vpMatrix::inverseByCholeskyLapack(), vpMatrix::inverseByQRLapack(), vpMatrix::kernel(), vpMatrix::maplePrint(), vpMatrix::matlabPrint(), vpColVector::operator+(), vpColVector::operator+=(), vpColVector::operator-(), vpColVector::operator-=(), vpForceTwistMatrix::print(), vpVelocityTwistMatrix::print(), vpPoseVector::print(), vpColVector::print(), vpMatrix::print(), and vpMatrix::pseudoInverse().
|
inherited |
Compute and return the infinity norm with where is the matrix size.
Definition at line 3518 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
void vpSubMatrix::init | ( | vpMatrix & | m, |
const unsigned int & | row_offset, | ||
const unsigned int & | col_offset, | ||
const unsigned int & | nrows, | ||
const unsigned int & | ncols | ||
) |
Initialisation of vpMatrix.
Initialisation of a sub matrix.
m | : parent matrix |
row_offset | : row offset |
col_offset | : col offset |
nrows | : number of rows of the sub matrix |
ncols | : number of columns of the sub matrix |
Definition at line 72 of file vpSubMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< Type >::data, vpArray2D< double >::data, vpArray2D< double >::dsize, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpMatrixException::incorrectMatrixSizeError, parent, pColNum, pRowNum, vpArray2D< double >::rowNum, vpArray2D< double >::rowPtrs, vpMatrixException::subMatrixError, and vpERROR_TRACE.
|
inherited |
Initialize the matrix from a part of an input matrix M.
M | : Input matrix used for initialization. |
r | : row index in matrix M. |
c | : column index in matrix M. |
nrows | : Number of rows of the matrix that should be initialized. |
ncols | : Number of columns of the matrix that should be initialized. |
The sub-matrix starting from M[r][c] element and ending on M[r+nrows-1][c+ncols-1] element is used to initialize the matrix.
The following code shows how to use this function:
It produces the following output:
Definition at line 137 of file vpMatrix.cpp.
References vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< double >::resize(), and vpArray2D< double >::rowPtrs.
|
inlineinherited |
Definition at line 582 of file vpMatrix.h.
Referenced by vpMatrix::vpMatrix(), and vpSubMatrix().
|
inherited |
Insert matrix A at the given position in the current matrix.
A | : The matrix 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 2952 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), and vpArray2D< double >::rowNum.
Referenced by vpNurbs::curveKnotIns(), and vpMatrix::insert().
|
staticinherited |
Insert matrix B in matrix A at the given position.
A | : Main matrix. |
B | : Matrix to insert. |
r | : Index of the row where to add the matrix. |
c | : Index of the column where to add the matrix. |
Definition at line 2497 of file vpMatrix.cpp.
References vpMatrix::insert().
|
staticinherited |
Insert matrix B in matrix A at the given position.
A | : Main matrix. |
B | : Matrix to insert. |
C | : Result matrix. |
r | : Index of the row where to insert matrix B. |
c | : Index of the column where to insert matrix B. |
Definition at line 2526 of file vpMatrix.cpp.
References vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), and vpArray2D< Type >::resize().
|
inherited |
Compute the inverse of a n-by-n matrix using the Cholesky decomposition. The matrix must be real and symmetric. Only available if lapack is installed.
Here an example:
Definition at line 113 of file vpMatrix_cholesky.cpp.
References vpArray2D< double >::colNum, vpMatrix::inverseByCholeskyLapack(), vpMatrixException::matrixError, vpArray2D< double >::rowNum, and vpERROR_TRACE.
|
inherited |
Definition at line 55 of file vpMatrix_cholesky.cpp.
References vpException::badValue, vpArray2D< Type >::data, vpArray2D< Type >::getCols(), vpArray2D< double >::getRows(), and vpArray2D< Type >::getRows().
Referenced by vpMatrix::inverseByCholesky().
|
inherited |
Compute the inverse of a n-by-n matrix using the LU decomposition.
Here an example:
Definition at line 232 of file vpMatrix_lu.cpp.
References vpArray2D< double >::colNum, vpArray2D< Type >::getRows(), vpMatrixException::matrixError, vpArray2D< double >::rowNum, and vpERROR_TRACE.
Referenced by vpMatrix::expm(), vpKalmanFilter::filtering(), vpTemplateTrackerWarpHomographySL3::findWarp(), vpTemplateTrackerWarpAffine::getParamInverse(), vpTemplateTrackerTriangle::init(), vpTemplateTrackerSSDInverseCompositional::initCompInverse(), vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), vpTemplateTrackerMIForwardCompositional::initHessienDesired(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), vpTemplateTrackerMIESM::initHessienDesired(), vpTemplateTrackerMIForwardAdditional::initHessienDesired(), vpTemplateTrackerMIInverseCompositional::initHessienDesired(), vpTemplateTracker::setHDes(), vpTemplateTrackerSSDForwardCompositional::trackNoPyr(), vpTemplateTrackerMIForwardCompositional::trackNoPyr(), vpTemplateTrackerSSDForwardAdditional::trackNoPyr(), vpTemplateTrackerMIESM::trackNoPyr(), vpTemplateTrackerMIForwardAdditional::trackNoPyr(), and vpTemplateTrackerMIInverseCompositional::trackNoPyr().
|
inherited |
Compute the inverse of a n-by-n matrix using the QR decomposition. Only available if lapack is installed.
Here an example:
Definition at line 224 of file vpMatrix_qr.cpp.
References vpArray2D< double >::colNum, vpMatrix::inverseByQRLapack(), vpMatrixException::matrixError, vpArray2D< double >::rowNum, and vpERROR_TRACE.
|
inherited |
Definition at line 72 of file vpMatrix_qr.cpp.
References vpException::badValue, vpArray2D< Type >::data, vpArray2D< double >::getCols(), vpArray2D< double >::getRows(), and vpArray2D< Type >::getRows().
Referenced by vpMatrix::inverseByQR().
Juxtapose to matrices C = [ A B ].
A | : Left matrix. |
B | : Right matrix. |
Definition at line 2567 of file vpMatrix.cpp.
Juxtapose to matrices C = [ A B ].
A | : Left matrix. |
B | : Right matrix. |
C | : Juxtaposed matrix C = [ A B ] |
Definition at line 2594 of file vpMatrix.cpp.
References vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), and vpArray2D< Type >::resize().
|
inherited |
Function to compute the null space (the kernel) of the interaction matrix A which is not full rank. The null space ( the kernel ) of a matrix A is defined as Null(A) = Ker(A) = {X : A*X =0}.
kerA | : The matrix to contain the null space (kernel) of A defined by the row vectors (A*KerA.t()=0) |
svThreshold | : Specify the used threshold in the svd(...) function (a function to compute the singular value decomposition) |
Definition at line 3201 of file vpMatrix.cpp.
References vpException::dimensionError, vpMatrix::getCol(), vpArray2D< double >::getCols(), vpArray2D< double >::getRows(), vpArray2D< Type >::getRows(), vpArray2D< Type >::resize(), vpColVector::sumSquare(), and vpMatrix::svd().
Compute Kronecker product matrix.
m | : vpMatrix. |
out | : If m1.kron(m2) out contains the kronecker product's result : . |
Definition at line 1419 of file vpMatrix.cpp.
Referenced by vpMatrix::kron().
Compute Kronecker product matrix.
m | : vpMatrix; |
Definition at line 1461 of file vpMatrix.cpp.
References vpMatrix::kron().
Compute Kronecker product matrix.
Definition at line 1384 of file vpMatrix.cpp.
References vpArray2D< Type >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< Type >::rowNum, and vpERROR_TRACE.
Compute Kronecker product matrix.
Definition at line 1430 of file vpMatrix.cpp.
References vpArray2D< Type >::getCols(), 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 308 of file vpArray2D.h.
References vpException::badValue, and vpArray2D< Type >::resize().
|
inlinestaticinherited |
Load a matrix from a file. This function overloads vpArray2D::load().
filename | : absolute file name. |
M | : matrix 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 518 of file vpMatrix.h.
References vpArray2D< Type >::load().
Referenced by vpDot2::defineDots().
|
inlinestaticinherited |
Load a matrix from a YAML-formatted file. This function overloads vpArray2D::loadYAML().
filename | : absolute file name. |
M | : matrix to be loaded from the file. |
header | : Header of the file is loaded in this parameter. |
Definition at line 533 of file vpMatrix.h.
References vpArray2D< Type >::loadYAML().
|
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 392 of file vpArray2D.h.
References vpArray2D< Type >::resize().
|
inherited |
Print using MAPLE matrix input format.
Print using the following way so that this output can be directly copied into MAPLE:
Definition at line 2770 of file vpMatrix.cpp.
References vpArray2D< double >::getCols(), and vpArray2D< double >::getRows().
|
inherited |
Print using matlab syntax, to be put in matlab later.
Print using the following form:
Definition at line 2745 of file vpMatrix.cpp.
References vpArray2D< double >::getRows().
|
staticinherited |
Operation C = A * B.
The result is placed in the third parameter C and not returned. A new matrix won't be allocated for every use of the function (speed gain if used many times with the same result matrix size).
Definition at line 658 of file vpMatrix.cpp.
References vpArray2D< Type >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< Type >::resize(), vpArray2D< Type >::rowNum, and vpArray2D< Type >::rowPtrs.
Referenced by vpMatrix::operator*().
|
staticinherited |
Operation C = A * B.
The result is placed in the third parameter C and not returned. A new matrix won't be allocated for every use of the function (speed gain if used many times with the same result matrix size).
vpException::dimensionError | If matrices are not 3-by-3 dimension. |
Definition at line 704 of file vpMatrix.cpp.
References vpArray2D< Type >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< Type >::rowNum, and vpArray2D< Type >::rowPtrs.
|
staticinherited |
Operation C = A * B.
The result is placed in the third parameter C and not returned. A new matrix won't be allocated for every use of the function (speed gain if used many times with the same result matrix size).
vpException::dimensionError | If matrices are not 4-by-4 dimension. |
Definition at line 743 of file vpMatrix.cpp.
References vpArray2D< Type >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< Type >::rowNum, and vpArray2D< Type >::rowPtrs.
|
staticinherited |
Operation C = A * B.
The result is placed in the third parameter C and not returned. A new matrix won't be allocated for every use of the function (speed gain if used many times with the same result matrix size).
Definition at line 781 of file vpMatrix.cpp.
References vpMatrix::multMatrixVector().
|
staticinherited |
Operation w = A * v (v and w are vectors).
A new matrix won't be allocated for every use of the function (Speed gain if used many times with the same result matrix size).
Definition at line 621 of file vpMatrix.cpp.
References vpArray2D< Type >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpColVector::resize(), vpArray2D< Type >::rowNum, and vpArray2D< Type >::rowPtrs.
Referenced by vpMatrix::mult2Matrices(), and vpMatrix::operator*().
Operation C = -A.
The result is placed in the second parameter C and not returned. A new matrix won't be allocated for every use of the function (Speed gain if used many times with the same result matrix size).
Definition at line 1139 of file vpMatrix.cpp.
References vpArray2D< Type >::colNum, vpArray2D< Type >::resize(), vpArray2D< Type >::rowNum, and vpArray2D< Type >::rowPtrs.
Referenced by vpMatrix::operator-().
Operation C = A * B (A is unchanged).
Definition at line 790 of file vpMatrix.cpp.
References vpMatrix::mult2Matrices().
|
inherited |
Operator that allow to multiply a matrix by a rotation matrix. The matrix should be of dimension m-by-3.
Definition at line 803 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
|
inherited |
Operator that allow to multiply a matrix by a velocity twist matrix. The matrix should be of dimension m-by-6.
Definition at line 832 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
|
inherited |
Operator that allow to multiply a matrix by a force/torque twist matrix. The matrix should be of dimension m-by-6.
Definition at line 861 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
|
inherited |
Operator that allows to multiply a matrix by a translation vector. The matrix should be of dimension (3x3)
Definition at line 580 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
|
inherited |
Operation w = A * v (matrix A is unchanged, v and w are column vectors).
Definition at line 606 of file vpMatrix.cpp.
References vpMatrix::multMatrixVector().
|
inherited |
Operator that allows to multiply all the elements of a matrix by a scalar.
Definition at line 1218 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
|
inherited |
Multiply all the element of the matrix by x : Aij = Aij * x.
Operator that allows to multiply all the elements of a matrix by a scalar.
Definition at line 1281 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
Operation C = A + B (A is unchanged).
Definition at line 998 of file vpMatrix.cpp.
References vpMatrix::add2Matrices().
Operation A = A + B.
Definition at line 1096 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< double >::rowNum, vpArray2D< Type >::rowPtrs, and vpArray2D< double >::rowPtrs.
|
inherited |
Add x to all the element of the matrix : Aij = Aij + x.
Definition at line 1257 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
Operation C = A - B (A is unchanged).
Definition at line 1087 of file vpMatrix.cpp.
References vpMatrix::sub2Matrices().
|
inherited |
Operation C = -A (A is unchanged).
Definition at line 1161 of file vpMatrix.cpp.
References vpMatrix::negateMatrix().
Operation A = A - B.
Definition at line 1114 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< double >::rowNum, vpArray2D< Type >::rowPtrs, and vpArray2D< double >::rowPtrs.
|
inherited |
Substract x to all the element of the matrix : Aij = Aij - x.
Definition at line 1268 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
|
inherited |
Cij = Aij / x (A is unchanged)
Definition at line 1230 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpException::divideByZeroError, vpArray2D< Type >::resize(), vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
|
inherited |
Divide all the element of the matrix by x : Aij = Aij / x.
Definition at line 1291 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpException::divideByZeroError, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
|
inherited |
Assigment from an array of double. This methos has to be used carefully since the array allocated behind x pointer should have the same dimension than the matrix.
Definition at line 446 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
vpSubMatrix & vpSubMatrix::operator= | ( | const vpSubMatrix & | B | ) |
Operation such as subA = subB.
Operation A = B.
B | : a subMatrix |
Definition at line 143 of file vpSubMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpMatrixException::incorrectMatrixSizeError, vpArray2D< double >::rowNum, vpArray2D< double >::rowPtrs, vpArray2D< Type >::rowPtrs, and vpERROR_TRACE.
vpSubMatrix & vpSubMatrix::operator= | ( | const vpMatrix & | B | ) |
Operation such as subA = B.
Operation A = B.
B | : a matrix |
Definition at line 123 of file vpSubMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpMatrixException::incorrectMatrixSizeError, vpArray2D< double >::rowNum, vpArray2D< double >::rowPtrs, and vpERROR_TRACE.
vpSubMatrix & vpSubMatrix::operator= | ( | const double & | x | ) |
Operation such as subA = x.
Operation A = x.
x | : a scalar |
Definition at line 166 of file vpSubMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
|
inlineinherited |
Set element using A[i][j] = x.
Definition at line 259 of file vpArray2D.h.
|
inlineinherited |
Get element using x = A[i][j].
Definition at line 261 of file vpArray2D.h.
|
inherited |
Pretty print a matrix. 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 matrix 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 matrix. Can be set to zero (or omitted), in which case the introduction is not printed. |
Definition at line 2649 of file vpMatrix.cpp.
References vpArray2D< double >::getCols(), vpArray2D< double >::getRows(), and vpMath::maximum().
|
inlineinherited |
Definition at line 417 of file vpMatrix.h.
References vpArray2D< Type >::getCols(), and vpArray2D< Type >::getRows().
|
inherited |
Compute the pseudo inverse of the matrix using the SVD.
Compute and return the pseudo inverse of a n-by-m matrix :
svThreshold | : Threshold used to test the singular values. |
Here an example to compute the inverse of a n-by-n matrix. If the matrix is n-by-n it is also possible to use inverseByLU().
Definition at line 1756 of file vpMatrix.cpp.
Referenced by vpCalibration::calibrationTsai(), vpSimulatorAfma6::computeArticularVelocity(), vpSimulatorViper850::computeArticularVelocity(), vpServo::computeControlLaw(), vpMatrix::computeCovarianceMatrix(), vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), vpMbEdgeTracker::computeVVS(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), vpMeEllipse::initTracking(), vpHomography::inverse(), vpMeLine::leastSquare(), vpPose::poseDementhonNonPlan(), vpPose::poseFromRectangle(), vpPose::poseVirtualVS(), vpMatrix::pseudoInverse(), vpHomography::robust(), and vpMatrix::solveBySVD().
|
inherited |
Compute the pseudo inverse of the matrix using the SVD. return the rank
Compute the pseudo inverse of the matrix
Ap | : The pseudo inverse . |
svThreshold | : Threshold used to test the singular values. |
Definition at line 1716 of file vpMatrix.cpp.
References vpMatrix::pseudoInverse().
|
inherited |
Compute the pseudo inverse of the matrix using the SVD. return the rank and the singular value
Compute the pseudo inverse of the matrix
Ap | : The pseudo inverse . |
sv | : Singular values. |
svThreshold | : Threshold used to test the singular values. |
Definition at line 1772 of file vpMatrix.cpp.
References vpMatrix::pseudoInverse().
|
inherited |
Compute the pseudo inverse of the matrix using the SVD. return the rank and the singular value, image
Compute the pseudo inverse of the matrix along with Ker A, Ker , Im A and Im
Pseudo inverse, kernel and image are computed using the SVD decomposition.
A is an m x n matrix, if m >=n the svd works on A other wise it works on .
Therefore if m>=n we have
where Im(A) is an m x r matrix (r is the rank of A) and Im(A^T) is an r x n matrix
Ap | : The pseudo inverse . |
sv | : Singular values. |
svThreshold | : Threshold used to test the singular values. |
imAt | : Image A^T |
imA | Image A |
Definition at line 1810 of file vpMatrix.cpp.
References vpArray2D< double >::getCols(), vpArray2D< double >::getRows(), vpArray2D< Type >::resize(), vpColVector::resize(), vpMatrix::svd(), and vpMatrix::t().
|
inherited |
Compute the pseudo inverse of the matrix using the SVD. return the rank and the singular value, image, kernel.
Compute the pseudo inverse of the matrix along with Ker A, Ker , Im A and Im
Pseudo inverse, kernel and image are computed using the SVD decomposition.
A is an m x n matrix, if m >=n the svd works on A other wise it works on .
Therefore if m>=n we have
where Im(A) is an m x r matrix (r is the rank of A) and Im(A^T) is an r x n matrix
Ap | : The pseudo inverse . |
sv | : Singular values. |
svThreshold | : Threshold used to test the singular values. |
imA | Image A |
imAt | : Image A^T |
kerA | : null space of A |
Definition at line 1986 of file vpMatrix.cpp.
References vpArray2D< double >::getCols(), vpArray2D< Type >::getCols(), vpMatrix::getRow(), vpArray2D< double >::getRows(), vpArray2D< Type >::resize(), vpColVector::resize(), vpRowVector::sumSquare(), vpMatrix::svd(), and vpMatrix::t().
|
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. |
Definition at line 167 of file vpArray2D.h.
References vpArray2D< Type >::colNum, vpArray2D< Type >::dsize, vpException::memoryAllocationError, vpArray2D< Type >::rowNum, and vpArray2D< Type >::rowPtrs.
Referenced by vpMatrix::diag(), vpMatrix::eye(), vpMatrix::init(), and vpMatrix::operator=().
|
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 468 of file vpArray2D.h.
References vpArray2D< Type >::getCols(), and vpArray2D< Type >::getRows().
|
inlinestaticinherited |
Save a matrix to a file. This function overloads vpArray2D::load().
filename | : absolute file name. |
M | : matrix to be saved. |
binary | : If true the matrix is save 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 550 of file vpMatrix.h.
References vpArray2D< Type >::save().
Referenced by vpDot2::defineDots().
|
inlinestaticinherited |
Save a matrix in a YAML-formatted file. This function overloads vpArray2D::saveYAML().
filename | : absolute file name. |
M | : matrix 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. |
Definition at line 567 of file vpMatrix.h.
References vpArray2D< Type >::saveYAML().
|
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 560 of file vpArray2D.h.
References vpArray2D< Type >::getCols(), and vpArray2D< Type >::getRows().
|
inherited |
Set the matrix diagonal elements to val. More generally set M[i][i] = val.
Definition at line 209 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, and vpArray2D< double >::rowNum.
Referenced by vpServo::secondaryTask().
|
inlineinherited |
Return the number of elements of the 2D array.
Definition at line 156 of file vpArray2D.h.
References vpArray2D< Type >::rowNum.
Referenced by vpRowVector::insert(), vpColVector::insert(), and vpColVector::operator*().
|
inherited |
Solve a linear system using Singular Value Decomposition (SVD).
Non destructive wrt. A and B.
b | : Vector . |
x | : Vector . |
Here an example:
Definition at line 1517 of file vpMatrix.cpp.
References vpMatrix::pseudoInverse().
Referenced by vpMatrix::solveBySVD().
|
inherited |
Solve a linear system using Singular Value Decomposition (SVD).
Non destructive wrt. A and B.
B | : Vector . |
Here an example:
Definition at line 1572 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, and vpMatrix::solveBySVD().
|
inherited |
Stack A at the end of the current matrix, or copy if the matrix has no dimensions : this = [ this A ]^T.
Here an example for a robot velocity log :
Definition at line 2922 of file vpMatrix.cpp.
References vpArray2D< double >::rowNum.
Referenced by vpCalibration::calibrationTsai(), vpMbEdgeKltTracker::computeVVS(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureSegment::interaction(), vpGenericFeature::interaction(), vpFeatureMoment::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeatureThetaU::interaction(), vpFeaturePointPolar::interaction(), vpFeatureTranslation::interaction(), vpMatrix::stack(), vpColVector::stackMatrices(), and vpMatrix::stackMatrices().
|
inherited |
Stack row vector r at the end of the current matrix, or copy if the matrix has no dimensions : this = [ this r ]^T.
Definition at line 2933 of file vpMatrix.cpp.
References vpArray2D< double >::rowNum, and vpMatrix::stack().
Stack matrix B to the end of matrix A and return the resulting matrix [ A B ]^T
A | : Upper matrix. |
B | : Lower matrix. |
Definition at line 2366 of file vpMatrix.cpp.
References vpMatrix::stack().
|
staticinherited |
Stack row vector r to matrix A and return the resulting matrix [ A r ]^T
A | : Upper matrix. |
r | : Lower matrix. |
Definition at line 2390 of file vpMatrix.cpp.
References vpMatrix::stack().
Stack matrix B to the end of matrix A and return the resulting matrix in C.
A | : Upper matrix. |
B | : Lower matrix. |
C | : Stacked matrix C = [ A B ]^T |
Definition at line 2414 of file vpMatrix.cpp.
References vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), and vpArray2D< Type >::resize().
|
staticinherited |
Stack row vector v to the end of matrix A and return the resulting matrix in C.
A | : Upper matrix. |
r | : Lower row vector. |
C | : Stacked matrix C = [ A r ]^T |
Definition at line 2456 of file vpMatrix.cpp.
References vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), and vpArray2D< Type >::resize().
|
inherited |
Stacks columns of a matrix in a vector.
out | : a vpColVector. |
Definition at line 1320 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< Type >::colNum, vpArray2D< Type >::data, vpColVector::resize(), vpArray2D< Type >::rowNum, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
|
inherited |
Stacks columns of a matrix in a vector.
Definition at line 1341 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, and vpArray2D< double >::rowNum.
|
inlineinherited |
Definition at line 586 of file vpMatrix.h.
|
inlinestaticinherited |
Definition at line 590 of file vpMatrix.h.
References vpMatrix::stack().
|
inlinestaticinherited |
Definition at line 594 of file vpMatrix.h.
References vpMatrix::stack().
|
staticinherited |
Definition at line 3565 of file vpMatrix.cpp.
References vpMatrix::stack().
|
staticinherited |
Definition at line 3570 of file vpMatrix.cpp.
References vpMatrix::stack().
|
staticinherited |
Definition at line 3555 of file vpMatrix.cpp.
References vpColVector::stack().
|
staticinherited |
Definition at line 3560 of file vpMatrix.cpp.
References vpColVector::stack().
|
inherited |
Stacks rows of a matrix in a vector
out | : a vpRowVector. |
Definition at line 1352 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< double >::data, vpArray2D< Type >::data, vpArray2D< double >::dsize, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpRowVector::resize(), and vpArray2D< double >::rowNum.
|
inherited |
Stacks rows of a matrix in a vector.
Definition at line 1371 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, and vpArray2D< double >::rowNum.
|
staticinherited |
Operation C = A - B.
The result is placed in the third parameter C and not returned. A new matrix won't be allocated for every use of the function (speed gain if used many times with the same result matrix size).
vpException::dimensionError | If A and B matrices have not the same size. |
Definition at line 1057 of file vpMatrix.cpp.
References vpArray2D< Type >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< Type >::resize(), vpArray2D< Type >::rowNum, and vpArray2D< Type >::rowPtrs.
Referenced by vpMatrix::operator-().
|
staticinherited |
Operation C = A - B on column vectors.
The result is placed in the third parameter C and not returned. A new vector won't be allocated for every use of the function (speed gain if used many times with the same result matrix size).
vpException::dimensionError | If A and B vectors have not the same size. |
Definition at line 1020 of file vpMatrix.cpp.
References vpArray2D< Type >::colNum, vpException::dimensionError, vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpColVector::resize(), vpArray2D< Type >::rowNum, and vpArray2D< Type >::rowPtrs.
|
inherited |
Return the sum of all the elements of the matrix.
Definition at line 1170 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
Referenced by vpMatrix::expm().
|
inherited |
Return the sum square of all the elements of the matrix .
Definition at line 3539 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< double >::rowNum, and vpArray2D< double >::rowPtrs.
|
inherited |
Singular value decomposition (SVD).
w | : Vector of singular values. . |
v | : Matrix . |
Here an example of SVD decomposition of a non square Matrix M.
Definition at line 1646 of file vpMatrix.cpp.
References vpArray2D< double >::getCols(), vpArray2D< Type >::getCols(), vpArray2D< Type >::getRows(), vpArray2D< Type >::resize(), and vpColVector::resize().
Referenced by vpMatrix::cond(), vpHomography::DLT(), vpMatrix::kernel(), vpPose::poseDementhonPlan(), and vpMatrix::pseudoInverse().
|
inherited |
Compute and return the transpose of the matrix.
Definition at line 221 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< Type >::resize(), and vpArray2D< double >::rowNum.
Referenced by vpCalibration::calibrationTsai(), vpServo::computeControlLaw(), vpMatrix::computeCovarianceMatrix(), vpTemplateTracker::computeOptimalBrentGain(), vpMatrix::eigenValues(), vpKalmanFilter::filtering(), vpTemplateTrackerWarpHomographySL3::findWarp(), vpPose::poseDementhonNonPlan(), vpPose::poseDementhonPlan(), vpKalmanFilter::prediction(), and vpMatrix::pseudoInverse().
|
inherited |
Compute and return the transpose of the matrix.
Definition at line 247 of file vpMatrix.cpp.
Referenced by vpServo::computeProjectionOperators(), vpTemplateTrackerWarpSRT::getParamInverse(), and vpTemplateTrackerWarpRT::getParamInverse().
|
inherited |
Compute At the transpose of the matrix.
At | (output) : Resulting transpose matrix. |
Definition at line 259 of file vpMatrix.cpp.
References vpArray2D< double >::colNum, vpArray2D< Type >::resize(), vpArray2D< double >::rowNum, vpArray2D< Type >::rowPtrs, and vpArray2D< double >::rowPtrs.
Allow to multiply a scalar by a matrix.
Definition at line 1200 of file vpMatrix.cpp.
References vpArray2D< Type >::getCols(), and vpArray2D< Type >::getRows().
|
related |
Enumeration of the operations applied on matrices in vpGEMM() function.
Operations are :
|
protectedinherited |
Number of columns in the array.
Definition at line 76 of file vpArray2D.h.
Referenced by vpMatrix::AAt(), vpMatrix::AtA(), vpColVector::clear(), vpMatrix::diag(), vpMatrix::eigenValues(), vpMatrix::expm(), vpMatrix::eye(), vpMatrix::infinityNorm(), vpSubColVector::init(), vpSubRowVector::init(), init(), vpRowVector::insert(), vpMatrix::insert(), vpMatrix::inverseByCholesky(), vpMatrix::inverseByLU(), vpMatrix::inverseByQR(), vpRotationMatrix::operator*(), vpRowVector::operator*(), vpMatrix::operator*(), vpRotationMatrix::operator*=(), vpRowVector::operator*=(), vpMatrix::operator*=(), vpRowVector::operator+(), vpRowVector::operator+=(), vpMatrix::operator+=(), vpRowVector::operator-(), vpRowVector::operator-=(), vpMatrix::operator-=(), vpRowVector::operator/(), vpMatrix::operator/(), vpRowVector::operator/=(), vpMatrix::operator/=(), vpMatrix::operator<<(), vpColVector::operator<<(), vpSubRowVector::operator=(), operator=(), vpRowVector::operator=(), vpMatrix::operator=(), vpRowVector::reshape(), vpMatrix::setIdentity(), vpMatrix::solveBySVD(), vpRowVector::stack(), vpMatrix::stackColumns(), vpMatrix::stackRows(), vpMatrix::sum(), vpRowVector::sumSquare(), vpMatrix::sumSquare(), vpRowVector::t(), vpMatrix::t(), and vpMatrix::transpose().
|
inherited |
Address of the first element of the data array.
Definition at line 84 of file vpArray2D.h.
Referenced by vpMatrix::AtA(), vpHomogeneousMatrix::buildFrom(), vpRzyxVector::buildFrom(), vpRzyzVector::buildFrom(), vpRxyzVector::buildFrom(), vpThetaUVector::buildFrom(), vpSubColVector::checkParentStatus(), vpSubRowVector::checkParentStatus(), checkParentStatus(), vpColVector::clear(), vpHomogeneousMatrix::convert(), vpTranslationVector::euclideanNorm(), vpRowVector::euclideanNorm(), vpColVector::euclideanNorm(), vpMatrix::euclideanNorm(), vpMatrix::expm(), vpThetaUVector::extract(), vpSubColVector::init(), vpSubRowVector::init(), init(), vpTranslationVector::operator*(), vpRowVector::operator*(), vpColVector::operator*(), vpHomography::operator*(), vpTranslationVector::operator-(), vpRowVector::operator-(), vpColVector::operator-(), vpTranslationVector::operator/(), vpRowVector::operator/(), vpColVector::operator/(), vpHomography::operator/(), vpHomography::operator/=(), vpSubColVector::operator=(), vpSubRowVector::operator=(), vpTranslationVector::operator=(), vpRowVector::operator=(), vpColVector::operator=(), vpRzyxVector::operator=(), vpRzyzVector::operator=(), vpRxyzVector::operator=(), vpMatrix::operator=(), vpThetaUVector::operator=(), vpColVector::operator[](), vpRowVector::reshape(), vpColVector::reshape(), vpQuaternionVector::set(), vpMatrix::stackRows(), vpRotationVector::t(), vpTranslationVector::t(), vpPoseVector::t(), vpRowVector::t(), vpColVector::t(), vpQuaternionVector::w(), vpQuaternionVector::x(), vpQuaternionVector::y(), vpQuaternionVector::z(), vpSubColVector::~vpSubColVector(), ~vpSubMatrix(), and vpSubRowVector::~vpSubRowVector().
|
protectedinherited |
Current array size (rowNum * colNum)
Definition at line 80 of file vpArray2D.h.
Referenced by vpColVector::clear(), vpTranslationVector::euclideanNorm(), vpRowVector::euclideanNorm(), vpColVector::euclideanNorm(), vpMatrix::euclideanNorm(), vpSubColVector::init(), vpSubRowVector::init(), init(), vpTranslationVector::operator*(), vpRotationVector::operator*(), vpTranslationVector::operator-(), vpTranslationVector::operator/(), vpRzyzVector::operator=(), vpRzyxVector::operator=(), vpRxyzVector::operator=(), vpMatrix::operator=(), vpThetaUVector::operator=(), vpRowVector::reshape(), vpColVector::reshape(), vpMatrix::stackRows(), and vpRotationVector::t().
|
protected |
Definition at line 76 of file vpSubMatrix.h.
Referenced by checkParentStatus(), and init().
|
protected |
Definition at line 75 of file vpSubMatrix.h.
Referenced by checkParentStatus(), and init().
|
protected |
Definition at line 74 of file vpSubMatrix.h.
Referenced by checkParentStatus(), and init().
|
protectedinherited |
Number of rows in the array.
Definition at line 74 of file vpArray2D.h.
Referenced by vpMatrix::AAt(), vpMatrix::AtA(), vpColVector::clear(), vpMatrix::diag(), vpMatrix::eigenValues(), vpMatrix::expm(), vpColVector::extract(), vpMatrix::eye(), vpColVector::infinityNorm(), vpMatrix::infinityNorm(), vpSubColVector::init(), vpSubRowVector::init(), init(), vpMatrix::insert(), vpMatrix::inverseByCholesky(), vpMatrix::inverseByLU(), vpMatrix::inverseByQR(), vpRotationMatrix::operator*(), vpTranslationVector::operator*(), vpHomogeneousMatrix::operator*(), vpColVector::operator*(), vpMatrix::operator*(), vpRotationMatrix::operator*=(), vpTranslationVector::operator*=(), vpColVector::operator*=(), vpMatrix::operator*=(), vpColVector::operator+(), vpColVector::operator+=(), vpMatrix::operator+=(), vpColVector::operator-(), vpColVector::operator-=(), vpMatrix::operator-=(), vpColVector::operator/(), vpMatrix::operator/(), vpTranslationVector::operator/=(), vpColVector::operator/=(), vpMatrix::operator/=(), vpMatrix::operator<<(), vpColVector::operator<<(), vpSubColVector::operator=(), vpSubRowVector::operator=(), operator=(), vpTranslationVector::operator=(), vpRowVector::operator=(), vpColVector::operator=(), vpMatrix::operator=(), vpColVector::reshape(), vpMatrix::setIdentity(), vpMatrix::stack(), vpColVector::stack(), vpMatrix::stackColumns(), vpMatrix::stackRows(), vpMatrix::sum(), vpRotationVector::sumSquare(), vpTranslationVector::sumSquare(), vpColVector::sumSquare(), vpMatrix::sumSquare(), vpTranslationVector::t(), vpPoseVector::t(), vpColVector::t(), vpMatrix::t(), and vpMatrix::transpose().
|
protectedinherited |
Address of the first element of each rows.
Definition at line 78 of file vpArray2D.h.
Referenced by vpMatrix::AAt(), vpColVector::clear(), vpMatrix::infinityNorm(), vpSubColVector::init(), vpSubRowVector::init(), init(), vpRowVector::init(), vpColVector::init(), vpMatrix::init(), vpRotationMatrix::operator*(), vpForceTwistMatrix::operator*(), vpVelocityTwistMatrix::operator*(), vpHomogeneousMatrix::operator*(), vpMatrix::operator*(), vpRotationMatrix::operator*=(), vpMatrix::operator*=(), vpMatrix::operator+=(), vpMatrix::operator-=(), vpMatrix::operator/(), vpMatrix::operator/=(), vpMatrix::operator<<(), vpColVector::operator<<(), operator=(), vpRotationMatrix::operator=(), vpForceTwistMatrix::operator=(), vpVelocityTwistMatrix::operator=(), vpHomogeneousMatrix::operator=(), vpRowVector::operator=(), vpMatrix::operator=(), vpMatrix::stackColumns(), vpMatrix::sum(), vpRotationVector::sumSquare(), vpTranslationVector::sumSquare(), vpRowVector::sumSquare(), vpColVector::sumSquare(), vpMatrix::sumSquare(), and vpMatrix::transpose().