#include #include #include #include #include "nr.h" using namespace std; // Driver for routine gaussj int main(void) { int j,k,l,m,n; string dummy; ifstream fp("matrx1.dat"); if (fp.fail()) NR::nrerror("Data file matrx1.dat not found"); cout << fixed << setprecision(6); getline(fp,dummy); while (!fp.eof()) { getline(fp,dummy); fp >> n >> m; fp.get(); getline(fp,dummy); Mat_DP a(n,n),u(n,n),b(n,m),t(n,m); for (k=0;k> a[k][l]; fp.get(); getline(fp,dummy); for (l=0;l> b[k][l]; fp.get(); getline(fp,dummy); // save matrices for later testing of results Mat_DP ai=a; Mat_DP x=b; // invert matrix NR::gaussj(ai,x); cout << endl << "Inverse of matrix a : " << endl; for (k=0;k