PARP Research Group | Universidad de Murcia |
QVMatrix Class Reference
|
Public Types | |
enum | MatrixType { General = 0x00, Symmetric = 0x01, UpperTriangular = 0x2, LowerTriangular = 0x03, Diagonal = 0x04, PermutationMatrix = 0x05 } |
Matrix types. More... | |
Public Member Functions | |
QVMatrix () | |
Default constructor. | |
QVMatrix (const QVMatrix &matrix) | |
Copy constructor. | |
QVMatrix (const int rows, const int cols, const double *data=NULL) | |
Dimensional constructor. | |
QVMatrix (const int rows, const int cols, const QVVector &data) | |
Dimensional constructor. | |
QVMatrix (const int rows, const int cols, const double value) | |
Dimensional constructor with default value. | |
QVMatrix (const QVQuaternion &quaternion) | |
Rotation matrix constructor. | |
QVMatrix (const gsl_matrix *matrix) | |
Copy constructor for gsl_matrix. | |
QVMatrix (const CvMat *cvMatrix) | |
OpenCV matrix conversion constructor. | |
CvMat * | toCvMat (const int cvMatType=CV_64F) const |
Converts the matrix to an OpenCV matrix structure. | |
operator CvMat * () const | |
Converts the matrix to an OpenCV matrix structure. | |
QVMatrix (const QVVector &vector, const bool rowVector=true) | |
Octave matrix conversion constructor. | |
QVMatrix (const QList< QVVector > &vectorList) | |
Constructor from a list of QVVectors. | |
QVMatrix (const QList< QVector< double > > &vectorList) | |
Constructor from a list of QVectors. | |
QVMatrix (const QList< QPointF > &pointList) | |
Constructor from a list of QPointF. | |
operator QList< QVVector > () const | |
Convert to a list of QVVectors operator. | |
operator QList< QVector< double > > () const | |
Convert to a list of QVectors operator. | |
operator gsl_matrix * () const | |
Convert to a gsl_matrix * operator. | |
QVMatrix & | operator= (const QVMatrix &matrix) |
Copy operator. | |
bool | operator== (const QVMatrix &matrix) const |
Matrix-matrix equality operator. | |
QVMatrix & | operator+= (const QVMatrix &matrix) |
Matrix-matrix incremental operator. | |
bool | operator!= (const QVMatrix &matrix) const |
Matrix-matrix unequality operator. | |
QVMatrix | operator* (const QVMatrix &matrix) const |
Matrix-matrix product operator. | |
QVMatrix | operator/ (const QVMatrix &matrix) const |
Matrix-matrix division. | |
QVMatrix | operator+ (const QVMatrix &matrix) const |
Matrix-matrix addition operator. | |
QVMatrix | operator- (const QVMatrix &matrix) const |
Matrix-matrix substraction operator. | |
QVMatrix | operator- () const |
Obtains the additive inverse of the matrix. | |
QVMatrix | operator* (const double value) const |
Matrix-scalar product. | |
QVMatrix | operator/ (const double value) const |
Matrix-scalar division operator. | |
QVMatrix | operator+ (const double value) const |
Matrix-scalar addition. | |
QVMatrix | operator- (const double value) const |
Matrix-scalar substraction operator. | |
QVVector | operator* (const QVVector &vector) const |
Matrix-vector product. | |
QVMatrix | verticalAppend (const QVMatrix &matrix) const |
Appends matrices vertically. | |
QVMatrix | horizontalAppend (const QVMatrix &matrix) const |
Appends matrices horizontally. | |
QVMatrix | operator& (const QVMatrix &matrix) const |
Appends matrices vertically. | |
QVMatrix | operator| (const QVMatrix &matrix) const |
Appends matrices horizontally. | |
QVMatrix | operator& (const QVVector &vector) const |
Appends vector to matrix vertically. | |
QVMatrix | operator| (const QVVector &vector) const |
Appends vector to matrix horizontally. | |
double & | operator() (const int row, const int col) |
Element access operator. | |
double | operator() (const int row, const int col) const |
Overloaded version of element access operator. | |
int | getDataSize () const |
Gets the size of the data array. | |
const double * | getReadData () const |
Gets a read-only reference to the data buffer of the matrix. | |
double * | getWriteData () |
Gets a reference of the data buffer of the matrix for read and write accesses. | |
QVMatrix | transpose () const |
Change the order of the indexes in the matrix. | |
void | set (const double value) |
Sets every element of the matrix to a given value. | |
bool | equals (const QVMatrix &matrix) const |
Matrix-matrix equality operator. | |
QVMatrix | dotProduct (const QVMatrix &matrix, const bool transposeFirstOperand=false, const bool transposeSecondOperand=false) const |
Matrix-matrix product. | |
QVVector | dotProduct (const QVVector &vector, const bool transposeMatrix=false) const |
Matrix-vector product. | |
QVMatrix | elementProduct (const QVMatrix &matrix) const |
Matrix-matrix element product. | |
QVMatrix | matrixDivide (const QVMatrix &matrix) const |
Matrix-matrix division. | |
void | triangularSolve (const QVVector &b, QVVector &x, bool transposed=false, bool unit_diagonal=false) const |
Triangular system solving (vector of RHS). | |
void | triangularSolve (const QVMatrix &B, QVMatrix &X, bool transposed=false, bool unit_diagonal=false, bool left=true) const |
Triangular system solving (matrix of RHS). | |
QVMatrix | inverse () const |
Computes the inverse of the matrix. | |
double | det () const |
Computes the determinant of the matrix. | |
QVVector | meanCol () const |
Obtains the mean vector for the column vectors in the matrix. | |
QVMatrix | addition (const QVMatrix &matrix) const |
Matrix-matrix addition. | |
void | inlineAddition (const QVMatrix &matrix) |
Matrix-matrix addition. | |
QVMatrix | substract (const QVMatrix &matrix) const |
Matrix-matrix substraction. | |
QVMatrix | scalarDivide (const double value) const |
Matrix-scalar division. | |
QVMatrix | scalarProduct (const double value) const |
Matrix-scalar product. | |
QVMatrix | scalarAdd (const double value) const |
Matrix-scalar addition. | |
QVMatrix | scalarSubstract (const double value) const |
Matrix-scalar substraction. | |
double | norm2 () const |
Gets the norm2 for matrix. | |
double | trace () const |
Gets the trace of the matrix. | |
bool | containsNaN () const |
Checks whether the matrix contains a NaN value or not. | |
bool | containsInf () const |
Checks whether the matrix contains an infinite value or not. | |
bool | isDiagonal () const |
Checks whether the matrix is a diagonal matrix or not. | |
QVMatrix | rowHomogeneousNormalize () const |
Homogeneous normalization for rows of the matrix. | |
int | getCols () const |
Get width of the matrix. | |
int | getRows () const |
Get height of the matrix. | |
MatrixType | getType () const |
Get type of the matrix. | |
void | setType (MatrixType type) |
Set type of the matrix. | |
const QVMatrix | getCols (const int firstCol, const int lastCol) const |
Get submatrix composed by given column range. | |
const QVMatrix | getRows (const int firstRow, const int lastRow) const |
Get submatrix composed by given row range. | |
const QVVector | getRow (const int row) const |
Gets a row of the matrix. | |
void | setRow (const int row, QVVector vector) |
Sets a row of the matrix. | |
void | setRow (const int row, QVector< double > vector) |
Sets a row of the matrix. | |
const QVVector | getCol (const int col) const |
Gets a column of the matrix. | |
void | setCol (const int col, QVVector vector) |
Sets a column of the matrix. | |
const QVMatrix | getSubmatrix (const int firstRow, const int lastRow, const int firstCol, const int lastCol) const |
Gets a submatrix from a matrix. | |
void | setSubmatrix (const int row, const int col, const QVMatrix &M) |
Sets a submatrix from a matrix. | |
QVMatrix | reversedRows () const |
Gets a matrix with reversed rows (bottom to top). | |
QVMatrix | reversedCols () const |
Gets a matrix with reversed columns (right to left). | |
const QVVector | diagonal () const |
Gets the diagonal of the matrix. | |
QVMatrix | reshape (const int newRows, const int newCols) const |
Create a new matrix with different size and the same content. | |
Static Public Member Functions | |
static QVMatrix | identity (const int size) |
Creates an identity matrix. | |
static QVMatrix | cameraCalibrationMatrix (const double f, const double r=1.0, const double cx=0.0, const double cy=0.0, const double s=0.0) |
Creates an intrinsic camera calibration matrix. | |
static QVMatrix | zeros (const int rows, const int cols) |
Creates a zero matrix. | |
static QVMatrix | random (const int rows, const int cols) |
Creates a matrix of random values. | |
static QVMatrix | diagonal (const QVVector &diagonalVector) |
Creates a diagonal matrix with given entries. | |
static QVMatrix | rotationMatrix (const double angle) |
Create a rotation matrix for points in the 2D plane. | |
static QVMatrix | rotationMatrix (const QPointF center, const double angle) |
Create a rotation matrix for points in the 2D plane. | |
static QVMatrix | translationMatrix (const double x, const double y) |
Create a 2D translation matrix. | |
static QVMatrix | scaleMatrix (const double zoom) |
Create a 2D scale matrix. | |
static QVMatrix | rotationMatrix3dXAxis (const double angle) |
Create a rotation matrix for 3D-X axis. | |
static QVMatrix | rotationMatrix3dYAxis (const double angle) |
Create a rotation matrix for 3D-Y axis. | |
static QVMatrix | rotationMatrix3dZAxis (const double angle) |
Create a rotation matrix for 3D-Z axis. | |
static QVMatrix | translationMatrix3d (const double x, const double y, const double z) |
Create a 3D translation matrix. | |
static QVMatrix | multiply (const QList< QVMatrix > &matrices) |
Compute the product of a list of matrices. |
Implementation of numerical matrices.
Definition at line 68 of file qvmatrix.h.
enum QVMatrix::MatrixType |
Matrix types.
General |
General matrix. |
Symmetric |
Symmetrix matrices. |
UpperTriangular |
Upper triangular matrix. |
LowerTriangular |
Lower triangular matrix. |
Diagonal |
Diagonal matrix. |
PermutationMatrix |
Permutation matrix. |
Definition at line 73 of file qvmatrix.h.
QVMatrix::QVMatrix | ( | ) |
Default constructor.
By default, it constructs a 1x1 matrix.
Definition at line 38 of file qvmatrix.cpp.
Referenced by cameraCalibrationMatrix(), operator&(), and operator|().
QVMatrix::QVMatrix | ( | const QVMatrix & | matrix | ) |
Copy constructor.
Creates a matrix object copying the content from a given one.
matrix | matrix to be copied. |
Definition at line 44 of file qvmatrix.cpp.
QVMatrix::QVMatrix | ( | const int | rows, | |
const int | cols, | |||
const double * | data = NULL | |||
) |
Dimensional constructor.
Creates a new matrix of the specified dimensions.
rows | number of rows for the new matrix. | |
cols | number of rows for the new matrix. | |
data | pointer to the data, stored in row mayor order. If no pointer, or the NULL value, is provided, |
Definition at line 48 of file qvmatrix.cpp.
QVMatrix::QVMatrix | ( | const int | rows, | |
const int | cols, | |||
const QVVector & | data | |||
) |
Dimensional constructor.
Creates a new matrix of the specified dimensions.
rows | number of rows for the new matrix. | |
cols | number of rows for the new matrix. | |
data | Vector containing the data, in row mayor order. |
Definition at line 63 of file qvmatrix.cpp.
QVMatrix::QVMatrix | ( | const int | rows, | |
const int | cols, | |||
const double | value | |||
) |
Dimensional constructor with default value.
Creates a new matrix of the specified dimensions, and with each one of its cells containing a provided value.
rows | number of rows for the new matrix. | |
cols | number of rows for the new matrix. | |
value | default value to set the elements of the matrix. |
Definition at line 73 of file qvmatrix.cpp.
QVMatrix::QVMatrix | ( | const QVQuaternion & | quaternion | ) |
Rotation matrix constructor.
Creates a rotation matrix from a quaternion.
quaternion | quaternion containing the rotation. |
Definition at line 79 of file qvmatrix.cpp.
QVMatrix::QVMatrix | ( | const gsl_matrix * | matrix | ) |
Copy constructor for gsl_matrix.
matrix | matrix to be copied |
Definition at line 112 of file qvmatrix.cpp.
QVMatrix::QVMatrix | ( | const CvMat * | cvMatrix | ) |
OpenCV matrix conversion constructor.
This function creates a matrix importing the contents of an OpenCV matrix.
cvMatrix | pointer to OpenCV matrix |
Definition at line 136 of file qvmatrix.cpp.
QVMatrix::QVMatrix | ( | const QVVector & | vector, | |
const bool | rowVector = true | |||
) |
Octave matrix conversion constructor.
This function creates a matrix importing the contents of an Octave matrix.
cvMatrix | pointer to OpenCV matrix Converts the matrix to an Octave library matrix structure This function creates a new Octave matrix object with the same dimensions and content than the actual matrix. |
vector | vector to convert to matrix type. | |
rowVector | if true, creates a row matrix from the vector, else creates a column matrix from it. |
Definition at line 84 of file qvmatrix.cpp.
QVMatrix::QVMatrix | ( | const QList< QVVector > & | vectorList | ) |
Constructor from a list of QVVectors.
Creates a new matrix from a list of row QVVectors.
vectorList | list of row vectors. |
Definition at line 93 of file qvmatrix.cpp.
QVMatrix::QVMatrix | ( | const QList< QVector< double > > & | vectorList | ) |
Constructor from a list of QVectors.
Creates a new matrix from a list of row QVectors.
vectorList | list of row vectors. |
Definition at line 102 of file qvmatrix.cpp.
QVMatrix::QVMatrix | ( | const QList< QPointF > & | pointList | ) |
Constructor from a list of QPointF.
Creates a new matrix from a list of points
pointList | list of points. |
Definition at line 129 of file qvmatrix.cpp.
CvMat * QVMatrix::toCvMat | ( | const int | cvMatType = CV_64F |
) | const |
Converts the matrix to an OpenCV matrix structure.
This function creates a new CvMat object with the same dimensions and content of the actual matrix.
cvMatType | OpenCV type of the elements of the new matrix. Actually two types are valid as parameters:
|
Definition at line 143 of file qvmatrix.cpp.
Referenced by operator CvMat *().
QVMatrix::operator CvMat * | ( | ) | const [inline] |
Converts the matrix to an OpenCV matrix structure.
This function creates a new CvMat object with the same dimensions and content than the actual matrix.
Definition at line 183 of file qvmatrix.h.
QVMatrix::operator QList< QVVector > | ( | ) | const [inline] |
Convert to a list of QVVectors operator.
Definition at line 247 of file qvmatrix.h.
QVMatrix::operator QList< QVector< double > > | ( | ) | const [inline] |
Convert to a list of QVectors operator.
Definition at line 258 of file qvmatrix.h.
QVMatrix::operator gsl_matrix * | ( | ) | const |
Convert to a gsl_matrix * operator.
Creates a new gsl_matrix * from a matrix
Definition at line 119 of file qvmatrix.cpp.
bool QVMatrix::operator== | ( | const QVMatrix & | matrix | ) | const [inline] |
Matrix-matrix equality operator.
matrix | term for the compare operation. |
Definition at line 293 of file qvmatrix.h.
Matrix-matrix incremental operator.
matrix | addendum to the actual matrix |
Definition at line 300 of file qvmatrix.h.
bool QVMatrix::operator!= | ( | const QVMatrix & | matrix | ) | const [inline] |
Matrix-matrix unequality operator.
matrix | term for the compare operation. |
Definition at line 311 of file qvmatrix.h.
Matrix-matrix product operator.
matrix | factor for the product operation. |
Definition at line 317 of file qvmatrix.h.
Referenced by operator-().
Matrix-matrix division.
The following expression:
X = A / B
is equivalent to this one
X = A * pseudoInverse(B)
With the difference that the pseudoinverse matrix for B is not directly computed. Instead, the matrix equation:
X * B = A
is solved for the X term. This leads to more stable and efficient results than using the pseudo inverse.
this operator gets X from:
X = A / B -> X * B = A -> B' * X' = A'
using a linear system resolution based on a LU decomposition over A.
matrix | factor for the operation. |
Definition at line 346 of file qvmatrix.h.
Matrix-matrix addition operator.
matrix | term for the operation. |
Definition at line 353 of file qvmatrix.h.
Matrix-matrix substraction operator.
matrix | subtrahend for the operation. |
Definition at line 359 of file qvmatrix.h.
QVMatrix QVMatrix::operator- | ( | ) | const [inline] |
Obtains the additive inverse of the matrix.
Obtains a matrix changing the sign of its elements.
Definition at line 366 of file qvmatrix.h.
QVMatrix QVMatrix::operator* | ( | const double | value | ) | const [inline] |
Matrix-scalar product.
value | factor for the operation. |
Definition at line 374 of file qvmatrix.h.
QVMatrix QVMatrix::operator/ | ( | const double | value | ) | const [inline] |
Matrix-scalar division operator.
value | divider for the operation. |
Definition at line 380 of file qvmatrix.h.
QVMatrix QVMatrix::operator+ | ( | const double | value | ) | const [inline] |
Matrix-scalar addition.
value | addendum for the operation. |
Definition at line 386 of file qvmatrix.h.
QVMatrix QVMatrix::operator- | ( | const double | value | ) | const [inline] |
Matrix-scalar substraction operator.
value | value to substract. |
Definition at line 392 of file qvmatrix.h.
Matrix-vector product.
vector | vector to multiply by. |
Definition at line 399 of file qvmatrix.h.
Appends matrices vertically.
Considering two matrix objects and , this method returns the following matrix object:
matrix | matrix to be appended |
Definition at line 598 of file qvmatrix.cpp.
Referenced by operator&().
Appends matrices horizontally.
Considering two matrix objects and , this method returns the following matrix object:
matrix | matrix to be appended |
Definition at line 572 of file qvmatrix.cpp.
Referenced by operator|().
Appends matrices vertically.
Considering two matrix objects and , this operator returns the following matrix object:
matrix | matrix to be appended |
Definition at line 432 of file qvmatrix.h.
Appends matrices horizontally.
Considering two matrix objects and , this operator returns the following matrix object:
matrix | matrix to be appended |
Definition at line 442 of file qvmatrix.h.
Appends vector to matrix vertically.
Considering a matrix object and a vector object , this operator returns the following matrix object:
vector | vector to be appended |
Definition at line 452 of file qvmatrix.h.
Appends vector to matrix horizontally.
Considering a matrix object and a vector object , this operator returns the following matrix object:
vector | vector to be appended |
Definition at line 462 of file qvmatrix.h.
double& QVMatrix::operator() | ( | const int | row, | |
const int | col | |||
) | [inline] |
Element access operator.
row | main index value for data access | |
col | secondary index value for data access |
Definition at line 470 of file qvmatrix.h.
Referenced by elementProduct(), getCols(), getRows(), norm2(), QVMatrix(), reversedCols(), reversedRows(), and rowHomogeneousNormalize().
double QVMatrix::operator() | ( | const int | row, | |
const int | col | |||
) | const [inline] |
Overloaded version of element access operator.
row | main index value for data access | |
col | secondary index value for data access |
Definition at line 477 of file qvmatrix.h.
int QVMatrix::getDataSize | ( | ) | const [inline] |
Gets the size of the data array.
This returns the number of elements in the matrix.
Definition at line 484 of file qvmatrix.h.
Referenced by addition(), containsInf(), containsNaN(), equals(), inlineAddition(), norm2(), scalarAdd(), scalarDivide(), scalarProduct(), scalarSubstract(), set(), and substract().
const double* QVMatrix::getReadData | ( | ) | const [inline] |
Gets a read-only reference to the data buffer of the matrix.
Definition at line 489 of file qvmatrix.h.
Referenced by addition(), containsInf(), containsNaN(), dotProduct(), equals(), inlineAddition(), isDiagonal(), linear3DPointTriangulation(), linearCameraCenterResection(), linearCameraResection(), norm2(), operator<<(), QVVector::QVVector(), substract(), symmetricEpipolarDistance(), transpose(), and triangularSolve().
double* QVMatrix::getWriteData | ( | ) | [inline] |
Gets a reference of the data buffer of the matrix for read and write accesses.
Definition at line 494 of file qvmatrix.h.
Referenced by addition(), dotProduct(), inlineAddition(), linear3DPointTriangulation(), linearCameraResection(), optimizeReprojectionErrorFor3DPoint(), optimizeReprojectionErrorForCameraPose(), optimizeReprojectionErrorForCameraPoseCauchy(), QVVector::outerProduct(), QVMatrix(), scalarAdd(), scalarDivide(), scalarProduct(), scalarSubstract(), set(), substract(), transpose(), and triangularSolve().
QVMatrix QVMatrix::transpose | ( | ) | const |
Change the order of the indexes in the matrix.
This function reorders the indexes of the matrix.
Definition at line 433 of file qvmatrix.cpp.
Referenced by CholeskyDecompositionResidual(), computeFundamentalMatrix(), eigenDecompositionResidual(), getCameraPosesFromEssentialMatrix(), LQDecomposition(), LQDecompositionResidual(), matrixDivide(), operator|(), QLDecomposition(), QLDecompositionResidual(), QRDecompositionResidual(), qvLinearRegularizedRegression(), QVSparseBlockMatrix::randomSquare(), RQDecomposition(), RQDecompositionResidual(), singularValueDecompositionResidual(), solveFromLUDecomposition(), and QVUKF::update().
void QVMatrix::set | ( | const double | value | ) |
Sets every element of the matrix to a given value.
value | value to set elements in the matrix |
Definition at line 450 of file qvmatrix.cpp.
Referenced by diagonal(), identity(), and zeros().
bool QVMatrix::equals | ( | const QVMatrix & | matrix | ) | const |
Matrix-matrix equality operator.
matrix | term for the compare operation. |
Definition at line 198 of file qvmatrix.cpp.
Referenced by operator!=(), and operator==().
QVMatrix QVMatrix::dotProduct | ( | const QVMatrix & | matrix, | |
const bool | transposeFirstOperand = false , |
|||
const bool | transposeSecondOperand = false | |||
) | const |
Matrix-matrix product.
matrix | second operator for the multiplication. |
Definition at line 235 of file qvmatrix.cpp.
Referenced by computeProjectiveHomography(), QVSparseBlockMatrix::dotProduct(), QVVector::operator*(), operator*(), optimizeReprojectionErrorFor3DPoint(), optimizeReprojectionErrorForCameraPose(), optimizeReprojectionErrorForCameraPoseCauchy(), solveFromQRDecomposition(), and solveFromSingularValueDecomposition().
Matrix-vector product.
vector | second operator for the multiplication. |
Definition at line 216 of file qvmatrix.cpp.
Matrix-matrix element product.
This method returns a matrix containing the product of the elements at the corresponding cells of the actual matrix and the one provided as the input parameter.
matrix | second operator for the multiplication. |
Definition at line 323 of file qvmatrix.cpp.
Matrix-matrix division.
This function solves the X term from the following matrix equation:
where A and B are respectively the actual matrix, and the one given by parameter. This is equivalent to using the following expression for X:
but with a faster method returning a more stable result.
matrix | factor for the operation. |
Definition at line 349 of file qvmatrix.cpp.
Referenced by operator/().
void QVMatrix::triangularSolve | ( | const QVVector & | b, | |
QVVector & | x, | |||
bool | transposed = false , |
|||
bool | unit_diagonal = false | |||
) | const |
Triangular system solving (vector of RHS).
This function solves the x term from the following equation:
where L and b are respectively the actual matrix (which is triangular), and the rhs vector given by parameter.
b | vector for the right hand side (input). | |
x | vector with the solution (output). |
Definition at line 364 of file qvmatrix.cpp.
Referenced by solveFromCholeskyDecomposition(), solveFromLUDecomposition(), and solveFromQRDecomposition().
void QVMatrix::triangularSolve | ( | const QVMatrix & | B, | |
QVMatrix & | X, | |||
bool | transposed = false , |
|||
bool | unit_diagonal = false , |
|||
bool | left = true | |||
) | const |
Triangular system solving (matrix of RHS).
This function solves the X term from the following matrix equation:
where L and B are respectively the actual matrix (which is triangular), and the one given by parameter.
B | vector for the right hand side (input). | |
X | vector with the solution (output). |
Definition at line 392 of file qvmatrix.cpp.
QVMatrix QVMatrix::inverse | ( | ) | const |
Computes the inverse of the matrix.
Por ahora con la misma pseudoinversa, serÃa mejor de otro modo...
Definition at line 421 of file qvmatrix.cpp.
Referenced by BhattacharyyaDistance(), and getCameraPoseFromCalibratedHomography().
double QVMatrix::det | ( | ) | const |
Computes the determinant of the matrix.
Definition at line 427 of file qvmatrix.cpp.
Referenced by BhattacharyyaDistance().
QVVector QVMatrix::meanCol | ( | ) | const |
Obtains the mean vector for the column vectors in the matrix.
Definition at line 953 of file qvmatrix.cpp.
Matrix-matrix addition.
matrix | operand for the add operation. |
Definition at line 460 of file qvmatrix.cpp.
Referenced by operator+().
void QVMatrix::inlineAddition | ( | const QVMatrix & | matrix | ) |
Matrix-matrix addition.
matrix | operand for the add operation. |
Definition at line 478 of file qvmatrix.cpp.
Referenced by operator+=().
Matrix-matrix substraction.
matrix | subtrahend for the operation. |
Definition at line 493 of file qvmatrix.cpp.
Referenced by operator-().
QVMatrix QVMatrix::scalarDivide | ( | const double | value | ) | const |
Matrix-scalar division.
value | scalar value to use in the operation. |
Definition at line 527 of file qvmatrix.cpp.
Referenced by operator/().
QVMatrix QVMatrix::scalarProduct | ( | const double | value | ) | const |
Matrix-scalar product.
value | factor for the operation. |
Definition at line 512 of file qvmatrix.cpp.
Referenced by operator*(), and operator*().
QVMatrix QVMatrix::scalarAdd | ( | const double | value | ) | const |
Matrix-scalar addition.
value | summand for the operation. |
Definition at line 542 of file qvmatrix.cpp.
Referenced by operator+(), and operator+().
QVMatrix QVMatrix::scalarSubstract | ( | const double | value | ) | const |
Matrix-scalar substraction.
value | value to substract. |
Definition at line 557 of file qvmatrix.cpp.
Referenced by operator-(), and operator-().
double QVMatrix::norm2 | ( | ) | const |
Gets the norm2 for matrix.
The resulting value will be the square root of the following sumatory:
where are the elements of the matrix .
Definition at line 626 of file qvmatrix.cpp.
Referenced by QVQuaternion::QVQuaternion(), and QVUKF::update().
double QVMatrix::trace | ( | ) | const |
Gets the trace of the matrix.
The trace of the matrix is the sum of the diagonal elements:
where are the elements of the matrix .
Definition at line 645 of file qvmatrix.cpp.
bool QVMatrix::containsNaN | ( | ) | const |
Checks whether the matrix contains a NaN value or not.
Definition at line 667 of file qvmatrix.cpp.
Referenced by linearCameraPairInitialization(), optimizeReprojectionErrorForCameraPoseCauchy(), and QVQuaternion::QVQuaternion().
bool QVMatrix::containsInf | ( | ) | const |
Checks whether the matrix contains an infinite value or not.
Definition at line 679 of file qvmatrix.cpp.
bool QVMatrix::isDiagonal | ( | ) | const |
Checks whether the matrix is a diagonal matrix or not.
Definition at line 654 of file qvmatrix.cpp.
QVMatrix QVMatrix::rowHomogeneousNormalize | ( | ) | const |
Homogeneous normalization for rows of the matrix.
Definition at line 691 of file qvmatrix.cpp.
int QVMatrix::getCols | ( | ) | const [inline] |
Get width of the matrix.
Definition at line 683 of file qvmatrix.h.
Referenced by CholeskyDecompositionResidual(), determinant(), diagonal(), eigenDecompositionResidual(), eigenValues(), eigenValuesResidual(), Filter(), QVPermutation::fromMatrix(), getCameraPoseFromCalibratedHomography(), getCol(), getCols(), getRow(), getRows(), getSubmatrix(), matrixDivide(), meanCol(), norm2(), QVVector::operator*(), operator<<(), optimizeReprojectionErrorFor3DPoint(), optimizeReprojectionErrorForCameraPose(), pseudoInverse(), qHash(), QLDecompositionResidual(), QRDecompositionResidual(), qvLinearRegularizedRegression(), QVMatrix(), QVSparseBlockMatrix::QVSparseBlockMatrix(), QVUKF::QVUKF(), reversedCols(), reversedRows(), rowHomogeneousNormalize(), QVSparseBlockMatrix::setBlock(), setCol(), setRow(), QVUKF::setState(), setSubmatrix(), singularValueDecompositionResidual(), singularValuesResidual(), solveFromLUDecomposition(), solveFromQRDecomposition(), solveFromSingularValueDecomposition(), solveHomogeneous(), trace(), transpose(), triangularSolve(), and QVUKF::update().
int QVMatrix::getRows | ( | ) | const [inline] |
Get height of the matrix.
Definition at line 688 of file qvmatrix.h.
Referenced by CholeskyDecompositionResidual(), determinant(), diagonal(), eigenDecompositionResidual(), eigenValues(), eigenValuesResidual(), Filter(), QVPermutation::fromMatrix(), getCameraPoseFromCalibratedHomography(), getCol(), getCols(), getRow(), getRows(), getSubmatrix(), LQDecompositionResidual(), matrixDivide(), norm2(), operator QList< QVector< double > >(), operator QList< QVVector >(), QVVector::operator*(), operator<<(), pseudoInverse(), qHash(), QVMatrix(), QVSparseBlockMatrix::QVSparseBlockMatrix(), regressionLine(), reversedCols(), reversedRows(), rowHomogeneousNormalize(), RQDecompositionResidual(), QVSparseBlockMatrix::setBlock(), setCol(), setRow(), setSubmatrix(), singularValuesResidual(), solveFromLUDecomposition(), solveFromQRDecomposition(), solveFromSingularValueDecomposition(), trace(), transpose(), triangularSolve(), and QVUKF::update().
MatrixType QVMatrix::getType | ( | ) | const [inline] |
Get type of the matrix.
See documentation for enum MatrixType. This matrix feature must nowadays be set by handi. In a future, the matrix type will be detected when certain matrix operations and decopositions will be performed.
Definition at line 696 of file qvmatrix.h.
Referenced by triangularSolve().
void QVMatrix::setType | ( | MatrixType | type | ) | [inline] |
Set type of the matrix.
See documentation for enum MatrixType. This matrix feature must nowadays be set by handi. In a future, the matrix type will be detected when certain matrix operations and decopositions will be performed.
Definition at line 704 of file qvmatrix.h.
Referenced by LQDecomposition(), QLDecomposition(), RQDecomposition(), solveFromLUDecomposition(), and solveFromQRDecomposition().
const QVMatrix QVMatrix::getCols | ( | const int | firstCol, | |
const int | lastCol | |||
) | const [inline] |
Get submatrix composed by given column range.
firstCol | first column to be included in the submatrix. | |
lastCol | last column to be included in the submatrix. |
Definition at line 711 of file qvmatrix.h.
const QVMatrix QVMatrix::getRows | ( | const int | firstRow, | |
const int | lastRow | |||
) | const [inline] |
Get submatrix composed by given row range.
firstRow | first row to be included in the submatrix. | |
lastRow | last row to be included in the submatrix. |
Definition at line 729 of file qvmatrix.h.
const QVVector QVMatrix::getRow | ( | const int | row | ) | const |
Gets a row of the matrix.
row | row number, a value within [0, r-1], for a matrix with 'r' rows |
Definition at line 702 of file qvmatrix.cpp.
Referenced by computeAffineHomography(), QVPermutation::fromMatrix(), getSubmatrix(), operator QList< QVector< double > >(), operator QList< QVVector >(), QVUKF::update(), and verticalAppend().
void QVMatrix::setRow | ( | const int | row, | |
QVVector | vector | |||
) |
Sets a row of the matrix.
row | row number, a value within [0, r-1], for a matrix with 'r' rows | |
vector | a vector containing the values for the row |
Definition at line 714 of file qvmatrix.cpp.
Referenced by getSubmatrix(), QVMatrix(), QVVector::toRowMatrix(), QVUKF::update(), and verticalAppend().
void QVMatrix::setRow | ( | const int | row, | |
QVector< double > | vector | |||
) |
Sets a row of the matrix.
row | row number, a value within [0, r-1], for a matrix with 'r' rows | |
vector | a vector containing the values for the row |
Definition at line 724 of file qvmatrix.cpp.
const QVVector QVMatrix::getCol | ( | const int | col | ) | const |
Gets a column of the matrix.
col | column number, a value within [0, c-1], for a matrix with 'c' columns |
Definition at line 734 of file qvmatrix.cpp.
Referenced by computeProjectiveHomography(), getCameraPoseFromCalibratedHomography(), getCameraPosesFromEssentialMatrix(), horizontalAppend(), meanCol(), pseudoInverse(), and solveHomogeneous().
void QVMatrix::setCol | ( | const int | col, | |
QVVector | vector | |||
) |
Sets a column of the matrix.
col | column number, a value within [0, c-1], for a matrix with 'c' columns | |
vector | a vector containing the values for the column |
Definition at line 746 of file qvmatrix.cpp.
Referenced by getCameraPoseFromCalibratedHomography(), horizontalAppend(), QVMatrix(), and QVVector::toColumnMatrix().
const QVMatrix QVMatrix::getSubmatrix | ( | const int | firstRow, | |
const int | lastRow, | |||
const int | firstCol, | |||
const int | lastCol | |||
) | const |
Gets a submatrix from a matrix.
firstCol | first column number for the submatrix | |
firstRow | first row number for the submatrix | |
lastCol | last column number for the submatrix | |
lastRow | last row number for the submatrix |
Definition at line 768 of file qvmatrix.cpp.
Referenced by QVEuclideanMapping3::QVEuclideanMapping3(), QVSparseBlockMatrix::QVSparseBlockMatrix(), and testCheirality().
void QVMatrix::setSubmatrix | ( | const int | row, | |
const int | col, | |||
const QVMatrix & | M | |||
) |
Sets a submatrix from a matrix.
row | first column number for the submatrix | |
col | first row number for the submatrix | |
M | Submatrix |
Definition at line 785 of file qvmatrix.cpp.
Referenced by QVSparseBlockMatrix::operator QVMatrix().
QVMatrix QVMatrix::reversedRows | ( | ) | const |
Gets a matrix with reversed rows (bottom to top).
Definition at line 797 of file qvmatrix.cpp.
Referenced by QLDecomposition(), and RQDecomposition().
QVMatrix QVMatrix::reversedCols | ( | ) | const |
Gets a matrix with reversed columns (right to left).
Definition at line 809 of file qvmatrix.cpp.
Referenced by QLDecomposition(), and RQDecomposition().
const QVVector QVMatrix::diagonal | ( | ) | const |
Gets the diagonal of the matrix.
Definition at line 757 of file qvmatrix.cpp.
Referenced by eigenDecompositionResidual(), and singularValueDecompositionResidual().
QVMatrix QVMatrix::identity | ( | const int | size | ) | [static] |
Creates an identity matrix.
size | number of cols and rows for the identity matrix |
Definition at line 824 of file qvmatrix.cpp.
Referenced by computeSimilarHomography(), eigenDecompositionResidual(), linearCameraPairInitialization(), LQDecompositionResidual(), multiply(), QLDecompositionResidual(), QRDecompositionResidual(), qvLinearRegularizedRegression(), rotationMatrix(), rotationMatrix3dXAxis(), rotationMatrix3dYAxis(), rotationMatrix3dZAxis(), RQDecompositionResidual(), scaleMatrix(), singularValueDecompositionResidual(), QVCameraPose::toProjectionMatrix(), QVEuclideanMapping3::toRotationTranslationMatrix(), translationMatrix(), translationMatrix3d(), and QVUKF::update().
QVMatrix QVMatrix::cameraCalibrationMatrix | ( | const double | f, | |
const double | r = 1.0 , |
|||
const double | cx = 0.0 , |
|||
const double | cy = 0.0 , |
|||
const double | s = 0.0 | |||
) | [static] |
Creates an intrinsic camera calibration matrix.
This function returns the following matrix, corresponding to the intrinsic calibration matrix of a camera:
provided the intrinsic parameters , , , and of that camera.
f | value for the camera focal | |
r | aspect ratio | |
cx | first coordinate for the principal point of the image | |
cy | second coordinate for the principal point of the image | |
s | camera skew |
Definition at line 833 of file qvmatrix.cpp.
Referenced by computeCameraFocalFromPlanarHomography(), getCameraFocals(), and readReconstruction_NVM().
QVMatrix QVMatrix::zeros | ( | const int | rows, | |
const int | cols | |||
) | [static] |
Creates a zero matrix.
rows | number of cols and rows for the identity matrix | |
cols | number of cols and rows for the identity matrix |
Definition at line 839 of file qvmatrix.cpp.
QVMatrix QVMatrix::random | ( | const int | rows, | |
const int | cols | |||
) | [static] |
Creates a matrix of random values.
This function returns a matrix containing random values, from a uniform distribution [0,1].
rows | rows of the matrix | |
cols | cols of the matrix |
Definition at line 846 of file qvmatrix.cpp.
Referenced by QVSparseBlockMatrix::randomSquare().
Creates a diagonal matrix with given entries.
diagonalVector | vector containing the diagonal values |
Definition at line 855 of file qvmatrix.cpp.
QVMatrix QVMatrix::rotationMatrix | ( | const double | angle | ) | [static] |
Create a rotation matrix for points in the 2D plane.
angle | angle to rotate around coordinate center |
Definition at line 865 of file qvmatrix.cpp.
Referenced by computeSimilarHomography(), and rotationMatrix().
QVMatrix QVMatrix::rotationMatrix | ( | const QPointF | center, | |
const double | angle | |||
) | [static] |
Create a rotation matrix for points in the 2D plane.
angle | angle to rotate around coordinate center | |
center | point at the center of the rotation |
Definition at line 876 of file qvmatrix.cpp.
QVMatrix QVMatrix::translationMatrix | ( | const double | x, | |
const double | y | |||
) | [static] |
Create a 2D translation matrix.
x | increment in X axis | |
y | increment in Y axis |
Definition at line 882 of file qvmatrix.cpp.
Referenced by computeSimilarHomography(), and rotationMatrix().
QVMatrix QVMatrix::scaleMatrix | ( | const double | zoom | ) | [static] |
Create a 2D scale matrix.
zoom | scale |
Definition at line 893 of file qvmatrix.cpp.
Referenced by computeSimilarHomography().
QVMatrix QVMatrix::rotationMatrix3dXAxis | ( | const double | angle | ) | [static] |
Create a rotation matrix for 3D-X axis.
angle | angle to rotate around X axis in radians |
Definition at line 916 of file qvmatrix.cpp.
QVMatrix QVMatrix::rotationMatrix3dYAxis | ( | const double | angle | ) | [static] |
Create a rotation matrix for 3D-Y axis.
angle | angle to rotate around Y axis in radians |
Definition at line 929 of file qvmatrix.cpp.
QVMatrix QVMatrix::rotationMatrix3dZAxis | ( | const double | angle | ) | [static] |
Create a rotation matrix for 3D-Z axis.
angle | angle to rotate around Z axis in radians |
Definition at line 903 of file qvmatrix.cpp.
QVMatrix QVMatrix::translationMatrix3d | ( | const double | x, | |
const double | y, | |||
const double | z | |||
) | [static] |
Create a 3D translation matrix.
x | increment in X axis | |
y | increment in Y axis | |
z | increment in Z axis |
Definition at line 942 of file qvmatrix.cpp.
QVMatrix QVMatrix::reshape | ( | const int | newRows, | |
const int | newCols | |||
) | const [inline] |
Create a new matrix with different size and the same content.
This method creates a matrix with the dimensions specified in the input arguments, keeping the elements of the actual matrix.
rows | ||
cols |
Definition at line 897 of file qvmatrix.h.
Compute the product of a list of matrices.
matrices | matrice list |
Definition at line 908 of file qvmatrix.h.