BOOL inverse(double** a, int n)
Replaces the matrix a with its inverse. The routine returns TRUE if the inversion was successful, otherwise it returns FALSE.
Parameters:
a | Matrix to invert. |
---|---|
n | Size of a. |
Returns:
TRUE if a was successfully inverted, FALSE otherwise. On return, a is replaced with its inverse.
Usage:
double** a; BOOL success; a = dmatrix(0, 3, 0, 3); // initialize the a[i][j] elements success = inverse(a, 4); free_dmatrix(a, 0, 3, 0);
Header:
#include "linalg.h"