removed unneeded multiplications by zero by separating
the first iteration from the following ones in a loop git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/branches/MATH_2_0@701852 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f0aeb29d16
commit
3a751b5acf
|
@ -114,9 +114,15 @@ class TriDiagonalTransformer implements Serializable {
|
||||||
final double inv = 1.0 / (secondary[k - 1] * hK[k]);
|
final double inv = 1.0 / (secondary[k - 1] * hK[k]);
|
||||||
qtData[k][k] = 1;
|
qtData[k][k] = 1;
|
||||||
if (hK[k] != 0.0) {
|
if (hK[k] != 0.0) {
|
||||||
for (int j = k; j < m; ++j) {
|
final double[] qtK = qtData[k];
|
||||||
|
double beta = 1.0 / secondary[k - 1];
|
||||||
|
qtK[k] = 1 + beta * hK[k];
|
||||||
|
for (int i = k + 1; i < m; ++i) {
|
||||||
|
qtK[i] = beta * hK[i];
|
||||||
|
}
|
||||||
|
for (int j = k + 1; j < m; ++j) {
|
||||||
final double[] qtJ = qtData[j];
|
final double[] qtJ = qtData[j];
|
||||||
double beta = 0;
|
beta = 0;
|
||||||
for (int i = k; i < m; ++i) {
|
for (int i = k; i < m; ++i) {
|
||||||
beta += qtJ[i] * hK[i];
|
beta += qtJ[i] * hK[i];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue