#ifndef lint static char *rcs="$Header: /mit/hst/src/sim/RCS/lineqs.c,v 2.2 90/08/28 14:45:44 tldavis Exp $"; #endif /************************************************************************/ /* */ /* lineqs.c Version 1.0 Robert Sah Aug 1983 */ /* Tim Davis Aug 1990 */ /* $Source: /mit/hst/src/sim/RCS/lineqs.c,v $ */ /* */ /* routine which... */ /* */ /* - finds solution vector to a set of N simultaneous */ /* linear equations using the Gauss-Jordan reduction */ /* algorithm with the diagonal pivot strategy. NxN */ /* matrix A contains the coefficients; B contains */ /* the right-hand side vector. */ /* */ /* (Carnahan B., Luther H., Wilkes J.: Applied */ /* Numerical Methods, 1969, p. 276) */ /* */ /************************************************************************/ #include #define N 8 #define EPS 0.00001 /*PUBLIC*/ int lineqs (A,B) double A[][N],B[]; { int i,j,k; for (k=0; k