23 #define REPORT { static ExeCounter ExeCount(__LINE__,16); ++ExeCount; } 38 if (n == 0 || s == 0) { L = 0.0;
return; }
40 for (
int i=0; i<s; i++)
43 Real* xi0=xi; k=n;
while(k--) { sum +=
square(*xi++); }
48 k=n;
while(k--) { *xi0++ = 0.0; }
49 for (
int j=i; j<s; j++) L.
element(j,i) = 0.0;
54 Real* xj0=xi0; k=n;
while(k--) { *xj0++ /=
sum; }
55 for (
int j=i+1; j<s; j++)
58 xi=xi0;
Real* xj=xj0; k=n;
while(k--) { sum += *xi++ * *xj++; }
59 xi=xi0; k=n;
while(k--) { *xj0++ -= sum * *xi++; }
75 for (
int i=0; i<s; i++)
78 for (
int j=0; j<t; j++)
81 xi=xi0;
Real* xj=xj0; k=n;
while(k--) { sum += *xi++ * *xj++; }
82 xi=xi0; k=n;
while(k--) { *xj0++ -= sum * *xi++; }
122 if (n == 0 || s == 0)
return;
124 int j, k;
int J = s;
int i = s;
127 Real* xj0 = xi0;
Real* xi = xi0; k = n;
130 u = u0;
Real Xi = *xi;
Real* xj = xj0;
131 j = J;
while(j--) *u++ += Xi * *xj++;
140 j = J - 1;
while(j--) *u++ = 0.0;
153 int J1 = J-1; j = J1;
while(j--) *u++ /=
sum;
155 xj0 = xi0; xi = xi0++; k = n;
158 u = u0+1;
Real Xi = *xi;
Real* xj = xj0;
159 Xi /=
sum; *xj++ = Xi;
160 j = J1;
while(j--) *xj++ -= *u++ * Xi;
184 m = m0;
Real Xi = *xi;
Real* xj = xj0;
185 j = t;
while(j--) *m++ += Xi * *xj++;
190 xj0 = Y.
Store(); xi = xi0++; k = n;
193 m = m0;
Real Xi = *xi;
Real* xj = xj0;
194 j = t;
while(j--) *xj++ -= *m++ * Xi;
236 if (n == 0 || s == 0)
return;
238 for (
int i=0; i<s; i++)
242 Real* xi0=xi; k=n;
while(k--) { sum +=
square(*xi++); }
243 sum = sqrt(sum +
square(r));
247 k=n;
while(k--) { *xi0++ = 0.0; }
248 for (
int j=i; j<s; j++) L.
element(j,i) = 0.0;
256 Real* xj0=xi0; k=n;
while(k--) { *xj0++ *=
alpha; }
257 for (
int j=i+1; j<s; j++)
260 xi=xi0;
Real* xj=xj0; k=n;
while(k--) { sum += *xi++ * *xj++; }
262 xi=xi0; k=n;
while(k--) { *xj0++ -= sum * *xi++; }
276 if (n == 0 || s == 0)
return;
279 int j, k;
int J = s;
int i = s;
282 Real* xj0 = xi0;
Real* xi = xi0; k = n;
285 v = v0;
Real Xi = *xi;
Real* xj = xj0;
286 j = J;
while(j--) *v++ += Xi * *xj++;
298 j = J;
while(j--) { *u++ = 0.0; *v++ = 0.0; }
315 j = J - 1; v = v0 + 1; u = u0 + 1;
317 { *v = a0 * *u + alpha * *v; *u -= a0 * *v; ++v; ++u; }
319 xj0 = xi0; xi = xi0++; k = n;
322 v = v0 + 1;
Real Xi = *xi;
Real* xj = xj0;
323 Xi *=
alpha; *xj++ = Xi;
324 j = J - 1;
while(j--) *xj++ -= *v++ * Xi;
330 while (j--) *v++ = 0.0;
344 Tracer et(
"extend_orthonormal");
350 for (
int i = n; i < nc; ++i)
361 for (k = 1; k <= nr; ++k) SSR(k) +=
square(X(k));
void QRZT(Matrix &X, LowerTriangularMatrix &L)
void updateQRZT(Matrix &X, LowerTriangularMatrix &L)
Miscellaneous exception (details in character string).
GetSubMatrix Columns(int f, int l) const
GetSubMatrix Column(int f) const
TransposedMatrix t() const
void extend_orthonormal(Matrix &A, int n)
ReturnMatrix sum_square_rows() const
The usual rectangular matrix.
Incompatible dimensions exception.
void QRZ(Matrix &X, UpperTriangularMatrix &U)
void updateQRZ(Matrix &X, UpperTriangularMatrix &U)
GetSubMatrix SubMatrix(int fr, int lr, int fc, int lc) const
virtual void resize(int, int)
FloatVector FloatVector FloatVector * alpha
Real sum(const BaseMatrix &B)
Real minimum1(int &i) const