65 #define TCL_MXMAD(n_,a,b,c,i,j,k) \ 67 int l, m, n, ia, ic, ib, ja, jb, iia, iib, ioa, iob; \ 74 const int iandj1[] = {2, 2 , 2 , 2 , 1 , 1 , 1 , 1 , 3 , 3 , 3 , 3 }; \ 75 const int iandj2[] = { 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4 }; \ 76 int n1 = iandj1[n_]; \ 77 int n2 = iandj2[n_]; \ 78 if (i == 0 || k == 0) return 0; \ 81 case 1: iia = 1; ioa = j; iib = k; iob = 1; break; \ 82 case 2: iia = 1; ioa = j; iib = 1; iob = j; break; \ 83 case 3: iia = i; ioa = 1; iib = k; iob = 1; break; \ 84 case 4: iia = i; ioa = 1; iib = 1; iob = j; break; \ 85 default: iia = ioa = iib = iob = 0; assert(iob); \ 89 for (l = 1; l <= i; ++l) { \ 91 for (m = 1; m <= k; ++m,++ic) { \ 93 case 1: c[ic] = 0.; break; \ 94 case 3: c[ic] = -c[ic]; break; \ 96 if (j == 0) continue; \ 99 for (n = 1; n <= j; ++n, ja+=iia, jb+=iib) \ 100 cic += a[ja] * b[jb]; \ 109 float *
TCL::mxmad_0_(
int n_,
const float *
a,
const float *b,
float *
c,
int i,
int j,
int k)
117 double *
TCL::mxmad_0_(
int n_,
const double *
a,
const double *b,
double *
c,
int i,
int j,
int k)
130 #define TCL_MXMLRT( n__, a, b, c, ni,nj) \ 131 if (ni <= 0 || nj <= 0) return 0; \ 133 int ia, ib, ic, ja, kc, ii, jj, kj, ki, ia1, ib1, ic1, ja1; \ 134 int ipa = 1; int jpa = nj; \ 135 if (n__ == 1) { ipa = ni; jpa = 1; } \ 140 for (ii = 1; ii <= ni; ++ii, ic1+=ni, ia1+=jpa) { \ 142 for (kc = 1; kc <= ni; ++kc,ic++) c[ic] = 0.; \ 144 for (jj = 1; jj <= nj; ++jj,++ib1,ja1 += ipa) { \ 145 ib = ib1; ia = ia1; \ 147 for (kj = 1;kj <= nj;++kj,ia+=ipa,ib += nj) \ 148 x += a[ia] * b[ib]; \ 149 ja = ja1; ic = ic1; \ 150 for (ki = 1; ki <= ni; ++ki,++ic,ja += jpa) \ 151 c[ic] += x * a[ja]; \ 198 double *
TCL::mxmlrt_0_(
int n__,
const double *
a,
const double *b,
double *
c,
int ni,
int nj)
212 #define TCL_MXTRP(a, b, i, j) \ 213 if (i == 0 || j == 0) return 0; \ 216 for (int k = 1; k <= j; ++k) \ 218 for (int l = 1; l <= i; ++l,ia += j,++ib) b[ib] = a[ia]; } 259 #define TCL_TRAAT(a, s, m, n) \ 261 int ipiv, i, j, ipivn, ia, is, iat; \ 265 for (i = 1; i <= m; ++i) { \ 269 for (j = 1; j <= i; ++j) { \ 274 sum += a[ia] * a[iat]; \ 275 } while (ia < ipivn); \ 319 #define TCL_TRAL(a, u, b, m, n) \ 320 int indu, i, j, k, ia, ib, iu; \ 324 for (i = 1; i <= m; ++i) { \ 326 for (j = 1; j <= n; ++j) { \ 331 for (k = j; k <= n; ++k) {\ 332 sum += a[ia] * u[iu]; \ 353 float *
TCL::tral(
const float *
a,
const float *u,
float *b,
int m,
int n)
370 double *
TCL::tral(
const double *
a,
const double *u,
double *b,
int m,
int n)
380 #define TCL_TRALT(a, u, b, m, n) \ 381 int indu, j, k, ia, ib, iu; \ 385 indu = (n * n + n) / 2; \ 388 for (j = 1; j <= n; ++j) { \ 391 for (k = j; k <= n; ++k) {\ 392 sum += a[ia] * u[iu]; \ 429 double *
TCL::tralt(
const double *
a,
const double *u,
double *b,
int m,
int n)
439 #define TCL_TRAS(a, s, b, m, n) \ 440 int inds, i__, j, k, ia, ib, is; \ 443 ib = 0; inds = 0; i__ = 0; \ 448 for (j = 1; j <= m; ++j) { \ 453 if (k > i__) is += k; \ 456 sum += a[ia] * s[is]; \ 477 float *
TCL::tras(
const float *
a,
const float *s,
float *b,
int m,
int n)
494 double *
TCL::tras(
const double *
a,
const double *s,
double *b,
int m,
int n)
505 #define TCL_TRASAT(a, s, r__, m, n) \ 507 int ia, mn, ir, is, iaa; \ 510 imax = (m * m + m) / 2; \ 511 vzero(&r__[1], imax); \ 522 if (k > i__) is += k; \ 525 sum += s[is] * a[ia]; \ 531 r__[ir] += sum * a[iaa];\ 533 } while (iaa <= ia); \ 604 int i__, j, ia, mn, ir, iat;
614 for (i__ = 1; i__ <=
m; ++i__) {
615 for (j = 1; j <= i__; ++j) {
620 sum += a[ia] * a[iat];
644 int inds, i__, j, k, ia, ib, is;
651 ib = 0; inds = 0; i__ = 0;
656 for (j = 1; j <=
m; ++j) {
663 if (k > i__) is += k;
665 sum += a[ia] * s[is];
692 int ia, ir, is, iaa, ind;
699 imax = (m * m +
m) / 2;
700 vzero(&r__[1], imax);
708 for (j = 1; j <=
m; ++j) {
715 if (k > i__) is += k;
717 sum += s[is] * a[ia];
723 for (k = 1; k <= j; ++k) {
726 r__[ir] += sum * a[iaa];
747 int ipiv, kpiv, i__, j;
766 for (j = i__; j <=
n; ++j) {
768 if (i__ == 1)
goto L40;
769 if (r__ == 0.)
goto L42;
774 sum += b[kd] * b[
id];
781 if (j != i__) b[kpiv] = sum * r__;
785 if (r__ > 0.) r__ = 1. / dc;
818 kpiv = (n * n +
n) / 2;
827 if (i__ == n)
goto L40;
828 if (r__ == 0.)
goto L42;
837 sum += b[
id] * b[kd];
843 if (kpiv < ipiv) b[kpiv] = sum * r__;
847 if (r__ > 0.) r__ = 1. / dc;
850 }
while (kpiv > ipiv - i__);
870 int lhor, ipiv, lver, j;
880 mx = (n * n +
n) / 2;
886 if (t[ipiv] > 0.) r__ = 1. / t[ipiv];
891 while (ind != ipiv) {
901 sum += t[lhor] * s[lver];
903 }
while (lhor < ind);
927 float *
TCL::trla(
const float *u,
const float *
a,
float *b,
int m,
int n)
929 int ipiv, ia, ib, iu;
937 ipiv = (m * m +
m) / 2;
946 sum += a[ia] * u[iu];
953 }
while (ia > 1 - n);
973 int ipiv, mxpn, i__, nTep, ia, ib, iu, mx;
998 sum += a[ia] * u[iu];
1005 }
while (ia < mxpn);
1024 int i__, ia, ind, ipiv;
1034 for (i__ = 1; i__ <=
n; ++i__) {
1040 }
while (ind < ipiv);
1059 int indq, inds, imax, i__, j, k,
l;
1060 int iq, ir, is, iqq;
1067 imax = (m * m +
m) / 2;
1068 vzero(&r__[1], imax);
1086 if (k > i__) is += k;
1092 sum += s[is] * q[
iq];
1100 if (l > i__) iqq +=
l;
1102 r__[ir] += q[iqq] * sum;
1126 int inds, i__, j, k, ia, ib, is;
1140 for (j = 1; j <=
n; ++j) {
1147 if (k > i__) is += k;
1149 sum += s[is] * a[ia];
1177 return trsmul(gi, gi, n);
1192 int lhor, lver, i__, k,
l, ind;
1199 ind = (n * n +
n) / 2;
1201 for (i__ = 1; i__ <=
n; ++i__) {
1204 for (k = i__; k <=
n; ++k,--ind) {
1205 lhor = ind; sum = 0.;
1206 for (l = k; l <=
n; ++
l,--lver,--lhor)
1207 sum += u[lver] * u[lhor];
1227 int lhor, lver, lpiv, i__, j, k, ind;
1236 for (i__ = 1; i__ <=
n; ++i__) {
1238 for (j = 1; j <= i__; ++j,++ind) {
1242 for (k = i__; k <=
n; lhor += k,lver += k,++k)
1243 sum += g[lver] * g[lhor];
1262 int i__, im, is, iu, iv, ih, m2;
1313 int inds, i__, j, k, ia, ib, is;
1328 for (j = 1; j <=
n; ++j) {
1334 if (k > i__) is += k;
1337 sum += s[is] * a[ia];
1364 int i__, j, ia, mn, ir, iat;
1374 for (i__ = 1; i__ <=
m; ++i__) {
1376 for (j = 1; j <= i__; ++j) {
1382 sum += a[ia] * a[iat];
1406 int inds, i__, j, k, ia, ib, is;
1413 ib = 0; inds = 0; i__ = 0;
1419 for (j = 1; j <=
m; ++j) {
1426 if (k > i__) is += k;
1428 sum += a[ia] * s[is];
1454 int imax, i__, j, k;
1455 int ia, ir, is, iaa, ind;
1462 imax = (m * m +
m) / 2;
1463 vzero(&r__[1], imax);
1471 for (j = 1; j <=
m; ++j) {
1478 if (k > i__) is += k;
1480 sum += s[is] * a[ia];
1486 for (k = 1; k <= j; ++k) {
1489 r__[ir] += sum * a[iaa];
1510 int ipiv, kpiv, i__, j;
1529 for (j = i__; j <=
n; ++j) {
1531 if (i__ == 1)
goto L40;
1532 if (r__ == 0.)
goto L42;
1533 id = ipiv - i__ + 1;
1534 kd = kpiv - i__ + 1;
1537 sum += b[kd] * b[
id];
1539 }
while (
id < ipiv);
1542 sum = a[kpiv] - sum;
1544 if (j != i__) b[kpiv] = sum * r__;
1548 if (r__ > 0.) r__ = (double)1. / dc;
1570 int ipiv, kpiv, i__;
1581 kpiv = (n * n +
n) / 2;
1590 if (i__ == n)
goto L40;
1591 if (r__ == (
double)0.)
goto L42;
1600 sum += b[
id] * b[kd];
1604 sum = a[kpiv] - sum;
1606 if (kpiv < ipiv) b[kpiv] = sum * r__;
1610 if (r__ > (
double)0.) r__ = (double)1. / dc;
1613 }
while (kpiv > ipiv - i__);
1632 int lhor, ipiv, lver, j;
1641 mx = (n * n +
n) / 2;
1647 if (t[ipiv] > 0.) r__ = (double)1. / t[ipiv];
1652 while (ind != ipiv) {
1662 sum += t[lhor] * s[lver];
1664 }
while (lhor < ind);
1666 s[ind] = -sum * r__;
1687 double *
TCL::trla(
const double *u,
const double *
a,
double *b,
int m,
int n)
1689 int ipiv, ia, ib, iu;
1697 ipiv = (m * m +
m) / 2;
1706 sum += a[ia] * u[iu];
1713 }
while (ia > 1 - n);
1732 int ipiv, mxpn, i__, nTep, ia, ib, iu, mx;
1757 sum += a[ia] * u[iu];
1764 }
while (ia < mxpn);
1782 int i__, ia, ind, ipiv;
1792 for (i__ = 1; i__ <=
n; ++i__) {
1798 }
while (ind < ipiv);
1816 int indq, inds, imax, i__, j, k,
l;
1817 int iq, ir, is, iqq;
1824 imax = (m * m +
m) / 2;
1825 vzero(&r__[1], imax);
1843 if (k > i__) is += k;
1849 sum += s[is] * q[
iq];
1857 if (l > i__) iqq +=
l;
1859 r__[ir] += q[iqq] * sum;
1879 double *
TCL::trsa(
const double *s,
const double *
a,
double *b,
int m,
int n)
1882 int inds, i__, j, k, ia, ib, is;
1896 for (j = 1; j <=
n; ++j) {
1903 if (k > i__) is += k;
1905 sum += s[is] * a[ia];
1949 int lhor, lver, i__, k,
l, ind;
1956 ind = (n * n +
n) / 2;
1958 for (i__ = 1; i__ <=
n; ++i__) {
1961 for (k = i__; k <=
n; ++k,--ind) {
1962 lhor = ind; sum = 0.;
1963 for (l = k; l <=
n; ++
l,--lver,--lhor)
1964 sum += u[lver] * u[lhor];
1984 int lhor, lver, lpiv, i__, j, k, ind;
1993 for (i__ = 1; i__ <=
n; ++i__) {
1995 for (j = 1; j <= i__; ++j,++ind) {
1999 for (k = i__; k <=
n;lhor += k,lver += k,++k)
2000 sum += g[lver] * g[lhor];
2019 int i__, im, is, iu, iv, ih, m2;
2069 int inds, i__, j, k, ia, ib, is;
2084 for (j = 1; j <=
n; ++j) {
2090 if (k > i__) is += k;
2093 sum += s[is] * a[ia];
2120 float *mem =
new float[(m*(m+1))/2+
m];
2127 for (
int i=0;i<
n;i++) {
2147 double *mem =
new double[(m*(m+1))/2+
m];
2154 for (
int i=0;i<
n;i++) {
static float * traat(const float *a, float *s, int m, int n)
Symmetric Multiplication of Rectangular Matrices.
static float * trsmul(const float *g, float *gi, int n)
trsmul.F – translated by f2c (version 19970219).
#define TCL_TRAAT(a, s, m, n)
#define TCL_TRASAT(a, s, r__, m, n)
static float * trata(const float *a, float *r, int m, int n)
trata.F – translated by f2c (version 19970219).
#define TCL_MXTRP(a, b, i, j)
static float * mxtrp(const float *a, float *b, int i, int j)
Matrix Transposition.
static float * trinv(const float *t, float *s, int n)
trinv.F – translated by f2c (version 19970219).
static float * trsat(const float *s, const float *a, float *b, int m, int n)
trsat.F – translated by f2c (version 19970219).
static float * mxmad_0_(int n, const float *a, const float *b, float *c, int i, int j, int k)
static float * trpck(const float *s, float *u, int n)
trpck.F – translated by f2c (version 19970219).
static float * trsequ(float *smx, int m=3, float *b=0, int n=1)
Linear Equations, Matrix Inversion trsequ solves the matrix equation.
static float * trsa(const float *s, const float *a, float *b, int m, int n)
trsa.F – translated by f2c (version 19970219).
static float * tralt(const float *a, const float *u, float *b, int m, int n)
Triangular - Rectangular Multiplication.
#define TCL_TRAS(a, s, b, m, n)
static float * trlta(const float *u, const float *a, float *b, int m, int n)
trlta.F – translated by f2c (version 19970219).
static float * trqsq(const float *q, const float *s, float *r, int m)
trqsq.F – translated by f2c (version 19970219).
static float * trats(const float *a, const float *s, float *b, int m, int n)
trats.F – translated by f2c (version 19970219).
static int * ucopy(const int *a, int *b, int n)
static float * tral(const float *a, const float *u, float *b, int m, int n)
Triangular - Rectangular Multiplication.
static float * trchul(const float *a, float *b, int n)
trchul.F – translated by f2c (version 19970219).
static float * trsinv(const float *g, float *gi, int n)
trsinv.F – translated by f2c (version 19970219).
#define TCL_TRALT(a, u, b, m, n)
static float * trasat(const float *a, const float *s, float *r, int m, int n)
Transformation of Symmetric Matrix.
static float * trsmlu(const float *u, float *s, int n)
trsmlu.F – translated by f2c (version 19970219).
static float * tras(const float *a, const float *s, float *b, int m, int n)
Symmetric - Rectangular Multiplication.
static float * mxmlrt_0_(int n__, const float *a, const float *b, float *c, int ni, int nj)
Matrix Multiplication.
static float * vzero(float *a, int n2)
#define TCL_TRAL(a, u, b, m, n)
#define TCL_MXMLRT(n__, a, b, c, ni, nj)
static float * trupck(const float *u, float *s, int m)
trupck.F – translated by f2c (version 19970219).
#define TCL_MXMAD(n_, a, b, c, i, j, k)
static float * tratsa(const float *a, const float *s, float *r, int m, int n)
tratsa.F – translated by f2c (version 19970219).
Double_t Sqrt(Double_t x)
static float * trchlu(const float *a, float *b, int n)
trchlu.F – translated by f2c (version 19970219).
static float * trla(const float *u, const float *a, float *b, int m, int n)
trla.F – translated by f2c (version 19970219).