You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/lapack/base/dgttrf/lib/base.js
+36-50Lines changed: 36 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -30,21 +30,21 @@ var abs = require( '@stdlib/math/base/special/abs' );
30
30
*
31
31
* ## Notes
32
32
*
33
-
* - On exit, `DL` is overwritten by the multipliers that define the matrix `L` from the `LU` factorization of `A`.
34
-
* - On exit, `D` is overwritten by the diagonal elements of the upper triangular matrix `U` from the `LU` factorization of `A`.
35
-
* - On exit, `DU` is overwritten by the elements of the first super-diagonal of `U`.
36
-
* - On exit, `DU2` is overwritten by the elements of the second super-diagonal of `U`.
37
-
* - On exit, for 0 <= i < n, row i of the matrix was interchanged with row IPIV(i). IPIV(i) will always be either i or i+1; IPIV(i) = i indicates a row interchange was not required.
33
+
* - `DL` is overwritten by the multipliers that define the matrix `L` from the `LU` factorization of `A`.
34
+
* - `D` is overwritten by the diagonal elements of the upper triangular matrix `U` from the `LU` factorization of `A`.
35
+
* - `DU` is overwritten by the elements of the first super-diagonal of `U`.
36
+
* - `DU2` is overwritten by the elements of the second super-diagonal of `U`.
37
+
* - For 0 <= i < n, row i of the matrix was interchanged with row IPIV(i). IPIV(i) will always be either i or i+1; IPIV(i) = i indicates a row interchange was not required.
38
38
*
39
39
* @private
40
-
* @param {NonNegativeInteger} N - order of matrix A.
41
-
* @param {Float64Array} DL - sub diagonal elements of A.
40
+
* @param {NonNegativeInteger} N - order of matrix A
41
+
* @param {Float64Array} DL - sub diagonal elements of A
42
42
* @param {integer} strideDL - stride length for `DL`
43
43
* @param {NonNegativeInteger} offsetDL - starting index of `DL`
44
-
* @param {Float64Array} D - diagonal elements of A.
44
+
* @param {Float64Array} D - diagonal elements of A
45
45
* @param {integer} strideD - stride length for `D`
46
46
* @param {NonNegativeInteger} offsetD - starting index of `D`
47
-
* @param {Float64Array} DU - super diagonal elements of A.
47
+
* @param {Float64Array} DU - super diagonal elements of A
48
48
* @param {integer} strideDU - stride length for `DU`
49
49
* @param {NonNegativeInteger} offsetDU - starting index of `DU`
50
50
* @param {Float64Array} DU2 - vector to store the second super diagonal of `U`
@@ -78,12 +78,8 @@ function dgttrf( N, DL, strideDL, offsetDL, D, strideD, offsetD, DU, strideDU, o
78
78
varidu2;
79
79
varidu;
80
80
varidl;
81
-
vardli;
82
-
vardui;
83
81
varid;
84
82
varip;
85
-
vardi;
86
-
varii;
87
83
vari;
88
84
89
85
// Quick return if possible
@@ -97,12 +93,12 @@ function dgttrf( N, DL, strideDL, offsetDL, D, strideD, offsetD, DU, strideDU, o
97
93
idu2=offsetDU2;
98
94
ip=offsetIPIV;
99
95
100
-
// Initialise ith element of IPIV as i
96
+
// Initialize ith element of IPIV as i
101
97
for(i=0;i<N;i++){
102
98
IPIV[ip]=i;
103
99
104
100
if(i<N-2){
105
-
// Initialise ith element of DU2 as 0
101
+
// Initialize ith element of DU2 as 0
106
102
DU2[idu2]=0;
107
103
}
108
104
@@ -115,51 +111,41 @@ function dgttrf( N, DL, strideDL, offsetDL, D, strideD, offsetD, DU, strideDU, o
115
111
ip=offsetIPIV;
116
112
117
113
for(i=0;i<N-2;i++){
118
-
di=strideD*i;
119
-
dli=strideDL*i;
120
-
ii=strideIPIV*i;
121
-
dui=strideDU*i;
122
-
123
-
if(abs(D[id+di])>=abs(DL[idl+dli])){// No row interchange required, eleminate ith element of DL
114
+
if(abs(D[id+(strideD*i)])>=abs(DL[idl+(strideDL*i)])){// No row interchange required, eleminate ith element of DL
0 commit comments