14 double s,
t, tq = 0., zr = 1.e-15;
16 double *pa, *pd, *
ps, *p, *q, *q0;
20 le = (
int *)
malloc(n *
sizeof(
int));
21 q0 = (
double *)
malloc(n *
sizeof(
double));
22 for (j = 0, pa = pd = a; j < n; ++j, ++pa, pd += n + 1) {
24 for (i = 0, q = q0, p = pa; i < n; ++i, p += n)
26 for (i = 1; i < n; ++i) {
28 for (k = 0, p = pa + i * n - j, q = q0,
t = 0.; k < lc; ++k)
32 for (i = 0, q = q0, p = pa; i < n; ++i, p += n)
37 for (k = j + 1,
ps = pd; k < n; ++k) {
38 if ((
t = fabs(*(
ps += n))) > s) {
51 for (k = 0, p = a + n * j, q = a + n * lc; k < n; ++k) {
57 for (k = j + 1,
ps = pd,
t = 1. / *pd; k < n; ++k)
61 for (j = 1, pd =
ps = a; j < n; ++j) {
62 for (k = 0, pd += n + 1, q = ++
ps; k < j; ++k, q += n)
65 for (j = 1, pa = a; j < n; ++j) {
67 for (i = 0, q = q0, p = pa; i < j; ++i, p += n)
69 for (k = 0; k < j; ++k) {
71 for (i = k, p = pa + k * n + k - j, q = q0 + k; i < j; ++i)
75 for (i = 0, q = q0, p = pa; i < j; ++i, p += n)
78 for (j = n - 2, pd = pa = a + n * n - 1; j >= 0; --j) {
81 for (i = 0, m = n - j - 1, q = q0, p = pd + n; i < m; ++i, p += n)
83 for (k = n - 1,
ps = pa; k > j; --k,
ps -= n) {
85 for (i = j + 1, p =
ps, q = q0; i < k; ++i)
89 for (i = 0, m = n - j - 1, q = q0, p = pd + n; i < m; ++i, p += n)
92 for (k = 0, pa = a; k < n - 1; ++k, ++pa) {
93 for (i = 0, q = q0, p = pa; i < n; ++i, p += n)
95 for (j = 0,
ps = a; j < n; ++j,
ps += n) {
110 for (i = 0, q = q0, p = pa; i < n; ++i, p += n)
113 for (j = n - 2, le--; j >= 0; --j) {
114 for (k = 0, p = a + j, q = a + *(--le); k < n; ++k, p += n, q += n) {
int minv(double *a, int n)