Get matrix decomposition that can be used to solve linear systems of equations.
int ocmath_qr( const double * pMatI, double * pQ, double * pR, int rows, int cols )
- [input] pointer to the original matrix
- [output] pointer to matrix Q
- [output] pointer to matrix R
- [input] row number of the original matrix
- [input] column number of the original matrix
0 : success
-1 : rows or cols is not positive
int m = mat0.GetNumRows();
int n = mat0.GetNumCols();
int iRet = ocmath_qr(mat0, matQ, matR, m, n);
QR decomposition. Given a Matrix A, its QR-decomposition is of the form A = QR.
where R is an upper Triangular Matrix and Q is an Orthogonal Matrix, i.e., one satisfying Q'Q = I where I is the Identity Matrix.
This matrix decomposition can be used to solve linear systems of equations.
Header to Include