#ifndef lint static char vcid[] = "$Id: baijfact.c,v 1.6 1996/02/20 18:52:30 curfman Exp bsmith $"; #endif /* This file creating by running f2c linpack. this version dated 08/14/78 cleve moler, university of new mexico, argonne national lab. Computes the inverse of a matrix given its factors and pivots calculated by Linpack_DGEFA(). */ #include "petsc.h" int Linpack_DGEDI(Scalar *a,int n,int *ipvt,Scalar *work) { int a_offset, i__2,kb, kp1, nm1,i, j, k, l, ll; Scalar t, *aa,*ax,*ay,tmp; --work; --ipvt; a_offset = n + 1; a -= a_offset; /* compute inverse(u) */ for (k = 1; k <= n; ++k) { a[k + k * n] = 1. / a[k + k * n]; t = -a[k + k * n]; i__2 = k - 1; /* dscal_(&i__2, &t, &a[k * n + 1], &c__1); */ aa = &a[k * n + 1]; for ( ll=0; ll