|
| 1 | + |
| 2 | +{{alias}}( N, DL, D, DU, DU2, IPIV ) |
| 3 | + Computes an LU factorization of a real tri diagonal matrix A using |
| 4 | + elimination with partial pivoting and row interchanges. |
| 5 | + |
| 6 | + Indexing is relative to the first index. To introduce an offset, use typed |
| 7 | + array views. |
| 8 | + |
| 9 | + The function mutates `DL`, `D`, `DU`, `DU2` and `IPIV`. |
| 10 | + |
| 11 | + Parameters |
| 12 | + ---------- |
| 13 | + N: integer |
| 14 | + Order of matrix `A`. |
| 15 | + |
| 16 | + DL: Float64Array |
| 17 | + Sub diagonal elements of A. On exit, DL is overwritten by the |
| 18 | + multipliers that define the matrix L from the LU factorization of A. |
| 19 | + |
| 20 | + D: Float64Array |
| 21 | + Diagonal elements of A. On exit, D is overwritten by the diagonal |
| 22 | + elements of the upper triangular matrix U from the LU factorization |
| 23 | + of A. |
| 24 | + |
| 25 | + DU: Float64Array |
| 26 | + Super diagonal elements of A. On exit, DU is overwritten by the |
| 27 | + elements of the first super-diagonal of U. |
| 28 | + |
| 29 | + DU2: Float64Array |
| 30 | + On exit, DU2 is overwritten by the elements of the second |
| 31 | + super-diagonal of U. |
| 32 | + |
| 33 | + IPIV: Int32Array |
| 34 | + Array of pivot indices. |
| 35 | + |
| 36 | + Returns |
| 37 | + ------- |
| 38 | + info: integer |
| 39 | + Status code. The status code indicates the following conditions: |
| 40 | + |
| 41 | + - if equal to zero, then the factorization was successful. |
| 42 | + - if less than zero, then the k-th argument had an illegal value, where |
| 43 | + `k = -info`. |
| 44 | + - if greater than zero, then U( k, k ) is exactly zero the factorization |
| 45 | + has been completed, but the factor U is exactly singular, and division |
| 46 | + by zero will occur if it is used to solve a system of equations, |
| 47 | + where `k = StatusCode`. |
| 48 | + |
| 49 | + Examples |
| 50 | + -------- |
| 51 | + > var DL = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); |
| 52 | + > var D = new {{alias:@stdlib/array/float64}}( [ 2.0, 3.0, 1.0 ] ); |
| 53 | + > var DU = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); |
| 54 | + > var DU2 = new {{alias:@stdlib/array/float64}}( 1 ); |
| 55 | + > var IPIV = new {{alias:@stdlib/array/int32}}( 3 ); |
| 56 | + > {{alias}}( 3, DL, D, DU, DU2, IPIV ) |
| 57 | + 0 |
| 58 | + > DL |
| 59 | + <Float64Array>[ 0.5, 0.4 ] |
| 60 | + > D |
| 61 | + <Float64Array>[ 2, 2.5, 0.6 ] |
| 62 | + > DU |
| 63 | + <Float64Array>[ 1, 1 ] |
| 64 | + > DU2 |
| 65 | + <Float64Array>[ 0 ] |
| 66 | + |
| 67 | + // Using typed array views: |
| 68 | + > var DL0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 1.0, 1.0 ] ); |
| 69 | + > var D0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 2.0, 3.0, 1.0 ] ); |
| 70 | + > var DU0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 1.0, 1.0 ] ); |
| 71 | + > var DU2 = new {{alias:@stdlib/array/float64}}( 1 ); |
| 72 | + > var IPIV = new {{alias:@stdlib/array/int32}}( 3 ); |
| 73 | + > DL = new Float64Array( DL0.buffer, DL0.BYTES_PER_ELEMENT*1 ); |
| 74 | + > D = new Float64Array( D0.buffer, D0.BYTES_PER_ELEMENT*1 ); |
| 75 | + > DU = new Float64Array( DU0.buffer, DU0.BYTES_PER_ELEMENT*1 ); |
| 76 | + > {{alias}}( 3, DL, D, DU, DU2, IPIV ) |
| 77 | + 0 |
| 78 | + > DL |
| 79 | + <Float64Array>[ 0.5, 0.4 ] |
| 80 | + > D |
| 81 | + <Float64Array>[ 2, 2.5, 0.6 ] |
| 82 | + > DU |
| 83 | + <Float64Array>[ 1, 1 ] |
| 84 | + > DU2 |
| 85 | + <Float64Array>[ 0 ] |
| 86 | + |
| 87 | + |
| 88 | +{{alias}}.ndarray( N, DL, sdl, odl, D, sd, od, DU, sdu, odu, DU2, sdu2, odu2, IPIV, si, oi ) |
| 89 | + Computes an LU factorization of a real tri diagonal matrix A using |
| 90 | + elimination with partial pivoting and row interchanges and alternative |
| 91 | + indexing semantics. |
| 92 | + |
| 93 | + While typed array views mandate a view offset based on the underlying |
| 94 | + buffer, the offset parameters support indexing semantics based on starting |
| 95 | + indices. |
| 96 | + |
| 97 | + The function mutates `DL`, `D`, `DU`, `DU2` and `IPIV`. |
| 98 | + |
| 99 | + Parameters |
| 100 | + ---------- |
| 101 | + N: integer |
| 102 | + Order of matrix `A`. |
| 103 | + |
| 104 | + DL: Float64Array |
| 105 | + Sub diagonal elements of A. On exit, DL is overwritten by the |
| 106 | + multipliers that define the matrix L from the LU factorization of A. |
| 107 | + |
| 108 | + sdl: integer |
| 109 | + Stride length for `DL`. |
| 110 | + |
| 111 | + odl: integer |
| 112 | + Starting index for `DL`. |
| 113 | + |
| 114 | + D: Float64Array |
| 115 | + Diagonal elements of A. On exit, D is overwritten by the diagonal |
| 116 | + elements of the upper triangular matrix U from the LU factorization |
| 117 | + of A. |
| 118 | + |
| 119 | + sd: integer |
| 120 | + Stride length for `D`. |
| 121 | + |
| 122 | + od: integer |
| 123 | + Starting index for `D`. |
| 124 | + |
| 125 | + DU: Float64Array |
| 126 | + Super diagonal elements of A. On exit, DU is overwritten by the |
| 127 | + elements of the first super-diagonal of U. |
| 128 | + |
| 129 | + sdu: integer |
| 130 | + Stride length for `DU`. |
| 131 | + |
| 132 | + odu: integer |
| 133 | + Starting index for `DU2`. |
| 134 | + |
| 135 | + DU2: Float64Array |
| 136 | + On exit, DU2 is overwritten by the elements of the second |
| 137 | + super-diagonal of U. |
| 138 | + |
| 139 | + sdu2: integer |
| 140 | + Stride length for `DU2`. |
| 141 | + |
| 142 | + odu2: integer |
| 143 | + Starting index for `DU2`. |
| 144 | + |
| 145 | + IPIV: Int32Array |
| 146 | + Array of pivot indices. |
| 147 | + |
| 148 | + si: integer |
| 149 | + Stride length for `IPIV`. |
| 150 | + |
| 151 | + oi: integer |
| 152 | + Starting index for `IPIV`. |
| 153 | + |
| 154 | + Returns |
| 155 | + ------- |
| 156 | + info: integer |
| 157 | + Status code. The status code indicates the following conditions: |
| 158 | + |
| 159 | + - if equal to zero, then the factorization was successful. |
| 160 | + - if less than zero, then the k-th argument had an illegal value, where |
| 161 | + `k = -info`. |
| 162 | + - if greater than zero, then U( k, k ) is exactly zero the factorization |
| 163 | + has been completed, but the factor U is exactly singular, and division |
| 164 | + by zero will occur if it is used to solve a system of equations, |
| 165 | + where `k = StatusCode`. |
| 166 | + |
| 167 | + Examples |
| 168 | + -------- |
| 169 | + > var DL = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); |
| 170 | + > var D = new {{alias:@stdlib/array/float64}}( [ 2.0, 3.0, 1.0 ] ); |
| 171 | + > var DU = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); |
| 172 | + > var DU2 = new {{alias:@stdlib/array/float64}}( 1 ); |
| 173 | + > var IPIV = new {{alias:@stdlib/array/int32}}( 3 ); |
| 174 | + > {{alias}}.ndarray( 3, DL, 1, 0, D, 1, 0, DU, 1, 0, DU2, 1, 0, IPIV, 1, 0 ) |
| 175 | + 0 |
| 176 | + > DL |
| 177 | + <Float64Array>[ 0.5, 0.4 ] |
| 178 | + > D |
| 179 | + <Float64Array>[ 2, 2.5, 0.6 ] |
| 180 | + > DU |
| 181 | + <Float64Array>[ 1, 1 ] |
| 182 | + > DU2 |
| 183 | + <Float64Array>[ 0 ] |
| 184 | + |
| 185 | + See Also |
| 186 | + -------- |
0 commit comments