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 )
0 : success
-1 : rows or cols is not positive
EX1
void ocmath_qr_ex1() { matrix mat0={{2,3,5,7},{11,13,17,19},{23,29,31,37}}; matrix matQ,matR; int m = mat0.GetNumRows(); int n = mat0.GetNumCols(); matQ.SetSize(m, m); matR.SetSize(m, n); 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.
origin.h