7extern int Mdcxmatinv(
double *array,
int *norder,
double *det){
16 cout <<
"In Mdcxmatinv, norder ( = " << *norder <<
" ) > nmax ( = "
17 << nmax <<
" ); error" << endl;
return 1000;
19 static double amax, save;
20 static int i, j, k, l, ik[nmax], jk[nmax];
27 for (k = 1; k <= *norder; ++k) {
33 for (i = k; i <= *norder; ++i) {
34 for (j = k; j <= *norder; ++j) {
35 d__1 = array[i + j * nmax];
36 if ((fabs(amax)-fabs(d__1)) <= 0.) {
37 amax = array[i + j * nmax];
46 if (amax == 0.) {*det = (double)0.;
return 1001;}
49 if ((i__3 = i - k) < 0) {
51 }
else if (i__3 == 0) {
57 for (j = 1; j <= *norder; ++j) {
58 save = array[k + j * nmax];
59 array[k + j * nmax] = array[i + j * nmax];
60 array[i + j * nmax] = -save;
64 if ((i__3 = j - k) < 0) {
66 }
else if (i__3 == 0) {
72 for (i = 1; i <= *norder; ++i) {
73 save = array[i + k * nmax];
74 array[i + k * nmax] = array[i + j * nmax];
75 array[i + j * nmax] = -save;
81 for (i = 1; i <= *norder; ++i) {
83 array[i + k * nmax] = -array[i + k * nmax] / amax;
86 for (i = 1; i <= *norder; ++i) {
87 for (j = 1; j <= *norder; ++j) {
100 array[i+j*nmax] += array[i+k*nmax] * array[k+j*nmax];
105 for (j = 1; j <= *norder; ++j) {
107 array[k + j * nmax] /= amax;
110 array[k + k * nmax] = (double)1. / amax;
116 for (l = 1; l <= *norder; ++l) {
125 for (i = 1; i <= *norder; ++i) {
126 save = array[i + k * nmax];
127 array[i + k * nmax] = -array[i + j * nmax];
128 array[i + j * nmax] = save;
138 for (j = 1; j <= *norder; ++j) {
139 save = array[k + j * nmax];
140 array[k + j * nmax] = -array[i + j * nmax];
141 array[i + j * nmax] = save;
int Mdcxmatinv(double *array, int *norder, double *det)