|
| 1 | +/** |
| 2 | +* @license Apache-2.0 |
| 3 | +* |
| 4 | +* Copyright (c) 2025 The Stdlib Authors. |
| 5 | +* |
| 6 | +* Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | +* you may not use this file except in compliance with the License. |
| 8 | +* You may obtain a copy of the License at |
| 9 | +* |
| 10 | +* http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | +* |
| 12 | +* Unless required by applicable law or agreed to in writing, software |
| 13 | +* distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | +* See the License for the specific language governing permissions and |
| 16 | +* limitations under the License. |
| 17 | +*/ |
| 18 | + |
| 19 | +// TypeScript Version: 4.1 |
| 20 | + |
| 21 | +/** |
| 22 | +* Status code. |
| 23 | +* |
| 24 | +* ## Notes |
| 25 | +* |
| 26 | +* The status code indicates the following conditions: |
| 27 | +* |
| 28 | +* - if equal to zero, then the factorization was successful. |
| 29 | +* - if less than zero, then the k-th argument had an illegal value, where `k = -StatusCode`. |
| 30 | +* - if greater than zero, then the leading principal minor of order `k` is not positive, where `k = StatusCode`. If `k < N`, then the factorization could not be completed. If `k = N`, then the factorization was completed, but `D(N) <= 0`, meaning that the matrix `A` is not positive definite. |
| 31 | +*/ |
| 32 | +type StatusCode = number; |
| 33 | + |
| 34 | +/** |
| 35 | +* Interface describing `dgttrf`. |
| 36 | +*/ |
| 37 | +interface Routine { |
| 38 | + /** |
| 39 | + * Computes an LU factorization of a real tri diagonal matrix A using elimination with partial pivoting and row interchanges. |
| 40 | + * |
| 41 | + * @param N - order of matrix `A` |
| 42 | + * @param DL - the `N-1` subdiagonal elements of `A` |
| 43 | + * @param D - the `N` diagonal elements of `A` |
| 44 | + * @param DU - the `N-1` superdiagonal elements of `A` |
| 45 | + * @param DU2 - the `N-2` elements of the second superdiagonal of `A` |
| 46 | + * @param IPIV - vector of pivot indices |
| 47 | + * @returns status code |
| 48 | + * |
| 49 | + * @example |
| 50 | + * var Float64Array = require( '@stdlib/array/float64' ); |
| 51 | + * var Int32Array = require( '@stdlib/array/int32' ); |
| 52 | + * |
| 53 | + * var DL = new Float64Array( [ 1.0, 1.0 ] ); |
| 54 | + * var D = new Float64Array( [ 2.0, 3.0, 1.0 ] ); |
| 55 | + * var DU = new Float64Array( [ 1.0, 1.0 ] ); |
| 56 | + * var DU2 = new Float64Array( 1 ); |
| 57 | + * var IPIV = new Int32Array( 3 ); |
| 58 | + * |
| 59 | + * dgttrf( 3, DL, D, DU, DU2, IPIV ); |
| 60 | + * // DL => <Float64Array>[ 0.5, 0.4 ] |
| 61 | + * // D => <Float64Array>[ 2, 2.5, 0.6 ] |
| 62 | + * // DU => <Float64Array>[ 1, 1 ] |
| 63 | + * // DU2 => <Float64Array>[ 0 ] |
| 64 | + */ |
| 65 | + ( N: number, DL: Float64Array, D: Float64Array, DU: Float64Array, DU2: Float64Array, IPIV: Int32Array ): StatusCode; |
| 66 | + |
| 67 | + /** |
| 68 | + * Computes an LU factorization of a real tri diagonal matrix A using elimination with partial pivoting and row interchanges and alternative indexing semantics. |
| 69 | + * |
| 70 | + * @param N - order of matrix `A` |
| 71 | + * @param DL - the `N-1` subdiagonal elements of `A` |
| 72 | + * @param strideDL - stride of the subdiagonal elements of `A` |
| 73 | + * @param offsetDL - offset of the subdiagonal elements of `A` |
| 74 | + * @param D - the `N` diagonal elements of `A` |
| 75 | + * @param strideD - stride of the diagonal elements of `A` |
| 76 | + * @param offsetD - offset of the diagonal elements of `A` |
| 77 | + * @param DU - the `N-1` superdiagonal elements of `A` |
| 78 | + * @param strideDU - stride of the first superdiagonal elements of `A` |
| 79 | + * @param offsetDU - offset of the first superdiagonal elements of `A` |
| 80 | + * @param DU2 - the `N-2` elements of the second superdiagonal of `A` |
| 81 | + * @param strideDU2 - stride of the second superdiagonal elements of `A` |
| 82 | + * @param offsetDU2 - offset of the second superdiagonal elements of `A` |
| 83 | + * @param IPIV - vector of pivot indices |
| 84 | + * @param strideIPIV - `IPIV` stride length |
| 85 | + * @param offsetIPIV - index offset for `IPIV` |
| 86 | + * @returns status code |
| 87 | + * |
| 88 | + * @example |
| 89 | + * var DL = new Float64Array( [ 1.0, 1.0 ] ); |
| 90 | + * var D = new Float64Array( [ 2.0, 3.0, 1.0 ] ); |
| 91 | + * var DU = new Float64Array( [ 1.0, 1.0 ] ); |
| 92 | + * var DU2 = new Float64Array( 1 ); |
| 93 | + * var IPIV = new Int32Array( 3 ); |
| 94 | + * |
| 95 | + * dgttrf.ndarray( 3, DL, 1, 0, D, 1, 0, DU, 1, 0, DU2, 1, 0, IPIV, 1, 0 ); |
| 96 | + * // DL => <Float64Array>[ 0.5, 0.4 ] |
| 97 | + * // D => <Float64Array>[ 2, 2.5, 0.6 ] |
| 98 | + * // DU => <Float64Array>[ 1, 1 ] |
| 99 | + * // DU2 => <Float64Array>[ 0 ] |
| 100 | + */ |
| 101 | + ndarray( N: number, DL: Float64Array, strideDL: number, offsetDL: number, D: Float64Array, strideD: number, offsetD: number, DU: Float64Array, strideDU: number, offsetDU: number, DU2: Float64Array, strideDU2: number, offsetDU2: number, IPIV: Int32Array, strideIPIV: number, offsetIPIV: number ): StatusCode; |
| 102 | +} |
| 103 | + |
| 104 | +/** |
| 105 | +* LAPACK routine to compute an LU factorization of a real tri diagonal matrix A using elimination with partial pivoting and row interchanges. |
| 106 | +* |
| 107 | +* @param N - order of matrix `A` |
| 108 | +* @param DL - the `N-1` subdiagonal elements of `A` |
| 109 | +* @param D - the `N` diagonal elements of `A` |
| 110 | +* @param DU - the `N-1` superdiagonal elements of `A` |
| 111 | +* @param DU2 - the `N-2` elements of the second superdiagonal of `A` |
| 112 | +* @param IPIV - vector of pivot indices |
| 113 | +* @returns status code |
| 114 | +* |
| 115 | +* @example |
| 116 | +* var Float64Array = require( '@stdlib/array/float64' ); |
| 117 | +* var Int32Array = require( '@stdlib/array/int32' ); |
| 118 | +* |
| 119 | +* var DL = new Float64Array( [ 1.0, 1.0 ] ); |
| 120 | +* var D = new Float64Array( [ 2.0, 3.0, 1.0 ] ); |
| 121 | +* var DU = new Float64Array( [ 1.0, 1.0 ] ); |
| 122 | +* var DU2 = new Float64Array( 1 ); |
| 123 | +* var IPIV = new Int32Array( 3 ); |
| 124 | +* |
| 125 | +* dgttrf( 3, DL, D, DU, DU2, IPIV ); |
| 126 | +* // DL => <Float64Array>[ 0.5, 0.4 ] |
| 127 | +* // D => <Float64Array>[ 2, 2.5, 0.6 ] |
| 128 | +* // DU => <Float64Array>[ 1, 1 ] |
| 129 | +* // DU2 => <Float64Array>[ 0 ] |
| 130 | +* |
| 131 | +* @example |
| 132 | +* var Float64Array = require( '@stdlib/array/float64' ); |
| 133 | +* var Int32Array = require( '@stdlib/array/int32' ); |
| 134 | +* |
| 135 | +* var DL = new Float64Array( [ 1.0, 1.0 ] ); |
| 136 | +* var D = new Float64Array( [ 2.0, 3.0, 1.0 ] ); |
| 137 | +* var DU = new Float64Array( [ 1.0, 1.0 ] ); |
| 138 | +* var DU2 = new Float64Array( 1 ); |
| 139 | +* var IPIV = new Int32Array( 3 ); |
| 140 | +* |
| 141 | +* dgttrf.ndarray( 3, DL, 1, 0, D, 1, 0, DU, 1, 0, DU2, 1, 0, IPIV, 1, 0 ); |
| 142 | +* // DL => <Float64Array>[ 0.5, 0.4 ] |
| 143 | +* // D => <Float64Array>[ 2, 2.5, 0.6 ] |
| 144 | +* // DU => <Float64Array>[ 1, 1 ] |
| 145 | +* // DU2 => <Float64Array>[ 0 ] |
| 146 | +*/ |
| 147 | +declare var dgttrf: Routine; |
| 148 | + |
| 149 | + |
| 150 | +// EXPORTS // |
| 151 | + |
| 152 | +export = dgttrf; |
0 commit comments