/* minv.c * * Matrix inversion * * * * SYNOPSIS: * * int n, errcod; * double A[n*n], X[n*n]; * double B[n]; * int IPS[n]; * int minv(); * * errcod = minv( A, X, n, B, IPS ); * * * * DESCRIPTION: * * Finds the inverse of the n by n matrix A. The result goes * to X. B and IPS are scratch pad arrays of length n. * The contents of matrix A are destroyed. * * The routine returns nonzero on error; error messages are printed * by subroutine simq(). * */ minv( A, X, n, B, IPS ) double A[], X[]; int n; double B[]; int IPS[]; { double *pX; int i, j, k; for( i=1; i