/*** These are from numerical_recipes in C. */ /*** PROBLEM: Thier counts went from 1 to N. **/ /*** I Changed that. ***/ #include #include #include "scconst.h" #define MAX_MATRIX_SIZE MAX_NUM_SCORE_DIM /*** gaussj replaces a by its inverse?? If b starts as identity matrix?? ***/ #define SWAP(a,b) {double temp=(a);(a)=(b);(b)=temp;} void gaussj(a,n,b,m) double a[MAX_MATRIX_SIZE][MAX_MATRIX_SIZE],b[MAX_MATRIX_SIZE][MAX_MATRIX_SIZE]; int n,m; { int *indxc,*indxr,*ipiv; int i,icol,irow,j,k,l,ll,*ivector(); double big,dum,pivinv; void nrerror(),free_ivector(); indxc=ivector(1,n); indxr=ivector(1,n); ipiv=ivector(1,n); for (j=0;j= big) { big=fabs(a[j][k]); irow=j; icol=k; } } else if (ipiv[k] > 1) nrerror("GAUSSJ: Singular Matrix-1"); } ++(ipiv[icol]); if (irow != icol) { for (l=0;l=0;l--) { if (indxr[l] != indxc[l]) for (k=0;k big) big=temp; } if (big == 0.0) nrerror("Singular matrix in routine LUDCMP"); vv[i]=1.0/big; } for (j=0;j= big) { big=dum; imax=i; } } if (j != imax) { for (k=0;k=0;i--) { sum=b[i]; for (j=i+1;j