| ocmath_qr  DescriptionGet matrix decomposition that can be used to solve linear systems of equations. Syntax
int ocmath_qr( const double * pMatI, double * pQ, double * pR, int rows, int cols )
 Parameters
    pMatI[input] pointer to the original matrixpQ[output] pointer to matrix QpR[output] pointer to matrix Rrows[input] row number of the original matrixcols[input] column number of the original matrix Return0 : success -1 : rows or cols is not positive ExamplesEX1 
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);
}
RemarkQR 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. See Alsoheader to Includeorigin.h Reference |