diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/README.md b/lib/node_modules/@stdlib/lapack/base/dlaqsy/README.md new file mode 100644 index 000000000000..e2b72725ffa6 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/README.md @@ -0,0 +1,308 @@ + + +# dlaqsy + +> Equilibrate a real symmetric matrix using the scaling factors in a vector. + +
+ +Equilibration rescales the rows and columns of a matrix in order to improve its condition number. Given a real symmetric matrix `A` and a vector of scale factors `S`, this routine overwrites `A` with + + + +```math +A = \mathrm{diag}(S) \cdot A \cdot \mathrm{diag}(S) +``` + + + +such that each referenced element is updated according to + + + +```math +a_{ij} = s_i \cdot a_{ij} \cdot s_j +``` + + + +Equilibration is only performed when the ratio of the smallest scale factor to the largest scale factor is less than `0.1` or when the absolute value of the largest matrix entry is either too large or too small. + +
+ + + +
+ +## Usage + +```javascript +var dlaqsy = require( '@stdlib/lapack/base/dlaqsy' ); +``` + +#### dlaqsy( order, uplo, N, A, LDA, S, scond, amax ) + +Equilibrates a real symmetric matrix `A` using the scaling factors in the vector `S`. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 5.0, 6.0, 3.0, 6.0, 9.0 ] ); +var S = new Float64Array( [ 0.25, 2.0, 4.0 ] ); + +/* + A = [ + [ 1.0, 2.0, 3.0 ], + [ 2.0, 5.0, 6.0 ], + [ 3.0, 6.0, 9.0 ] + ] +*/ + +dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625, 9.0 ); +// A => [ 0.0625, 1.0, 3.0, 2.0, 20.0, 48.0, 3.0, 6.0, 144.0 ] +``` + +The function has the following parameters: + +- **order**: storage layout. +- **uplo**: specifies whether to reference the upper or lower triangular part of the symmetric matrix `A`. Must be either `'upper'` or `'lower'`. +- **N**: order of the matrix `A`. +- **A**: input matrix stored in linear memory as a [`Float64Array`][mdn-float64array]. +- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). Must be at least `max(1,N)`. +- **S**: vector of scale factors as a [`Float64Array`][mdn-float64array]. Should have `N` elements. +- **scond**: ratio of the smallest scale factor to the largest scale factor. +- **amax**: absolute value of the largest matrix entry. + +The function returns a character flag indicating whether the matrix was equilibrated (`'Y'`) or not (`'N'`). + +Only the triangular part of `A` specified by `uplo` is referenced and updated. If equilibration is not needed, `A` is left unchanged. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 5.0, 6.0, 3.0, 6.0, 9.0 ] ); +var S = new Float64Array( [ 0.5, 1.0, 2.0 ] ); + +var equed = dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.25, 9.0 ); +// returns 'N' +``` + +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' ); + +// Initial arrays... +var A0 = new Float64Array( [ 0.0, 1.0, 2.0, 2.0, 5.0 ] ); +var S0 = new Float64Array( [ 0.0, 0.25, 4.0 ] ); + +// Create offset views... +var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var S1 = new Float64Array( S0.buffer, S0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +dlaqsy( 'row-major', 'upper', 2, A1, 2, S1, 0.0625, 5.0 ); +// A0 => [ 0.0, 0.0625, 2.0, 2.0, 80.0 ] +``` + +#### dlaqsy.ndarray( uplo, N, A, sa1, sa2, oa, S, ss, os, scond, amax ) + +Equilibrates a real symmetric matrix `A` using the scaling factors in the vector `S` and alternative indexing semantics. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 5.0, 6.0, 3.0, 6.0, 9.0 ] ); +var S = new Float64Array( [ 0.25, 2.0, 4.0 ] ); + +dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); +// A => [ 0.0625, 1.0, 3.0, 2.0, 20.0, 48.0, 3.0, 6.0, 144.0 ] +``` + +The function has the following parameters: + +- **uplo**: specifies whether to reference the upper or lower triangular part of the symmetric matrix `A`. Must be either `'upper'` or `'lower'`. +- **N**: order of the matrix `A`. +- **A**: input matrix as a [`Float64Array`][mdn-float64array]. +- **sa1**: stride of the first dimension of `A`. +- **sa2**: stride of the second dimension of `A`. +- **oa**: starting index for `A`. +- **S**: vector of scale factors as a [`Float64Array`][mdn-float64array]. +- **ss**: stride length for `S`. +- **os**: starting index for `S`. +- **scond**: ratio of the smallest scale factor to the largest scale factor. +- **amax**: absolute value of the largest matrix entry. + +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 A = new Float64Array( [ 0.0, 1.0, 2.0, 2.0, 5.0 ] ); +var S = new Float64Array( [ 0.0, 4.0, 0.0, 0.25 ] ); + +dlaqsy.ndarray( 'upper', 2, A, 2, 1, 1, S, -2, 3, 0.0625, 5.0 ); +// A => [ 0.0, 0.0625, 2.0, 2.0, 80.0 ] +``` + +
+ + + +
+ +## Notes + +- `dlaqsy()` corresponds to the [LAPACK][lapack] function [`dlaqsy`][lapack-dlaqsy]. +- Equilibration is performed when `scond < 0.1`, `amax < smallnum`, or `amax > bignum`, where `smallnum` is the ratio of the safe minimum to the machine precision and `bignum = 1/smallnum`. + +
+ + + +
+ +## Examples + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var dlaqsy = require( '@stdlib/lapack/base/dlaqsy' ); + +// Specify matrix meta data: +var shape = [ 3, 3 ]; +var order = 'row-major'; +var strides = shape2strides( shape, order ); + +// Create a symmetric matrix stored in linear memory: +var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 5.0, 6.0, 3.0, 6.0, 9.0 ] ); +console.log( ndarray2array( A, shape, strides, 0, order ) ); + +// Define a vector of scale factors: +var S = new Float64Array( [ 0.25, 2.0, 4.0 ] ); + +// Equilibrate the upper triangular part of the matrix: +var equed = dlaqsy( order, 'upper', 3, A, strides[ 0 ], S, 0.0625, 9.0 ); +console.log( equed ); +console.log( ndarray2array( A, shape, strides, 0, order ) ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/benchmark/benchmark.js b/lib/node_modules/@stdlib/lapack/base/dlaqsy/benchmark/benchmark.js new file mode 100644 index 000000000000..4c74855028bf --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/benchmark/benchmark.js @@ -0,0 +1,131 @@ +/** +* @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 ones = require( '@stdlib/array/ones' ); +var isString = require( '@stdlib/assert/is-string' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dlaqsy = require( './../lib/dlaqsy.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; +var UPLOS = [ + 'upper', + 'lower' +]; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {string} uplo - specifies whether to reference the upper or lower triangular part of the matrix +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( order, uplo, N ) { + var A; + var S; + + A = uniform( N*N, -10.0, 10.0, options ); + + // Use unit scale factors so that repeated equilibration does not overflow or underflow: + S = ones( N, options.dtype ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var equed; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + equed = dlaqsy( order, uplo, N, A, N, S, 0.01, 10.0 ); + if ( !isString( equed ) ) { + b.fail( 'should return a string' ); + } + } + b.toc(); + if ( !isString( equed ) ) { + b.fail( 'should return a string' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var uplo; + var min; + var max; + var ord; + var N; + var f; + var i; + var j; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( j = 0; j < UPLOS.length; j++ ) { + uplo = UPLOS[ j ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, uplo, N ); + bench( format( '%s::square_matrix:order=%s,uplo=%s,size=%d', pkg, ord, uplo, N*N ), f ); + } + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlaqsy/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..28d2db06835c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/benchmark/benchmark.ndarray.js @@ -0,0 +1,140 @@ +/** +* @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 ones = require( '@stdlib/array/ones' ); +var isString = require( '@stdlib/assert/is-string' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dlaqsy = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; +var UPLOS = [ + 'upper', + 'lower' +]; +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {string} uplo - specifies whether to reference the upper or lower triangular part of the matrix +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( order, uplo, N ) { + var sa1; + var sa2; + var A; + var S; + + if ( order === 'column-major' ) { + sa1 = 1; + sa2 = N; + } else { // order === 'row-major' + sa1 = N; + sa2 = 1; + } + A = uniform( N*N, -10.0, 10.0, options ); + + // Use unit scale factors so that repeated equilibration does not overflow or underflow: + S = ones( N, options.dtype ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var equed; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + equed = dlaqsy( uplo, N, A, sa1, sa2, 0, S, 1, 0, 0.01, 10.0 ); + if ( !isString( equed ) ) { + b.fail( 'should return a string' ); + } + } + b.toc(); + if ( !isString( equed ) ) { + b.fail( 'should return a string' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var uplo; + var min; + var max; + var ord; + var N; + var f; + var i; + var j; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( j = 0; j < UPLOS.length; j++ ) { + uplo = UPLOS[ j ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, uplo, N ); + bench( format( '%s::square_matrix:ndarray:order=%s,uplo=%s,size=%d', pkg, ord, uplo, N*N ), f ); + } + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/dlaqsy/docs/repl.txt new file mode 100644 index 000000000000..a3dc9ae765c6 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/docs/repl.txt @@ -0,0 +1,119 @@ + +{{alias}}( order, uplo, N, A, LDA, S, scond, amax ) + Equilibrates a real symmetric matrix `A` using the scaling factors in the + vector `S`. + + If equilibration is performed, `A` is overwritten by `diag(S)*A*diag(S)`. + + Only the triangular part of `A` specified by `uplo` is referenced and + updated. + + Equilibration is performed when `scond` is less than `0.1` or when `amax` + is either too large or too small. + + Parameters + ---------- + order: string + Storage layout. Must be either 'row-major' or 'column-major'. + + uplo: string + Specifies whether to reference the upper or lower triangular part of the + symmetric matrix `A`. Must be either 'upper' or 'lower'. + + N: integer + Order of the matrix `A`. + + A: Float64Array + Input matrix. + + LDA: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). Must be at least `max(1,N)`. + + S: Float64Array + Vector of scale factors. + + scond: number + Ratio of the smallest scale factor to the largest scale factor. + + amax: number + Absolute value of the largest matrix entry. + + Returns + ------- + equed: string + Character flag indicating whether the matrix was equilibrated ('Y') or + not ('N'). + + Examples + -------- + > var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 2.0, 5.0 ] ); + > var S = new {{alias:@stdlib/array/float64}}( [ 0.25, 4.0 ] ); + > {{alias}}( 'row-major', 'upper', 2, A, 2, S, 0.0625, 5.0 ) + 'Y' + > A + [ 0.0625, 2.0, 2.0, 80.0 ] + + +{{alias}}.ndarray( uplo, N, A, sa1, sa2, oa, S, ss, os, scond, amax ) + Equilibrates a real symmetric matrix `A` using the scaling factors in the + vector `S` and 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. + + Parameters + ---------- + uplo: string + Specifies whether to reference the upper or lower triangular part of the + symmetric matrix `A`. Must be either 'upper' or 'lower'. + + N: integer + Order of the matrix `A`. + + A: Float64Array + Input matrix. + + sa1: integer + Stride of the first dimension of `A`. + + sa2: integer + Stride of the second dimension of `A`. + + oa: integer + Starting index for `A`. + + S: Float64Array + Vector of scale factors. + + ss: integer + Stride length for `S`. + + os: integer + Starting index for `S`. + + scond: number + Ratio of the smallest scale factor to the largest scale factor. + + amax: number + Absolute value of the largest matrix entry. + + Returns + ------- + equed: string + Character flag indicating whether the matrix was equilibrated ('Y') or + not ('N'). + + Examples + -------- + > var A = new {{alias:@stdlib/array/float64}}( [ 0.0, 1.0, 2.0, 2.0, 5.0 ] ); + > var S = new {{alias:@stdlib/array/float64}}( [ 0.0, 0.25, 4.0 ] ); + > {{alias}}.ndarray( 'upper', 2, A, 2, 1, 1, S, 1, 1, 0.0625, 5.0 ) + 'Y' + > A + [ 0.0, 0.0625, 2.0, 2.0, 80.0 ] + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/dlaqsy/docs/types/index.d.ts new file mode 100644 index 000000000000..60d24788f50d --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/docs/types/index.d.ts @@ -0,0 +1,117 @@ +/* +* @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 { Layout, MatrixTriangle } from '@stdlib/types/blas'; + +/** +* Interface describing `dlaqsy`. +*/ +interface Routine { + /** + * Equilibrates a real symmetric matrix `A` using the scaling factors in the vector `S`. + * + * @param order - storage layout + * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is referenced + * @param N - order of the matrix `A` + * @param A - input matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param S - vector of scale factors + * @param scond - ratio of the smallest scale factor to the largest scale factor + * @param amax - absolute value of the largest matrix entry + * @returns character flag indicating whether the matrix was equilibrated (`'Y'`) or not (`'N'`) + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 5.0, 6.0, 3.0, 6.0, 9.0 ] ); + * var S = new Float64Array( [ 0.25, 2.0, 4.0 ] ); + * + * dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625, 9.0 ); + * // A => [ 0.0625, 1.0, 3.0, 2.0, 20.0, 48.0, 3.0, 6.0, 144.0 ] + */ + ( order: Layout, uplo: MatrixTriangle, N: number, A: Float64Array, LDA: number, S: Float64Array, scond: number, amax: number ): string; + + /** + * Equilibrates a real symmetric matrix `A` using the scaling factors in the vector `S` and alternative indexing semantics. + * + * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is referenced + * @param N - order of the matrix `A` + * @param A - input matrix + * @param strideA1 - stride of the first dimension of `A` + * @param strideA2 - stride of the second dimension of `A` + * @param offsetA - starting index for `A` + * @param S - vector of scale factors + * @param strideS - stride length for `S` + * @param offsetS - starting index for `S` + * @param scond - ratio of the smallest scale factor to the largest scale factor + * @param amax - absolute value of the largest matrix entry + * @returns character flag indicating whether the matrix was equilibrated (`'Y'`) or not (`'N'`) + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 5.0, 6.0, 3.0, 6.0, 9.0 ] ); + * var S = new Float64Array( [ 0.25, 2.0, 4.0 ] ); + * + * dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); + * // A => [ 0.0625, 1.0, 3.0, 2.0, 20.0, 48.0, 3.0, 6.0, 144.0 ] + */ + ndarray( uplo: MatrixTriangle, N: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number, S: Float64Array, strideS: number, offsetS: number, scond: number, amax: number ): string; +} + +/** +* Equilibrates a real symmetric matrix `A` using the scaling factors in the vector `S`. +* +* @param order - storage layout +* @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is referenced +* @param N - order of the matrix `A` +* @param A - input matrix +* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param S - vector of scale factors +* @param scond - ratio of the smallest scale factor to the largest scale factor +* @param amax - absolute value of the largest matrix entry +* @returns character flag indicating whether the matrix was equilibrated (`'Y'`) or not (`'N'`) +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 5.0, 6.0, 3.0, 6.0, 9.0 ] ); +* var S = new Float64Array( [ 0.25, 2.0, 4.0 ] ); +* +* dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625, 9.0 ); +* // A => [ 0.0625, 1.0, 3.0, 2.0, 20.0, 48.0, 3.0, 6.0, 144.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 5.0, 6.0, 3.0, 6.0, 9.0 ] ); +* var S = new Float64Array( [ 0.25, 2.0, 4.0 ] ); +* +* dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); +* // A => [ 0.0625, 1.0, 3.0, 2.0, 20.0, 48.0, 3.0, 6.0, 144.0 ] +*/ +declare var dlaqsy: Routine; + + +// EXPORTS // + +export = dlaqsy; diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/docs/types/test.ts b/lib/node_modules/@stdlib/lapack/base/dlaqsy/docs/types/test.ts new file mode 100644 index 000000000000..1678b9be5006 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/docs/types/test.ts @@ -0,0 +1,335 @@ +/* +* @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. +*/ + +import dlaqsy = require( './index' ); + + +// TESTS // + +// The function returns a string... +{ + const A = new Float64Array( 9 ); + const S = new Float64Array( 3 ); + dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625, 9.0 ); // $ExpectType string +} + +// The compiler throws an error if the function is provided a first argument which is not a valid order... +{ + const A = new Float64Array( 9 ); + const S = new Float64Array( 3 ); + dlaqsy( 5, 'upper', 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( true, 'upper', 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( false, 'upper', 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( null, 'upper', 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( void 0, 'upper', 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( [], 'upper', 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( {}, 'upper', 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( ( x: number ): number => x, 'upper', 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a valid matrix triangle... +{ + const A = new Float64Array( 9 ); + const S = new Float64Array( 3 ); + dlaqsy( 'row-major', 5, 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', true, 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', false, 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', null, 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', void 0, 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', [], 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', {}, 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', ( x: number ): number => x, 3, A, 3, S, 0.0625, 9.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const A = new Float64Array( 9 ); + const S = new Float64Array( 3 ); + dlaqsy( 'row-major', 'upper', '5', A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', true, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', false, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', null, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', void 0, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', [], A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', {}, A, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', ( x: number ): number => x, A, 3, S, 0.0625, 9.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a Float64Array... +{ + const S = new Float64Array( 3 ); + dlaqsy( 'row-major', 'upper', 3, '5', 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, 5, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, true, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, false, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, null, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, void 0, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, [], 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, {}, 3, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, ( x: number ): number => x, 3, S, 0.0625, 9.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const S = new Float64Array( 3 ); + dlaqsy( 'row-major', 'upper', 3, A, '5', S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, true, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, false, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, null, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, void 0, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, [], S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, {}, S, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, ( x: number ): number => x, S, 0.0625, 9.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a Float64Array... +{ + const A = new Float64Array( 9 ); + dlaqsy( 'row-major', 'upper', 3, A, 3, '5', 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, 5, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, true, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, false, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, null, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, void 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, [], 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, {}, 0.0625, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, ( x: number ): number => x, 0.0625, 9.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const A = new Float64Array( 9 ); + const S = new Float64Array( 3 ); + dlaqsy( 'row-major', 'upper', 3, A, 3, S, '5', 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, true, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, false, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, null, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, void 0, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, [], 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, {}, 9.0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, ( x: number ): number => x, 9.0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const S = new Float64Array( 3 ); + dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625, '5' ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625, true ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625, false ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625, null ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625, void 0 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625, [] ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625, {} ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const A = new Float64Array( 9 ); + const S = new Float64Array( 3 ); + dlaqsy(); // $ExpectError + dlaqsy( 'row-major' ); // $ExpectError + dlaqsy( 'row-major', 'upper' ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625 ); // $ExpectError + dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625, 9.0, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a string... +{ + const A = new Float64Array( 9 ); + const S = new Float64Array( 3 ); + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectType string +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a valid matrix triangle... +{ + const A = new Float64Array( 9 ); + const S = new Float64Array( 3 ); + dlaqsy.ndarray( 5, 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( true, 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( false, 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( null, 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( void 0, 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( [], 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( {}, 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( ( x: number ): number => x, 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.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( 9 ); + const S = new Float64Array( 3 ); + dlaqsy.ndarray( 'upper', '5', A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', true, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', false, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', null, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', void 0, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', [], A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', {}, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', ( x: number ): number => x, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a Float64Array... +{ + const S = new Float64Array( 3 ); + dlaqsy.ndarray( 'upper', 3, '5', 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, 5, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, true, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, false, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, null, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, void 0, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, [], 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, {}, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, ( x: number ): number => x, 3, 1, 0, S, 1, 0, 0.0625, 9.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( 9 ); + const S = new Float64Array( 3 ); + dlaqsy.ndarray( 'upper', 3, A, '5', 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, true, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, false, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, null, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, void 0, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, [], 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, {}, 1, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, ( x: number ): number => x, 1, 0, S, 1, 0, 0.0625, 9.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( 9 ); + const S = new Float64Array( 3 ); + dlaqsy.ndarray( 'upper', 3, A, 3, '5', 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, true, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, false, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, null, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, void 0, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, [], 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, {}, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, ( x: number ): number => x, 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const S = new Float64Array( 3 ); + dlaqsy.ndarray( 'upper', 3, A, 3, 1, '5', S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, true, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, false, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, null, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, void 0, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, [], S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, {}, S, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, ( x: number ): number => x, S, 1, 0, 0.0625, 9.0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a seventh argument which is not a Float64Array... +{ + const A = new Float64Array( 9 ); + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, '5', 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, 5, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, true, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, false, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, null, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, void 0, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, [], 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, {}, 1, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, ( x: number ): number => x, 1, 0, 0.0625, 9.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( 9 ); + const S = new Float64Array( 3 ); + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, '5', 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, true, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, false, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, null, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, void 0, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, [], 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, {}, 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, ( x: number ): number => x, 0, 0.0625, 9.0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a ninth argument which is not a number... +{ + const A = new Float64Array( 9 ); + const S = new Float64Array( 3 ); + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, '5', 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, true, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, false, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, null, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, void 0, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, [], 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, {}, 0.0625, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, ( x: number ): number => x, 0.0625, 9.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( 9 ); + const S = new Float64Array( 3 ); + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, '5', 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, true, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, false, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, null, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, void 0, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, [], 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, {}, 9.0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, ( x: number ): number => x, 9.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( 9 ); + const S = new Float64Array( 3 ); + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, '5' ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, true ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, false ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, null ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, void 0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, [] ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, {} ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, ( 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( 9 ); + const S = new Float64Array( 3 ); + dlaqsy.ndarray(); // $ExpectError + dlaqsy.ndarray( 'upper' ); // $ExpectError + dlaqsy.ndarray( 'upper', 3 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625 ); // $ExpectError + dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/examples/index.js b/lib/node_modules/@stdlib/lapack/base/dlaqsy/examples/index.js new file mode 100644 index 000000000000..2c2fe78ce373 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/examples/index.js @@ -0,0 +1,41 @@ +/** +* @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'; + +var Float64Array = require( '@stdlib/array/float64' ); +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var dlaqsy = require( './../lib' ); + +// Specify matrix meta data: +var shape = [ 3, 3 ]; +var order = 'row-major'; +var strides = shape2strides( shape, order ); + +// Create a symmetric matrix stored in linear memory: +var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 5.0, 6.0, 3.0, 6.0, 9.0 ] ); +console.log( ndarray2array( A, shape, strides, 0, order ) ); + +// Define a vector of scale factors: +var S = new Float64Array( [ 0.25, 2.0, 4.0 ] ); + +// Equilibrate the upper triangular part of the matrix: +var equed = dlaqsy( order, 'upper', 3, A, strides[ 0 ], S, 0.0625, 9.0 ); +console.log( equed ); +console.log( ndarray2array( A, shape, strides, 0, order ) ); diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/lib/base.js b/lib/node_modules/@stdlib/lapack/base/dlaqsy/lib/base.js new file mode 100644 index 000000000000..25ef9032a974 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/lib/base.js @@ -0,0 +1,132 @@ +/** +* @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 isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var dlamch = require( '@stdlib/lapack/base/dlamch' ); + + +// VARIABLES // + +// Scale factor ratio below which equilibration is performed: +var THRESH = 0.1; + +// Bounds on the largest matrix entry beyond which equilibration is performed: +var SMALL = dlamch( 'safe minimum' ) / dlamch( 'precision' ); +var LARGE = 1.0 / SMALL; + + +// MAIN // + +/** +* Equilibrates a real symmetric matrix `A` using the scaling factors in the vector `S`. +* +* @private +* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is referenced +* @param {NonNegativeInteger} N - order of the matrix `A` +* @param {Float64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Float64Array} S - vector of scale factors +* @param {integer} strideS - stride length for `S` +* @param {NonNegativeInteger} offsetS - starting index for `S` +* @param {number} scond - ratio of the smallest scale factor to the largest scale factor +* @param {number} amax - absolute value of the largest matrix entry +* @returns {string} character flag indicating whether the matrix was equilibrated (`'Y'`) or not (`'N'`) +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 5.0, 6.0, 3.0, 6.0, 9.0 ] ); +* var S = new Float64Array( [ 0.25, 2.0, 4.0 ] ); +* +* dlaqsy( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); +* // A => [ 0.0625, 1.0, 3.0, 2.0, 20.0, 48.0, 3.0, 6.0, 144.0 ] +*/ +function dlaqsy( uplo, N, A, strideA1, strideA2, offsetA, S, strideS, offsetS, scond, amax ) { // eslint-disable-line max-len, max-params + var isrm; + var sa0; + var sa1; + var is0; + var is1; + var ia; + var cj; + var i0; + var i1; + + // Quick return if possible... + if ( N <= 0 ) { + return 'N'; + } + // Return early if the matrix does not need to be equilibrated... + if ( scond >= THRESH && amax >= SMALL && amax <= LARGE ) { + return 'N'; + } + isrm = isRowMajor( [ strideA1, strideA2 ] ); + if ( isrm ) { + // For row-major matrices, the last dimension has the fastest changing index... + sa0 = strideA2; // stride for innermost loop + sa1 = strideA1; // stride for outermost loop + } else { // isColMajor + // For column-major matrices, the first dimension has the fastest changing index... + sa0 = strideA1; // stride for innermost loop + sa1 = strideA2; // stride for outermost loop + } + // Row-major upper and column-major lower share the same traversal (and vice versa)... + if ( + ( !isrm && uplo === 'upper' ) || + ( isrm && uplo === 'lower' ) + ) { + is1 = offsetS; + for ( i1 = 0; i1 < N; i1++ ) { + cj = S[ is1 ]; + ia = offsetA + ( sa1*i1 ); + is0 = offsetS; + for ( i0 = 0; i0 <= i1; i0++ ) { + A[ ia ] *= cj * S[ is0 ]; + ia += sa0; + is0 += strideS; + } + is1 += strideS; + } + return 'Y'; + } + // ( isrm && uplo === 'upper' ) || ( !isrm && uplo === 'lower' ) + is1 = offsetS; + for ( i1 = 0; i1 < N; i1++ ) { + cj = S[ is1 ]; + ia = offsetA + ( sa1*i1 ) + ( sa0*i1 ); + is0 = is1; + for ( i0 = i1; i0 < N; i0++ ) { + A[ ia ] *= cj * S[ is0 ]; + ia += sa0; + is0 += strideS; + } + is1 += strideS; + } + return 'Y'; +} + + +// EXPORTS // + +module.exports = dlaqsy; diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/lib/dlaqsy.js b/lib/node_modules/@stdlib/lapack/base/dlaqsy/lib/dlaqsy.js new file mode 100644 index 000000000000..bc8dc0ba2822 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/lib/dlaqsy.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. +*/ + +'use strict'; + +// MODULES // + +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var max = require( '@stdlib/math/base/special/max' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Equilibrates a real symmetric matrix `A` using the scaling factors in the vector `S`. +* +* @param {string} order - storage layout +* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is referenced +* @param {NonNegativeInteger} N - order of the matrix `A` +* @param {Float64Array} A - input matrix +* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Float64Array} S - vector of scale factors +* @param {number} scond - ratio of the smallest scale factor to the largest scale factor +* @param {number} amax - absolute value of the largest matrix entry +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must specify whether to reference the lower or upper triangular matrix +* @throws {RangeError} third argument must be a nonnegative integer +* @throws {RangeError} fifth argument must be greater than or equal to max(1,N) +* @returns {string} character flag indicating whether the matrix was equilibrated (`'Y'`) or not (`'N'`) +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 5.0, 6.0, 3.0, 6.0, 9.0 ] ); +* var S = new Float64Array( [ 0.25, 2.0, 4.0 ] ); +* +* dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625, 9.0 ); +* // A => [ 0.0625, 1.0, 3.0, 2.0, 20.0, 48.0, 3.0, 6.0, 144.0 ] +*/ +function dlaqsy( order, uplo, N, A, LDA, S, scond, amax ) { + var sa1; + var sa2; + + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( !isMatrixTriangle( uplo ) ) { + throw new TypeError( format( 'invalid argument. Second argument must specify whether to reference the lower or upper triangular matrix. Value: `%s`.', uplo ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Third argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + if ( LDA < max( 1, N ) ) { + throw new RangeError( format( 'invalid argument. Fifth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) ); + } + if ( isColumnMajor( order ) ) { + sa1 = 1; + sa2 = LDA; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; + } + return base( uplo, N, A, sa1, sa2, 0, S, 1, 0, scond, amax ); +} + + +// EXPORTS // + +module.exports = dlaqsy; diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/lib/index.js b/lib/node_modules/@stdlib/lapack/base/dlaqsy/lib/index.js new file mode 100644 index 000000000000..6e85bb03b34d --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/lib/index.js @@ -0,0 +1,70 @@ +/** +* @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 equilibrate a real symmetric matrix using the scaling factors in a vector `S`. +* +* @module @stdlib/lapack/base/dlaqsy +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dlaqsy = require( '@stdlib/lapack/base/dlaqsy' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 5.0, 6.0, 3.0, 6.0, 9.0 ] ); +* var S = new Float64Array( [ 0.25, 2.0, 4.0 ] ); +* +* dlaqsy( 'row-major', 'upper', 3, A, 3, S, 0.0625, 9.0 ); +* // A => [ 0.0625, 1.0, 3.0, 2.0, 20.0, 48.0, 3.0, 6.0, 144.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dlaqsy = require( '@stdlib/lapack/base/dlaqsy' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 5.0, 6.0, 3.0, 6.0, 9.0 ] ); +* var S = new Float64Array( [ 0.25, 2.0, 4.0 ] ); +* +* dlaqsy.ndarray( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); +* // A => [ 0.0625, 1.0, 3.0, 2.0, 20.0, 48.0, 3.0, 6.0, 144.0 ] +*/ + +// 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 dlaqsy; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dlaqsy = main; +} else { + dlaqsy = tmp; +} + + +// EXPORTS // + +module.exports = dlaqsy; + +// exports: { "ndarray": "dlaqsy.ndarray" } diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/lib/main.js b/lib/node_modules/@stdlib/lapack/base/dlaqsy/lib/main.js new file mode 100644 index 000000000000..ed8015e4a02b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/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 dlaqsy = require( './dlaqsy.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dlaqsy, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dlaqsy; diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/lib/ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlaqsy/lib/ndarray.js new file mode 100644 index 000000000000..b6b7b9f9f675 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/lib/ndarray.js @@ -0,0 +1,70 @@ +/** +* @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 isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Equilibrates a real symmetric matrix `A` using the scaling factors in the vector `S` and alternative indexing semantics. +* +* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is referenced +* @param {NonNegativeInteger} N - order of the matrix `A` +* @param {Float64Array} A - input matrix +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Float64Array} S - vector of scale factors +* @param {integer} strideS - stride length for `S` +* @param {NonNegativeInteger} offsetS - starting index for `S` +* @param {number} scond - ratio of the smallest scale factor to the largest scale factor +* @param {number} amax - absolute value of the largest matrix entry +* @throws {TypeError} first argument must specify whether to reference the lower or upper triangular matrix +* @throws {RangeError} second argument must be a nonnegative integer +* @returns {string} character flag indicating whether the matrix was equilibrated (`'Y'`) or not (`'N'`) +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 2.0, 5.0, 6.0, 3.0, 6.0, 9.0 ] ); +* var S = new Float64Array( [ 0.25, 2.0, 4.0 ] ); +* +* dlaqsy( 'upper', 3, A, 3, 1, 0, S, 1, 0, 0.0625, 9.0 ); +* // A => [ 0.0625, 1.0, 3.0, 2.0, 20.0, 48.0, 3.0, 6.0, 144.0 ] +*/ +function dlaqsy( uplo, N, A, strideA1, strideA2, offsetA, S, strideS, offsetS, scond, amax ) { // eslint-disable-line max-len, max-params + if ( !isMatrixTriangle( uplo ) ) { + throw new TypeError( format( 'invalid argument. First argument must specify whether to reference the lower or upper triangular matrix. Value: `%s`.', uplo ) ); + } + if ( N < 0 ) { + throw new RangeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + return base( uplo, N, A, strideA1, strideA2, offsetA, S, strideS, offsetS, scond, amax ); // eslint-disable-line max-len +} + + +// EXPORTS // + +module.exports = dlaqsy; diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/package.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/package.json new file mode 100644 index 000000000000..fca993202ba5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/package.json @@ -0,0 +1,73 @@ +{ + "name": "@stdlib/lapack/base/dlaqsy", + "version": "0.0.0", + "description": "Equilibrate a real symmetric matrix using the scaling factors in a vector.", + "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", + "dlaqsy", + "equilibrate", + "equilibration", + "scale", + "scaling", + "symmetric", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "float64", + "double", + "float64array", + "matrix" + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/amax_large_lower.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/amax_large_lower.json new file mode 100644 index 000000000000..9896295fcb24 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/amax_large_lower.json @@ -0,0 +1,33 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 1, + "strideA2": 4, + "offsetA": 0, + "A": [ 1.0, 5.0, 9.0, 13.0, 2.0, 6.0, 10.0, 14.0, 3.0, 7.0, 11.0, 15.0, 4.0, 8.0, 12.0, 16.0 ], + + "S": [ 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 0, + + "scond": 0.5, + "amax": 1e+300, + + "A_out_mat": [ + [ 0.09, 2.0, 3.0, 4.0 ], + [ 2.55, 17.339999999999996, 7.0, 8.0 ], + [ 7.83, 49.3, 92.51, 12.0 ], + [ 0.42900000000000005, 2.618, 4.785, 0.1936 ] + ], + "A_out": [ 0.09, 2.55, 7.83, 0.42900000000000005, 2.0, 17.339999999999996, 49.3, 2.618, 3.0, 7.0, 92.51, 4.785, 4.0, 8.0, 12.0, 0.1936 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/amax_large_upper.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/amax_large_upper.json new file mode 100644 index 000000000000..966384008477 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/amax_large_upper.json @@ -0,0 +1,33 @@ +{ + "order": "column-major", + "uplo": "upper", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 1, + "strideA2": 4, + "offsetA": 0, + "A": [ 1.0, 5.0, 9.0, 13.0, 2.0, 6.0, 10.0, 14.0, 3.0, 7.0, 11.0, 15.0, 4.0, 8.0, 12.0, 16.0 ], + + "S": [ 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 0, + + "scond": 0.5, + "amax": 1e+300, + + "A_out_mat": [ + [ 0.09, 1.02, 2.61, 0.132 ], + [ 5.0, 17.339999999999996, 34.51, 1.496 ], + [ 9.0, 10.0, 92.51, 3.8280000000000003 ], + [ 13.0, 14.0, 15.0, 0.1936 ] + ], + "A_out": [ 0.09, 5.0, 9.0, 13.0, 1.02, 17.339999999999996, 10.0, 14.0, 2.61, 34.51, 92.51, 15.0, 0.132, 1.496, 3.8280000000000003, 0.1936 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/amax_small.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/amax_small.json new file mode 100644 index 000000000000..5ac2b81bf917 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/amax_small.json @@ -0,0 +1,33 @@ +{ + "order": "row-major", + "uplo": "upper", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 4, + "strideA2": 1, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ], + + "S": [ 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 0, + + "scond": 0.5, + "amax": 1e-300, + + "A_out_mat": [ + [ 0.09, 1.02, 2.61, 0.132 ], + [ 5.0, 17.339999999999996, 34.51, 1.496 ], + [ 9.0, 10.0, 92.51, 3.8280000000000003 ], + [ 13.0, 14.0, 15.0, 0.1936 ] + ], + "A_out": [ 0.09, 1.02, 2.61, 0.132, 5.0, 17.339999999999996, 34.51, 1.496, 9.0, 10.0, 92.51, 3.8280000000000003, 13.0, 14.0, 15.0, 0.1936 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/column_major_lower.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/column_major_lower.json new file mode 100644 index 000000000000..b6260b8e6471 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/column_major_lower.json @@ -0,0 +1,33 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 1, + "strideA2": 4, + "offsetA": 0, + "A": [ 1.0, 5.0, 9.0, 13.0, 2.0, 6.0, 10.0, 14.0, 3.0, 7.0, 11.0, 15.0, 4.0, 8.0, 12.0, 16.0 ], + + "S": [ 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 0, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 2.0, 3.0, 4.0 ], + [ 2.55, 17.339999999999996, 7.0, 8.0 ], + [ 7.83, 49.3, 92.51, 12.0 ], + [ 0.42900000000000005, 2.618, 4.785, 0.1936 ] + ], + "A_out": [ 0.09, 2.55, 7.83, 0.42900000000000005, 2.0, 17.339999999999996, 49.3, 2.618, 3.0, 7.0, 92.51, 4.785, 4.0, 8.0, 12.0, 0.1936 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/column_major_upper.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/column_major_upper.json new file mode 100644 index 000000000000..daf2cf86d6a9 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/column_major_upper.json @@ -0,0 +1,33 @@ +{ + "order": "column-major", + "uplo": "upper", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 1, + "strideA2": 4, + "offsetA": 0, + "A": [ 1.0, 5.0, 9.0, 13.0, 2.0, 6.0, 10.0, 14.0, 3.0, 7.0, 11.0, 15.0, 4.0, 8.0, 12.0, 16.0 ], + + "S": [ 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 0, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 1.02, 2.61, 0.132 ], + [ 5.0, 17.339999999999996, 34.51, 1.496 ], + [ 9.0, 10.0, 92.51, 3.8280000000000003 ], + [ 13.0, 14.0, 15.0, 0.1936 ] + ], + "A_out": [ 0.09, 5.0, 9.0, 13.0, 1.02, 17.339999999999996, 10.0, 14.0, 2.61, 34.51, 92.51, 15.0, 0.132, 1.496, 3.8280000000000003, 0.1936 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/large_strides/column_major_lower.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/large_strides/column_major_lower.json new file mode 100644 index 000000000000..d0700340ca96 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/large_strides/column_major_lower.json @@ -0,0 +1,33 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 2, + "strideA2": 8, + "offsetA": 0, + "A": [ 1.0, 9999.0, 5.0, 9999.0, 9.0, 9999.0, 13.0, 9999.0, 2.0, 9999.0, 6.0, 9999.0, 10.0, 9999.0, 14.0, 9999.0, 3.0, 9999.0, 7.0, 9999.0, 11.0, 9999.0, 15.0, 9999.0, 4.0, 9999.0, 8.0, 9999.0, 12.0, 9999.0, 16.0 ], + + "S": [ 0.3, 9999.0, 1.7, 9999.0, 2.9, 9999.0, 0.11 ], + "strideS": 2, + "offsetS": 0, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 2.0, 3.0, 4.0 ], + [ 2.55, 17.339999999999996, 7.0, 8.0 ], + [ 7.83, 49.3, 92.51, 12.0 ], + [ 0.42900000000000005, 2.618, 4.785, 0.1936 ] + ], + "A_out": [ 0.09, 9999.0, 2.55, 9999.0, 7.83, 9999.0, 0.42900000000000005, 9999.0, 2.0, 9999.0, 17.339999999999996, 9999.0, 49.3, 9999.0, 2.618, 9999.0, 3.0, 9999.0, 7.0, 9999.0, 92.51, 9999.0, 4.785, 9999.0, 4.0, 9999.0, 8.0, 9999.0, 12.0, 9999.0, 0.1936 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/large_strides/column_major_upper.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/large_strides/column_major_upper.json new file mode 100644 index 000000000000..8b0dbc804e16 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/large_strides/column_major_upper.json @@ -0,0 +1,33 @@ +{ + "order": "column-major", + "uplo": "upper", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 2, + "strideA2": 8, + "offsetA": 0, + "A": [ 1.0, 9999.0, 5.0, 9999.0, 9.0, 9999.0, 13.0, 9999.0, 2.0, 9999.0, 6.0, 9999.0, 10.0, 9999.0, 14.0, 9999.0, 3.0, 9999.0, 7.0, 9999.0, 11.0, 9999.0, 15.0, 9999.0, 4.0, 9999.0, 8.0, 9999.0, 12.0, 9999.0, 16.0 ], + + "S": [ 0.3, 9999.0, 1.7, 9999.0, 2.9, 9999.0, 0.11 ], + "strideS": 2, + "offsetS": 0, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 1.02, 2.61, 0.132 ], + [ 5.0, 17.339999999999996, 34.51, 1.496 ], + [ 9.0, 10.0, 92.51, 3.8280000000000003 ], + [ 13.0, 14.0, 15.0, 0.1936 ] + ], + "A_out": [ 0.09, 9999.0, 5.0, 9999.0, 9.0, 9999.0, 13.0, 9999.0, 1.02, 9999.0, 17.339999999999996, 9999.0, 10.0, 9999.0, 14.0, 9999.0, 2.61, 9999.0, 34.51, 9999.0, 92.51, 9999.0, 15.0, 9999.0, 0.132, 9999.0, 1.496, 9999.0, 3.8280000000000003, 9999.0, 0.1936 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/large_strides/row_major_lower.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/large_strides/row_major_lower.json new file mode 100644 index 000000000000..dd41dfc609f6 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/large_strides/row_major_lower.json @@ -0,0 +1,33 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 8, + "strideA2": 2, + "offsetA": 0, + "A": [ 1.0, 9999.0, 2.0, 9999.0, 3.0, 9999.0, 4.0, 9999.0, 5.0, 9999.0, 6.0, 9999.0, 7.0, 9999.0, 8.0, 9999.0, 9.0, 9999.0, 10.0, 9999.0, 11.0, 9999.0, 12.0, 9999.0, 13.0, 9999.0, 14.0, 9999.0, 15.0, 9999.0, 16.0 ], + + "S": [ 0.3, 9999.0, 1.7, 9999.0, 2.9, 9999.0, 0.11 ], + "strideS": 2, + "offsetS": 0, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 2.0, 3.0, 4.0 ], + [ 2.55, 17.339999999999996, 7.0, 8.0 ], + [ 7.83, 49.3, 92.51, 12.0 ], + [ 0.42900000000000005, 2.618, 4.785, 0.1936 ] + ], + "A_out": [ 0.09, 9999.0, 2.0, 9999.0, 3.0, 9999.0, 4.0, 9999.0, 2.55, 9999.0, 17.339999999999996, 9999.0, 7.0, 9999.0, 8.0, 9999.0, 7.83, 9999.0, 49.3, 9999.0, 92.51, 9999.0, 12.0, 9999.0, 0.42900000000000005, 9999.0, 2.618, 9999.0, 4.785, 9999.0, 0.1936 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/large_strides/row_major_upper.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/large_strides/row_major_upper.json new file mode 100644 index 000000000000..41fa8263406f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/large_strides/row_major_upper.json @@ -0,0 +1,33 @@ +{ + "order": "row-major", + "uplo": "upper", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 8, + "strideA2": 2, + "offsetA": 0, + "A": [ 1.0, 9999.0, 2.0, 9999.0, 3.0, 9999.0, 4.0, 9999.0, 5.0, 9999.0, 6.0, 9999.0, 7.0, 9999.0, 8.0, 9999.0, 9.0, 9999.0, 10.0, 9999.0, 11.0, 9999.0, 12.0, 9999.0, 13.0, 9999.0, 14.0, 9999.0, 15.0, 9999.0, 16.0 ], + + "S": [ 0.3, 9999.0, 1.7, 9999.0, 2.9, 9999.0, 0.11 ], + "strideS": 2, + "offsetS": 0, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 1.02, 2.61, 0.132 ], + [ 5.0, 17.339999999999996, 34.51, 1.496 ], + [ 9.0, 10.0, 92.51, 3.8280000000000003 ], + [ 13.0, 14.0, 15.0, 0.1936 ] + ], + "A_out": [ 0.09, 9999.0, 1.02, 9999.0, 2.61, 9999.0, 0.132, 9999.0, 5.0, 9999.0, 17.339999999999996, 9999.0, 34.51, 9999.0, 1.496, 9999.0, 9.0, 9999.0, 10.0, 9999.0, 92.51, 9999.0, 3.8280000000000003, 9999.0, 13.0, 9999.0, 14.0, 9999.0, 15.0, 9999.0, 0.1936 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/mixed_strides/column_major_lower.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/mixed_strides/column_major_lower.json new file mode 100644 index 000000000000..c0a76ae60fe7 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/mixed_strides/column_major_lower.json @@ -0,0 +1,33 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": -1, + "strideA2": 4, + "offsetA": 3, + "A": [ 13.0, 9.0, 5.0, 1.0, 14.0, 10.0, 6.0, 2.0, 15.0, 11.0, 7.0, 3.0, 16.0, 12.0, 8.0, 4.0 ], + + "S": [ 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 0, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 2.0, 3.0, 4.0 ], + [ 2.55, 17.339999999999996, 7.0, 8.0 ], + [ 7.83, 49.3, 92.51, 12.0 ], + [ 0.42900000000000005, 2.618, 4.785, 0.1936 ] + ], + "A_out": [ 0.42900000000000005, 7.83, 2.55, 0.09, 2.618, 49.3, 17.339999999999996, 2.0, 4.785, 92.51, 7.0, 3.0, 0.1936, 12.0, 8.0, 4.0 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/mixed_strides/column_major_upper.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/mixed_strides/column_major_upper.json new file mode 100644 index 000000000000..1853abb13e27 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/mixed_strides/column_major_upper.json @@ -0,0 +1,33 @@ +{ + "order": "column-major", + "uplo": "upper", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": -1, + "strideA2": 4, + "offsetA": 3, + "A": [ 13.0, 9.0, 5.0, 1.0, 14.0, 10.0, 6.0, 2.0, 15.0, 11.0, 7.0, 3.0, 16.0, 12.0, 8.0, 4.0 ], + + "S": [ 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 0, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 1.02, 2.61, 0.132 ], + [ 5.0, 17.339999999999996, 34.51, 1.496 ], + [ 9.0, 10.0, 92.51, 3.8280000000000003 ], + [ 13.0, 14.0, 15.0, 0.1936 ] + ], + "A_out": [ 13.0, 9.0, 5.0, 0.09, 14.0, 10.0, 17.339999999999996, 1.02, 15.0, 92.51, 34.51, 2.61, 0.1936, 3.8280000000000003, 1.496, 0.132 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/mixed_strides/row_major_lower.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/mixed_strides/row_major_lower.json new file mode 100644 index 000000000000..345f5b3d272e --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/mixed_strides/row_major_lower.json @@ -0,0 +1,33 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 4, + "strideA2": -1, + "offsetA": 3, + "A": [ 4.0, 3.0, 2.0, 1.0, 8.0, 7.0, 6.0, 5.0, 12.0, 11.0, 10.0, 9.0, 16.0, 15.0, 14.0, 13.0 ], + + "S": [ 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 0, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 2.0, 3.0, 4.0 ], + [ 2.55, 17.339999999999996, 7.0, 8.0 ], + [ 7.83, 49.3, 92.51, 12.0 ], + [ 0.42900000000000005, 2.618, 4.785, 0.1936 ] + ], + "A_out": [ 4.0, 3.0, 2.0, 0.09, 8.0, 7.0, 17.339999999999996, 2.55, 12.0, 92.51, 49.3, 7.83, 0.1936, 4.785, 2.618, 0.42900000000000005 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/mixed_strides/row_major_upper.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/mixed_strides/row_major_upper.json new file mode 100644 index 000000000000..a6cfb14c3509 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/mixed_strides/row_major_upper.json @@ -0,0 +1,33 @@ +{ + "order": "row-major", + "uplo": "upper", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 4, + "strideA2": -1, + "offsetA": 3, + "A": [ 4.0, 3.0, 2.0, 1.0, 8.0, 7.0, 6.0, 5.0, 12.0, 11.0, 10.0, 9.0, 16.0, 15.0, 14.0, 13.0 ], + + "S": [ 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 0, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 1.02, 2.61, 0.132 ], + [ 5.0, 17.339999999999996, 34.51, 1.496 ], + [ 9.0, 10.0, 92.51, 3.8280000000000003 ], + [ 13.0, 14.0, 15.0, 0.1936 ] + ], + "A_out": [ 0.132, 2.61, 1.02, 0.09, 1.496, 34.51, 17.339999999999996, 5.0, 3.8280000000000003, 92.51, 10.0, 9.0, 0.1936, 15.0, 14.0, 13.0 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/negative_strides/column_major_lower.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/negative_strides/column_major_lower.json new file mode 100644 index 000000000000..fde59385cbfb --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/negative_strides/column_major_lower.json @@ -0,0 +1,33 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": -1, + "strideA2": -4, + "offsetA": 15, + "A": [ 16.0, 12.0, 8.0, 4.0, 15.0, 11.0, 7.0, 3.0, 14.0, 10.0, 6.0, 2.0, 13.0, 9.0, 5.0, 1.0 ], + + "S": [ 0.11, 2.9, 1.7, 0.3 ], + "strideS": -1, + "offsetS": 3, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 2.0, 3.0, 4.0 ], + [ 2.55, 17.339999999999996, 7.0, 8.0 ], + [ 7.83, 49.3, 92.51, 12.0 ], + [ 0.42900000000000005, 2.618, 4.785, 0.1936 ] + ], + "A_out": [ 0.1936, 12.0, 8.0, 4.0, 4.785, 92.51, 7.0, 3.0, 2.618, 49.3, 17.339999999999996, 2.0, 0.42900000000000005, 7.83, 2.55, 0.09 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/negative_strides/column_major_upper.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/negative_strides/column_major_upper.json new file mode 100644 index 000000000000..390901ca2a4e --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/negative_strides/column_major_upper.json @@ -0,0 +1,33 @@ +{ + "order": "column-major", + "uplo": "upper", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": -1, + "strideA2": -4, + "offsetA": 15, + "A": [ 16.0, 12.0, 8.0, 4.0, 15.0, 11.0, 7.0, 3.0, 14.0, 10.0, 6.0, 2.0, 13.0, 9.0, 5.0, 1.0 ], + + "S": [ 0.11, 2.9, 1.7, 0.3 ], + "strideS": -1, + "offsetS": 3, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 1.02, 2.61, 0.132 ], + [ 5.0, 17.339999999999996, 34.51, 1.496 ], + [ 9.0, 10.0, 92.51, 3.8280000000000003 ], + [ 13.0, 14.0, 15.0, 0.1936 ] + ], + "A_out": [ 0.1936, 3.8280000000000003, 1.496, 0.132, 15.0, 92.51, 34.51, 2.61, 14.0, 10.0, 17.339999999999996, 1.02, 13.0, 9.0, 5.0, 0.09 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/negative_strides/row_major_lower.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/negative_strides/row_major_lower.json new file mode 100644 index 000000000000..31173b9df8e1 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/negative_strides/row_major_lower.json @@ -0,0 +1,33 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": -4, + "strideA2": -1, + "offsetA": 15, + "A": [ 16.0, 15.0, 14.0, 13.0, 12.0, 11.0, 10.0, 9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0 ], + + "S": [ 0.11, 2.9, 1.7, 0.3 ], + "strideS": -1, + "offsetS": 3, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 2.0, 3.0, 4.0 ], + [ 2.55, 17.339999999999996, 7.0, 8.0 ], + [ 7.83, 49.3, 92.51, 12.0 ], + [ 0.42900000000000005, 2.618, 4.785, 0.1936 ] + ], + "A_out": [ 0.1936, 4.785, 2.618, 0.42900000000000005, 12.0, 92.51, 49.3, 7.83, 8.0, 7.0, 17.339999999999996, 2.55, 4.0, 3.0, 2.0, 0.09 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/negative_strides/row_major_upper.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/negative_strides/row_major_upper.json new file mode 100644 index 000000000000..0924ea8811ea --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/negative_strides/row_major_upper.json @@ -0,0 +1,33 @@ +{ + "order": "row-major", + "uplo": "upper", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": -4, + "strideA2": -1, + "offsetA": 15, + "A": [ 16.0, 15.0, 14.0, 13.0, 12.0, 11.0, 10.0, 9.0, 8.0, 7.0, 6.0, 5.0, 4.0, 3.0, 2.0, 1.0 ], + + "S": [ 0.11, 2.9, 1.7, 0.3 ], + "strideS": -1, + "offsetS": 3, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 1.02, 2.61, 0.132 ], + [ 5.0, 17.339999999999996, 34.51, 1.496 ], + [ 9.0, 10.0, 92.51, 3.8280000000000003 ], + [ 13.0, 14.0, 15.0, 0.1936 ] + ], + "A_out": [ 0.1936, 15.0, 14.0, 13.0, 3.8280000000000003, 92.51, 10.0, 9.0, 1.496, 34.51, 17.339999999999996, 5.0, 0.132, 2.61, 1.02, 0.09 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/no_equilibration.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/no_equilibration.json new file mode 100644 index 000000000000..365b9cbe78e5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/no_equilibration.json @@ -0,0 +1,33 @@ +{ + "order": "row-major", + "uplo": "upper", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 4, + "strideA2": 1, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ], + + "S": [ 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 0, + + "scond": 0.5, + "amax": 16.0, + + "A_out_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "A_out": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ], + "equed": "N" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/offsets/column_major_lower.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/offsets/column_major_lower.json new file mode 100644 index 000000000000..13bb8ac0db13 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/offsets/column_major_lower.json @@ -0,0 +1,33 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 1, + "strideA2": 4, + "offsetA": 2, + "A": [ 9999.0, 9999.0, 1.0, 5.0, 9.0, 13.0, 2.0, 6.0, 10.0, 14.0, 3.0, 7.0, 11.0, 15.0, 4.0, 8.0, 12.0, 16.0 ], + + "S": [ 9999.0, 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 1, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 2.0, 3.0, 4.0 ], + [ 2.55, 17.339999999999996, 7.0, 8.0 ], + [ 7.83, 49.3, 92.51, 12.0 ], + [ 0.42900000000000005, 2.618, 4.785, 0.1936 ] + ], + "A_out": [ 9999.0, 9999.0, 0.09, 2.55, 7.83, 0.42900000000000005, 2.0, 17.339999999999996, 49.3, 2.618, 3.0, 7.0, 92.51, 4.785, 4.0, 8.0, 12.0, 0.1936 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/offsets/column_major_upper.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/offsets/column_major_upper.json new file mode 100644 index 000000000000..58113b738609 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/offsets/column_major_upper.json @@ -0,0 +1,33 @@ +{ + "order": "column-major", + "uplo": "upper", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 1, + "strideA2": 4, + "offsetA": 2, + "A": [ 9999.0, 9999.0, 1.0, 5.0, 9.0, 13.0, 2.0, 6.0, 10.0, 14.0, 3.0, 7.0, 11.0, 15.0, 4.0, 8.0, 12.0, 16.0 ], + + "S": [ 9999.0, 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 1, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 1.02, 2.61, 0.132 ], + [ 5.0, 17.339999999999996, 34.51, 1.496 ], + [ 9.0, 10.0, 92.51, 3.8280000000000003 ], + [ 13.0, 14.0, 15.0, 0.1936 ] + ], + "A_out": [ 9999.0, 9999.0, 0.09, 5.0, 9.0, 13.0, 1.02, 17.339999999999996, 10.0, 14.0, 2.61, 34.51, 92.51, 15.0, 0.132, 1.496, 3.8280000000000003, 0.1936 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/offsets/row_major_lower.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/offsets/row_major_lower.json new file mode 100644 index 000000000000..ef29458b548d --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/offsets/row_major_lower.json @@ -0,0 +1,33 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 4, + "strideA2": 1, + "offsetA": 2, + "A": [ 9999.0, 9999.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ], + + "S": [ 9999.0, 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 1, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 2.0, 3.0, 4.0 ], + [ 2.55, 17.339999999999996, 7.0, 8.0 ], + [ 7.83, 49.3, 92.51, 12.0 ], + [ 0.42900000000000005, 2.618, 4.785, 0.1936 ] + ], + "A_out": [ 9999.0, 9999.0, 0.09, 2.0, 3.0, 4.0, 2.55, 17.339999999999996, 7.0, 8.0, 7.83, 49.3, 92.51, 12.0, 0.42900000000000005, 2.618, 4.785, 0.1936 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/offsets/row_major_upper.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/offsets/row_major_upper.json new file mode 100644 index 000000000000..898b21cf7d18 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/offsets/row_major_upper.json @@ -0,0 +1,33 @@ +{ + "order": "row-major", + "uplo": "upper", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 4, + "strideA2": 1, + "offsetA": 2, + "A": [ 9999.0, 9999.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ], + + "S": [ 9999.0, 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 1, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 1.02, 2.61, 0.132 ], + [ 5.0, 17.339999999999996, 34.51, 1.496 ], + [ 9.0, 10.0, 92.51, 3.8280000000000003 ], + [ 13.0, 14.0, 15.0, 0.1936 ] + ], + "A_out": [ 9999.0, 9999.0, 0.09, 1.02, 2.61, 0.132, 5.0, 17.339999999999996, 34.51, 1.496, 9.0, 10.0, 92.51, 3.8280000000000003, 13.0, 14.0, 15.0, 0.1936 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/row_major_lower.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/row_major_lower.json new file mode 100644 index 000000000000..00529122b5c8 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/row_major_lower.json @@ -0,0 +1,33 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 4, + "strideA2": 1, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ], + + "S": [ 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 0, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 2.0, 3.0, 4.0 ], + [ 2.55, 17.339999999999996, 7.0, 8.0 ], + [ 7.83, 49.3, 92.51, 12.0 ], + [ 0.42900000000000005, 2.618, 4.785, 0.1936 ] + ], + "A_out": [ 0.09, 2.0, 3.0, 4.0, 2.55, 17.339999999999996, 7.0, 8.0, 7.83, 49.3, 92.51, 12.0, 0.42900000000000005, 2.618, 4.785, 0.1936 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/row_major_upper.json b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/row_major_upper.json new file mode 100644 index 000000000000..98c3f48b3f8b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/fixtures/row_major_upper.json @@ -0,0 +1,33 @@ +{ + "order": "row-major", + "uplo": "upper", + "N": 4, + + "A_mat": [ + [ 1.0, 2.0, 3.0, 4.0 ], + [ 5.0, 6.0, 7.0, 8.0 ], + [ 9.0, 10.0, 11.0, 12.0 ], + [ 13.0, 14.0, 15.0, 16.0 ] + ], + "LDA": 4, + "strideA1": 4, + "strideA2": 1, + "offsetA": 0, + "A": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0 ], + + "S": [ 0.3, 1.7, 2.9, 0.11 ], + "strideS": 1, + "offsetS": 0, + + "scond": 0.03793103448275862, + "amax": 16.0, + + "A_out_mat": [ + [ 0.09, 1.02, 2.61, 0.132 ], + [ 5.0, 17.339999999999996, 34.51, 1.496 ], + [ 9.0, 10.0, 92.51, 3.8280000000000003 ], + [ 13.0, 14.0, 15.0, 0.1936 ] + ], + "A_out": [ 0.09, 1.02, 2.61, 0.132, 5.0, 17.339999999999996, 34.51, 1.496, 9.0, 10.0, 92.51, 3.8280000000000003, 13.0, 14.0, 15.0, 0.1936 ], + "equed": "Y" +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/test.dlaqsy.js b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/test.dlaqsy.js new file mode 100644 index 000000000000..bec948c52ceb --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/test.dlaqsy.js @@ -0,0 +1,421 @@ +/** +* @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 tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var dlaqsy = require( './../lib/dlaqsy.js' ); + + +// FIXTURES // + +var ROW_MAJOR_UPPER = require( './fixtures/row_major_upper.json' ); +var ROW_MAJOR_LOWER = require( './fixtures/row_major_lower.json' ); +var COLUMN_MAJOR_UPPER = require( './fixtures/column_major_upper.json' ); +var COLUMN_MAJOR_LOWER = require( './fixtures/column_major_lower.json' ); +var AMAX_LARGE_UPPER = require( './fixtures/amax_large_upper.json' ); +var AMAX_LARGE_LOWER = require( './fixtures/amax_large_lower.json' ); +var AMAX_SMALL = require( './fixtures/amax_small.json' ); +var NO_EQUILIBRATION = require( './fixtures/no_equilibration.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dlaqsy, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 8', function test( t ) { + t.strictEqual( dlaqsy.length, 8, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not a valid order', function test( t ) { + var values; + var A; + var S; + var i; + + A = new Float64Array( 9 ); + S = new Float64Array( 3 ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dlaqsy( value, 'upper', 3, A, 3, S, 0.05, 9.0 ); + }; + } +}); + +tape( 'the function throws an error if provided a second argument which is not a valid matrix triangle', function test( t ) { + var values; + var A; + var S; + var i; + + A = new Float64Array( 9 ); + S = new Float64Array( 3 ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + 'all', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dlaqsy( 'row-major', value, 3, A, 3, S, 0.05, 9.0 ); + }; + } +}); + +tape( 'the function throws an error if provided a third argument which is a negative integer', function test( t ) { + var values; + var A; + var S; + var i; + + A = new Float64Array( 9 ); + S = new Float64Array( 3 ); + + 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() { + dlaqsy( 'row-major', 'upper', value, A, 3, S, 0.05, 9.0 ); + }; + } +}); + +tape( 'the function throws an error if provided a fifth argument which is not a valid `LDA` value (row-major)', function test( t ) { + var values; + var A; + var S; + var i; + + A = new Float64Array( 9 ); + S = new Float64Array( 3 ); + + values = [ + 0, + 1, + 2 + ]; + + 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() { + dlaqsy( 'row-major', 'upper', 3, A, value, S, 0.05, 9.0 ); + }; + } +}); + +tape( 'the function throws an error if provided a fifth argument which is not a valid `LDA` value (column-major)', function test( t ) { + var values; + var A; + var S; + var i; + + A = new Float64Array( 9 ); + S = new Float64Array( 3 ); + + values = [ + 0, + 1, + 2 + ]; + + 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() { + dlaqsy( 'column-major', 'upper', 3, A, value, S, 0.05, 9.0 ); + }; + } +}); + +tape( 'the function equilibrates a symmetric matrix (row-major, upper)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = ROW_MAJOR_UPPER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.order, data.uplo, data.N, A, data.LDA, S, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (row-major, lower)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = ROW_MAJOR_LOWER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.order, data.uplo, data.N, A, data.LDA, S, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (column-major, upper)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = COLUMN_MAJOR_UPPER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.order, data.uplo, data.N, A, data.LDA, S, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (column-major, lower)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = COLUMN_MAJOR_LOWER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.order, data.uplo, data.N, A, data.LDA, S, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix if the largest matrix entry is too large (upper)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = AMAX_LARGE_UPPER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.order, data.uplo, data.N, A, data.LDA, S, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix if the largest matrix entry is too large (lower)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = AMAX_LARGE_LOWER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.order, data.uplo, data.N, A, data.LDA, S, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix if the largest matrix entry is too small', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = AMAX_SMALL; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.order, data.uplo, data.N, A, data.LDA, S, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function does not equilibrate a symmetric matrix if equilibration is not needed', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = NO_EQUILIBRATION; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.order, data.uplo, data.N, A, data.LDA, S, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, 'N', 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `N` and leaves the input matrix unchanged if `N` is equal to zero', function test( t ) { + var expected; + var equed; + var A; + var S; + + A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + S = new Float64Array( [ 0.1, 10.0 ] ); + expected = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + equed = dlaqsy( 'row-major', 'upper', 0, A, 2, S, 0.01, 4.0 ); + t.strictEqual( equed, 'N', 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + + equed = dlaqsy( 'column-major', 'lower', 0, A, 2, S, 0.01, 4.0 ); + t.strictEqual( equed, 'N', 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a leading dimension which is greater than the number of columns (row-major)', function test( t ) { + var expected; + var equed; + var A; + var S; + + A = new Float64Array( [ 1.0, 2.0, 9999.0, 2.0, 5.0, 9999.0 ] ); + S = new Float64Array( [ 0.25, 4.0 ] ); + expected = new Float64Array( [ 0.0625, 2.0, 9999.0, 2.0, 80.0, 9999.0 ] ); + + equed = dlaqsy( 'row-major', 'upper', 2, A, 3, S, 0.0625, 5.0 ); + t.strictEqual( equed, 'Y', 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function supports specifying a leading dimension which is greater than the number of rows (column-major)', function test( t ) { + var expected; + var equed; + var A; + var S; + + A = new Float64Array( [ 1.0, 2.0, 9999.0, 2.0, 5.0, 9999.0 ] ); + S = new Float64Array( [ 0.25, 4.0 ] ); + expected = new Float64Array( [ 0.0625, 2.0, 9999.0, 2.0, 80.0, 9999.0 ] ); + + equed = dlaqsy( 'column-major', 'lower', 2, A, 3, S, 0.0625, 5.0 ); + t.strictEqual( equed, 'Y', 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/test.js b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/test.js new file mode 100644 index 000000000000..2083fffe07c0 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/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 dlaqsy = 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 dlaqsy, '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 dlaqsy.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 dlaqsy = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dlaqsy, 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 dlaqsy; + var main; + + main = require( './../lib/dlaqsy.js' ); + + dlaqsy = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dlaqsy, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/test.ndarray.js new file mode 100644 index 000000000000..7dd7a30253b4 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlaqsy/test/test.ndarray.js @@ -0,0 +1,630 @@ +/** +* @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, id-length */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var dlaqsy = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var ROW_MAJOR_UPPER = require( './fixtures/row_major_upper.json' ); +var ROW_MAJOR_LOWER = require( './fixtures/row_major_lower.json' ); +var COLUMN_MAJOR_UPPER = require( './fixtures/column_major_upper.json' ); +var COLUMN_MAJOR_LOWER = require( './fixtures/column_major_lower.json' ); +var OFFSETS_ROW_MAJOR_UPPER = require( './fixtures/offsets/row_major_upper.json' ); +var OFFSETS_ROW_MAJOR_LOWER = require( './fixtures/offsets/row_major_lower.json' ); +var OFFSETS_COLUMN_MAJOR_UPPER = require( './fixtures/offsets/column_major_upper.json' ); +var OFFSETS_COLUMN_MAJOR_LOWER = require( './fixtures/offsets/column_major_lower.json' ); +var MIXED_STRIDES_ROW_MAJOR_UPPER = require( './fixtures/mixed_strides/row_major_upper.json' ); +var MIXED_STRIDES_ROW_MAJOR_LOWER = require( './fixtures/mixed_strides/row_major_lower.json' ); +var MIXED_STRIDES_COLUMN_MAJOR_UPPER = require( './fixtures/mixed_strides/column_major_upper.json' ); +var MIXED_STRIDES_COLUMN_MAJOR_LOWER = require( './fixtures/mixed_strides/column_major_lower.json' ); +var NEGATIVE_STRIDES_ROW_MAJOR_UPPER = require( './fixtures/negative_strides/row_major_upper.json' ); +var NEGATIVE_STRIDES_ROW_MAJOR_LOWER = require( './fixtures/negative_strides/row_major_lower.json' ); +var NEGATIVE_STRIDES_COLUMN_MAJOR_UPPER = require( './fixtures/negative_strides/column_major_upper.json' ); +var NEGATIVE_STRIDES_COLUMN_MAJOR_LOWER = require( './fixtures/negative_strides/column_major_lower.json' ); +var LARGE_STRIDES_ROW_MAJOR_UPPER = require( './fixtures/large_strides/row_major_upper.json' ); +var LARGE_STRIDES_ROW_MAJOR_LOWER = require( './fixtures/large_strides/row_major_lower.json' ); +var LARGE_STRIDES_COLUMN_MAJOR_UPPER = require( './fixtures/large_strides/column_major_upper.json' ); +var LARGE_STRIDES_COLUMN_MAJOR_LOWER = require( './fixtures/large_strides/column_major_lower.json' ); +var AMAX_LARGE_UPPER = require( './fixtures/amax_large_upper.json' ); +var AMAX_LARGE_LOWER = require( './fixtures/amax_large_lower.json' ); +var AMAX_SMALL = require( './fixtures/amax_small.json' ); +var NO_EQUILIBRATION = require( './fixtures/no_equilibration.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dlaqsy, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 11', function test( t ) { + t.strictEqual( dlaqsy.length, 11, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not a valid matrix triangle', function test( t ) { + var values; + var A; + var S; + var i; + + A = new Float64Array( 9 ); + S = new Float64Array( 3 ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + 'all', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dlaqsy( value, 3, A, 3, 1, 0, S, 1, 0, 0.05, 9.0 ); + }; + } +}); + +tape( 'the function throws an error if provided a second argument which is a negative integer', function test( t ) { + var values; + var A; + var S; + var i; + + A = new Float64Array( 9 ); + S = new Float64Array( 3 ); + + 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() { + dlaqsy( 'upper', value, A, 3, 1, 0, S, 1, 0, 0.05, 9.0 ); + }; + } +}); + +tape( 'the function equilibrates a symmetric matrix (row-major, upper)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = ROW_MAJOR_UPPER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (row-major, lower)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = ROW_MAJOR_LOWER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (column-major, upper)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = COLUMN_MAJOR_UPPER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (column-major, lower)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = COLUMN_MAJOR_LOWER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (row-major, upper, offsets)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = OFFSETS_ROW_MAJOR_UPPER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (row-major, lower, offsets)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = OFFSETS_ROW_MAJOR_LOWER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (column-major, upper, offsets)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = OFFSETS_COLUMN_MAJOR_UPPER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (column-major, lower, offsets)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = OFFSETS_COLUMN_MAJOR_LOWER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (row-major, upper, mixed strides)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = MIXED_STRIDES_ROW_MAJOR_UPPER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (row-major, lower, mixed strides)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = MIXED_STRIDES_ROW_MAJOR_LOWER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (column-major, upper, mixed strides)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = MIXED_STRIDES_COLUMN_MAJOR_UPPER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (column-major, lower, mixed strides)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = MIXED_STRIDES_COLUMN_MAJOR_LOWER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (row-major, upper, negative strides)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = NEGATIVE_STRIDES_ROW_MAJOR_UPPER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (row-major, lower, negative strides)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = NEGATIVE_STRIDES_ROW_MAJOR_LOWER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (column-major, upper, negative strides)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = NEGATIVE_STRIDES_COLUMN_MAJOR_UPPER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (column-major, lower, negative strides)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = NEGATIVE_STRIDES_COLUMN_MAJOR_LOWER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (row-major, upper, large strides)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = LARGE_STRIDES_ROW_MAJOR_UPPER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (row-major, lower, large strides)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = LARGE_STRIDES_ROW_MAJOR_LOWER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (column-major, upper, large strides)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = LARGE_STRIDES_COLUMN_MAJOR_UPPER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (column-major, lower, large strides)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = LARGE_STRIDES_COLUMN_MAJOR_LOWER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (largest matrix entry too large, upper)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = AMAX_LARGE_UPPER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (largest matrix entry too large, lower)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = AMAX_LARGE_LOWER; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function equilibrates a symmetric matrix (largest matrix entry too small)', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = AMAX_SMALL; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, data.equed, 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function does not equilibrate a symmetric matrix if equilibration is not needed', function test( t ) { + var expected; + var equed; + var data; + var A; + var S; + + data = NO_EQUILIBRATION; + + A = new Float64Array( data.A ); + S = new Float64Array( data.S ); + + equed = dlaqsy( data.uplo, data.N, A, data.strideA1, data.strideA2, data.offsetA, S, data.strideS, data.offsetS, data.scond, data.amax ); + expected = new Float64Array( data.A_out ); + + t.strictEqual( equed, 'N', 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +}); + +tape( 'the function returns `N` and leaves the input matrix unchanged if `N` is equal to zero', function test( t ) { + var expected; + var equed; + var A; + var S; + + A = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + S = new Float64Array( [ 0.1, 10.0 ] ); + expected = new Float64Array( [ 1.0, 2.0, 3.0, 4.0 ] ); + + equed = dlaqsy( 'upper', 0, A, 2, 1, 0, S, 1, 0, 0.01, 4.0 ); + t.strictEqual( equed, 'N', 'returns expected value' ); + t.deepEqual( A, expected, 'returns expected value' ); + t.end(); +});