ocmath_inverse

 

Contents

Description

Compute the inverse of a non-singular matrix.

Syntax

int ocmath_inverse( double * pMatIO, int n )

Parameters

pMatIO
[modify] input: pointer to original matrix
output: pointer to matrix inverse if success
n
[input] The input matrix's cols or rows, because is a rectangle matrix

Return

NE_NOERROR = 0, Success

NE_SINGULAR = 366, The matrix is singular, possibly due to rounding errors.

NE_INT_ARG_LT = 11, On entry, n must not be less than 1.

NE_BAD_PARAM = 70, On entry, n must not be less than 1.

NE_ALLOC_FAIL = 73, Memory allocation failed.

Examples

EX1

void ocmath_inverse_ex1()
{
    matrix mat0={{2,3,5},{7,11,13},{17,19,23}};
    int n = mat0.GetNumRows();
    int iRet = ocmath_inverse(mat0, n);
}

Remark

See Also

header to Include

origin.h

Reference

nag_real_lu(f03afc)nag_real_lu(f03afc), Nag Manual