diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/README.md b/lib/node_modules/@stdlib/lapack/base/dlagts/README.md new file mode 100644 index 000000000000..0af89e88b8bc --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/README.md @@ -0,0 +1,323 @@ + + +# dlagts + +> Solve a system of equations with a tridiagonal matrix `T` following a precomputed factorization. + +
+ +```math +(T - \lambda I) x = y \quad \textrm{or} \quad (T - \lambda I)^T x = y, +``` + +where `T` is an `N` by `N` tridiagonal matrix, following the factorization of `T - \lambda I` as + +```math +T - \lambda I = P L U, +``` + +computed beforehand. The choice of equation to be solved is controlled by the `job` argument, and in each case there is an option to perturb zero or very small diagonal elements of `U`, this option being intended for use in applications such as inverse iteration. + +
+ + + +
+ +## Usage + +```javascript +var dlagts = require( '@stdlib/lapack/base/dlagts' ); +``` + +#### dlagts( job, N, A, B, C, D, IN, Y, TOL ) + +Solves a system of equations with a tridiagonal matrix `T` following a precomputed factorization of `T - lambda*I`. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var Int32Array = require( '@stdlib/array/int32' ); + +// Factorization of the symmetric matrix `T`: +var A = new Float64Array( [ 4.0, 3.75, 3.7333333333333334 ] ); +var B = new Float64Array( [ 1.0, 1.0 ] ); +var C = new Float64Array( [ 0.25, 0.26666666666666666 ] ); +var D = new Float64Array( [ 0.0 ] ); +var IN = new Int32Array( [ 0, 0, 0 ] ); + +// Right-hand side vector: +var Y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + +// Tolerance (only referenced when `job` is negative): +var TOL = new Float64Array( [ 0.0 ] ); + +dlagts( 1, 3, A, B, C, D, IN, Y, TOL ); +// Y => [ ~0.179, ~0.286, ~0.679 ] +``` + +The function has the following parameters: + +- **job**: specifies the system to solve. If `job` is `1`, solve `(T - lambda*I)*x = y`. If `job` is `2`, solve `(T - lambda*I)^T*x = y`. When `job` is positive, very small diagonal elements of `U` are not perturbed. When `job` is negative (`-1` or `-2`), very small diagonal elements of `U` are perturbed if overflow would otherwise occur. +- **N**: order of the matrix `T`. +- **A**: diagonal elements of `U`, as a [`Float64Array`][mdn-float64array]. Should have `N` indexed elements. +- **B**: first super-diagonal elements of `U`, as a [`Float64Array`][mdn-float64array]. Should have `N-1` indexed elements. +- **C**: sub-diagonal elements of `L`, as a [`Float64Array`][mdn-float64array]. Should have `N-1` indexed elements. +- **D**: second super-diagonal elements of `U`, as a [`Float64Array`][mdn-float64array]. Should have `N-2` indexed elements. +- **IN**: details of the matrix `P`, as an [`Int32Array`][mdn-int32array]. Should have `N` indexed elements. +- **Y**: right-hand side vector as a [`Float64Array`][mdn-float64array]. Should have `N` indexed elements. On exit, `Y` is overwritten by the solution vector `x`. +- **TOL**: tolerance as a [`Float64Array`][mdn-float64array]. When `job` is negative and `TOL` is non-positive on entry, `TOL` is reset to `eps*max(abs(u(i,j)))` (where `eps` is the relative machine precision) and, on exit, `TOL` is overwritten by the tolerance actually used. When `job` is positive, `TOL` is not referenced. + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var Int32Array = require( '@stdlib/array/int32' ); + +// Initial arrays... +var A0 = new Float64Array( [ 0.0, 4.0, 3.75, 3.7333333333333334 ] ); +var B0 = new Float64Array( [ 0.0, 1.0, 1.0 ] ); +var C0 = new Float64Array( [ 0.0, 0.25, 0.26666666666666666 ] ); +var D0 = new Float64Array( [ 0.0, 0.0 ] ); +var IN0 = new Int32Array( [ 0, 0, 0, 0 ] ); +var Y0 = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); + +// Create offset views... +var A = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var B = new Float64Array( B0.buffer, B0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var C = new Float64Array( C0.buffer, C0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var D = new Float64Array( D0.buffer, D0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var IN = new Int32Array( IN0.buffer, IN0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var Y = new Float64Array( Y0.buffer, Y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +var TOL = new Float64Array( [ 0.0 ] ); + +dlagts( 1, 3, A, B, C, D, IN, Y, TOL ); +// Y0 => [ 0.0, ~0.179, ~0.286, ~0.679 ] +``` + + + +#### dlagts.ndarray( job, N, A, sa, oa, B, sb, ob, C, sc, oc, D, sd, od, IN, si, oi, Y, sy, oy, TOL, ot ) + +Solves a system of equations with a tridiagonal matrix `T` following a precomputed factorization of `T - lambda*I` and using alternative indexing semantics. + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var Int32Array = require( '@stdlib/array/int32' ); + +var A = new Float64Array( [ 4.0, 3.75, 3.7333333333333334 ] ); +var B = new Float64Array( [ 1.0, 1.0 ] ); +var C = new Float64Array( [ 0.25, 0.26666666666666666 ] ); +var D = new Float64Array( [ 0.0 ] ); +var IN = new Int32Array( [ 0, 0, 0 ] ); +var Y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +var TOL = new Float64Array( [ 0.0 ] ); + +dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); +// Y => [ ~0.179, ~0.286, ~0.679 ] +``` + +The function has the following additional parameters: + +- **sa**: stride length for `A`. +- **oa**: starting index for `A`. +- **sb**: stride length for `B`. +- **ob**: starting index for `B`. +- **sc**: stride length for `C`. +- **oc**: starting index for `C`. +- **sd**: stride length for `D`. +- **od**: starting index for `D`. +- **si**: stride length for `IN`. +- **oi**: starting index for `IN`. +- **sy**: stride length for `Y`. +- **oy**: starting index for `Y`. +- **ot**: index for `TOL`. + +While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var Int32Array = require( '@stdlib/array/int32' ); + +var A = new Float64Array( [ 0.0, 4.0, 3.75, 3.7333333333333334 ] ); +var B = new Float64Array( [ 0.0, 1.0, 1.0 ] ); +var C = new Float64Array( [ 0.0, 0.25, 0.26666666666666666 ] ); +var D = new Float64Array( [ 0.0, 0.0 ] ); +var IN = new Int32Array( [ 0, 0, 0, 0 ] ); +var Y = new Float64Array( [ 0.0, 1.0, 2.0, 3.0 ] ); +var TOL = new Float64Array( [ 0.0 ] ); + +dlagts.ndarray( 1, 3, A, 1, 1, B, 1, 1, C, 1, 1, D, 1, 1, IN, 1, 1, Y, 1, 1, TOL, 0 ); +// Y => [ 0.0, ~0.179, ~0.286, ~0.679 ] +``` + +
+ + + +
+ +## Notes + +- Both functions mutate the input array `Y`. When `job` is negative and `TOL` is non-positive on entry, both functions also mutate the input array `TOL`. In all other cases, `TOL` is left unchanged. + +- Both functions return a status code indicating success or failure. The status code indicates the following conditions: + + - `0`: the routine completed successfully. + - `>0`: overflow would occur when computing the `k`-th element of the solution vector `x`, where `k` equals the status code value. This can only occur when `job` is positive and either means that a diagonal element of `U` is very small, or that the elements of the right-hand side vector `y` are very large. + +- `dlagts()` corresponds to the [LAPACK][lapack] routine [`dlagts`][lapack-dlagts]. + +
+ + + +
+ +## Examples + + + +```javascript +var Int32Array = require( '@stdlib/array/int32' ); +var Float64Array = require( '@stdlib/array/float64' ); +var dlagts = require( '@stdlib/lapack/base/dlagts' ); + +var A = new Float64Array( [ 4.0, 3.75, 3.7333333333333334, 3.732142857142857, 3.7320574162679425 ] ); +var B = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +var C = new Float64Array( [ 0.25, 0.26666666666666666, 0.26785714285714285, 0.2679425837320574 ] ); +var D = new Float64Array( [ 0.0, 0.0, 0.0 ] ); +var IN = new Int32Array( [ 0, 0, 0, 0, 0 ] ); + +var Y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); +var TOL = new Float64Array( [ 0.0 ] ); + +var info = dlagts( 1, 5, A, B, C, D, IN, Y, TOL ); + +console.log( Y ); +console.log( info ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/benchmark/benchmark.js b/lib/node_modules/@stdlib/lapack/base/dlagts/benchmark/benchmark.js new file mode 100644 index 000000000000..06680f10532b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/benchmark/benchmark.js @@ -0,0 +1,110 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Int32Array = require( '@stdlib/array/int32' ); +var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dlagts = require( './../lib/dlagts.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var TOL = new Float64Array( [ 0.0 ] ); + var IN = new Int32Array( len ); + var A = uniform( len, 1.0, 2.0, options ); + var B = uniform( len-1, 0.0, 0.5, options ); + var C = uniform( len-1, 0.0, 0.5, options ); + var D = uniform( len-2, 0.0, 0.5, options ); + var Y = uniform( len, 1.0, 2.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var d; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + d = dlagts( 1, len, A, B, C, D, IN, Y, TOL ); + if ( d < 0 ) { + b.fail( 'should return a valid status code' ); + } + } + b.toc(); + if ( d < 0 ) { + b.fail( 'should return a valid status code' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlagts/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..87d1ff4d7eb9 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/benchmark/benchmark.ndarray.js @@ -0,0 +1,110 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var bench = require( '@stdlib/bench' ); +var uniform = require( '@stdlib/random/array/uniform' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var Int32Array = require( '@stdlib/array/int32' ); +var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dlagts = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var TOL = new Float64Array( [ 0.0 ] ); + var IN = new Int32Array( len ); + var A = uniform( len, 1.0, 2.0, options ); + var B = uniform( len-1, 0.0, 0.5, options ); + var C = uniform( len-1, 0.0, 0.5, options ); + var D = uniform( len-2, 0.0, 0.5, options ); + var Y = uniform( len, 1.0, 2.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var d; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + d = dlagts( 1, len, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // eslint-disable-line max-len + if ( d < 0 ) { + b.fail( 'should return a valid status code' ); + } + } + b.toc(); + if ( d < 0 ) { + b.fail( 'should return a valid status code' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/dlagts/docs/repl.txt new file mode 100644 index 000000000000..6f02ec2429b1 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/docs/repl.txt @@ -0,0 +1,195 @@ + +{{alias}}( job, N, A, B, C, D, IN, Y, TOL ) + Solves a system of equations with a tridiagonal matrix `T` following a + precomputed factorization of `T - lambda*I`. + + `job` specifies the system to solve and whether to perturb very small + diagonal elements of `U`: + + - `1`: solve `(T - lambda*I)*x = y`, without perturbing. + - `-1`: solve `(T - lambda*I)*x = y`, perturbing if overflow would occur. + - `2`: solve `(T - lambda*I)^T*x = y`, without perturbing. + - `-2`: solve `(T - lambda*I)^T*x = y`, perturbing if overflow would occur. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + The function mutates `Y` (and `TOL` when `job` is negative and `TOL` is + non-positive on entry). + + Parameters + ---------- + job: integer + Job to be performed. Must be `1`, `-1`, `2`, or `-2`. + + N: integer + Order of the matrix `T`. + + A: Float64Array + Diagonal elements of `U`. Should have `N` + indexed elements. + + B: Float64Array + First super-diagonal elements of `U`. Should + have `N-1` indexed elements. + + C: Float64Array + Sub-diagonal elements of `L`. Should have + `N-1` indexed elements. + + D: Float64Array + Second super-diagonal elements of `U`. Should + have `N-2` indexed elements. + + IN: Int32Array + Details of the matrix `P`. Should have `N` + indexed elements. + + Y: Float64Array + Right-hand side vector. Should have `N` indexed elements. On exit, `Y` + is overwritten by the solution vector `x`. + + TOL: Float64Array + Tolerance used to perturb very small diagonal elements when `job` is + negative. When `job` is negative and `TOL` is non-positive on entry, + `TOL` is overwritten by the tolerance actually used. + + Returns + ------- + info: integer + Status code. The status code indicates the following conditions: + + - if equal to zero, then the routine completed successfully. + - if greater than zero, then overflow would occur when computing the + `k`-th element of the solution vector `x`, where `k = StatusCode`. This + can only occur when `job` is positive. + + Examples + -------- + > var A = new {{alias:@stdlib/array/float64}}( [ 4.0, 3.75, 3.7333333333333334 ] ); + > var B = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); + > var C = new {{alias:@stdlib/array/float64}}( [ 0.25, 0.26666666666666666 ] ); + > var D = new {{alias:@stdlib/array/float64}}( [ 0.0 ] ); + > var IN = new {{alias:@stdlib/array/int32}}( [ 0, 0, 0 ] ); + > var Y = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 3.0 ] ); + > var TOL = new {{alias:@stdlib/array/float64}}( [ 0.0 ] ); + > {{alias}}( 1, 3, A, B, C, D, IN, Y, TOL ) + 0 + > Y + [ ~0.179, ~0.286, ~0.679 ] + + +{{alias}}.ndarray(job,N,A,sa,oa,B,sb,ob,C,sc,oc,D,sd,od,IN,si,oi,Y,sy,oy,TOL,ot) + Solves a system of equations with a tridiagonal matrix `T` following a + precomputed factorization of `T - lambda*I` and using alternative + indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameters support indexing semantics based on starting + indices. + + The function mutates `Y` (and `TOL` when `job` is negative and `TOL` is + non-positive on entry). + + Parameters + ---------- + job: integer + Job to be performed. Must be `1`, `-1`, `2`, or `-2`. + + N: integer + Order of the matrix `T`. + + A: Float64Array + Diagonal elements of `U`. Should have `N` + indexed elements. + + sa: integer + Stride length for `A`. + + oa: integer + Starting index for `A`. + + B: Float64Array + First super-diagonal elements of `U`. Should + have `N-1` indexed elements. + + sb: integer + Stride length for `B`. + + ob: integer + Starting index for `B`. + + C: Float64Array + Sub-diagonal elements of `L`. Should have + `N-1` indexed elements. + + sc: integer + Stride length for `C`. + + oc: integer + Starting index for `C`. + + D: Float64Array + Second super-diagonal elements of `U`. Should + have `N-2` indexed elements. + + sd: integer + Stride length for `D`. + + od: integer + Starting index for `D`. + + IN: Int32Array + Details of the matrix `P`. Should have `N` + indexed elements. + + si: integer + Stride length for `IN`. + + oi: integer + Starting index for `IN`. + + Y: Float64Array + Right-hand side vector. Should have `N` indexed elements. On exit, `Y` + is overwritten by the solution vector `x`. + + sy: integer + Stride length for `Y`. + + oy: integer + Starting index for `Y`. + + TOL: Float64Array + Tolerance used to perturb very small diagonal elements when `job` is + negative. When `job` is negative and `TOL` is non-positive on entry, + `TOL` is overwritten by the tolerance actually used. + + ot: integer + Index for `TOL`. + + Returns + ------- + info: integer + Status code. The status code indicates the following conditions: + + - if equal to zero, then the routine completed successfully. + - if greater than zero, then overflow would occur when computing the + `k`-th element of the solution vector `x`, where `k = StatusCode`. This + can only occur when `job` is positive. + + Examples + -------- + > var A = new {{alias:@stdlib/array/float64}}( [ 4.0, 3.75, 3.7333333333333334 ] ); + > var B = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); + > var C = new {{alias:@stdlib/array/float64}}( [ 0.25, 0.26666666666666666 ] ); + > var D = new {{alias:@stdlib/array/float64}}( [ 0.0 ] ); + > var IN = new {{alias:@stdlib/array/int32}}( [ 0, 0, 0 ] ); + > var Y = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 3.0 ] ); + > var TOL = new {{alias:@stdlib/array/float64}}( [ 0.0 ] ); + > {{alias}}.ndarray(1, 3, A,1,0, B,1,0, C,1,0, D,1,0, IN,1,0, Y,1,0, TOL,0 ) + 0 + > Y + [ ~0.179, ~0.286, ~0.679 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/dlagts/docs/types/index.d.ts new file mode 100644 index 000000000000..566a2afdec54 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/docs/types/index.d.ts @@ -0,0 +1,162 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/** +* Status code. +* +* ## Notes +* +* The status code indicates the following conditions: +* +* - if equal to zero, then the routine completed successfully. +* - if greater than zero, then overflow would occur when computing the `k`-th element of the solution vector `x`, where `k = StatusCode`. This can only occur when `job` is supplied as positive and either means that a diagonal element of `U` is very small, or that the elements of the right-hand side vector `y` are very large. +*/ +type StatusCode = number; + +/** +* Interface describing `dlagts`. +*/ +interface Routine { + /** + * Solves a system of equations with a tridiagonal matrix `T` following a precomputed factorization of `T - lambda*I`. + * + * @param job - specifies the job to be performed + * @param N - order of the matrix `T` + * @param A - diagonal elements of `U` + * @param B - first super-diagonal elements of `U` + * @param C - sub-diagonal elements of `L` + * @param D - second super-diagonal elements of `U` + * @param IN - details of the matrix `P` + * @param Y - right-hand side vector which is overwritten by the solution vector + * @param TOL - tolerance used to perturb very small diagonal elements when `job` is negative + * @returns status code + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var Int32Array = require( '@stdlib/array/int32' ); + * + * var A = new Float64Array( [ 4.0, 3.75, 3.7333333333333334 ] ); + * var B = new Float64Array( [ 1.0, 1.0 ] ); + * var C = new Float64Array( [ 0.25, 0.26666666666666666 ] ); + * var D = new Float64Array( [ 0.0 ] ); + * var IN = new Int32Array( [ 0, 0, 0 ] ); + * var Y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + * var TOL = new Float64Array( [ 0.0 ] ); + * + * dlagts( 1, 3, A, B, C, D, IN, Y, TOL ); + * // Y => [ ~0.179, ~0.286, ~0.679 ] + */ + ( job: number, N: number, A: Float64Array, B: Float64Array, C: Float64Array, D: Float64Array, IN: Int32Array, Y: Float64Array, TOL: Float64Array ): StatusCode; + + /** + * Solves a system of equations with a tridiagonal matrix `T` following a precomputed factorization of `T - lambda*I` using alternative indexing semantics. + * + * @param job - specifies the job to be performed + * @param N - order of the matrix `T` + * @param A - diagonal elements of `U` + * @param strideA - stride length for `A` + * @param offsetA - starting index for `A` + * @param B - first super-diagonal elements of `U` + * @param strideB - stride length for `B` + * @param offsetB - starting index for `B` + * @param C - sub-diagonal elements of `L` + * @param strideC - stride length for `C` + * @param offsetC - starting index for `C` + * @param D - second super-diagonal elements of `U` + * @param strideD - stride length for `D` + * @param offsetD - starting index for `D` + * @param IN - details of the matrix `P` + * @param strideIN - stride length for `IN` + * @param offsetIN - starting index for `IN` + * @param Y - right-hand side vector which is overwritten by the solution vector + * @param strideY - stride length for `Y` + * @param offsetY - starting index for `Y` + * @param TOL - tolerance used to perturb very small diagonal elements when `job` is negative + * @param offsetTOL - index for `TOL` + * @returns status code + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * var Int32Array = require( '@stdlib/array/int32' ); + * + * var A = new Float64Array( [ 4.0, 3.75, 3.7333333333333334 ] ); + * var B = new Float64Array( [ 1.0, 1.0 ] ); + * var C = new Float64Array( [ 0.25, 0.26666666666666666 ] ); + * var D = new Float64Array( [ 0.0 ] ); + * var IN = new Int32Array( [ 0, 0, 0 ] ); + * var Y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + * var TOL = new Float64Array( [ 0.0 ] ); + * + * dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); + * // Y => [ ~0.179, ~0.286, ~0.679 ] + */ + ndarray( job: number, N: number, A: Float64Array, strideA: number, offsetA: number, B: Float64Array, strideB: number, offsetB: number, C: Float64Array, strideC: number, offsetC: number, D: Float64Array, strideD: number, offsetD: number, IN: Int32Array, strideIN: number, offsetIN: number, Y: Float64Array, strideY: number, offsetY: number, TOL: Float64Array, offsetTOL: number ): StatusCode; +} + +/** +* Solves a system of equations with a tridiagonal matrix `T` following a precomputed factorization of `T - lambda*I`. +* +* @param job - specifies the job to be performed +* @param N - order of the matrix `T` +* @param A - diagonal elements of `U` +* @param B - first super-diagonal elements of `U` +* @param C - sub-diagonal elements of `L` +* @param D - second super-diagonal elements of `U` +* @param IN - details of the matrix `P` +* @param Y - right-hand side vector which is overwritten by the solution vector +* @param TOL - tolerance used to perturb very small diagonal elements when `job` is negative +* @returns status code +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var Int32Array = require( '@stdlib/array/int32' ); +* +* var A = new Float64Array( [ 4.0, 3.75, 3.7333333333333334 ] ); +* var B = new Float64Array( [ 1.0, 1.0 ] ); +* var C = new Float64Array( [ 0.25, 0.26666666666666666 ] ); +* var D = new Float64Array( [ 0.0 ] ); +* var IN = new Int32Array( [ 0, 0, 0 ] ); +* var Y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* var TOL = new Float64Array( [ 0.0 ] ); +* +* dlagts( 1, 3, A, B, C, D, IN, Y, TOL ); +* // Y => [ ~0.179, ~0.286, ~0.679 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var Int32Array = require( '@stdlib/array/int32' ); +* +* var A = new Float64Array( [ 4.0, 3.75, 3.7333333333333334 ] ); +* var B = new Float64Array( [ 1.0, 1.0 ] ); +* var C = new Float64Array( [ 0.25, 0.26666666666666666 ] ); +* var D = new Float64Array( [ 0.0 ] ); +* var IN = new Int32Array( [ 0, 0, 0 ] ); +* var Y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* var TOL = new Float64Array( [ 0.0 ] ); +* +* dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); +* // Y => [ ~0.179, ~0.286, ~0.679 ] +*/ +declare var dlagts: Routine; + + +// EXPORTS // + +export = dlagts; diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/docs/types/test.ts b/lib/node_modules/@stdlib/lapack/base/dlagts/docs/types/test.ts new file mode 100644 index 000000000000..4c0ec8f9e16a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/docs/types/test.ts @@ -0,0 +1,709 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +import dlagts = require( './index' ); + + +// TESTS // + +// The function returns a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts( 1, 3, A, B, C, D, IN, Y, TOL ); // $ExpectType number +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts( '5', 3, A, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( true, 3, A, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( false, 3, A, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( null, 3, A, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( undefined, 3, A, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( [], 3, A, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( {}, 3, A, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( ( x: number ): number => x, 3, A, B, C, D, IN, Y, TOL ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts( 1, '5', A, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, true, A, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, false, A, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, null, A, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, undefined, A, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, [], A, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, {}, A, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, ( x: number ): number => x, A, B, C, D, IN, Y, TOL ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a Float64Array... +{ + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts( 1, 3, '5', B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, 5, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, true, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, false, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, null, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, undefined, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, [], B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, {}, B, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, ( x: number ): number => x, B, C, D, IN, Y, TOL ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a Float64Array... +{ + const A = new Float64Array( 3 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts( 1, 3, A, '5', C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, 5, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, true, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, false, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, null, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, undefined, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, [], C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, {}, C, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, ( x: number ): number => x, C, D, IN, Y, TOL ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a Float64Array... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts( 1, 3, A, B, '5', D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, 5, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, true, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, false, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, null, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, undefined, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, [], D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, {}, D, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, ( x: number ): number => x, D, IN, Y, TOL ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a Float64Array... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts( 1, 3, A, B, C, '5', IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, 5, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, true, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, false, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, null, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, undefined, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, [], IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, {}, IN, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, ( x: number ): number => x, IN, Y, TOL ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not an Int32Array... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts( 1, 3, A, B, C, D, '5', Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, 5, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, true, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, false, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, null, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, undefined, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, [], Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, {}, Y, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, ( x: number ): number => x, Y, TOL ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a Float64Array... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts( 1, 3, A, B, C, D, IN, '5', TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, 5, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, true, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, false, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, null, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, undefined, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, [], TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, {}, TOL ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, ( x: number ): number => x, TOL ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a Float64Array... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + + dlagts( 1, 3, A, B, C, D, IN, Y, '5' ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, Y, 5 ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, Y, true ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, Y, false ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, Y, null ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, Y, undefined ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, Y, [] ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, Y, {} ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, Y, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts(); // $ExpectError + dlagts( 1 ); // $ExpectError + dlagts( 1, 3 ); // $ExpectError + dlagts( 1, 3, A ); // $ExpectError + dlagts( 1, 3, A, B ); // $ExpectError + dlagts( 1, 3, A, B, C ); // $ExpectError + dlagts( 1, 3, A, B, C, D ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, Y ); // $ExpectError + dlagts( 1, 3, A, B, C, D, IN, Y, TOL, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectType number +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( '5', 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( true, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( false, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( null, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( undefined, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( [], 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( {}, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( ( x: number ): number => x, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, '5', A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, true, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, false, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, null, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, undefined, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, [], A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, {}, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, ( x: number ): number => x, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a Float64Array... +{ + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, '5', 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, 5, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, true, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, false, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, null, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, undefined, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, [], 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, {}, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, ( x: number ): number => x, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, '5', 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, true, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, false, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, null, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, undefined, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, [], 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, {}, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, ( x: number ): number => x, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, '5', B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, true, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, false, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, null, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, undefined, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, [], B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, {}, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, ( x: number ): number => x, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a Float64Array... +{ + const A = new Float64Array( 3 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, '5', 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, 5, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, true, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, false, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, null, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, undefined, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, [], 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, {}, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, ( x: number ): number => x, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a seventh argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, '5', 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, true, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, false, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, null, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, undefined, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, [], 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, {}, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, ( x: number ): number => x, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an eighth argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, '5', C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, true, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, false, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, null, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, undefined, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, [], C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, {}, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, ( x: number ): number => x, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a ninth argument which is not a Float64Array... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, '5', 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, 5, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, true, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, false, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, null, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, undefined, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, [], 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, {}, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, ( x: number ): number => x, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a tenth argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, '5', 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, true, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, false, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, null, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, undefined, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, [], 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, {}, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, ( x: number ): number => x, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an eleventh argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, '5', D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, true, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, false, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, null, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, undefined, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, [], D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, {}, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, ( x: number ): number => x, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a twelfth argument which is not a Float64Array... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, '5', 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, 5, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, true, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, false, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, null, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, undefined, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, [], 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, {}, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, ( x: number ): number => x, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a thirteenth argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, '5', 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, true, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, false, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, null, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, undefined, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, [], 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, {}, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, ( x: number ): number => x, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourteenth argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, '5', IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, true, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, false, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, null, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, undefined, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, [], IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, {}, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, ( x: number ): number => x, IN, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fifteenth argument which is not an Int32Array... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, '5', 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, 5, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, true, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, false, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, null, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, undefined, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, [], 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, {}, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, ( x: number ): number => x, 1, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a sixteenth argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, '5', 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, true, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, false, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, null, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, undefined, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, [], 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, {}, 0, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, ( x: number ): number => x, 0, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a seventeenth argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, '5', Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, true, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, false, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, null, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, undefined, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, [], Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, {}, Y, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, ( x: number ): number => x, Y, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an eighteenth argument which is not a Float64Array... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, '5', 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, 5, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, true, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, false, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, null, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, undefined, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, [], 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, {}, 1, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, ( x: number ): number => x, 1, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a nineteenth argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, '5', 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, true, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, false, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, null, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, undefined, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, [], 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, {}, 0, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, ( x: number ): number => x, 0, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a twentieth argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, '5', TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, true, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, false, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, null, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, undefined, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, [], TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, {}, TOL, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, ( x: number ): number => x, TOL, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a twenty-first argument which is not a Float64Array... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, '5', 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, 5, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, true, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, false, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, null, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, undefined, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, [], 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, {}, 0 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a twenty-second argument which is not a number... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, '5' ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, true ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, false ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, null ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, undefined ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, [] ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, {} ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const A = new Float64Array( 3 ); + const B = new Float64Array( 2 ); + const C = new Float64Array( 2 ); + const D = new Float64Array( 1 ); + const IN = new Int32Array( 3 ); + const Y = new Float64Array( 3 ); + const TOL = new Float64Array( 1 ); + + dlagts.ndarray(); // $ExpectError + dlagts.ndarray( 1 ); // $ExpectError + dlagts.ndarray( 1, 3 ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL ); // $ExpectError + dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/examples/index.js b/lib/node_modules/@stdlib/lapack/base/dlagts/examples/index.js new file mode 100644 index 000000000000..61c5bc8149ef --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/examples/index.js @@ -0,0 +1,52 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +var Int32Array = require( '@stdlib/array/int32' ); +var Float64Array = require( '@stdlib/array/float64' ); +var dlagts = require( './../lib' ); + +// Diagonal elements of `U`: +var A = new Float64Array( [ 4.0, 3.75, 3.7333333333333334, 3.732142857142857, 3.7320574162679425 ] ); + +// First super-diagonal elements of `U`: +var B = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); + +// Sub-diagonal multipliers of `L`: +var C = new Float64Array( [ 0.25, 0.26666666666666666, 0.26785714285714285, 0.2679425837320574 ] ); + +// Second super-diagonal elements of `U`: +var D = new Float64Array( [ 0.0, 0.0, 0.0 ] ); + +// Details of the permutation matrix `P`: +var IN = new Int32Array( [ 0, 0, 0, 0, 0 ] ); + +// Right-hand side vector: +var Y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0, 5.0 ] ); + +// Tolerance (only referenced when `job` is negative): +var TOL = new Float64Array( [ 0.0 ] ); + +// Solve `T*x = y`, overwriting `Y` with the solution vector `x`: +var info = dlagts( 1, 5, A, B, C, D, IN, Y, TOL ); + +console.log( Y ); +console.log( info ); diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/lib/base.js b/lib/node_modules/@stdlib/lapack/base/dlagts/lib/base.js new file mode 100644 index 000000000000..cb3d8621d53c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/lib/base.js @@ -0,0 +1,216 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len, max-params */ + +'use strict'; + +// MODULES // + +var abs = require( '@stdlib/math/base/special/abs' ); +var max = require( '@stdlib/math/base/special/max' ); +var copysign = require( '@stdlib/math/base/special/copysign' ); +var dlamch = require( '@stdlib/lapack/base/dlamch' ); + + +// FUNCTIONS // + +/** +* Divides `temp` by a diagonal element `ak`, scaling to avoid overflow and, optionally, perturbing very small diagonal elements, and writes the result to `Y`. +* +* @private +* @param {number} temp - dividend +* @param {number} ak - diagonal element +* @param {boolean} perturb - boolean indicating whether to perturb very small diagonal elements to avoid overflow +* @param {number} tol - tolerance controlling the magnitude of the perturbation +* @param {number} sfmin - safe minimum (i.e., smallest number for which `1/sfmin` does not overflow) +* @param {number} bignum - reciprocal of the safe minimum +* @param {Float64Array} Y - output array +* @param {integer} iy - index at which to write the result in `Y` +* @returns {boolean} boolean indicating whether the division could be performed without overflow +*/ +function divide( temp, ak, perturb, tol, sfmin, bignum, Y, iy ) { + var absak; + var pert; + + if ( perturb ) { + pert = copysign( tol, ak ); + } + for ( ; ; ) { + absak = abs( ak ); + if ( absak < 1.0 ) { + if ( absak < sfmin ) { + if ( absak === 0.0 || abs( temp )*sfmin > absak ) { + if ( perturb ) { + ak += pert; + pert *= 2.0; + continue; + } + return false; + } + temp *= bignum; + ak *= bignum; + } else if ( abs( temp ) > absak*bignum ) { + if ( perturb ) { + ak += pert; + pert *= 2.0; + continue; + } + return false; + } + } + break; + } + Y[ iy ] = temp / ak; + return true; +} + + +// MAIN // + +/** +* Solves a system of equations with a tridiagonal matrix `T` following a precomputed factorization of `T - lambda*I`. +* +* @private +* @param {integer} job - specifies the job to be performed +* @param {NonNegativeInteger} N - order of the matrix `T` +* @param {Float64Array} A - diagonal elements of `U` +* @param {integer} strideA - stride length for `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Float64Array} B - first super-diagonal elements of `U` +* @param {integer} strideB - stride length for `B` +* @param {NonNegativeInteger} offsetB - starting index for `B` +* @param {Float64Array} C - sub-diagonal elements of `L` +* @param {integer} strideC - stride length for `C` +* @param {NonNegativeInteger} offsetC - starting index for `C` +* @param {Float64Array} D - second super-diagonal elements of `U` +* @param {integer} strideD - stride length for `D` +* @param {NonNegativeInteger} offsetD - starting index for `D` +* @param {Int32Array} IN - details of the matrix `P` +* @param {integer} strideIN - stride length for `IN` +* @param {NonNegativeInteger} offsetIN - starting index for `IN` +* @param {Float64Array} Y - right-hand side vector which is overwritten by the solution vector +* @param {integer} strideY - stride length for `Y` +* @param {NonNegativeInteger} offsetY - starting index for `Y` +* @param {Float64Array} TOL - tolerance used to perturb very small diagonal elements when `job` is negative +* @param {NonNegativeInteger} offsetTOL - index for `TOL` +* @returns {integer} status code +*/ +function dlagts( job, N, A, strideA, offsetA, B, strideB, offsetB, C, strideC, offsetC, D, strideD, offsetD, IN, strideIN, offsetIN, Y, strideY, offsetY, TOL, offsetTOL ) { + var perturb; + var bignum; + var sfmin; + var temp; + var tol; + var eps; + var ak; + var iy; + var ii; + var ic; + var k; + + if ( N === 0 ) { + return 0; + } + eps = dlamch( 'E' ); + sfmin = dlamch( 'S' ); + bignum = 1.0 / sfmin; + + tol = TOL[ offsetTOL ]; + if ( job < 0 && tol <= 0.0 ) { + tol = abs( A[ offsetA ] ); + if ( N > 1 ) { + tol = max( max( tol, abs( A[ offsetA+strideA ] ) ), abs( B[ offsetB ] ) ); + } + for ( k = 3; k <= N; k++ ) { + tol = max( max( max( tol, abs( A[ offsetA+((k-1)*strideA) ] ) ), abs( B[ offsetB+((k-2)*strideB) ] ) ), abs( D[ offsetD+((k-3)*strideD) ] ) ); + } + tol *= eps; + if ( tol === 0.0 ) { + tol = eps; + } + TOL[ offsetTOL ] = tol; + } + if ( abs( job ) === 1 ) { + // Apply the permutation `P` and the unit lower bidiagonal matrix `L`... + for ( k = 2; k <= N; k++ ) { + iy = offsetY + ( (k-1)*strideY ); + ii = offsetIN + ( (k-2)*strideIN ); + ic = offsetC + ( (k-2)*strideC ); + if ( IN[ ii ] === 0 ) { + Y[ iy ] -= C[ ic ]*Y[ iy-strideY ]; + } else { + temp = Y[ iy-strideY ]; + Y[ iy-strideY ] = Y[ iy ]; + Y[ iy ] = temp - ( C[ ic ]*Y[ iy ] ); + } + } + // Solve the upper triangular system `U*x = y`... + perturb = ( job === -1 ); + for ( k = N; k >= 1; k-- ) { + iy = offsetY + ( (k-1)*strideY ); + if ( k <= N-2 ) { + temp = Y[ iy ] - ( B[ offsetB+((k-1)*strideB) ]*Y[ iy+strideY ] ) - ( D[ offsetD+((k-1)*strideD) ]*Y[ iy+(2*strideY) ] ); + } else if ( k === N-1 ) { + temp = Y[ iy ] - ( B[ offsetB+((k-1)*strideB) ]*Y[ iy+strideY ] ); + } else { + temp = Y[ iy ]; + } + ak = A[ offsetA+((k-1)*strideA) ]; + if ( !divide( temp, ak, perturb, tol, sfmin, bignum, Y, iy ) ) { + return k; + } + } + } else { + // Solve the transposed upper triangular system `U^T*x = y`... + perturb = ( job === -2 ); + for ( k = 1; k <= N; k++ ) { + iy = offsetY + ( (k-1)*strideY ); + if ( k >= 3 ) { + temp = Y[ iy ] - ( B[ offsetB+((k-2)*strideB) ]*Y[ iy-strideY ] ) - ( D[ offsetD+((k-3)*strideD) ]*Y[ iy-(2*strideY) ] ); + } else if ( k === 2 ) { + temp = Y[ iy ] - ( B[ offsetB+((k-2)*strideB) ]*Y[ iy-strideY ] ); + } else { + temp = Y[ iy ]; + } + ak = A[ offsetA+((k-1)*strideA) ]; + if ( !divide( temp, ak, perturb, tol, sfmin, bignum, Y, iy ) ) { + return k; + } + } + // Apply the transposed unit lower bidiagonal matrix `L^T` and the permutation `P`... + for ( k = N; k >= 2; k-- ) { + iy = offsetY + ( (k-1)*strideY ); + ii = offsetIN + ( (k-2)*strideIN ); + ic = offsetC + ( (k-2)*strideC ); + if ( IN[ ii ] === 0 ) { + Y[ iy-strideY ] -= C[ ic ]*Y[ iy ]; + } else { + temp = Y[ iy-strideY ]; + Y[ iy-strideY ] = Y[ iy ]; + Y[ iy ] = temp - ( C[ ic ]*Y[ iy ] ); + } + } + } + return 0; +} + + +// EXPORTS // + +module.exports = dlagts; diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/lib/dlagts.js b/lib/node_modules/@stdlib/lapack/base/dlagts/lib/dlagts.js new file mode 100644 index 000000000000..aa779fcbd7a2 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/lib/dlagts.js @@ -0,0 +1,75 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Solves a system of equations with a tridiagonal matrix `T` following a precomputed factorization of `T - lambda*I`. +* +* @param {integer} job - specifies the job to be performed +* @param {NonNegativeInteger} N - order of the matrix `T` +* @param {Float64Array} A - diagonal elements of `U` +* @param {Float64Array} B - first super-diagonal elements of `U` +* @param {Float64Array} C - sub-diagonal elements of `L` +* @param {Float64Array} D - second super-diagonal elements of `U` +* @param {Int32Array} IN - details of the matrix `P` +* @param {Float64Array} Y - right-hand side vector which is overwritten by the solution vector +* @param {Float64Array} TOL - tolerance used to perturb very small diagonal elements when `job` is negative +* @throws {RangeError} first argument must be `1`, `-1`, `2`, or `-2` +* @throws {RangeError} second argument must be a nonnegative integer +* @returns {integer} status code +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var Int32Array = require( '@stdlib/array/int32' ); +* +* var A = new Float64Array( [ 4.0, 3.75, 3.7333333333333334 ] ); +* var B = new Float64Array( [ 1.0, 1.0 ] ); +* var C = new Float64Array( [ 0.25, 0.26666666666666666 ] ); +* var D = new Float64Array( [ 0.0 ] ); +* var IN = new Int32Array( [ 0, 0, 0 ] ); +* var Y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* var TOL = new Float64Array( [ 0.0 ] ); +* +* dlagts( 1, 3, A, B, C, D, IN, Y, TOL ); +* // Y => [ ~0.179, ~0.286, ~0.679 ] +*/ +function dlagts( job, N, A, B, C, D, IN, Y, TOL ) { + if ( job !== 1 && job !== -1 && job !== 2 && job !== -2 ) { + throw new RangeError( format( 'invalid argument. First argument must be one of the following: `1`, `-1`, `2`, or `-2`. Value: `%d`.', job ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + return base( job, N, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); +} + + +// EXPORTS // + +module.exports = dlagts; diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/lib/index.js b/lib/node_modules/@stdlib/lapack/base/dlagts/lib/index.js new file mode 100644 index 000000000000..287a3fbf355f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/lib/index.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +/** +* LAPACK routine to solve a system of equations with a tridiagonal matrix `T` following a precomputed factorization of `T - lambda*I`. +* +* @module @stdlib/lapack/base/dlagts +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var Int32Array = require( '@stdlib/array/int32' ); +* var dlagts = require( '@stdlib/lapack/base/dlagts' ); +* +* var A = new Float64Array( [ 4.0, 3.75, 3.7333333333333334 ] ); +* var B = new Float64Array( [ 1.0, 1.0 ] ); +* var C = new Float64Array( [ 0.25, 0.26666666666666666 ] ); +* var D = new Float64Array( [ 0.0 ] ); +* var IN = new Int32Array( [ 0, 0, 0 ] ); +* var Y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* var TOL = new Float64Array( [ 0.0 ] ); +* +* dlagts( 1, 3, A, B, C, D, IN, Y, TOL ); +* // Y => [ ~0.179, ~0.286, ~0.679 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var Int32Array = require( '@stdlib/array/int32' ); +* var dlagts = require( '@stdlib/lapack/base/dlagts' ); +* +* var A = new Float64Array( [ 4.0, 3.75, 3.7333333333333334 ] ); +* var B = new Float64Array( [ 1.0, 1.0 ] ); +* var C = new Float64Array( [ 0.25, 0.26666666666666666 ] ); +* var D = new Float64Array( [ 0.0 ] ); +* var IN = new Int32Array( [ 0, 0, 0 ] ); +* var Y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* var TOL = new Float64Array( [ 0.0 ] ); +* +* dlagts.ndarray( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); +* // Y => [ ~0.179, ~0.286, ~0.679 ] +*/ + +// MODULES // + +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); +var isError = require( '@stdlib/assert/is-error' ); +var main = require( './main.js' ); + + +// MAIN // + +var dlagts; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dlagts = main; +} else { + dlagts = tmp; +} + + +// EXPORTS // + +module.exports = dlagts; + +// exports: { "ndarray": "dlagts.ndarray" } diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/lib/main.js b/lib/node_modules/@stdlib/lapack/base/dlagts/lib/main.js new file mode 100644 index 000000000000..5f963851bde1 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var dlagts = require( './dlagts.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dlagts, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dlagts; diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/lib/ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlagts/lib/ndarray.js new file mode 100644 index 000000000000..93a46be7d0a9 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/lib/ndarray.js @@ -0,0 +1,88 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len, max-params */ + +'use strict'; + +// MODULES // + +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Solves a system of equations with a tridiagonal matrix `T` following a precomputed factorization of `T - lambda*I` using alternative indexing semantics. +* +* @param {integer} job - specifies the job to be performed +* @param {NonNegativeInteger} N - order of the matrix `T` +* @param {Float64Array} A - diagonal elements of `U` +* @param {integer} strideA - stride length for `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Float64Array} B - first super-diagonal elements of `U` +* @param {integer} strideB - stride length for `B` +* @param {NonNegativeInteger} offsetB - starting index for `B` +* @param {Float64Array} C - sub-diagonal elements of `L` +* @param {integer} strideC - stride length for `C` +* @param {NonNegativeInteger} offsetC - starting index for `C` +* @param {Float64Array} D - second super-diagonal elements of `U` +* @param {integer} strideD - stride length for `D` +* @param {NonNegativeInteger} offsetD - starting index for `D` +* @param {Int32Array} IN - details of the matrix `P` +* @param {integer} strideIN - stride length for `IN` +* @param {NonNegativeInteger} offsetIN - starting index for `IN` +* @param {Float64Array} Y - right-hand side vector which is overwritten by the solution vector +* @param {integer} strideY - stride length for `Y` +* @param {NonNegativeInteger} offsetY - starting index for `Y` +* @param {Float64Array} TOL - tolerance used to perturb very small diagonal elements when `job` is negative +* @param {NonNegativeInteger} offsetTOL - index for `TOL` +* @throws {RangeError} first argument must be `1`, `-1`, `2`, or `-2` +* @throws {RangeError} second argument must be a nonnegative integer +* @returns {integer} status code +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var Int32Array = require( '@stdlib/array/int32' ); +* +* var A = new Float64Array( [ 4.0, 3.75, 3.7333333333333334 ] ); +* var B = new Float64Array( [ 1.0, 1.0 ] ); +* var C = new Float64Array( [ 0.25, 0.26666666666666666 ] ); +* var D = new Float64Array( [ 0.0 ] ); +* var IN = new Int32Array( [ 0, 0, 0 ] ); +* var Y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* var TOL = new Float64Array( [ 0.0 ] ); +* +* dlagts( 1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 0 ); +* // Y => [ ~0.179, ~0.286, ~0.679 ] +*/ +function dlagts( job, N, A, strideA, offsetA, B, strideB, offsetB, C, strideC, offsetC, D, strideD, offsetD, IN, strideIN, offsetIN, Y, strideY, offsetY, TOL, offsetTOL ) { + if ( job !== 1 && job !== -1 && job !== 2 && job !== -2 ) { + throw new RangeError( format( 'invalid argument. First argument must be one of the following: `1`, `-1`, `2`, or `-2`. Value: `%d`.', job ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + return base( job, N, A, strideA, offsetA, B, strideB, offsetB, C, strideC, offsetC, D, strideD, offsetD, IN, strideIN, offsetIN, Y, strideY, offsetY, TOL, offsetTOL ); +} + + +// EXPORTS // + +module.exports = dlagts; diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/package.json b/lib/node_modules/@stdlib/lapack/base/dlagts/package.json new file mode 100644 index 000000000000..8dc63dacece3 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/package.json @@ -0,0 +1,69 @@ +{ + "name": "@stdlib/lapack/base/dlagts", + "version": "0.0.0", + "description": "Solve a system of equations with a tridiagonal matrix following a precomputed factorization.", + "license": "Apache-2.0", + "author": { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + }, + "contributors": [ + { + "name": "The Stdlib Authors", + "url": "https://github.com/stdlib-js/stdlib/graphs/contributors" + } + ], + "main": "./lib", + "directories": { + "benchmark": "./benchmark", + "doc": "./docs", + "example": "./examples", + "lib": "./lib", + "test": "./test" + }, + "types": "./docs/types", + "scripts": {}, + "homepage": "https://github.com/stdlib-js/stdlib", + "repository": { + "type": "git", + "url": "git://github.com/stdlib-js/stdlib.git" + }, + "bugs": { + "url": "https://github.com/stdlib-js/stdlib/issues" + }, + "dependencies": {}, + "devDependencies": {}, + "engines": { + "node": ">=0.10.0", + "npm": ">2.7.0" + }, + "os": [ + "aix", + "darwin", + "freebsd", + "linux", + "macos", + "openbsd", + "sunos", + "win32", + "windows" + ], + "keywords": [ + "stdlib", + "stdmath", + "mathematics", + "math", + "lapack", + "dlagts", + "tridiagonal", + "solve", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "float64", + "double", + "float64array" + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job1.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job1.json new file mode 100644 index 000000000000..752b5fdb7ca5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job1.json @@ -0,0 +1,27 @@ +{ + "job": 1, + "N": 5, + "A": [ 4, 3.75, 3.7333333333333334, 3.732142857142857, 3.7320574162679425 ], + "strideA": 1, + "offsetA": 0, + "B": [ 1, 1, 1, 1 ], + "strideB": 1, + "offsetB": 0, + "C": [ 0.25, 0.26666666666666666, 0.26785714285714285, 0.2679425837320574 ], + "strideC": 1, + "offsetC": 0, + "D": [ 0, 0, 0 ], + "strideD": 1, + "offsetD": 0, + "IN": [ 0, 0, 0, 0, 0 ], + "strideIN": 1, + "offsetIN": 0, + "Y": [ 1, 2, 3, 4, 5 ], + "strideY": 1, + "offsetY": 0, + "TOL": [ 0 ], + "offsetTOL": 0, + "Y_out": [ 0.16794871794871796, 0.3282051282051282, 0.5192307692307692, 0.5948717948717949, 1.1012820512820511 ], + "TOL_out": [ 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job1_pivoted.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job1_pivoted.json new file mode 100644 index 000000000000..cc8dcaa89626 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job1_pivoted.json @@ -0,0 +1,27 @@ +{ + "job": 1, + "N": 4, + "A": [ 5, 4.8, 5, 4.591666666666667 ], + "strideA": 1, + "offsetA": 0, + "B": [ 1, -1, 1 ], + "strideB": 1, + "offsetB": 0, + "C": [ 0.2, 1.0416666666666667, 0.4083333333333334 ], + "strideC": 1, + "offsetC": 0, + "D": [ 5, 0 ], + "strideD": 1, + "offsetD": 0, + "IN": [ 1, 0, 1, 0 ], + "strideIN": 1, + "offsetIN": 0, + "Y": [ 1, 2, 3, 4 ], + "strideY": 1, + "offsetY": 0, + "TOL": [ 0 ], + "offsetTOL": 0, + "Y_out": [ -0.4246823956442832, 0.2849364791288566, 0.7676950998185118, 0.16152450090744097 ], + "TOL_out": [ 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job2.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job2.json new file mode 100644 index 000000000000..c7d22e488747 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job2.json @@ -0,0 +1,27 @@ +{ + "job": 2, + "N": 5, + "A": [ 4, 3.75, 3.7333333333333334, 3.732142857142857, 3.7320574162679425 ], + "strideA": 1, + "offsetA": 0, + "B": [ 1, 1, 1, 1 ], + "strideB": 1, + "offsetB": 0, + "C": [ 0.25, 0.26666666666666666, 0.26785714285714285, 0.2679425837320574 ], + "strideC": 1, + "offsetC": 0, + "D": [ 0, 0, 0 ], + "strideD": 1, + "offsetD": 0, + "IN": [ 0, 0, 0, 0, 0 ], + "strideIN": 1, + "offsetIN": 0, + "Y": [ 1, 2, 3, 4, 5 ], + "strideY": 1, + "offsetY": 0, + "TOL": [ 0 ], + "offsetTOL": 0, + "Y_out": [ 0.16794871794871793, 0.32820512820512826, 0.5192307692307692, 0.5948717948717949, 1.1012820512820511 ], + "TOL_out": [ 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job2_pivoted.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job2_pivoted.json new file mode 100644 index 000000000000..ad7516ec3c1e --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job2_pivoted.json @@ -0,0 +1,27 @@ +{ + "job": 2, + "N": 4, + "A": [ 5, 4.8, 5, 4.591666666666667 ], + "strideA": 1, + "offsetA": 0, + "B": [ 1, -1, 1 ], + "strideB": 1, + "offsetB": 0, + "C": [ 0.2, 1.0416666666666667, 0.4083333333333334 ], + "strideC": 1, + "offsetC": 0, + "D": [ 5, 0 ], + "strideD": 1, + "offsetD": 0, + "IN": [ 1, 0, 1, 0 ], + "strideIN": 1, + "offsetIN": 0, + "Y": [ 1, 2, 3, 4 ], + "strideY": 1, + "offsetY": 0, + "TOL": [ 0 ], + "offsetTOL": 0, + "Y_out": [ -0.42468239564428323, 0.28493647912885667, 0.7676950998185118, 0.16152450090744097 ], + "TOL_out": [ 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job_neg1_auto_tol.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job_neg1_auto_tol.json new file mode 100644 index 000000000000..fb88b8f64b0d --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job_neg1_auto_tol.json @@ -0,0 +1,27 @@ +{ + "job": -1, + "N": 5, + "A": [ 4, 3.75, 3.7333333333333334, 3.732142857142857, 3.7320574162679425 ], + "strideA": 1, + "offsetA": 0, + "B": [ 1, 1, 1, 1 ], + "strideB": 1, + "offsetB": 0, + "C": [ 0.25, 0.26666666666666666, 0.26785714285714285, 0.2679425837320574 ], + "strideC": 1, + "offsetC": 0, + "D": [ 0, 0, 0 ], + "strideD": 1, + "offsetD": 0, + "IN": [ 0, 0, 0, 0, 0 ], + "strideIN": 1, + "offsetIN": 0, + "Y": [ 1, 2, 3, 4, 5 ], + "strideY": 1, + "offsetY": 0, + "TOL": [ 0 ], + "offsetTOL": 0, + "Y_out": [ 0.16794871794871796, 0.3282051282051282, 0.5192307692307692, 0.5948717948717949, 1.1012820512820511 ], + "TOL_out": [ 4.440892098500626e-16 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job_neg2_pivoted_auto_tol.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job_neg2_pivoted_auto_tol.json new file mode 100644 index 000000000000..7706dbdad582 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/job_neg2_pivoted_auto_tol.json @@ -0,0 +1,27 @@ +{ + "job": -2, + "N": 4, + "A": [ 5, 4.8, 5, 4.591666666666667 ], + "strideA": 1, + "offsetA": 0, + "B": [ 1, -1, 1 ], + "strideB": 1, + "offsetB": 0, + "C": [ 0.2, 1.0416666666666667, 0.4083333333333334 ], + "strideC": 1, + "offsetC": 0, + "D": [ 5, 0 ], + "strideD": 1, + "offsetD": 0, + "IN": [ 1, 0, 1, 0 ], + "strideIN": 1, + "offsetIN": 0, + "Y": [ 1, 2, 3, 4 ], + "strideY": 1, + "offsetY": 0, + "TOL": [ 0 ], + "offsetTOL": 0, + "Y_out": [ -0.42468239564428323, 0.28493647912885667, 0.7676950998185118, 0.16152450090744097 ], + "TOL_out": [ 5.551115123125783e-16 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job1.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job1.json new file mode 100644 index 000000000000..f1189b4aa542 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job1.json @@ -0,0 +1,27 @@ +{ + "job": 1, + "N": 5, + "A": [ 4, 9999, 3.75, 9999, 3.7333333333333334, 9999, 3.732142857142857, 9999, 3.7320574162679425, 9999 ], + "strideA": 2, + "offsetA": 0, + "B": [ 1, 9999, 1, 9999, 1, 9999, 1, 9999 ], + "strideB": 2, + "offsetB": 0, + "C": [ 0.25, 9999, 0.26666666666666666, 9999, 0.26785714285714285, 9999, 0.2679425837320574, 9999 ], + "strideC": 2, + "offsetC": 0, + "D": [ 0, 9999, 0, 9999, 0, 9999 ], + "strideD": 2, + "offsetD": 0, + "IN": [ 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999 ], + "strideIN": 2, + "offsetIN": 0, + "Y": [ 1, 9999, 2, 9999, 3, 9999, 4, 9999, 5, 9999 ], + "strideY": 2, + "offsetY": 0, + "TOL": [ 0, 9999 ], + "offsetTOL": 0, + "Y_out": [ 0.16794871794871796, 9999, 0.3282051282051282, 9999, 0.5192307692307692, 9999, 0.5948717948717949, 9999, 1.1012820512820511, 9999 ], + "TOL_out": [ 0, 9999 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job1_pivoted.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job1_pivoted.json new file mode 100644 index 000000000000..3dbc08f48585 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job1_pivoted.json @@ -0,0 +1,27 @@ +{ + "job": 1, + "N": 4, + "A": [ 5, 9999, 4.8, 9999, 5, 9999, 4.591666666666667, 9999 ], + "strideA": 2, + "offsetA": 0, + "B": [ 1, 9999, -1, 9999, 1, 9999 ], + "strideB": 2, + "offsetB": 0, + "C": [ 0.2, 9999, 1.0416666666666667, 9999, 0.4083333333333334, 9999 ], + "strideC": 2, + "offsetC": 0, + "D": [ 5, 9999, 0, 9999 ], + "strideD": 2, + "offsetD": 0, + "IN": [ 1, 9999, 0, 9999, 1, 9999, 0, 9999 ], + "strideIN": 2, + "offsetIN": 0, + "Y": [ 1, 9999, 2, 9999, 3, 9999, 4, 9999 ], + "strideY": 2, + "offsetY": 0, + "TOL": [ 0, 9999 ], + "offsetTOL": 0, + "Y_out": [ -0.4246823956442832, 9999, 0.2849364791288566, 9999, 0.7676950998185118, 9999, 0.16152450090744097, 9999 ], + "TOL_out": [ 0, 9999 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job2.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job2.json new file mode 100644 index 000000000000..9bcafd44a1b4 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job2.json @@ -0,0 +1,27 @@ +{ + "job": 2, + "N": 5, + "A": [ 4, 9999, 3.75, 9999, 3.7333333333333334, 9999, 3.732142857142857, 9999, 3.7320574162679425, 9999 ], + "strideA": 2, + "offsetA": 0, + "B": [ 1, 9999, 1, 9999, 1, 9999, 1, 9999 ], + "strideB": 2, + "offsetB": 0, + "C": [ 0.25, 9999, 0.26666666666666666, 9999, 0.26785714285714285, 9999, 0.2679425837320574, 9999 ], + "strideC": 2, + "offsetC": 0, + "D": [ 0, 9999, 0, 9999, 0, 9999 ], + "strideD": 2, + "offsetD": 0, + "IN": [ 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999 ], + "strideIN": 2, + "offsetIN": 0, + "Y": [ 1, 9999, 2, 9999, 3, 9999, 4, 9999, 5, 9999 ], + "strideY": 2, + "offsetY": 0, + "TOL": [ 0, 9999 ], + "offsetTOL": 0, + "Y_out": [ 0.16794871794871793, 9999, 0.32820512820512826, 9999, 0.5192307692307692, 9999, 0.5948717948717949, 9999, 1.1012820512820511, 9999 ], + "TOL_out": [ 0, 9999 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job2_pivoted.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job2_pivoted.json new file mode 100644 index 000000000000..e625e7cb2010 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job2_pivoted.json @@ -0,0 +1,27 @@ +{ + "job": 2, + "N": 4, + "A": [ 5, 9999, 4.8, 9999, 5, 9999, 4.591666666666667, 9999 ], + "strideA": 2, + "offsetA": 0, + "B": [ 1, 9999, -1, 9999, 1, 9999 ], + "strideB": 2, + "offsetB": 0, + "C": [ 0.2, 9999, 1.0416666666666667, 9999, 0.4083333333333334, 9999 ], + "strideC": 2, + "offsetC": 0, + "D": [ 5, 9999, 0, 9999 ], + "strideD": 2, + "offsetD": 0, + "IN": [ 1, 9999, 0, 9999, 1, 9999, 0, 9999 ], + "strideIN": 2, + "offsetIN": 0, + "Y": [ 1, 9999, 2, 9999, 3, 9999, 4, 9999 ], + "strideY": 2, + "offsetY": 0, + "TOL": [ 0, 9999 ], + "offsetTOL": 0, + "Y_out": [ -0.42468239564428323, 9999, 0.28493647912885667, 9999, 0.7676950998185118, 9999, 0.16152450090744097, 9999 ], + "TOL_out": [ 0, 9999 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job_neg1_auto_tol.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job_neg1_auto_tol.json new file mode 100644 index 000000000000..261fff1f3126 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job_neg1_auto_tol.json @@ -0,0 +1,27 @@ +{ + "job": -1, + "N": 5, + "A": [ 4, 9999, 3.75, 9999, 3.7333333333333334, 9999, 3.732142857142857, 9999, 3.7320574162679425, 9999 ], + "strideA": 2, + "offsetA": 0, + "B": [ 1, 9999, 1, 9999, 1, 9999, 1, 9999 ], + "strideB": 2, + "offsetB": 0, + "C": [ 0.25, 9999, 0.26666666666666666, 9999, 0.26785714285714285, 9999, 0.2679425837320574, 9999 ], + "strideC": 2, + "offsetC": 0, + "D": [ 0, 9999, 0, 9999, 0, 9999 ], + "strideD": 2, + "offsetD": 0, + "IN": [ 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999 ], + "strideIN": 2, + "offsetIN": 0, + "Y": [ 1, 9999, 2, 9999, 3, 9999, 4, 9999, 5, 9999 ], + "strideY": 2, + "offsetY": 0, + "TOL": [ 0, 9999 ], + "offsetTOL": 0, + "Y_out": [ 0.16794871794871796, 9999, 0.3282051282051282, 9999, 0.5192307692307692, 9999, 0.5948717948717949, 9999, 1.1012820512820511, 9999 ], + "TOL_out": [ 4.440892098500626e-16, 9999 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job_neg2_pivoted_auto_tol.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job_neg2_pivoted_auto_tol.json new file mode 100644 index 000000000000..5871e8ea4498 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/large_strides/job_neg2_pivoted_auto_tol.json @@ -0,0 +1,27 @@ +{ + "job": -2, + "N": 4, + "A": [ 5, 9999, 4.8, 9999, 5, 9999, 4.591666666666667, 9999 ], + "strideA": 2, + "offsetA": 0, + "B": [ 1, 9999, -1, 9999, 1, 9999 ], + "strideB": 2, + "offsetB": 0, + "C": [ 0.2, 9999, 1.0416666666666667, 9999, 0.4083333333333334, 9999 ], + "strideC": 2, + "offsetC": 0, + "D": [ 5, 9999, 0, 9999 ], + "strideD": 2, + "offsetD": 0, + "IN": [ 1, 9999, 0, 9999, 1, 9999, 0, 9999 ], + "strideIN": 2, + "offsetIN": 0, + "Y": [ 1, 9999, 2, 9999, 3, 9999, 4, 9999 ], + "strideY": 2, + "offsetY": 0, + "TOL": [ 0, 9999 ], + "offsetTOL": 0, + "Y_out": [ -0.42468239564428323, 9999, 0.28493647912885667, 9999, 0.7676950998185118, 9999, 0.16152450090744097, 9999 ], + "TOL_out": [ 5.551115123125783e-16, 9999 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job1.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job1.json new file mode 100644 index 000000000000..7b422ab6588b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job1.json @@ -0,0 +1,27 @@ +{ + "job": 1, + "N": 5, + "A": [ 9999, 4, 9999, 3.75, 9999, 3.7333333333333334, 9999, 3.732142857142857, 9999, 3.7320574162679425 ], + "strideA": 2, + "offsetA": 1, + "B": [ 1, 9999, 9999, 1, 9999, 9999, 1, 9999, 9999, 1 ], + "strideB": 3, + "offsetB": 0, + "C": [ 9999, 9999, 0.25, 9999, 0.26666666666666666, 9999, 0.26785714285714285, 9999, 0.2679425837320574 ], + "strideC": 2, + "offsetC": 2, + "D": [ 9999, 0, 9999, 9999, 0, 9999, 9999, 0 ], + "strideD": 3, + "offsetD": 1, + "IN": [ 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0 ], + "strideIN": 2, + "offsetIN": 0, + "Y": [ 5, 9999, 4, 9999, 3, 9999, 2, 9999, 1 ], + "strideY": -2, + "offsetY": 8, + "TOL": [ 9999, 9999, 0 ], + "offsetTOL": 2, + "Y_out": [ 1.1012820512820511, 9999, 0.5948717948717949, 9999, 0.5192307692307692, 9999, 0.3282051282051282, 9999, 0.16794871794871796 ], + "TOL_out": [ 9999, 9999, 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job1_pivoted.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job1_pivoted.json new file mode 100644 index 000000000000..7013e9234ae5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job1_pivoted.json @@ -0,0 +1,27 @@ +{ + "job": 1, + "N": 4, + "A": [ 9999, 5, 9999, 4.8, 9999, 5, 9999, 4.591666666666667 ], + "strideA": 2, + "offsetA": 1, + "B": [ 1, 9999, 9999, -1, 9999, 9999, 1 ], + "strideB": 3, + "offsetB": 0, + "C": [ 9999, 9999, 0.2, 9999, 1.0416666666666667, 9999, 0.4083333333333334 ], + "strideC": 2, + "offsetC": 2, + "D": [ 9999, 5, 9999, 9999, 0 ], + "strideD": 3, + "offsetD": 1, + "IN": [ 1, 9999, 0, 9999, 1, 9999, 0 ], + "strideIN": 2, + "offsetIN": 0, + "Y": [ 4, 9999, 3, 9999, 2, 9999, 1 ], + "strideY": -2, + "offsetY": 6, + "TOL": [ 9999, 9999, 0 ], + "offsetTOL": 2, + "Y_out": [ 0.16152450090744097, 9999, 0.7676950998185118, 9999, 0.2849364791288566, 9999, -0.4246823956442832 ], + "TOL_out": [ 9999, 9999, 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job2.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job2.json new file mode 100644 index 000000000000..69454169765e --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job2.json @@ -0,0 +1,27 @@ +{ + "job": 2, + "N": 5, + "A": [ 9999, 4, 9999, 3.75, 9999, 3.7333333333333334, 9999, 3.732142857142857, 9999, 3.7320574162679425 ], + "strideA": 2, + "offsetA": 1, + "B": [ 1, 9999, 9999, 1, 9999, 9999, 1, 9999, 9999, 1 ], + "strideB": 3, + "offsetB": 0, + "C": [ 9999, 9999, 0.25, 9999, 0.26666666666666666, 9999, 0.26785714285714285, 9999, 0.2679425837320574 ], + "strideC": 2, + "offsetC": 2, + "D": [ 9999, 0, 9999, 9999, 0, 9999, 9999, 0 ], + "strideD": 3, + "offsetD": 1, + "IN": [ 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0 ], + "strideIN": 2, + "offsetIN": 0, + "Y": [ 5, 9999, 4, 9999, 3, 9999, 2, 9999, 1 ], + "strideY": -2, + "offsetY": 8, + "TOL": [ 9999, 9999, 0 ], + "offsetTOL": 2, + "Y_out": [ 1.1012820512820511, 9999, 0.5948717948717949, 9999, 0.5192307692307692, 9999, 0.32820512820512826, 9999, 0.16794871794871793 ], + "TOL_out": [ 9999, 9999, 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job2_pivoted.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job2_pivoted.json new file mode 100644 index 000000000000..ede6b9d082bc --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job2_pivoted.json @@ -0,0 +1,27 @@ +{ + "job": 2, + "N": 4, + "A": [ 9999, 5, 9999, 4.8, 9999, 5, 9999, 4.591666666666667 ], + "strideA": 2, + "offsetA": 1, + "B": [ 1, 9999, 9999, -1, 9999, 9999, 1 ], + "strideB": 3, + "offsetB": 0, + "C": [ 9999, 9999, 0.2, 9999, 1.0416666666666667, 9999, 0.4083333333333334 ], + "strideC": 2, + "offsetC": 2, + "D": [ 9999, 5, 9999, 9999, 0 ], + "strideD": 3, + "offsetD": 1, + "IN": [ 1, 9999, 0, 9999, 1, 9999, 0 ], + "strideIN": 2, + "offsetIN": 0, + "Y": [ 4, 9999, 3, 9999, 2, 9999, 1 ], + "strideY": -2, + "offsetY": 6, + "TOL": [ 9999, 9999, 0 ], + "offsetTOL": 2, + "Y_out": [ 0.16152450090744097, 9999, 0.7676950998185118, 9999, 0.28493647912885667, 9999, -0.42468239564428323 ], + "TOL_out": [ 9999, 9999, 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job_neg1_auto_tol.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job_neg1_auto_tol.json new file mode 100644 index 000000000000..3e84a9bd712f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job_neg1_auto_tol.json @@ -0,0 +1,27 @@ +{ + "job": -1, + "N": 5, + "A": [ 9999, 4, 9999, 3.75, 9999, 3.7333333333333334, 9999, 3.732142857142857, 9999, 3.7320574162679425 ], + "strideA": 2, + "offsetA": 1, + "B": [ 1, 9999, 9999, 1, 9999, 9999, 1, 9999, 9999, 1 ], + "strideB": 3, + "offsetB": 0, + "C": [ 9999, 9999, 0.25, 9999, 0.26666666666666666, 9999, 0.26785714285714285, 9999, 0.2679425837320574 ], + "strideC": 2, + "offsetC": 2, + "D": [ 9999, 0, 9999, 9999, 0, 9999, 9999, 0 ], + "strideD": 3, + "offsetD": 1, + "IN": [ 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0 ], + "strideIN": 2, + "offsetIN": 0, + "Y": [ 5, 9999, 4, 9999, 3, 9999, 2, 9999, 1 ], + "strideY": -2, + "offsetY": 8, + "TOL": [ 9999, 9999, 0 ], + "offsetTOL": 2, + "Y_out": [ 1.1012820512820511, 9999, 0.5948717948717949, 9999, 0.5192307692307692, 9999, 0.3282051282051282, 9999, 0.16794871794871796 ], + "TOL_out": [ 9999, 9999, 4.440892098500626e-16 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job_neg2_pivoted_auto_tol.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job_neg2_pivoted_auto_tol.json new file mode 100644 index 000000000000..9c174351e014 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/mixed_strides/job_neg2_pivoted_auto_tol.json @@ -0,0 +1,27 @@ +{ + "job": -2, + "N": 4, + "A": [ 9999, 5, 9999, 4.8, 9999, 5, 9999, 4.591666666666667 ], + "strideA": 2, + "offsetA": 1, + "B": [ 1, 9999, 9999, -1, 9999, 9999, 1 ], + "strideB": 3, + "offsetB": 0, + "C": [ 9999, 9999, 0.2, 9999, 1.0416666666666667, 9999, 0.4083333333333334 ], + "strideC": 2, + "offsetC": 2, + "D": [ 9999, 5, 9999, 9999, 0 ], + "strideD": 3, + "offsetD": 1, + "IN": [ 1, 9999, 0, 9999, 1, 9999, 0 ], + "strideIN": 2, + "offsetIN": 0, + "Y": [ 4, 9999, 3, 9999, 2, 9999, 1 ], + "strideY": -2, + "offsetY": 6, + "TOL": [ 9999, 9999, 0 ], + "offsetTOL": 2, + "Y_out": [ 0.16152450090744097, 9999, 0.7676950998185118, 9999, 0.28493647912885667, 9999, -0.42468239564428323 ], + "TOL_out": [ 9999, 9999, 5.551115123125783e-16 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job1.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job1.json new file mode 100644 index 000000000000..f92eb3da110e --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job1.json @@ -0,0 +1,27 @@ +{ + "job": 1, + "N": 5, + "A": [ 3.7320574162679425, 3.732142857142857, 3.7333333333333334, 3.75, 4 ], + "strideA": -1, + "offsetA": 4, + "B": [ 1, 1, 1, 1 ], + "strideB": -1, + "offsetB": 3, + "C": [ 0.2679425837320574, 0.26785714285714285, 0.26666666666666666, 0.25 ], + "strideC": -1, + "offsetC": 3, + "D": [ 0, 0, 0 ], + "strideD": -1, + "offsetD": 2, + "IN": [ 0, 0, 0, 0, 0 ], + "strideIN": -1, + "offsetIN": 4, + "Y": [ 5, 4, 3, 2, 1 ], + "strideY": -1, + "offsetY": 4, + "TOL": [ 0 ], + "offsetTOL": 0, + "Y_out": [ 1.1012820512820511, 0.5948717948717949, 0.5192307692307692, 0.3282051282051282, 0.16794871794871796 ], + "TOL_out": [ 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job1_pivoted.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job1_pivoted.json new file mode 100644 index 000000000000..f7dfe6efbae3 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job1_pivoted.json @@ -0,0 +1,27 @@ +{ + "job": 1, + "N": 4, + "A": [ 4.591666666666667, 5, 4.8, 5 ], + "strideA": -1, + "offsetA": 3, + "B": [ 1, -1, 1 ], + "strideB": -1, + "offsetB": 2, + "C": [ 0.4083333333333334, 1.0416666666666667, 0.2 ], + "strideC": -1, + "offsetC": 2, + "D": [ 0, 5 ], + "strideD": -1, + "offsetD": 1, + "IN": [ 0, 1, 0, 1 ], + "strideIN": -1, + "offsetIN": 3, + "Y": [ 4, 3, 2, 1 ], + "strideY": -1, + "offsetY": 3, + "TOL": [ 0 ], + "offsetTOL": 0, + "Y_out": [ 0.16152450090744097, 0.7676950998185118, 0.2849364791288566, -0.4246823956442832 ], + "TOL_out": [ 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job2.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job2.json new file mode 100644 index 000000000000..b4ddc16f448c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job2.json @@ -0,0 +1,27 @@ +{ + "job": 2, + "N": 5, + "A": [ 3.7320574162679425, 3.732142857142857, 3.7333333333333334, 3.75, 4 ], + "strideA": -1, + "offsetA": 4, + "B": [ 1, 1, 1, 1 ], + "strideB": -1, + "offsetB": 3, + "C": [ 0.2679425837320574, 0.26785714285714285, 0.26666666666666666, 0.25 ], + "strideC": -1, + "offsetC": 3, + "D": [ 0, 0, 0 ], + "strideD": -1, + "offsetD": 2, + "IN": [ 0, 0, 0, 0, 0 ], + "strideIN": -1, + "offsetIN": 4, + "Y": [ 5, 4, 3, 2, 1 ], + "strideY": -1, + "offsetY": 4, + "TOL": [ 0 ], + "offsetTOL": 0, + "Y_out": [ 1.1012820512820511, 0.5948717948717949, 0.5192307692307692, 0.32820512820512826, 0.16794871794871793 ], + "TOL_out": [ 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job2_pivoted.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job2_pivoted.json new file mode 100644 index 000000000000..6dfe161be009 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job2_pivoted.json @@ -0,0 +1,27 @@ +{ + "job": 2, + "N": 4, + "A": [ 4.591666666666667, 5, 4.8, 5 ], + "strideA": -1, + "offsetA": 3, + "B": [ 1, -1, 1 ], + "strideB": -1, + "offsetB": 2, + "C": [ 0.4083333333333334, 1.0416666666666667, 0.2 ], + "strideC": -1, + "offsetC": 2, + "D": [ 0, 5 ], + "strideD": -1, + "offsetD": 1, + "IN": [ 0, 1, 0, 1 ], + "strideIN": -1, + "offsetIN": 3, + "Y": [ 4, 3, 2, 1 ], + "strideY": -1, + "offsetY": 3, + "TOL": [ 0 ], + "offsetTOL": 0, + "Y_out": [ 0.16152450090744097, 0.7676950998185118, 0.28493647912885667, -0.42468239564428323 ], + "TOL_out": [ 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job_neg1_auto_tol.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job_neg1_auto_tol.json new file mode 100644 index 000000000000..2382c36ed1f6 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job_neg1_auto_tol.json @@ -0,0 +1,27 @@ +{ + "job": -1, + "N": 5, + "A": [ 3.7320574162679425, 3.732142857142857, 3.7333333333333334, 3.75, 4 ], + "strideA": -1, + "offsetA": 4, + "B": [ 1, 1, 1, 1 ], + "strideB": -1, + "offsetB": 3, + "C": [ 0.2679425837320574, 0.26785714285714285, 0.26666666666666666, 0.25 ], + "strideC": -1, + "offsetC": 3, + "D": [ 0, 0, 0 ], + "strideD": -1, + "offsetD": 2, + "IN": [ 0, 0, 0, 0, 0 ], + "strideIN": -1, + "offsetIN": 4, + "Y": [ 5, 4, 3, 2, 1 ], + "strideY": -1, + "offsetY": 4, + "TOL": [ 0 ], + "offsetTOL": 0, + "Y_out": [ 1.1012820512820511, 0.5948717948717949, 0.5192307692307692, 0.3282051282051282, 0.16794871794871796 ], + "TOL_out": [ 4.440892098500626e-16 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job_neg2_pivoted_auto_tol.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job_neg2_pivoted_auto_tol.json new file mode 100644 index 000000000000..f9a786d40fe6 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/negative_strides/job_neg2_pivoted_auto_tol.json @@ -0,0 +1,27 @@ +{ + "job": -2, + "N": 4, + "A": [ 4.591666666666667, 5, 4.8, 5 ], + "strideA": -1, + "offsetA": 3, + "B": [ 1, -1, 1 ], + "strideB": -1, + "offsetB": 2, + "C": [ 0.4083333333333334, 1.0416666666666667, 0.2 ], + "strideC": -1, + "offsetC": 2, + "D": [ 0, 5 ], + "strideD": -1, + "offsetD": 1, + "IN": [ 0, 1, 0, 1 ], + "strideIN": -1, + "offsetIN": 3, + "Y": [ 4, 3, 2, 1 ], + "strideY": -1, + "offsetY": 3, + "TOL": [ 0 ], + "offsetTOL": 0, + "Y_out": [ 0.16152450090744097, 0.7676950998185118, 0.28493647912885667, -0.42468239564428323 ], + "TOL_out": [ 5.551115123125783e-16 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job1.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job1.json new file mode 100644 index 000000000000..fd4131acac3a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job1.json @@ -0,0 +1,27 @@ +{ + "job": 1, + "N": 5, + "A": [ 9999, 4, 3.75, 3.7333333333333334, 3.732142857142857, 3.7320574162679425 ], + "strideA": 1, + "offsetA": 1, + "B": [ 9999, 1, 1, 1, 1 ], + "strideB": 1, + "offsetB": 1, + "C": [ 9999, 0.25, 0.26666666666666666, 0.26785714285714285, 0.2679425837320574 ], + "strideC": 1, + "offsetC": 1, + "D": [ 9999, 0, 0, 0 ], + "strideD": 1, + "offsetD": 1, + "IN": [ 9999, 0, 0, 0, 0, 0 ], + "strideIN": 1, + "offsetIN": 1, + "Y": [ 9999, 1, 2, 3, 4, 5 ], + "strideY": 1, + "offsetY": 1, + "TOL": [ 9999, 0 ], + "offsetTOL": 1, + "Y_out": [ 9999, 0.16794871794871796, 0.3282051282051282, 0.5192307692307692, 0.5948717948717949, 1.1012820512820511 ], + "TOL_out": [ 9999, 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job1_pivoted.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job1_pivoted.json new file mode 100644 index 000000000000..19c9a7e0f609 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job1_pivoted.json @@ -0,0 +1,27 @@ +{ + "job": 1, + "N": 4, + "A": [ 9999, 5, 4.8, 5, 4.591666666666667 ], + "strideA": 1, + "offsetA": 1, + "B": [ 9999, 1, -1, 1 ], + "strideB": 1, + "offsetB": 1, + "C": [ 9999, 0.2, 1.0416666666666667, 0.4083333333333334 ], + "strideC": 1, + "offsetC": 1, + "D": [ 9999, 5, 0 ], + "strideD": 1, + "offsetD": 1, + "IN": [ 9999, 1, 0, 1, 0 ], + "strideIN": 1, + "offsetIN": 1, + "Y": [ 9999, 1, 2, 3, 4 ], + "strideY": 1, + "offsetY": 1, + "TOL": [ 9999, 0 ], + "offsetTOL": 1, + "Y_out": [ 9999, -0.4246823956442832, 0.2849364791288566, 0.7676950998185118, 0.16152450090744097 ], + "TOL_out": [ 9999, 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job2.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job2.json new file mode 100644 index 000000000000..bd95ac5f1fb8 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job2.json @@ -0,0 +1,27 @@ +{ + "job": 2, + "N": 5, + "A": [ 9999, 4, 3.75, 3.7333333333333334, 3.732142857142857, 3.7320574162679425 ], + "strideA": 1, + "offsetA": 1, + "B": [ 9999, 1, 1, 1, 1 ], + "strideB": 1, + "offsetB": 1, + "C": [ 9999, 0.25, 0.26666666666666666, 0.26785714285714285, 0.2679425837320574 ], + "strideC": 1, + "offsetC": 1, + "D": [ 9999, 0, 0, 0 ], + "strideD": 1, + "offsetD": 1, + "IN": [ 9999, 0, 0, 0, 0, 0 ], + "strideIN": 1, + "offsetIN": 1, + "Y": [ 9999, 1, 2, 3, 4, 5 ], + "strideY": 1, + "offsetY": 1, + "TOL": [ 9999, 0 ], + "offsetTOL": 1, + "Y_out": [ 9999, 0.16794871794871793, 0.32820512820512826, 0.5192307692307692, 0.5948717948717949, 1.1012820512820511 ], + "TOL_out": [ 9999, 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job2_pivoted.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job2_pivoted.json new file mode 100644 index 000000000000..935ca4ac8927 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job2_pivoted.json @@ -0,0 +1,27 @@ +{ + "job": 2, + "N": 4, + "A": [ 9999, 5, 4.8, 5, 4.591666666666667 ], + "strideA": 1, + "offsetA": 1, + "B": [ 9999, 1, -1, 1 ], + "strideB": 1, + "offsetB": 1, + "C": [ 9999, 0.2, 1.0416666666666667, 0.4083333333333334 ], + "strideC": 1, + "offsetC": 1, + "D": [ 9999, 5, 0 ], + "strideD": 1, + "offsetD": 1, + "IN": [ 9999, 1, 0, 1, 0 ], + "strideIN": 1, + "offsetIN": 1, + "Y": [ 9999, 1, 2, 3, 4 ], + "strideY": 1, + "offsetY": 1, + "TOL": [ 9999, 0 ], + "offsetTOL": 1, + "Y_out": [ 9999, -0.42468239564428323, 0.28493647912885667, 0.7676950998185118, 0.16152450090744097 ], + "TOL_out": [ 9999, 0 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job_neg1_auto_tol.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job_neg1_auto_tol.json new file mode 100644 index 000000000000..6adcc7f174fe --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job_neg1_auto_tol.json @@ -0,0 +1,27 @@ +{ + "job": -1, + "N": 5, + "A": [ 9999, 4, 3.75, 3.7333333333333334, 3.732142857142857, 3.7320574162679425 ], + "strideA": 1, + "offsetA": 1, + "B": [ 9999, 1, 1, 1, 1 ], + "strideB": 1, + "offsetB": 1, + "C": [ 9999, 0.25, 0.26666666666666666, 0.26785714285714285, 0.2679425837320574 ], + "strideC": 1, + "offsetC": 1, + "D": [ 9999, 0, 0, 0 ], + "strideD": 1, + "offsetD": 1, + "IN": [ 9999, 0, 0, 0, 0, 0 ], + "strideIN": 1, + "offsetIN": 1, + "Y": [ 9999, 1, 2, 3, 4, 5 ], + "strideY": 1, + "offsetY": 1, + "TOL": [ 9999, 0 ], + "offsetTOL": 1, + "Y_out": [ 9999, 0.16794871794871796, 0.3282051282051282, 0.5192307692307692, 0.5948717948717949, 1.1012820512820511 ], + "TOL_out": [ 9999, 4.440892098500626e-16 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job_neg2_pivoted_auto_tol.json b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job_neg2_pivoted_auto_tol.json new file mode 100644 index 000000000000..cfda28826be3 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/fixtures/offsets/job_neg2_pivoted_auto_tol.json @@ -0,0 +1,27 @@ +{ + "job": -2, + "N": 4, + "A": [ 9999, 5, 4.8, 5, 4.591666666666667 ], + "strideA": 1, + "offsetA": 1, + "B": [ 9999, 1, -1, 1 ], + "strideB": 1, + "offsetB": 1, + "C": [ 9999, 0.2, 1.0416666666666667, 0.4083333333333334 ], + "strideC": 1, + "offsetC": 1, + "D": [ 9999, 5, 0 ], + "strideD": 1, + "offsetD": 1, + "IN": [ 9999, 1, 0, 1, 0 ], + "strideIN": 1, + "offsetIN": 1, + "Y": [ 9999, 1, 2, 3, 4 ], + "strideY": 1, + "offsetY": 1, + "TOL": [ 9999, 0 ], + "offsetTOL": 1, + "Y_out": [ 9999, -0.42468239564428323, 0.28493647912885667, 0.7676950998185118, 0.16152450090744097 ], + "TOL_out": [ 9999, 5.551115123125783e-16 ], + "info": 0 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/test.dlagts.js b/lib/node_modules/@stdlib/lapack/base/dlagts/test/test.dlagts.js new file mode 100644 index 000000000000..db1d5c30ec42 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/test.dlagts.js @@ -0,0 +1,900 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var Int32Array = require( '@stdlib/array/int32' ); +var dlagts = require( './../lib/dlagts.js' ); + + +// FIXTURES // + +var JOB1 = require( './fixtures/job1.json' ); +var JOB2 = require( './fixtures/job2.json' ); +var JOB_NEG1_AUTO_TOL = require( './fixtures/job_neg1_auto_tol.json' ); +var JOB_NEG2_PIVOTED_AUTO_TOL = require( './fixtures/job_neg2_pivoted_auto_tol.json' ); +var JOB1_PIVOTED = require( './fixtures/job1_pivoted.json' ); +var JOB2_PIVOTED = require( './fixtures/job2_pivoted.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dlagts, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 9', function test( t ) { + t.strictEqual( dlagts.length, 9, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not `1`, `-1`, `2`, or `-2`', function test( t ) { + var values; + var i; + + values = [ + 0, + 3, + -3, + 4, + -4, + 1.5 + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dlagts( value, 3, new Float64Array( 3 ), new Float64Array( 2 ), new Float64Array( 2 ), new Float64Array( 1 ), new Int32Array( 3 ), new Float64Array( 3 ), new Float64Array( 1 ) ); // eslint-disable-line max-len + }; + } +}); + +tape( 'the function throws an error if provided a second argument which is less than zero', function test( t ) { + var values; + var i; + + values = [ + -1, + -2, + -3 + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dlagts( 1, value, new Float64Array( 3 ), new Float64Array( 2 ), new Float64Array( 2 ), new Float64Array( 1 ), new Int32Array( 3 ), new Float64Array( 3 ), new Float64Array( 1 ) ); // eslint-disable-line max-len + }; + } +}); + +tape( 'the function solves `(T - lambda*I)*x = y`', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = JOB1; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y`', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = JOB2; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` and auto-computes the tolerance', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = JOB_NEG1_AUTO_TOL; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` for a pivoted factorization and auto-computes the tolerance', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = JOB_NEG2_PIVOTED_AUTO_TOL; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` for a pivoted factorization', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = JOB1_PIVOTED; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` for a pivoted factorization', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = JOB2_PIVOTED; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves the system when `N` equals `1`', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 2.0 ] ); + B = new Float64Array( 0 ); + C = new Float64Array( 0 ); + D = new Float64Array( 0 ); + IN = new Int32Array( [ 0 ] ); + Y = new Float64Array( [ 6.0 ] ); + TOL = new Float64Array( [ 0.0 ] ); + + expectedY = new Float64Array( [ 3.0 ] ); + expectedTOL = new Float64Array( [ 0.0 ] ); + + info = dlagts( 1, 1, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a positive status code when overflow would occur (job = 1)', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 0.0, 1.0, 1.0 ] ); + B = new Float64Array( [ 1.0, 1.0 ] ); + C = new Float64Array( [ 1.0, 1.0 ] ); + D = new Float64Array( [ 1.0 ] ); + IN = new Int32Array( [ 0, 0, 0 ] ); + Y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); + TOL = new Float64Array( [ 0.0 ] ); + + expectedY = new Float64Array( [ 1.0, -1.0, 1.0 ] ); + expectedTOL = new Float64Array( [ 0.0 ] ); + + info = dlagts( 1, 3, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 1, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a positive status code when overflow would occur (job = 2)', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 1.0, 1.0, 0.0 ] ); + B = new Float64Array( [ 1.0, 1.0 ] ); + C = new Float64Array( [ 1.0, 1.0 ] ); + D = new Float64Array( [ 1.0 ] ); + IN = new Int32Array( [ 0, 0, 0 ] ); + Y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); + TOL = new Float64Array( [ 0.0 ] ); + + expectedY = new Float64Array( [ 1.0, 0.0, 1.0 ] ); + expectedTOL = new Float64Array( [ 0.0 ] ); + + info = dlagts( 2, 3, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 3, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a positive status code when dividing by a small pivot would overflow', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 0.5 ] ); + B = new Float64Array( 0 ); + C = new Float64Array( 0 ); + D = new Float64Array( 0 ); + IN = new Int32Array( [ 0 ] ); + Y = new Float64Array( [ 1e+308 ] ); + TOL = new Float64Array( [ 0.0 ] ); + + expectedY = new Float64Array( [ 1e+308 ] ); + expectedTOL = new Float64Array( [ 0.0 ] ); + + info = dlagts( 1, 1, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 1, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function perturbs a zero diagonal element to avoid overflow', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 0.0, 1.0, 1.0 ] ); + B = new Float64Array( [ 1.0, 1.0 ] ); + C = new Float64Array( [ 1.0, 1.0 ] ); + D = new Float64Array( [ 1.0 ] ); + IN = new Int32Array( [ 0, 1, 0 ] ); + Y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); + TOL = new Float64Array( [ 0.0625 ] ); + + expectedY = new Float64Array( [ 0.0, 2.0, -1.0 ] ); + expectedTOL = new Float64Array( [ 0.0625 ] ); + + info = dlagts( -1, 3, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function perturbs a zero diagonal element to avoid overflow when solving the transposed system', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 0.0, 1.0, 1.0 ] ); + B = new Float64Array( [ 1.0, 1.0 ] ); + C = new Float64Array( [ 1.0, 1.0 ] ); + D = new Float64Array( [ 1.0 ] ); + IN = new Int32Array( [ 0, 1, 0 ] ); + Y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); + TOL = new Float64Array( [ 0.0625 ] ); + + expectedY = new Float64Array( [ 16.0, 0.0, -15.0 ] ); + expectedTOL = new Float64Array( [ 0.0625 ] ); + + info = dlagts( -2, 3, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function perturbs a negative diagonal element in the direction of its sign', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ -0.5 ] ); + B = new Float64Array( 0 ); + C = new Float64Array( 0 ); + D = new Float64Array( 0 ); + IN = new Int32Array( [ 0 ] ); + Y = new Float64Array( [ 1e+308 ] ); + TOL = new Float64Array( [ 0.5 ] ); + + expectedY = new Float64Array( [ -1e+308 ] ); + expectedTOL = new Float64Array( [ 0.5 ] ); + + info = dlagts( -1, 1, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function perturbs a negative diagonal element in the direction of its sign when solving the transposed system', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ -0.5 ] ); + B = new Float64Array( 0 ); + C = new Float64Array( 0 ); + D = new Float64Array( 0 ); + IN = new Int32Array( [ 0 ] ); + Y = new Float64Array( [ 1e+308 ] ); + TOL = new Float64Array( [ 0.5 ] ); + + expectedY = new Float64Array( [ -1e+308 ] ); + expectedTOL = new Float64Array( [ 0.5 ] ); + + info = dlagts( -2, 1, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a positive status code when dividing by a subnormal pivot would overflow (job = 1)', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 1e-320 ] ); + B = new Float64Array( 0 ); + C = new Float64Array( 0 ); + D = new Float64Array( 0 ); + IN = new Int32Array( [ 0 ] ); + Y = new Float64Array( [ 1.0 ] ); + TOL = new Float64Array( [ 0.0 ] ); + + expectedY = new Float64Array( [ 1.0 ] ); + expectedTOL = new Float64Array( [ 0.0 ] ); + + info = dlagts( 1, 1, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 1, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a positive status code when dividing by a subnormal pivot would overflow (job = 2)', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 1.0, 1e-320, 1.0 ] ); + B = new Float64Array( [ 1.0, 1.0 ] ); + C = new Float64Array( [ 1.0, 1.0 ] ); + D = new Float64Array( [ 1.0 ] ); + IN = new Int32Array( [ 0, 0, 0 ] ); + Y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + TOL = new Float64Array( [ 0.0 ] ); + + expectedY = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + expectedTOL = new Float64Array( [ 0.0 ] ); + + info = dlagts( 2, 3, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 2, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function computes the tolerance when provided a negative tolerance', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = JOB_NEG1_AUTO_TOL; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( [ -1.0 ] ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function computes the tolerance when `N` equals `1`', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 2.0 ] ); + B = new Float64Array( 0 ); + C = new Float64Array( 0 ); + D = new Float64Array( 0 ); + IN = new Int32Array( [ 0 ] ); + Y = new Float64Array( [ 6.0 ] ); + TOL = new Float64Array( [ 0.0 ] ); + + expectedY = new Float64Array( [ 3.0 ] ); + expectedTOL = new Float64Array( [ 2.220446049250313e-16 ] ); + + info = dlagts( -1, 1, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function computes the tolerance from the largest diagonal element of `U`', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 1.0, 7.0, 1.0, 1.0 ] ); + B = new Float64Array( [ 1.0, 1.0, 1.0 ] ); + C = new Float64Array( [ 0.5, 0.5, 0.5 ] ); + D = new Float64Array( [ 1.0, 1.0 ] ); + IN = new Int32Array( [ 0, 0, 0, 0 ] ); + Y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + TOL = new Float64Array( [ 0.0 ] ); + + expectedY = new Float64Array( [ 1.7321428571428572, -0.10714285714285714, -0.625, 2.875 ] ); // eslint-disable-line max-len + expectedTOL = new Float64Array( [ 7.771561172376096e-16 ] ); + + info = dlagts( -1, 4, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function computes the tolerance from the largest first super-diagonal element of `U`', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); + B = new Float64Array( [ 6.0, 1.0, 1.0 ] ); + C = new Float64Array( [ 0.5, 0.5, 0.5 ] ); + D = new Float64Array( [ 1.0, 1.0 ] ); + IN = new Int32Array( [ 0, 0, 0, 0 ] ); + Y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + TOL = new Float64Array( [ 0.0 ] ); + + expectedY = new Float64Array( [ 6.125, -0.75, -0.625, 2.875 ] ); + expectedTOL = new Float64Array( [ 6.661338147750939e-16 ] ); + + info = dlagts( -1, 4, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function computes the tolerance from the largest second super-diagonal element of `U`', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); + B = new Float64Array( [ 1.0, 1.0, 1.0 ] ); + C = new Float64Array( [ 0.5, 0.5, 0.5 ] ); + D = new Float64Array( [ 8.0, 1.0 ] ); + IN = new Int32Array( [ 0, 0, 0, 0 ] ); + Y = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + TOL = new Float64Array( [ 0.0 ] ); + + expectedY = new Float64Array( [ 6.75, -0.75, -0.625, 2.875 ] ); + expectedTOL = new Float64Array( [ 8.881784197001252e-16 ] ); + + info = dlagts( -1, 4, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function perturbs a small diagonal element to avoid overflow', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 0.5 ] ); + B = new Float64Array( 0 ); + C = new Float64Array( 0 ); + D = new Float64Array( 0 ); + IN = new Int32Array( [ 0 ] ); + Y = new Float64Array( [ 1e+308 ] ); + TOL = new Float64Array( [ 0.5 ] ); + + expectedY = new Float64Array( [ 1e+308 ] ); + expectedTOL = new Float64Array( [ 0.5 ] ); + + info = dlagts( -1, 1, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function scales intermediate results to avoid overflow for a tiny pivot', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 2.0, 5e-320 ] ); + B = new Float64Array( [ 0.0 ] ); + C = new Float64Array( [ 0.0 ] ); + D = new Float64Array( 0 ); + IN = new Int32Array( [ 0, 0 ] ); + Y = new Float64Array( [ 1.0, 1e-40 ] ); + TOL = new Float64Array( [ 0.0 ] ); + + expectedY = new Float64Array( [ 0.5, 2.000022265882516e+279 ] ); + expectedTOL = new Float64Array( [ 0.0 ] ); + + info = dlagts( 1, 2, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function resets a non-positive tolerance to machine epsilon', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 0.0, 0.0, 0.0 ] ); + B = new Float64Array( [ 0.0, 0.0 ] ); + C = new Float64Array( [ 1.0, 1.0 ] ); + D = new Float64Array( [ 0.0 ] ); + IN = new Int32Array( [ 0, 0, 0 ] ); + Y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); + TOL = new Float64Array( [ 0.0 ] ); + + expectedY = new Float64Array( [ 9007199254740992.0, 0.0, 9007199254740992.0 ] ); // eslint-disable-line max-len + expectedTOL = new Float64Array( [ 1.1102230246251565e-16 ] ); + + info = dlagts( -1, 3, A, B, C, D, IN, Y, TOL ); + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns `0` and leaves the input unchanged when `N` is `0`', function test( t ) { + var info; + var TOL; + var Y; + + Y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + TOL = new Float64Array( [ 0.0 ] ); + + info = dlagts( -1, 0, new Float64Array( 0 ), new Float64Array( 0 ), new Float64Array( 0 ), new Float64Array( 0 ), new Int32Array( 0 ), Y, TOL ); // eslint-disable-line max-len + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, new Float64Array( [ 1.0, 2.0, 3.0 ] ), 'returns expected value' ); + t.deepEqual( TOL, new Float64Array( [ 0.0 ] ), 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/test.js b/lib/node_modules/@stdlib/lapack/base/dlagts/test/test.js new file mode 100644 index 000000000000..f5470d5abf43 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var proxyquire = require( 'proxyquire' ); +var IS_BROWSER = require( '@stdlib/assert/is-browser' ); +var dlagts = require( './../lib' ); + + +// VARIABLES // + +var opts = { + 'skip': IS_BROWSER +}; + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dlagts, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { + t.strictEqual( typeof dlagts.ndarray, 'function', 'method is a function' ); + t.end(); +}); + +tape( 'if a native implementation is available, the main export is the native implementation', opts, function test( t ) { + var dlagts = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dlagts, mock, 'returns expected value' ); + t.end(); + + function tryRequire() { + return mock; + } + + function mock() { + // Mock... + } +}); + +tape( 'if a native implementation is not available, the main export is a JavaScript implementation', opts, function test( t ) { + var dlagts; + var main; + + main = require( './../lib/main.js' ); + + dlagts = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dlagts, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/lapack/base/dlagts/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlagts/test/test.ndarray.js new file mode 100644 index 000000000000..93efaa549c66 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlagts/test/test.ndarray.js @@ -0,0 +1,1411 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-lines, id-length */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var Int32Array = require( '@stdlib/array/int32' ); +var dlagts = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var JOB1 = require( './fixtures/job1.json' ); +var JOB2 = require( './fixtures/job2.json' ); +var JOB_NEG1_AUTO_TOL = require( './fixtures/job_neg1_auto_tol.json' ); +var JOB_NEG2_PIVOTED_AUTO_TOL = require( './fixtures/job_neg2_pivoted_auto_tol.json' ); +var JOB1_PIVOTED = require( './fixtures/job1_pivoted.json' ); +var JOB2_PIVOTED = require( './fixtures/job2_pivoted.json' ); +var OFFSET_JOB1 = require( './fixtures/offsets/job1.json' ); +var OFFSET_JOB2 = require( './fixtures/offsets/job2.json' ); +var OFFSET_JOB_NEG1_AUTO_TOL = require( './fixtures/offsets/job_neg1_auto_tol.json' ); +var OFFSET_JOB_NEG2_PIVOTED_AUTO_TOL = require( './fixtures/offsets/job_neg2_pivoted_auto_tol.json' ); +var OFFSET_JOB1_PIVOTED = require( './fixtures/offsets/job1_pivoted.json' ); +var OFFSET_JOB2_PIVOTED = require( './fixtures/offsets/job2_pivoted.json' ); +var LARGE_STRIDES_JOB1 = require( './fixtures/large_strides/job1.json' ); +var LARGE_STRIDES_JOB2 = require( './fixtures/large_strides/job2.json' ); +var LARGE_STRIDES_JOB_NEG1_AUTO_TOL = require( './fixtures/large_strides/job_neg1_auto_tol.json' ); +var LARGE_STRIDES_JOB_NEG2_PIVOTED_AUTO_TOL = require( './fixtures/large_strides/job_neg2_pivoted_auto_tol.json' ); +var LARGE_STRIDES_JOB1_PIVOTED = require( './fixtures/large_strides/job1_pivoted.json' ); +var LARGE_STRIDES_JOB2_PIVOTED = require( './fixtures/large_strides/job2_pivoted.json' ); +var NEGATIVE_STRIDES_JOB1 = require( './fixtures/negative_strides/job1.json' ); +var NEGATIVE_STRIDES_JOB2 = require( './fixtures/negative_strides/job2.json' ); +var NEGATIVE_STRIDES_JOB_NEG1_AUTO_TOL = require( './fixtures/negative_strides/job_neg1_auto_tol.json' ); +var NEGATIVE_STRIDES_JOB_NEG2_PIVOTED_AUTO_TOL = require( './fixtures/negative_strides/job_neg2_pivoted_auto_tol.json' ); +var NEGATIVE_STRIDES_JOB1_PIVOTED = require( './fixtures/negative_strides/job1_pivoted.json' ); +var NEGATIVE_STRIDES_JOB2_PIVOTED = require( './fixtures/negative_strides/job2_pivoted.json' ); +var MIXED_STRIDES_JOB1 = require( './fixtures/mixed_strides/job1.json' ); +var MIXED_STRIDES_JOB2 = require( './fixtures/mixed_strides/job2.json' ); +var MIXED_STRIDES_JOB_NEG1_AUTO_TOL = require( './fixtures/mixed_strides/job_neg1_auto_tol.json' ); +var MIXED_STRIDES_JOB_NEG2_PIVOTED_AUTO_TOL = require( './fixtures/mixed_strides/job_neg2_pivoted_auto_tol.json' ); +var MIXED_STRIDES_JOB1_PIVOTED = require( './fixtures/mixed_strides/job1_pivoted.json' ); +var MIXED_STRIDES_JOB2_PIVOTED = require( './fixtures/mixed_strides/job2_pivoted.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dlagts, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 22', function test( t ) { + t.strictEqual( dlagts.length, 22, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not `1`, `-1`, `2`, or `-2`', function test( t ) { + var values; + var i; + + values = [ + 0, + 3, + -3, + 4, + -4, + 1.5 + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dlagts( value, 3, new Float64Array( 3 ), 1, 0, new Float64Array( 2 ), 1, 0, new Float64Array( 2 ), 1, 0, new Float64Array( 1 ), 1, 0, new Int32Array( 3 ), 1, 0, new Float64Array( 3 ), 1, 0, new Float64Array( 1 ), 0 ); // eslint-disable-line max-len + }; + } +}); + +tape( 'the function throws an error if provided a second argument which is less than zero', function test( t ) { + var values; + var i; + + values = [ + -1, + -2, + -3 + ]; + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dlagts( 1, value, new Float64Array( 3 ), 1, 0, new Float64Array( 2 ), 1, 0, new Float64Array( 2 ), 1, 0, new Float64Array( 1 ), 1, 0, new Int32Array( 3 ), 1, 0, new Float64Array( 3 ), 1, 0, new Float64Array( 1 ), 0 ); // eslint-disable-line max-len + }; + } +}); + +tape( 'the function solves `(T - lambda*I)*x = y`', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = JOB1; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y`', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = JOB2; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` and auto-computes the tolerance', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = JOB_NEG1_AUTO_TOL; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` for a pivoted factorization and auto-computes the tolerance', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = JOB_NEG2_PIVOTED_AUTO_TOL; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` for a pivoted factorization', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = JOB1_PIVOTED; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` for a pivoted factorization', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = JOB2_PIVOTED; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` (offsets)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = OFFSET_JOB1; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` (offsets)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = OFFSET_JOB2; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` and auto-computes the tolerance (offsets)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = OFFSET_JOB_NEG1_AUTO_TOL; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` for a pivoted factorization and auto-computes the tolerance (offsets)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = OFFSET_JOB_NEG2_PIVOTED_AUTO_TOL; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` for a pivoted factorization (offsets)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = OFFSET_JOB1_PIVOTED; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` for a pivoted factorization (offsets)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = OFFSET_JOB2_PIVOTED; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` (large strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = LARGE_STRIDES_JOB1; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` (large strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = LARGE_STRIDES_JOB2; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` and auto-computes the tolerance (large strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = LARGE_STRIDES_JOB_NEG1_AUTO_TOL; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` for a pivoted factorization and auto-computes the tolerance (large strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = LARGE_STRIDES_JOB_NEG2_PIVOTED_AUTO_TOL; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` for a pivoted factorization (large strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = LARGE_STRIDES_JOB1_PIVOTED; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` for a pivoted factorization (large strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = LARGE_STRIDES_JOB2_PIVOTED; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` (negative strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = NEGATIVE_STRIDES_JOB1; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` (negative strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = NEGATIVE_STRIDES_JOB2; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` and auto-computes the tolerance (negative strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = NEGATIVE_STRIDES_JOB_NEG1_AUTO_TOL; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` for a pivoted factorization and auto-computes the tolerance (negative strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = NEGATIVE_STRIDES_JOB_NEG2_PIVOTED_AUTO_TOL; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` for a pivoted factorization (negative strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = NEGATIVE_STRIDES_JOB1_PIVOTED; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` for a pivoted factorization (negative strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = NEGATIVE_STRIDES_JOB2_PIVOTED; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` (mixed strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = MIXED_STRIDES_JOB1; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` (mixed strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = MIXED_STRIDES_JOB2; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` and auto-computes the tolerance (mixed strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = MIXED_STRIDES_JOB_NEG1_AUTO_TOL; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` for a pivoted factorization and auto-computes the tolerance (mixed strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = MIXED_STRIDES_JOB_NEG2_PIVOTED_AUTO_TOL; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)*x = y` for a pivoted factorization (mixed strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = MIXED_STRIDES_JOB1_PIVOTED; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves `(T - lambda*I)**T*x = y` for a pivoted factorization (mixed strides)', function test( t ) { + var expectedTOL; + var expectedY; + var data; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + data = MIXED_STRIDES_JOB2_PIVOTED; + + A = new Float64Array( data.A ); + B = new Float64Array( data.B ); + C = new Float64Array( data.C ); + D = new Float64Array( data.D ); + IN = new Int32Array( data.IN ); + Y = new Float64Array( data.Y ); + TOL = new Float64Array( data.TOL ); + + expectedY = new Float64Array( data.Y_out ); + expectedTOL = new Float64Array( data.TOL_out ); + + info = dlagts( data.job, data.N, A, data.strideA, data.offsetA, B, data.strideB, data.offsetB, C, data.strideC, data.offsetC, D, data.strideD, data.offsetD, IN, data.strideIN, data.offsetIN, Y, data.strideY, data.offsetY, TOL, data.offsetTOL ); // eslint-disable-line max-len + + t.strictEqual( info, data.info, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function solves the system when `N` equals `1`', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 2.0, 9999.0 ] ); + B = new Float64Array( 0 ); + C = new Float64Array( 0 ); + D = new Float64Array( 0 ); + IN = new Int32Array( [ 0, 9999 ] ); + Y = new Float64Array( [ 6.0, 9999.0 ] ); + TOL = new Float64Array( [ 9999.0, 0.0 ] ); + + expectedY = new Float64Array( [ 3.0, 9999.0 ] ); + expectedTOL = new Float64Array( [ 9999.0, 0.0 ] ); + + info = dlagts( 1, 1, A, 2, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 2, 0, Y, 2, 0, TOL, 1 ); // eslint-disable-line max-len + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a positive status code when overflow would occur (job = 1)', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 2.0, 1.0, 0.0 ] ); + B = new Float64Array( [ 1.0, 1.0 ] ); + C = new Float64Array( [ 1.0, 1.0 ] ); + D = new Float64Array( [ 1.0 ] ); + IN = new Int32Array( [ 0, 0, 0 ] ); + Y = new Float64Array( [ 3.0, 2.0, 1.0 ] ); + TOL = new Float64Array( [ 0.0 ] ); + + expectedY = new Float64Array( [ 1.0, 0.0, 1.0 ] ); + expectedTOL = new Float64Array( [ 0.0 ] ); + + info = dlagts( 1, 3, A, -1, 2, B, -1, 1, C, -1, 1, D, -1, 0, IN, -1, 2, Y, -1, 2, TOL, 0 ); // eslint-disable-line max-len + + t.strictEqual( info, 1, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a positive status code when overflow would occur (job = 2)', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 9999.0, 1.0, 2.0, 0.0 ] ); + B = new Float64Array( [ 9999.0, 1.0, 1.0 ] ); + C = new Float64Array( [ 9999.0, 1.0, 1.0 ] ); + D = new Float64Array( [ 9999.0, 1.0 ] ); + IN = new Int32Array( [ 9999, 0, 0, 0 ] ); + Y = new Float64Array( [ 9999.0, 1.0, 2.0, 3.0 ] ); + TOL = new Float64Array( [ 9999.0, 0.0 ] ); + + expectedY = new Float64Array( [ 9999.0, 1.0, 0.5, 3.0 ] ); + expectedTOL = new Float64Array( [ 9999.0, 0.0 ] ); + + info = dlagts( 2, 3, A, 1, 1, B, 1, 1, C, 1, 1, D, 1, 1, IN, 1, 1, Y, 1, 1, TOL, 1 ); // eslint-disable-line max-len + + t.strictEqual( info, 3, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function perturbs a zero diagonal element to avoid overflow (job = -1)', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 0.0, 9999.0, 1.0, 9999.0, 1.0, 9999.0 ] ); + B = new Float64Array( [ 1.0, 9999.0, 1.0, 9999.0 ] ); + C = new Float64Array( [ 1.0, 9999.0, 1.0, 9999.0 ] ); + D = new Float64Array( [ 1.0, 9999.0 ] ); + IN = new Int32Array( [ 0, 9999, 1, 9999, 0, 9999 ] ); + Y = new Float64Array( [ 1.0, 9999.0, 1.0, 9999.0, 1.0, 9999.0 ] ); + TOL = new Float64Array( [ 0.0625, 9999.0 ] ); + + expectedY = new Float64Array( [ 0.0, 9999.0, 2.0, 9999.0, -1.0, 9999.0 ] ); + expectedTOL = new Float64Array( [ 0.0625, 9999.0 ] ); + + info = dlagts( -1, 3, A, 2, 0, B, 2, 0, C, 2, 0, D, 2, 0, IN, 2, 0, Y, 2, 0, TOL, 0 ); // eslint-disable-line max-len + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function perturbs a zero diagonal element to avoid overflow (job = -2)', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 1.0, 1.0, 0.0 ] ); + B = new Float64Array( [ 1.0, 1.0 ] ); + C = new Float64Array( [ 1.0, 1.0 ] ); + D = new Float64Array( [ 1.0 ] ); + IN = new Int32Array( [ 0, 1, 0 ] ); + Y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); + TOL = new Float64Array( [ 0.0625 ] ); + + expectedY = new Float64Array( [ -15.0, 0.0, 16.0 ] ); + expectedTOL = new Float64Array( [ 0.0625 ] ); + + info = dlagts( -2, 3, A, -1, 2, B, -1, 1, C, -1, 1, D, -1, 0, IN, -1, 2, Y, -1, 2, TOL, 0 ); // eslint-disable-line max-len + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function scales intermediate results to avoid overflow for a tiny pivot', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 9999.0, 2.0, 9999.0, 5e-320 ] ); + B = new Float64Array( [ 9999.0, 0.0 ] ); + C = new Float64Array( [ 0.0 ] ); + D = new Float64Array( 0 ); + IN = new Int32Array( [ 0, 0 ] ); + Y = new Float64Array( [ 1e-40, 9999.0, 1.0 ] ); + TOL = new Float64Array( [ 9999.0, 9999.0, 0.0 ] ); + + expectedY = new Float64Array( [ 2.000022265882516e+279, 9999.0, 0.5 ] ); + expectedTOL = new Float64Array( [ 9999.0, 9999.0, 0.0 ] ); + + info = dlagts( 1, 2, A, 2, 1, B, 1, 1, C, 1, 0, D, 1, 0, IN, -1, 1, Y, -2, 2, TOL, 2 ); // eslint-disable-line max-len + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function resets a non-positive tolerance to machine epsilon', function test( t ) { + var expectedTOL; + var expectedY; + var info; + var TOL; + var IN; + var A; + var B; + var C; + var D; + var Y; + + A = new Float64Array( [ 0.0, 0.0, 0.0 ] ); + B = new Float64Array( [ 0.0, 0.0 ] ); + C = new Float64Array( [ 1.0, 1.0 ] ); + D = new Float64Array( [ 0.0 ] ); + IN = new Int32Array( [ 0, 0, 0 ] ); + Y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); + TOL = new Float64Array( [ 9999.0, 0.0 ] ); + + expectedY = new Float64Array( [ 9007199254740992.0, 0.0, 9007199254740992.0 ] ); // eslint-disable-line max-len + expectedTOL = new Float64Array( [ 9999.0, 1.1102230246251565e-16 ] ); + + info = dlagts( -1, 3, A, 1, 0, B, 1, 0, C, 1, 0, D, 1, 0, IN, 1, 0, Y, 1, 0, TOL, 1 ); // eslint-disable-line max-len + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, expectedY, 'returns expected value' ); + t.deepEqual( TOL, expectedTOL, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns `0` and leaves the input unchanged when `N` is `0`', function test( t ) { + var info; + var TOL; + var Y; + + Y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + TOL = new Float64Array( [ 0.0 ] ); + + info = dlagts( -1, 0, new Float64Array( 0 ), 1, 0, new Float64Array( 0 ), 1, 0, new Float64Array( 0 ), 1, 0, new Float64Array( 0 ), 1, 0, new Int32Array( 0 ), 1, 0, Y, 1, 0, TOL, 0 ); // eslint-disable-line max-len + + t.strictEqual( info, 0, 'returns expected value' ); + t.deepEqual( Y, new Float64Array( [ 1.0, 2.0, 3.0 ] ), 'returns expected value' ); + t.deepEqual( TOL, new Float64Array( [ 0.0 ] ), 'returns expected value' ); + t.end(); +});