/*$Id: dgedi.c,v 1.15 2000/04/09 04:36:19 bsmith Exp bsmith $*/
/*
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 LINPACKdgefa(). Performed in-place for an n by n
dense matrix.
Used by the sparse factorization routines in
src/mat/impls/baij/seq and src/mat/impls/bdiag/seq
See also src/inline/ilu.h
*/
#include "petsc.h"
#undef __FUNC__
#define __FUNC__ /**/"LINPACKdgedi"
int LINPACKdgedi(MatScalar *a,int n,int *ipvt,MatScalar *work)
{
int i__2,kb,kp1,nm1,i,j,k,l,ll,kn,knp1,jn1;
MatScalar *aa,*ax,*ay,tmp;
MatScalar t;
PetscFunctionBegin;
--work;
--ipvt;
a -= n + 1;
/* compute inverse(u) */
for (k = 1; k <= n; ++k) {
kn = k*n;
knp1 = kn + k;
a[knp1] = 1.0 / a[knp1];
t = -a[knp1];
i__2 = k - 1;
aa = &a[1 + kn];
for (ll=0; ll