ViSP
2.9.0
|
#include <vpMatrix.h>
Public Types | |
enum | vpDetMethod { LU_DECOMPOSITION } |
Public Member Functions | |
vpMatrix () | |
vpMatrix (unsigned int r, unsigned int c) | |
vpMatrix (const vpMatrix &m, unsigned int r, unsigned int c, unsigned int nrows, unsigned int ncols) | |
vpMatrix (const vpHomography &H) | |
virtual | ~vpMatrix () |
void | init () |
void | kill () |
void | eye (unsigned int n) |
void | eye (unsigned int m, unsigned int n) |
void | setIdentity (const double &val=1.0) |
void | insert (const vpMatrix &A, const unsigned int r, const unsigned int c) |
void | stackMatrices (const vpMatrix &A) |
Set/get Matrix size | |
unsigned int | getRows () const |
unsigned int | getCols () const |
void | resize (const unsigned int nrows, const unsigned int ncols, const bool nullify=true) |
double | getMinValue () const |
double | getMaxValue () const |
Printing | |
int | print (std::ostream &s, unsigned int length, char const *intro=0) |
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 () |
Copy / assignment | |
vpMatrix (const vpMatrix &m) | |
vpMatrix & | operator<< (double *) |
vpMatrix & | operator= (const vpMatrix &B) |
vpMatrix & | operator= (const vpHomography &H) |
vpMatrix & | operator= (const double x) |
void | diag (const vpColVector &A) |
Access/modification operators | |
double * | operator[] (unsigned int i) |
double * | operator[] (unsigned int i) const |
Matrix operations | |
vpMatrix & | operator+= (const vpMatrix &B) |
vpMatrix & | operator-= (const vpMatrix &B) |
vpMatrix | operator* (const vpMatrix &B) const |
vpMatrix | operator* (const vpHomography &H) const |
vpMatrix | operator+ (const vpMatrix &B) const |
vpMatrix | operator- (const vpMatrix &B) const |
vpMatrix | operator- () const |
vpColVector | operator* (const vpColVector &b) const |
vpTranslationVector | operator* (const vpTranslationVector &b) const |
vpMatrix & | operator+= (const double x) |
vpMatrix & | operator-= (const double x) |
vpMatrix & | operator*= (const double x) |
vpMatrix & | operator/= (double x) |
vpMatrix | operator* (const double x) const |
vpMatrix | operator/ (const double x) const |
double | sumSquare () const |
double | det (vpDetMethod method=LU_DECOMPOSITION) const |
vpMatrix | expm () |
Columns, Rows extraction, Submatrix | |
vpRowVector | row (const unsigned int i) |
vpColVector | column (const unsigned int j) |
void | init (const vpMatrix &m, unsigned int r, unsigned int c, unsigned int nrows, unsigned int ncols) |
Transpose, Identity | |
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 |
Kronecker product | |
void | stackColumns (vpColVector &out) |
vpColVector | stackColumns () |
void | stackRows (vpRowVector &out) |
vpRowVector | stackRows () |
void | kron (const vpMatrix &m1, vpMatrix &out) |
vpMatrix | kron (const vpMatrix &m1) |
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) |
double | cond () |
Eigen values | |
vpColVector | eigenValues () |
void | eigenValues (vpColVector &evalue, vpMatrix &evector) |
Norms | |
double | euclideanNorm () const |
double | infinityNorm () const |
Static Public Member Functions | |
static void | add2Matrices (const vpMatrix &A, const vpMatrix &B, vpMatrix &C) |
static void | add2WeightedMatrices (const vpMatrix &A, const double &wA, const vpMatrix &B, const double &wB, vpMatrix &C) |
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 void | computeHLM (const vpMatrix &H, const double &alpha, vpMatrix &HLM) |
static void | createDiagonalMatrix (const vpColVector &A, vpMatrix &DA) |
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) |
static vpMatrix | juxtaposeMatrices (const vpMatrix &A, const vpMatrix &B) |
static void | juxtaposeMatrices (const vpMatrix &A, const vpMatrix &B, vpMatrix &C) |
static void | kron (const vpMatrix &m1, const vpMatrix &m2, vpMatrix &out) |
static vpMatrix | kron (const vpMatrix &m1, const vpMatrix &m2) |
static bool | loadMatrix (std::string filename, vpMatrix &M, const bool binary=false, char *Header=NULL) |
static bool | loadMatrix (const char *filename, vpMatrix &M, const bool binary=false, char *Header=NULL) |
static void | mult2Matrices (const vpMatrix &A, const vpMatrix &B, vpMatrix &C) |
static void | multMatrixVector (const vpMatrix &A, const vpColVector &b, vpColVector &c) |
static void | negateMatrix (const vpMatrix &A, vpMatrix &C) |
static bool | saveMatrix (std::string filename, const vpMatrix &M, const bool binary=false, const char *Header="") |
static bool | saveMatrix (const char *filename, const vpMatrix &M, const bool binary=false, const char *Header="") |
static bool | saveMatrixYAML (std::string filename, const vpMatrix &M, const char *header="") |
static bool | saveMatrixYAML (const char *filename, const vpMatrix &M, const char *header="") |
static bool | loadMatrixYAML (std::string filename, vpMatrix &M, char *header=NULL) |
static bool | loadMatrixYAML (const char *filename, vpMatrix &M, char *header=NULL) |
static vpMatrix | stackMatrices (const vpMatrix &A, const vpMatrix &B) |
static void | stackMatrices (const vpMatrix &A, const vpMatrix &B, vpMatrix &C) |
static void | sub2Matrices (const vpMatrix &A, const vpMatrix &B, vpMatrix &C) |
Public Attributes | |
double * | data |
Protected Attributes | |
unsigned int | rowNum |
unsigned int | colNum |
double ** | rowPtrs |
unsigned int | dsize |
unsigned int | trsize |
Friends | |
VISP_EXPORT std::ostream & | operator<< (std::ostream &s, const vpMatrix &m) |
Related Functions | |
(Note that these are not member functions.) | |
enum | vpGEMMmethod |
void | vpGEMM (const vpMatrix &A, const vpMatrix &B, const double &alpha, const vpMatrix &C, const double &beta, vpMatrix &D, const unsigned int &ops=0) |
vpMatrix | operator* (const double &x, const vpMatrix &B) |
void | skew (const vpTranslationVector &t, vpMatrix &M) |
Definition of the vpMatrix class.
vpMatrix class provides a data structure for the matrices as well as a set of operations on these matrices
Definition at line 98 of file vpMatrix.h.
Method used to compute the determinant of a square matrix.
Enumerator | |
---|---|
LU_DECOMPOSITION |
LU decomposition method. |
Definition at line 105 of file vpMatrix.h.
vpMatrix::vpMatrix | ( | ) |
Basic constructor.
basic constructor of the matrix class Construction of the object matrix. Number of columns and rows are zero.
Definition at line 116 of file vpMatrix.cpp.
Referenced by vpColVector::operator*().
vpMatrix::vpMatrix | ( | unsigned int | r, |
unsigned int | c | ||
) |
Constructor. Initialization of A as an r x c matrix with 0.
Constructor.
Initialize a matrix with 0.
r | : Matrix number of rows. |
c | : Matrix number of columns. |
Definition at line 130 of file vpMatrix.cpp.
References resize().
vpMatrix::vpMatrix | ( | const vpMatrix & | m, |
unsigned int | r, | ||
unsigned int | c, | ||
unsigned int | nrows, | ||
unsigned int | ncols | ||
) |
sub vpMatrix constructor
submatrix constructor
Definition at line 145 of file vpMatrix.cpp.
References colNum, init(), rowNum, vpMatrixException::subMatrixError, and vpERROR_TRACE.
vpMatrix::vpMatrix | ( | const vpHomography & | H | ) |
Definition at line 136 of file vpMatrix.cpp.
|
virtual |
vpMatrix::vpMatrix | ( | const vpMatrix & | m | ) |
vpMatrix vpMatrix::AAt | ( | ) | const |
Computes the operation
Definition at line 1297 of file vpMatrix.cpp.
void vpMatrix::AAt | ( | vpMatrix & | B | ) | const |
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 1317 of file vpMatrix.cpp.
References colNum, resize(), rowNum, rowPtrs, vpCERROR, and vpERROR_TRACE.
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 542 of file vpMatrix.cpp.
References colNum, getCols(), getRows(), vpMatrixException::incorrectMatrixSizeError, resize(), rowNum, rowPtrs, and vpERROR_TRACE.
Referenced by operator+().
|
static |
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 503 of file vpMatrix.cpp.
References colNum, getCols(), getRows(), vpMatrixException::incorrectMatrixSizeError, resize(), rowNum, rowPtrs, and vpERROR_TRACE.
vpMatrix vpMatrix::AtA | ( | ) | const |
Compute the AtA operation such as
Definition at line 1408 of file vpMatrix.cpp.
Referenced by vpCalibration::calibrationTsai(), vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), vpTemplateTrackerWarpHomographySL3::findWarp(), and vpNurbs::globalCurveApprox().
void vpMatrix::AtA | ( | vpMatrix & | B | ) | const |
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 1360 of file vpMatrix.cpp.
References colNum, data, resize(), rowNum, vpCERROR, and vpERROR_TRACE.
vpColVector vpMatrix::column | ( | const unsigned int | j | ) |
Column extraction.
Return the ith columns of the matrix.
Definition at line 2289 of file vpMatrix.cpp.
References getRows().
Referenced by vpHomography::DLT(), vpPose::poseDementhonPlan(), and vpPose::poseFromRectangle().
|
static |
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 56 of file vpMatrix_covariance.cpp.
References pseudoInverse(), vpColVector::t(), and t().
Referenced by vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), vpMbEdgeTracker::computeVVS(), vpPose::poseVirtualVS(), and vpPose::poseVirtualVSrobust().
|
static |
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 74 of file vpMatrix_covariance.cpp.
References pseudoInverse(), and t().
Compute
H | : input Matrix . This matrix should be square. |
alpha | : Scalar |
HLM | : Resulting operation. |
Definition at line 4051 of file vpMatrix.cpp.
References getCols(), getRows(), vpMatrixException::incorrectMatrixSizeError, resize(), and vpTRACE.
Referenced by vpTemplateTrackerWarpHomographySL3::findWarp(), vpTemplateTrackerSSDESM::initCompInverse(), vpTemplateTrackerSSDInverseCompositional::initCompInverse(), vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), vpTemplateTracker::setHDes(), vpTemplateTrackerSSDForwardCompositional::trackNoPyr(), vpTemplateTrackerSSDESM::trackNoPyr(), and vpTemplateTrackerSSDForwardAdditional::trackNoPyr().
double vpMatrix::cond | ( | ) |
Definition at line 4026 of file vpMatrix.cpp.
std::ostream & vpMatrix::cppPrint | ( | std::ostream & | os, |
const char * | matrixName = NULL , |
||
bool | octet = false |
||
) | const |
Print to be used as part of a C++ code later.
Print under the following form: vpMatrix A(6,4); A[0][0] = 1.4; A[0][1] = 0.6; ...
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 2851 of file vpMatrix.cpp.
References getRows().
|
static |
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 2600 of file vpMatrix.cpp.
References getRows(), resize(), vpCERROR, and vpERROR_TRACE.
std::ostream & vpMatrix::csvPrint | ( | std::ostream & | os | ) | const |
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: 0.939846, 0.0300754, 0.340272 0.0300788, 0.984961, -0.170136 -0.340272, 0.170136, 0.924807
Definition at line 2818 of file vpMatrix.cpp.
double vpMatrix::det | ( | vpDetMethod | method = LU_DECOMPOSITION | ) | const |
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 3496 of file vpMatrix.cpp.
References LU_DECOMPOSITION.
void vpMatrix::diag | ( | const vpColVector & | A | ) |
Create a diagonal matrix with the element of a vector.
A | : Vector which element will be put in the diagonal. |
Definition at line 2572 of file vpMatrix.cpp.
References getRows(), resize(), vpCERROR, and vpERROR_TRACE.
Referenced by vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), and vpMbEdgeTracker::computeVVS().
vpColVector vpMatrix::eigenValues | ( | ) |
Compute the eigenvalues of a n-by-n real symmetric matrix.
vpMatrixException::matrixError | If the matrix is not square or if the matrix is not symmetric. |
vpMatrixException::notImplementedError | If the GSL library is not detected |
Here an example:
Definition at line 3079 of file vpMatrix.cpp.
References colNum, vpMatrixException::matrixError, vpMatrixException::notImplementedError, rowNum, t(), and vpERROR_TRACE.
void vpMatrix::eigenValues | ( | vpColVector & | evalue, |
vpMatrix & | evector | ||
) |
Compute the eigenvalues of a n-by-n real symmetric matrix.
evalue | : Eigenvalues of the matrix. |
evector | : Eigenvector of the matrix. |
vpMatrixException::matrixError | If the matrix is not square or if the matrix is not symmetric. |
vpMatrixException::notImplementedError | If the GSL library is not detected |
Here an example:
Definition at line 3198 of file vpMatrix.cpp.
References colNum, data, vpMatrixException::matrixError, vpMatrixException::notImplementedError, vpColVector::resize(), resize(), rowNum, t(), and vpERROR_TRACE.
double vpMatrix::euclideanNorm | ( | ) | const |
Compute and return the Euclidean norm .
Definition at line 2899 of file vpMatrix.cpp.
Referenced by vpSimulatorAfma6::setPosition().
vpMatrix vpMatrix::expm | ( | ) |
Compute the exponential matrix of a square matrix.
Definition at line 3868 of file vpMatrix.cpp.
References colNum, data, vpMatrixException::incorrectMatrixSizeError, inverseByLU(), rowNum, setIdentity(), and vpTRACE.
Referenced by vpTemplateTrackerWarpHomographySL3::computeCoeff().
void vpMatrix::eye | ( | unsigned int | n | ) |
Set an n-by-n matrix to identity.
eye(n) is an n-by-n matrix with ones on the diagonal and zeros else where.
Definition at line 1181 of file vpMatrix.cpp.
References vpCERROR, and vpERROR_TRACE.
Referenced by vpServo::setServo().
void vpMatrix::eye | ( | unsigned int | m, |
unsigned int | n | ||
) |
Set an m-by-n matrix to identity.
eye(m,n) is an m-by-n matrix with ones on the diagonal and zeros else where.
Definition at line 1201 of file vpMatrix.cpp.
References colNum, resize(), rowNum, vpCERROR, and vpERROR_TRACE.
|
inline |
Return the number of columns of the matrix.
Definition at line 163 of file vpMatrix.h.
Referenced by add2Matrices(), add2WeightedMatrices(), vpSubRowVector::checkParentStatus(), vpSubMatrix::checkParentStatus(), vpServo::computeControlLaw(), computeHLM(), vpServo::computeInteractionMatrix(), vpMbTracker::computeJTR(), cond(), csvPrint(), vpImageSimulator::getImage(), vpSubRowVector::init(), vpSubMatrix::init(), vpCameraParameters::initFromCalibrationMatrix(), insert(), inverseByCholeskyLapack(), inverseByQRLapack(), juxtaposeMatrices(), kernel(), kron(), maplePrint(), vpRowVector::operator*(), vpRotationMatrix::operator*(), vpVelocityTwistMatrix::operator*(), vpForceTwistMatrix::operator*(), operator*(), operator+=(), operator-=(), vpSubRowVector::operator=(), vpRowVector::operator=(), vpSubColVector::operator=(), vpSubMatrix::operator=(), vpRotationMatrix::operator=(), vpColVector::operator=(), vpHomography::operator=(), vpPose::poseDementhonPlan(), print(), pseudoInverse(), vpIoTools::readConfigVar(), vpRowVector::reshape(), vpColVector::reshape(), row(), saveMatrix(), saveMatrixYAML(), vpServo::secondaryTask(), vpRowVector::size(), stackMatrices(), sub2Matrices(), and svd().
double vpMatrix::getMaxValue | ( | ) | const |
Definition at line 3969 of file vpMatrix.cpp.
double vpMatrix::getMinValue | ( | ) | const |
Definition at line 3955 of file vpMatrix.cpp.
|
inline |
Return the number of rows of the matrix.
Definition at line 161 of file vpMatrix.h.
Referenced by add2Matrices(), add2WeightedMatrices(), vpLine::changeFrame(), vpSubColVector::checkParentStatus(), vpSubMatrix::checkParentStatus(), column(), vpServo::computeError(), computeHLM(), vpServo::computeInteractionMatrix(), vpMbTracker::computeJTR(), vpPtu46::computeMGD(), vpPose::computeResidual(), vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), vpMbEdgeTracker::computeVVS(), cppPrint(), createDiagonalMatrix(), vpColVector::crossProd(), csvPrint(), vpDot2::defineDots(), diag(), vpProjectionDisplay::display(), vpColVector::dotProd(), vpGenericFeature::error(), vpImageFilter::filter(), vpPtu46::get_eJe(), vpBiclops::get_eJe(), vpPtu46::get_fJe(), vpBiclops::get_fJe(), vpBiclops::get_fMe(), vpGenericFeature::get_s(), vpBasicFeature::getDimension(), vpImageSimulator::getImage(), vpAfma6::getInverseKinematics(), vpViper::getInverseKinematicsWrist(), vpSubColVector::init(), vpSubMatrix::init(), vpCameraParameters::initFromCalibrationMatrix(), insert(), vpFeatureLuminance::interaction(), vpGenericFeature::interaction(), inverseByCholeskyLapack(), inverseByLU(), inverseByQRLapack(), vpColVector::invSort(), juxtaposeMatrices(), kernel(), vpScale::KernelDensity(), vpScale::KernelDensityGradient(), kron(), maplePrint(), matlabPrint(), vpColVector::mean(), vpScale::MeanShift(), vpColVector::median(), vpRobust::MEstimator(), multMatrixVector(), vpRowVector::operator*(), vpRotationMatrix::operator*(), vpVelocityTwistMatrix::operator*(), vpForceTwistMatrix::operator*(), operator*(), operator+=(), operator-=(), vpColVector::operator<<(), vpSubColVector::operator=(), vpSubMatrix::operator=(), vpSubRowVector::operator=(), vpRotationMatrix::operator=(), vpColVector::operator=(), vpRGBa::operator=(), vpHomography::operator=(), vpPlot::plot(), vpPose::poseDementhonPlan(), vpPose::poseVirtualVSrobust(), vpKalmanFilter::prediction(), print(), vpLine::projection(), pseudoInverse(), vpIoTools::readConfigVar(), vpRowVector::reshape(), vpColVector::reshape(), saveMatrix(), saveMatrixYAML(), vpGenericFeature::set_s(), vpGenericFeature::setError(), vpGenericFeature::setInteractionMatrix(), vpSimulatorAfma6::setJointLimit(), vpSimulatorViper850::setJointLimit(), vpRobotBiclopsController::setPosition(), vpRobotAfma4::setPosition(), vpRobotBiclopsController::setVelocity(), vpRobotPtu46::setVelocity(), vpRobotBiclops::setVelocity(), vpSimulatorAfma6::setVelocity(), vpSimulatorViper850::setVelocity(), vpRobotAfma4::setVelocity(), vpLine::setWorldCoordinates(), vpRobust::simultMEstimator(), vpColVector::size(), vpColVector::skew(), vpColVector::sort(), vpColVector::stack(), stackMatrices(), sub2Matrices(), svd(), and vpColVector::vpColVector().
double vpMatrix::infinityNorm | ( | ) | const |
Compute and return the infinity norm with where is the matrix size.
Definition at line 2923 of file vpMatrix.cpp.
void vpMatrix::init | ( | ) |
Initialization of the object matrix.
initialization of the object matrix. Number of columns and rows are zero.
Definition at line 98 of file vpMatrix.cpp.
References colNum, data, dsize, rowNum, rowPtrs, and trsize.
Referenced by vpRotationVector::operator=(), operator=(), vpColVector::vpColVector(), vpMatrix(), vpRotationVector::vpRotationVector(), vpSubColVector::vpSubColVector(), vpSubMatrix::vpSubMatrix(), vpSubRowVector::vpSubRowVector(), and vpTranslationVector::vpTranslationVector().
void vpMatrix::init | ( | const vpMatrix & | m, |
unsigned int | r, | ||
unsigned int | c, | ||
unsigned int | nrows, | ||
unsigned int | ncols | ||
) |
subvpMatrix extraction
Definition at line 272 of file vpMatrix.cpp.
References resize(), and vpERROR_TRACE.
void vpMatrix::insert | ( | const vpMatrix & | A, |
const unsigned int | r, | ||
const unsigned int | c | ||
) |
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 3022 of file vpMatrix.cpp.
References colNum, getCols(), getRows(), vpMatrixException::incorrectMatrixSizeError, and rowNum.
Referenced by vpNurbs::curveKnotIns(), insert(), vpPioneerPan::set_mMp(), and vpPioneerPan::set_pMe().
|
static |
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 2397 of file vpMatrix.cpp.
|
static |
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 2428 of file vpMatrix.cpp.
References getCols(), getRows(), vpMatrixException::incorrectMatrixSizeError, resize(), vpCERROR, and vpERROR_TRACE.
vpMatrix vpMatrix::inverseByCholesky | ( | ) | const |
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 122 of file vpMatrix_cholesky.cpp.
References colNum, inverseByCholeskyLapack(), vpMatrixException::matrixError, rowNum, and vpERROR_TRACE.
vpMatrix vpMatrix::inverseByCholeskyLapack | ( | ) | const |
Definition at line 62 of file vpMatrix_cholesky.cpp.
References vpException::badValue, data, getCols(), and getRows().
Referenced by inverseByCholesky().
vpMatrix vpMatrix::inverseByLU | ( | ) | const |
Compute the inverse of a n-by-n matrix using the LU decomposition.
Here an example:
Definition at line 236 of file vpMatrix_lu.cpp.
References colNum, getRows(), vpMatrixException::matrixError, rowNum, and vpERROR_TRACE.
Referenced by expm(), vpKalmanFilter::filtering(), vpTemplateTrackerWarpHomographySL3::findWarp(), vpTemplateTrackerWarpAffine::getParamInverse(), vpTemplateTrackerTriangle::init(), vpTemplateTrackerSSDInverseCompositional::initCompInverse(), vpTemplateTrackerZNCCForwardAdditional::initHessienDesired(), vpTemplateTrackerZNCCInverseCompositional::initHessienDesired(), vpTemplateTracker::setHDes(), vpTemplateTrackerSSDForwardCompositional::trackNoPyr(), and vpTemplateTrackerSSDForwardAdditional::trackNoPyr().
vpMatrix vpMatrix::inverseByQR | ( | ) | const |
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 228 of file vpMatrix_qr.cpp.
References colNum, inverseByQRLapack(), vpMatrixException::matrixError, rowNum, and vpERROR_TRACE.
vpMatrix vpMatrix::inverseByQRLapack | ( | ) | const |
Definition at line 76 of file vpMatrix_qr.cpp.
References vpException::badValue, data, getCols(), and getRows().
Referenced by inverseByQR().
Juxtapose to matrices C = [ A B ].
A | : Left matrix. |
B | : Right matrix. |
Definition at line 2471 of file vpMatrix.cpp.
References vpCERROR.
Juxtapose to matrices C = [ A B ].
A | : Left matrix. |
B | : Right matrix. |
C | : Juxtaposed matrix C = [ A B ] |
Definition at line 2500 of file vpMatrix.cpp.
References getCols(), getRows(), vpMatrixException::incorrectMatrixSizeError, resize(), vpCERROR, and vpERROR_TRACE.
unsigned int vpMatrix::kernel | ( | vpMatrix & | kerA, |
double | svThreshold = 1e-6 |
||
) |
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(M) ={KerA : A*KerA =0}.
kerA | : The matrix to contain the null space (kernel) of A (A*KerA.t()=0) |
svThreshold | : Specify the used threshold in the svd(...) function (a function to compute the singular value decomposition) |
Definition at line 3300 of file vpMatrix.cpp.
References getCols(), getRows(), resize(), row(), sumSquare(), and svd().
void vpMatrix::kill | ( | ) |
Destruction of the matrix (Memory de-allocation)
Definition at line 295 of file vpMatrix.cpp.
Referenced by ~vpMatrix().
Compute Kronecker product matrix.
Definition at line 1492 of file vpMatrix.cpp.
References colNum, getCols(), getRows(), vpMatrixException::incorrectMatrixSizeError, rowNum, and vpERROR_TRACE.
Referenced by kron().
Compute Kronecker product matrix.
m | : vpMatrix. |
out | : If m1.kron(m2) out contains the kronecker product's result : . |
Definition at line 1526 of file vpMatrix.cpp.
References kron().
Compute Kronecker product matrix.
m | : vpMatrix; |
Definition at line 1567 of file vpMatrix.cpp.
References kron().
|
inlinestatic |
Load a matrix from a file.
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 262 of file vpMatrix.h.
Referenced by vpDot2::defineDots().
|
static |
Load a matrix from a file.
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 loaded in this parameter. |
Definition at line 3694 of file vpMatrix.cpp.
References vpException::badValue, and resize().
|
inlinestatic |
Load a matrix from a YAML-formatted file.
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 315 of file vpMatrix.h.
|
static |
Load a matrix from a YAML-formatted file.
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 3791 of file vpMatrix.cpp.
References resize().
std::ostream & vpMatrix::maplePrint | ( | std::ostream & | os | ) | const |
Print using MAPLE matrix input format.
Print using the following way so that this output can be directly copied into MAPLE: ([ [0.939846, 0.0300754, 0.340272, ], [0.0300788, 0.984961, -0.170136, ], [-0.340272, 0.170136, 0.924807, ], ])
Definition at line 2792 of file vpMatrix.cpp.
std::ostream & vpMatrix::matlabPrint | ( | std::ostream & | os | ) | const |
Print using matlab syntax, to be put in matlab later.
Print using the following form: [ a,b,c; d,e,f; g,h,i]
Definition at line 2763 of file vpMatrix.cpp.
References getRows().
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 420 of file vpMatrix.cpp.
References colNum, vpMatrixException::incorrectMatrixSizeError, resize(), rowNum, rowPtrs, and vpERROR_TRACE.
Referenced by operator*().
|
static |
Operation c = A * b (c and b are vectors).
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 860 of file vpMatrix.cpp.
References colNum, getRows(), vpMatrixException::incorrectMatrixSizeError, vpColVector::resize(), rowNum, rowPtrs, and vpERROR_TRACE.
Referenced by vpRotationMatrix::operator*(), and 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 758 of file vpMatrix.cpp.
References colNum, resize(), rowNum, rowPtrs, and vpERROR_TRACE.
Referenced by operator-().
Operation C = A * B (A is unchanged).
Definition at line 463 of file vpMatrix.cpp.
References mult2Matrices().
vpMatrix vpMatrix::operator* | ( | const vpHomography & | H | ) | const |
Allows to multiply a matrix by an homography. Operation M = K * H (H is unchanged).
Definition at line 476 of file vpMatrix.cpp.
References colNum, vpException::dimensionError, and rowNum.
vpColVector vpMatrix::operator* | ( | const vpColVector & | b | ) | const |
Operation c = A * b (A is unchanged, c and b are vectors).
Definition at line 895 of file vpMatrix.cpp.
References multMatrixVector().
vpTranslationVector vpMatrix::operator* | ( | const vpTranslationVector & | b | ) | const |
Operation c = A * b (A is unchanged, c and b are translation vectors).
Definition at line 904 of file vpMatrix.cpp.
References colNum, vpMatrixException::incorrectMatrixSizeError, rowNum, rowPtrs, and vpERROR_TRACE.
vpMatrix vpMatrix::operator* | ( | const double | x | ) | const |
Cij = Aij * x (A is unchanged)
Definition at line 979 of file vpMatrix.cpp.
References colNum, resize(), rowNum, rowPtrs, and vpERROR_TRACE.
vpMatrix & vpMatrix::operator*= | ( | const double | x | ) |
Multiply all the element of the matrix by x : Aij = Aij * x.
Definition at line 1107 of file vpMatrix.cpp.
Operation C = A + B (A is unchanged).
Definition at line 593 of file vpMatrix.cpp.
References add2Matrices().
Operation A = A + B.
Definition at line 673 of file vpMatrix.cpp.
References colNum, getCols(), getRows(), vpMatrixException::incorrectMatrixSizeError, rowNum, rowPtrs, and vpERROR_TRACE.
vpMatrix & vpMatrix::operator+= | ( | const double | x | ) |
Add x to all the element of the matrix : Aij = Aij + x.
Definition at line 1059 of file vpMatrix.cpp.
Operation C = A - B (A is unchanged).
Definition at line 664 of file vpMatrix.cpp.
References sub2Matrices().
vpMatrix vpMatrix::operator- | ( | void | ) | const |
Operation C = -A (A is unchanged).
Definition at line 800 of file vpMatrix.cpp.
References negateMatrix().
Operation A = A - B.
Definition at line 713 of file vpMatrix.cpp.
References colNum, getCols(), getRows(), vpMatrixException::incorrectMatrixSizeError, rowNum, rowPtrs, and vpERROR_TRACE.
vpMatrix & vpMatrix::operator-= | ( | const double | x | ) |
Substract x to all the element of the matrix : Aij = Aij - x.
Definition at line 1083 of file vpMatrix.cpp.
vpMatrix vpMatrix::operator/ | ( | const double | x | ) | const |
Cij = Aij / x (A is unchanged)
Definition at line 1014 of file vpMatrix.cpp.
References colNum, vpException::divideByZeroError, resize(), rowNum, rowPtrs, vpCERROR, and vpERROR_TRACE.
vpMatrix & vpMatrix::operator/= | ( | double | x | ) |
Divide all the element of the matrix by x : Aij = Aij / x.
Definition at line 1122 of file vpMatrix.cpp.
References colNum, vpException::divideByZeroError, rowNum, and rowPtrs.
vpMatrix & vpMatrix::operator<< | ( | double * | x | ) |
Assigment from an array of double.
Definition at line 395 of file vpMatrix.cpp.
Copy operator. Allow operation such as A = B.
B | : matrix to be copied. |
Definition at line 325 of file vpMatrix.cpp.
References colNum, data, dsize, resize(), rowNum, and vpERROR_TRACE.
vpMatrix & vpMatrix::operator= | ( | const vpHomography & | H | ) |
Copy operator. Allow operation such as A = H.
H | : homography matrix to be copied. |
Definition at line 351 of file vpMatrix.cpp.
vpMatrix & vpMatrix::operator= | ( | const double | x | ) |
Set all the element of the matrix A to x.
set all the element of the matrix A to x
Definition at line 364 of file vpMatrix.cpp.
|
inline |
write elements Aij (usage : A[i][j] = x )
Definition at line 218 of file vpMatrix.h.
|
inline |
read elements Aij (usage : x = A[i][j] )
Definition at line 220 of file vpMatrix.h.
int vpMatrix::print | ( | std::ostream & | s, |
unsigned int | length, | ||
char const * | intro = 0 |
||
) |
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 2668 of file vpMatrix.cpp.
References getCols(), getRows(), and vpMath::maximum().
|
inline |
Definition at line 188 of file vpMatrix.h.
vpMatrix vpMatrix::pseudoInverse | ( | double | svThreshold = 1e-6 | ) | const |
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 1861 of file vpMatrix.cpp.
Referenced by vpCalibration::calibrationTsai(), vpSimulatorAfma6::computeArticularVelocity(), vpSimulatorViper850::computeArticularVelocity(), vpServo::computeControlLaw(), computeCovarianceMatrix(), vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), vpMbEdgeTracker::computeVVS(), vpNurbs::globalCurveApprox(), vpNurbs::globalCurveInterp(), vpMeEllipse::initTracking(), vpHomography::inverse(), vpMeLine::leastSquare(), vpPose::poseDementhonNonPlan(), vpPose::poseFromRectangle(), vpPose::poseVirtualVS(), pseudoInverse(), vpHomography::robust(), and solveBySVD().
unsigned int vpMatrix::pseudoInverse | ( | vpMatrix & | Ap, |
double | svThreshold = 1e-6 |
||
) | const |
Compute the pseudo inverse of the matrix .
Compute the pseudo inverse of the matrix using the SVD. return the rank
Ap | : The pseudo inverse . |
svThreshold | : Threshold used to test the singular values. |
Definition at line 1821 of file vpMatrix.cpp.
References pseudoInverse().
unsigned int vpMatrix::pseudoInverse | ( | vpMatrix & | Ap, |
vpColVector & | sv, | ||
double | svThreshold = 1e-6 |
||
) | const |
Compute the pseudo inverse of the matrix .
Compute the pseudo inverse of the matrix using the SVD. return the rank and the singular value
Ap | : The pseudo inverse . |
sv | : Singular values. |
svThreshold | : Threshold used to test the singular values. |
Definition at line 1877 of file vpMatrix.cpp.
References pseudoInverse().
unsigned int vpMatrix::pseudoInverse | ( | vpMatrix & | Ap, |
vpColVector & | sv, | ||
double | svThreshold, | ||
vpMatrix & | imA, | ||
vpMatrix & | imAt | ||
) | const |
Compute the pseudo inverse of the matrix along with Ker A, Ker , Im A and Im .
Compute the pseudo inverse of the matrix using the SVD. return the rank and the singular value, image
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 1916 of file vpMatrix.cpp.
References getCols(), getRows(), vpColVector::resize(), resize(), svd(), and t().
unsigned int vpMatrix::pseudoInverse | ( | vpMatrix & | Ap, |
vpColVector & | sv, | ||
double | svThreshold, | ||
vpMatrix & | imA, | ||
vpMatrix & | imAt, | ||
vpMatrix & | kerA | ||
) | const |
Compute the pseudo inverse of the matrix along with Ker A, Ker , Im A and Im .
Compute the pseudo inverse of the matrix using the SVD. return the rank and the singular value, image, kernel.
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 2094 of file vpMatrix.cpp.
References getCols(), getRows(), vpColVector::resize(), resize(), row(), sumSquare(), svd(), and t().
void vpMatrix::resize | ( | const unsigned int | nrows, |
const unsigned int | ncols, | ||
const bool | flagNullify = true |
||
) |
Set the size of the matrix and initialize all the values to zero.
nrows | : number of rows |
ncols | : number of column |
flagNullify | : if true, then the matrix is re-initialized to 0 after resize. If false, the initial values from the common part of the matrix (common part between old and new version of the matrix) are kept. Default value is true. |
Definition at line 183 of file vpMatrix.cpp.
References colNum, data, dsize, vpException::memoryAllocationError, rowNum, rowPtrs, trsize, vpCDEBUG, vpDEBUG_TRACE, and vpERROR_TRACE.
Referenced by AAt(), add2Matrices(), add2WeightedMatrices(), AtA(), vpServo::computeControlLaw(), computeHLM(), vpMbTracker::computeJTR(), vpMbEdgeKltTracker::computeVVS(), vpMbKltTracker::computeVVS(), createDiagonalMatrix(), diag(), vpProjectionDisplay::display(), vpHomography::DLT(), eigenValues(), eye(), vpPtu46::get_eJe(), vpAfma4::get_eJe(), vpAfma6::get_eJe(), vpBiclops::get_eJe(), vpPtu46::get_fJe(), vpAfma4::get_fJe(), vpAfma6::get_fJe(), vpBiclops::get_fJe(), vpAfma4::get_fJe_inverse(), vpViper::get_fJw(), vpCameraParameters::get_K(), vpCameraParameters::get_K_inverse(), vpRotationMatrix::init(), vpProjectionDisplay::init(), vpVelocityTwistMatrix::init(), vpForceTwistMatrix::init(), vpKalmanFilter::init(), vpHomogeneousMatrix::init(), init(), vpTemplateTrackerSSDInverseCompositional::initCompInverse(), vpMbtDistanceCylinder::initInteractionMatrixError(), vpTemplateTracker::initTracking(), insert(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureLuminance::interaction(), vpFeatureSegment::interaction(), vpGenericFeature::interaction(), vpFeatureDepth::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), juxtaposeMatrices(), kernel(), loadMatrix(), loadMatrixYAML(), mult2Matrices(), negateMatrix(), operator*(), operator/(), operator=(), vpPose::poseDementhonNonPlan(), vpPose::poseDementhonPlan(), vpPose::poseVirtualVSrobust(), pseudoInverse(), vpIoTools::readConfigVar(), vpRowVector::reshape(), vpColVector::reshape(), vpRowVector::resize(), vpColVector::resize(), vpServo::secondaryTask(), vpTemplateTrackerWarp::setNbParam(), vpColVector::skew(), skew(), stackMatrices(), sub2Matrices(), svd(), t(), transpose(), vpMatrix(), vpTemplateTrackerSSD::vpTemplateTrackerSSD(), vpTemplateTrackerSSDESM::vpTemplateTrackerSSDESM(), vpTemplateTrackerSSDInverseCompositional::vpTemplateTrackerSSDInverseCompositional(), vpTemplateTrackerWarpAffine::vpTemplateTrackerWarpAffine(), vpTemplateTrackerWarpHomography::vpTemplateTrackerWarpHomography(), vpTemplateTrackerWarpHomographySL3::vpTemplateTrackerWarpHomographySL3(), vpTemplateTrackerWarpSRT::vpTemplateTrackerWarpSRT(), vpTemplateTrackerWarpTranslation::vpTemplateTrackerWarpTranslation(), and vpTemplateTrackerZNCC::vpTemplateTrackerZNCC().
vpRowVector vpMatrix::row | ( | const unsigned int | j | ) |
Row extraction.
Return the ith rows of the matrix.
Definition at line 2274 of file vpMatrix.cpp.
References getCols().
Referenced by kernel(), and pseudoInverse().
|
inlinestatic |
Save a matrix to a file.
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 283 of file vpMatrix.h.
Referenced by vpDot2::defineDots().
|
static |
Save a matrix to a file.
filename | : Absolute file name. |
M | : Matrix 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 3523 of file vpMatrix.cpp.
|
inlinestatic |
Save a matrix in a YAML-formatted file.
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 301 of file vpMatrix.h.
|
static |
Save a matrix in a YAML-formatted file.
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. |
Here is an example of outputs.
Content of matrix.yml:
Content of matrixIndent.yml:
Definition at line 3623 of file vpMatrix.cpp.
void vpMatrix::setIdentity | ( | const double & | val = 1.0 | ) |
By default set the matrix to identity. More generally set M[i][i] = val.
Definition at line 1159 of file vpMatrix.cpp.
References colNum, vpMatrixException::matrixError, rowNum, and vpERROR_TRACE.
Referenced by vpServo::computeControlLaw(), expm(), vpTemplateTrackerWarpHomographySL3::getdW0(), vpTemplateTrackerWarpHomographySL3::getdWdp0(), vpFeatureThetaU::interaction(), vpMeLine::leastSquare(), vpPose::poseFromRectangle(), and vpServo::secondaryTask().
void vpMatrix::solveBySVD | ( | const vpColVector & | b, |
vpColVector & | x | ||
) | const |
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 1622 of file vpMatrix.cpp.
References pseudoInverse().
Referenced by solveBySVD().
vpColVector vpMatrix::solveBySVD | ( | const vpColVector & | B | ) | const |
Solve a linear system using Singular Value Decomposition (SVD).
Non destructive wrt. A and B.
B | : Vector . |
Here an example:
Definition at line 1677 of file vpMatrix.cpp.
References colNum, and solveBySVD().
void vpMatrix::stackColumns | ( | vpColVector & | out | ) |
Stacks columns of a matrix in a vector.
out | : a vpColVector. |
Definition at line 1422 of file vpMatrix.cpp.
References colNum, data, vpColVector::resize(), rowNum, rowPtrs, vpCERROR, and vpERROR_TRACE.
vpColVector vpMatrix::stackColumns | ( | ) |
Stacks columns of a matrix in a vector.
Definition at line 1446 of file vpMatrix.cpp.
void vpMatrix::stackMatrices | ( | const vpMatrix & | A | ) |
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 3003 of file vpMatrix.cpp.
References rowNum.
Referenced by vpCalibration::calibrationTsai(), vpMbEdgeKltTracker::computeVVS(), vpFeatureSegment::error(), vpFeatureEllipse::error(), vpFeatureVanishingPoint::error(), vpFeatureMomentAlpha::error(), vpGenericFeature::error(), vpFeaturePoint::error(), vpFeatureLine::error(), vpFeaturePoint3D::error(), vpFeaturePointPolar::error(), vpFeatureThetaU::error(), vpFeatureTranslation::error(), vpBasicFeature::get_s(), vpFeatureEllipse::interaction(), vpFeatureVanishingPoint::interaction(), vpFeatureSegment::interaction(), vpGenericFeature::interaction(), vpFeatureMoment::interaction(), vpFeaturePoint::interaction(), vpFeatureLine::interaction(), vpFeaturePoint3D::interaction(), vpFeaturePointPolar::interaction(), vpFeatureThetaU::interaction(), vpFeatureTranslation::interaction(), and stackMatrices().
Stack two Matrices C = [ A B ]^T.
Stack matrices. "Stack" two matrices C = [ A B ]^T.
A | : Upper matrix. |
B | : Lower matrix. |
Definition at line 2312 of file vpMatrix.cpp.
References stackMatrices(), and vpCERROR.
Stack two Matrices C = [ A B ]^T.
stackMatrices. "stack" two matrices C = [ A B ]^T
A | : Upper matrix. |
B | : Lower matrix. |
C | : Stacked matrix C = [ A B ]^T |
Definition at line 2341 of file vpMatrix.cpp.
References getCols(), getRows(), vpMatrixException::incorrectMatrixSizeError, resize(), vpCERROR, and vpERROR_TRACE.
void vpMatrix::stackRows | ( | vpRowVector & | out | ) |
Stacks rows of a matrix in a vector
out | : a vpRowVector. |
Definition at line 1457 of file vpMatrix.cpp.
References colNum, data, dsize, vpRowVector::resize(), rowNum, vpCERROR, and vpERROR_TRACE.
vpRowVector vpMatrix::stackRows | ( | ) |
Stacks rows of a matrix in a vector.
Definition at line 1479 of file vpMatrix.cpp.
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 611 of file vpMatrix.cpp.
References colNum, getCols(), getRows(), vpMatrixException::incorrectMatrixSizeError, resize(), rowNum, rowPtrs, and vpERROR_TRACE.
Referenced by operator-().
double vpMatrix::sumSquare | ( | ) | const |
return sum of the Aij^2 (for all i, for all j)
Definition at line 809 of file vpMatrix.cpp.
References colNum, rowNum, and rowPtrs.
Referenced by vpPose::calculArbreDementhon(), vpCalibration::calibrationTsai(), vpPose::coplanar(), vpFeatureDepth::error(), vpFeatureThetaU::error(), vpFeatureTranslation::error(), vpMbTracker::extractCylinders(), vpFeatureThetaU::interaction(), kernel(), vpRowVector::normalize(), vpColVector::normalize(), vpPose::poseDementhonNonPlan(), vpPose::poseDementhonPlan(), vpPose::poseFromRectangle(), vpPose::poseLagrangeNonPlan(), vpPose::poseLagrangePlan(), vpPose::poseVirtualVS(), vpPose::poseVirtualVSrobust(), pseudoInverse(), vpServoData::save(), vpSimulatorAfma6::setPosition(), and vpSimulatorViper850::setPosition().
void vpMatrix::svd | ( | vpColVector & | w, |
vpMatrix & | v | ||
) |
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 1751 of file vpMatrix.cpp.
References getCols(), getRows(), vpColVector::resize(), and resize().
Referenced by vpHomography::computeDisplacement(), cond(), vpHomography::DLT(), kernel(), vpPose::poseDementhonPlan(), and pseudoInverse().
vpMatrix vpMatrix::t | ( | ) | const |
Compute and return the transpose of the matrix.
Definition at line 1225 of file vpMatrix.cpp.
References colNum, resize(), rowNum, vpCERROR, and vpERROR_TRACE.
Referenced by vpCalibration::calibrationTsai(), vpServo::computeControlLaw(), computeCovarianceMatrix(), vpTemplateTracker::computeOptimalBrentGain(), eigenValues(), vpKalmanFilter::filtering(), vpTemplateTrackerWarpHomographySL3::findWarp(), vpPose::poseDementhonNonPlan(), vpPose::poseDementhonPlan(), vpKalmanFilter::prediction(), and pseudoInverse().
vpMatrix vpMatrix::transpose | ( | ) | const |
Compute and return the transpose of the matrix.
Definition at line 1255 of file vpMatrix.cpp.
Referenced by vpTemplateTrackerWarpSRT::getParamInverse().
void vpMatrix::transpose | ( | vpMatrix & | At | ) | const |
Compute At the transpose of the matrix.
At | : Resulting transpose matrix. |
Definition at line 1267 of file vpMatrix.cpp.
References colNum, resize(), rowNum, rowPtrs, vpCERROR, and vpERROR_TRACE.
Multiplication by a scalar Cij = x*Bij.
Definition at line 935 of file vpMatrix.cpp.
References getCols(), getRows(), resize(), and vpERROR_TRACE.
|
friend |
std::cout a matrix
Definition at line 2625 of file vpMatrix.cpp.
|
related |
Compute the skew symmetric matrix of translation vector (matrice de pre-produit vectoriel).
t | : Translation vector in input used to compute the skew symmetric matrix M. |
M | : Skew symmetric matrix of translation vector . |
Definition at line 296 of file vpTranslationVector.cpp.
References resize().
|
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 alpha*A^T*B^T+beta*C we need to call :
If C is not used, vpGEMM must be called using an empty matrix null :
vpMatrixException::incorrectMatrixSizeError | if the sizes of the matrices do not allow the operations. |
A | : a Matrix |
B | : a Matrix |
alpha | : a scalar |
C | : a Matrix |
beta | : a scalar |
D | : a Matrix |
ops | : a scalar describing operation applied on the matrices |
Definition at line 331 of file vpGEMM.h.
References vpMatrixException::incorrectMatrixSizeError, and vpERROR_TRACE.
|
related |
Enumeration of the operations applied on matrices in vpGEMM function.
Operations are :
|
protected |
number of columns
Definition at line 114 of file vpMatrix.h.
Referenced by AAt(), add2Matrices(), add2WeightedMatrices(), AtA(), eigenValues(), expm(), eye(), infinityNorm(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), init(), insert(), inverseByCholesky(), inverseByLU(), inverseByQR(), kron(), mult2Matrices(), multMatrixVector(), negateMatrix(), vpRowVector::operator*(), operator*(), operator*=(), operator+=(), operator-=(), operator/(), operator/=(), vpColVector::operator<<(), operator<<(), vpSubRowVector::operator=(), vpRowVector::operator=(), vpSubMatrix::operator=(), operator=(), resize(), setIdentity(), solveBySVD(), stackColumns(), stackRows(), sub2Matrices(), sumSquare(), vpRowVector::t(), t(), transpose(), and vpMatrix().
double* vpMatrix::data |
address of the first element of the data array
Definition at line 118 of file vpMatrix.h.
Referenced by AtA(), vpSubColVector::checkParentStatus(), vpSubRowVector::checkParentStatus(), vpSubMatrix::checkParentStatus(), vpPose::computeResidual(), vpPose::computeTransformation(), vpColVector::dotProd(), eigenValues(), euclideanNorm(), expm(), vpRobotViper650::getForceTorque(), vpRobotViper850::getForceTorque(), getMaxValue(), getMinValue(), vpRobotViper650::getPosition(), vpRobotViper850::getPosition(), vpRobotViper850::getVelocity(), vpRobotViper650::getVelocity(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), init(), vpRobotViper650::init(), vpRobotViper850::init(), inverseByCholeskyLapack(), inverseByQRLapack(), vpColVector::invSort(), kill(), vpColVector::mean(), vpColVector::median(), vpRowVector::operator*(), vpColVector::operator*(), vpTranslationVector::operator*(), vpColVector::operator+(), vpTranslationVector::operator-(), vpColVector::operator-(), vpSubColVector::operator=(), vpSubRowVector::operator=(), vpRowVector::operator=(), vpColVector::operator=(), vpTranslationVector::operator=(), operator=(), vpRowVector::operator[](), vpColVector::operator[](), vpPose::ransac(), vpRowVector::reshape(), vpColVector::reshape(), resize(), vpRobotAfma4::setPosition(), vpRobotViper650::setPosition(), vpRobotViper850::setPosition(), vpRobotAfma4::setVelocity(), vpRobotAfma6::setVelocity(), vpRobotViper650::setVelocity(), vpRobotViper850::setVelocity(), vpColVector::sort(), stackColumns(), stackRows(), vpRowVector::t(), vpColVector::t(), vpColVector::vpColVector(), vpMatrix(), vpSubColVector::~vpSubColVector(), vpSubMatrix::~vpSubMatrix(), and vpSubRowVector::~vpSubRowVector().
|
protected |
Current size (rowNum * colNum)
Definition at line 124 of file vpMatrix.h.
Referenced by euclideanNorm(), getMaxValue(), getMinValue(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), init(), vpTranslationVector::operator*(), vpTranslationVector::operator-(), operator=(), vpRowVector::reshape(), vpColVector::reshape(), resize(), and stackRows().
|
protected |
number of rows
Definition at line 112 of file vpMatrix.h.
Referenced by AAt(), add2Matrices(), add2WeightedMatrices(), AtA(), vpColVector::deg2rad(), eigenValues(), expm(), eye(), infinityNorm(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), init(), insert(), inverseByCholesky(), inverseByLU(), inverseByQR(), kron(), mult2Matrices(), multMatrixVector(), negateMatrix(), vpColVector::operator*(), vpHomogeneousMatrix::operator*(), operator*(), operator*=(), vpColVector::operator+(), operator+=(), vpColVector::operator-(), operator-=(), operator/(), operator/=(), vpColVector::operator<<(), operator<<(), vpSubColVector::operator=(), vpSubRowVector::operator=(), vpRowVector::operator=(), vpSubMatrix::operator=(), vpColVector::operator=(), vpTranslationVector::operator=(), operator=(), vpColVector::rad2deg(), resize(), setIdentity(), vpColVector::stack(), stackColumns(), stackMatrices(), stackRows(), sub2Matrices(), sumSquare(), vpColVector::t(), t(), transpose(), and vpMatrix().
|
protected |
address of the first element of each rows
Definition at line 121 of file vpMatrix.h.
Referenced by AAt(), add2Matrices(), add2WeightedMatrices(), infinityNorm(), vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), init(), kill(), mult2Matrices(), multMatrixVector(), negateMatrix(), vpRotationMatrix::operator*(), vpVelocityTwistMatrix::operator*(), vpForceTwistMatrix::operator*(), vpHomogeneousMatrix::operator*(), operator*(), operator*=(), operator+=(), operator-=(), operator/(), operator/=(), vpColVector::operator<<(), operator<<(), vpRowVector::operator=(), vpSubMatrix::operator=(), vpRotationMatrix::operator=(), vpVelocityTwistMatrix::operator=(), vpForceTwistMatrix::operator=(), vpHomogeneousMatrix::operator=(), operator=(), resize(), stackColumns(), sub2Matrices(), sumSquare(), and transpose().
|
protected |
Total row space.
Definition at line 126 of file vpMatrix.h.
Referenced by vpSubColVector::init(), vpSubRowVector::init(), vpSubMatrix::init(), init(), and resize().