111 std::array< std::array < T, n >, m > &A,
112 std::array< T, m > &B,
113 std::array< T, n > &x
122std::array< std::array < T, n >, m > C;
130if (m == 0) {
return; }
131if (n == 0) {
return; }
142if (std::abs(dA) < 1.0e-14) {
147for (i = 0; i < m; i++) {
151 for (j = 0; j < m; j++) {
178 std::array< std::array < double, m >, m > &A,
179 std::array< std::array < double, m >, m > &L,
180 std::array< std::array < double, m >, m > &U,
181 std::array< std::array < double, m >, m > *P
189double toll_pivot = 1.0e-8;
194double pivot, pivot_trial;
195std::array<std::array<double, m>, m> AA;
203if (m == 0) {
return(3); };
222for (k = 0; k < m; k++) {
227 pivot = std::abs(AA[k][k]);
228 for (i = k+1; i < m; i++) {
229 pivot_trial = std::abs(AA[i][k]);
230 if (pivot_trial > pivot) {
237 if (pivot_row == k) {
238 if (pivot < 1.0e-14) {
242 else if ((pivot >= 1.0e-14) && (pivot < toll_pivot)) {
247 swap(AA[k], AA[pivot_row]);
249 swap((*P)[k], (*P)[pivot_row]);
254 for (i = k+1; i < m; i++) {
255 L[i][k] = AA[i][k]/AA[k][k] ;
256 for (j = k+1; j < m; j++) {
257 AA[i][j] = AA[i][j] - L[i][k]*AA[k][j];
261 for (j = k; j < m; j++) {
279 std::array< std::array < double, m >, m > &A,
280 std::array< double, m > &B,
281 std::array< double, m > &x
297if (m == 0) {
return; };
303for (i = 0; i < m; i++) {
306if (std::abs(d) < 1.0e-14) {
313for (i = m-1; i >= 0; i--) {
315 for(p = m-1; p > i; p--) {
318 x[i] = (B[i] -
sum)/A[i][i];
334 std::array< std::array < double, m >, m > &A,
335 std::array< double, m > &B,
336 std::array< double, m > &x
353if (m == 0) {
return; };
359for (i = 0; i < m; i++) {
362if (std::abs(d) < 1.0e-14) {
369for(i = 0; i < m; i++) {
371 for(p = 0; p < i; p++) {
372 sum += A[i][p] * x[p];
374 x[i] = (B[i] -
sum)/A[i][i];
390 std::array< std::array< double, m >, m > &A,
391 std::array< double, m > &B,
392 std::array< double, m > &x
401std::array<std::array<double, m>, m> L, U, P, *P_ = &P;
402std::array<double, m> z, C;
411if ((info == 2) || (info == 3)) {