diff --git a/lib/node_modules/@stdlib/lapack/base/dgttrf/test/test.js b/lib/node_modules/@stdlib/lapack/base/dgttrf/test/test.js index 5824cbe780af..40020a722507 100644 --- a/lib/node_modules/@stdlib/lapack/base/dgttrf/test/test.js +++ b/lib/node_modules/@stdlib/lapack/base/dgttrf/test/test.js @@ -1,7 +1,7 @@ /** * @license Apache-2.0 * -* Copyright (c) 2025 The Stdlib Authors. +* 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. diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/README.md b/lib/node_modules/@stdlib/lapack/base/dlasq6/README.md new file mode 100644 index 000000000000..2853a799299c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/README.md @@ -0,0 +1,262 @@ + + +# dlasq6 + +> Compute one dqd transform in ping-pong form. + +
+ +The `dlasq6` routine computes one dqd (shift equal to zero) transform in ping-pong form. This routine performs one dqd transform, updates the `Z` ( QD ) array in place, and returns the values `DMIN`, `DMIN1`, `DMIN2`, `DN`, `DNM1`, and `DNM2`. + +Where: + +- `d` is the current transformed diagonal element of the implicit tridiagonal matrix during iteration. +- `DMIN` is the minimum value of `d` over the whole transform. +- `DMIN1` is the minimum value of `d`, excluding `d[ N0 ]`. +- `DMIN2` is the minimum value of `d`, excluding `d[ N0 ]` and `d[ N0-1 ]`. +- `DN` is the final value `d[ N0 ]`. +- `DNM1` is the value `d[ N0-1 ]`. +- `DNM2` is the value `d[ N0-2 ]`. + +
+ + + +
+ +## Usage + +```javascript +var dlasq6 = require( '@stdlib/lapack/base/dlasq6' ); +``` + +#### dlasq6( I0, N0, Z, PP, out ) + +Computes one dqd transform in ping-pong form. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var out = new Float64Array( 6 ); +var Z = new Float64Array( [5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0] ); + +var v = dlasq6( 0, 3, Z, 0, out ); +// returns [ 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] + +var bool = ( v === out ); +// returns true +``` + +The function has the following parameters: + +- **I0**: the first index. +- **N0**: the last index. +- **Z**: [`Float64Array`][@stdlib/array/float64] QD array. +- **PP**: ping-pong flag, where `0` corresponds to ping and `1` corresponds to pong. +- **out**: [`Float64Array`][@stdlib/array/float64] output array containing `DMIN`, `DMIN1`, `DMIN2`, `DN`, `DNM1`, and `DNM2` respectively. + +On return, `Z` is updated in place and `out` contains the final scalar values from the transform. + +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 Z0 = new Float64Array( [0, 5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0] ); // eslint-disable-line max-len +var out0 = new Float64Array( 7 ); + +// Create offset views... +var Z = new Float64Array( Z0.buffer, Z0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var out = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +dlasq6( 0, 3, Z, 0, out ); +// out0 => [ 0.0, 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] +``` + +#### dlasq6.ndarray( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ) + +Computes one dqd transform in ping-pong form using alternative indexing semantics. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var out = new Float64Array( 6 ); +var Z = new Float64Array( [5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0] ); + +dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, 0 ); +// out => [ 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] +``` + +The function has the following additional parameters: + +- **strideZ**: stride length for `Z`. +- **offsetZ**: starting index for `Z`. +- **strideOut**: stride length for `out`. +- **offsetOut**: starting index for `out`. + +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 out = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ] ); +var Z = new Float64Array( [5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0] ); + +dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, 0 ); +// out => [ 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] +``` + +
+ + + +
+ +## Notes + +- `dlasq6()` corresponds to the [LAPACK][LAPACK] routine [`dlasq6`][lapack-dlasq6]. + +
+ + + +
+ +## Examples + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var dlasq6 = require( '@stdlib/lapack/base/dlasq6' ); + +var Z = new Float64Array( [6, 0, 3, 0, 8, 0, 2, 0, 10, 0, 4, 0, 18, 0, 0, 0] ); +var out = new Float64Array( 6 ); + +dlasq6( 0, 3, Z, 0, out ); +console.log( out ); + +// Redefine the `Z` array as it gets updated. +Z = new Float64Array( [6, 0, 3, 0, 8, 0, 2, 0, 10, 0, 4, 0, 18, 0, 0, 0] ); + +dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, 0 ); +console.log( out ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/benchmark/benchmark.js b/lib/node_modules/@stdlib/lapack/base/dlasq6/benchmark/benchmark.js new file mode 100644 index 000000000000..011b6446391d --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/benchmark/benchmark.js @@ -0,0 +1,108 @@ +/** +* @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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dlasq6 = require( './../lib/dlasq6.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var out = new Float64Array( 6 ); + var N0 = floor( (len / 4) - 1 ); + var N = len; + var Z = uniform( N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = dlasq6( 0, N0, Z, 0, out, 1, 0 ); + if ( isnan( out[ i%6 ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlasq6/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..e8fad5e999a8 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/benchmark/benchmark.ndarray.js @@ -0,0 +1,108 @@ +/** +* @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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var Float64Array = require( '@stdlib/array/float64' ); +var format = require( '@stdlib/string/format' ); +var pkg = require( './../package.json' ).name; +var dlasq6 = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} len - array length +* @returns {Function} benchmark function +*/ +function createBenchmark( len ) { + var out = new Float64Array( 6 ); + var N0 = floor( (len / 4) - 1 ); + var N = len; + var Z = uniform( N, -10.0, 10.0, options ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var y; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + y = dlasq6( 0, N0, Z, 1, 0, 0, out, 1, 0 ); + if ( isnan( out[ i%6 ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( y ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var len; + var min; + var max; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + len = pow( 10, i ); + f = createBenchmark( len ); + bench( format( '%s:ndarray:len=%d', pkg, len ), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/dlasq6/docs/repl.txt new file mode 100644 index 000000000000..aeebb51dd5a7 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/docs/repl.txt @@ -0,0 +1,102 @@ + +{{alias}}( I0, N0, Z, PP, out ) + Computes one dqd transform in ping-pong form. + + Indexing is relative to the first index. To introduce an offset, + use typed array views. + + Parameters + ---------- + I0: number + The first index. + + N0: number + The last index. + + Z: Float64Array + The QD array. + + PP: boolean + The ping-pong flag. + + out: Float64Array + Output array containing `DMIN`, `DMIN1`, `DMIN2`, + `DN`, `DNM1`, and `DNM2` respectively. + + Returns + ------- + out: Float64Array + Output array. + + Examples + -------- + > var out = new {{alias:@stdlib/array/float64}}( 6 ); + > var Z = new {{alias:@stdlib/array/float64}}( [5,0,7,0,9,0,3,0,11,0,4,0,20,0,0,0] ); + > {{alias}}( 0, 3, Z, 0, out ); + > out + [ 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] + + // Using typed array views: + > var Z0 = new {{alias:@stdlib/array/float64}}( [0,5,0,7,0,9,0,3,0,11,0,4,0,20,0,0,0] ); + > var out0 = new {{alias:@stdlib/array/float64}}( 7 ); + > Z = new Float64Array( Z0.buffer, Z0.BYTES_PER_ELEMENT*1 ); + > out = new Float64Array( out0.buffer, out0.BYTES_PER_ELEMENT*1 ); + > {{alias}}( 0, 3, Z, 0, out ); + > out0 + [ 0, 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] + + +{{alias}}.ndarray( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ) + Computes one dqd transform in ping-pong form using alternative + indexing semantics. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameter support indexing semantics based on + a starting index. + + Parameters + ---------- + I0: number + The first index. + + N0: number + The last index. + + Z: Float64Array + The QD array. + + strideZ: integer + Stride length for `Z`. + + offsetZ: integer + Starting index for `Z`. + + PP: boolean + The ping-pong flag. + + out: Float64Array + Output array containing `DMIN`, `DMIN1`, `DMIN2`, + `DN`, `DNM1`, and `DNM2` respectively. + + strideOut: integer + Stride length for `out`. + + offsetOut: integer + Starting index for `out`. + + Returns + ------- + out: Float64Array + Output array. + + Examples + -------- + > var out = new {{alias:@stdlib/array/float64}}( 6 ); + > var Z = new {{alias:@stdlib/array/float64}}( [5,0,7,0,9,0,3,0,11,0,4,0,20,0,0,0] ); + > {{alias}}.ndarray( 0, 3, Z, 1, 0, 0, out, 1, 0 ); + > out + [ 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] + + See Also + -------- + diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/dlasq6/docs/types/index.d.ts new file mode 100644 index 000000000000..c42e72cf31fe --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/docs/types/index.d.ts @@ -0,0 +1,120 @@ +/* +* @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 + +/** +* Interface describing `dlasq6`. +*/ +interface Routine { + /** + * Computes one dqd transform in ping-pong form. + * + * ## Notes + * + * - Z is a 1-D array of length >= 4*N0 storing interleaved q/e values. + * - PP is 0 for ping, 1 for pong. + * + * @param {integer} I0 - the first index + * @param {integer} N0 - the last index + * @param {Float64Array} Z - the QD array + * @param {boolean} PP - ping-pong flag (0 or 1) + * @param {Float64Array} out - output array containing `DMIN`, `DMIN1`, `DMIN2`, `DN`, `DNM1`, and `DNM2` respectively + * @returns {Float64Array} output array + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var out = new Float64Array( 6 ); + * var Z = new Float64Array( [ 5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0 ] ); + * + * dlasq6( 0, 3, Z, 0, out ); + * // out => [ 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] + */ + ( I0: number, N0: number, Z: Float64Array, PP: boolean, out: Float64Array ): Float64Array; + + /** + * Computes one dqd transform in ping-pong form using alternative indexing semantics. + * + * ## Notes + * + * - Z is a 1-D array of length >= 4*N0 storing interleaved q/e values. + * - PP is 0 for ping, 1 for pong. + * + * @param {integer} I0 - the first index + * @param {integer} N0 - the last index + * @param {Float64Array} Z - the QD array + * @param {integer} strideZ - stride length for `z` + * @param {NonNegativeInteger} offsetZ - starting index for `z` + * @param {boolean} PP - ping-pong flag (0 or 1) + * @param {Float64Array} out - output array containing `DMIN`, `DMIN1`, `DMIN2`, `DN`, `DNM1`, and `DNM2` respectively + * @param {integer} strideOut - stride length for `out` + * @param {NonNegativeInteger} offsetOut - starting index of `out` + * @returns {Float64Array} output array + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var out = new Float64Array( 6 ); + * var Z = new Float64Array( [ 5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0 ] ); + * + * dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, 0 ); + * // out => [ 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] + */ + ndarray( I0: number, N0: number, Z: Float64Array, strideZ: number, offsetZ: number, PP: boolean, out: Float64Array, strideOut: number, offsetOut: number ): Float64Array; +} + +/** +* LAPACK routine to compute one dqd transform in ping-pong form. +* +* ## Notes +* +* - Z is a 1-D array of length >= 4*N0 storing interleaved q/e values. +* - PP is 0 for ping, 1 for pong. +* +* @param {integer} I0 - the first index +* @param {integer} N0 - the last index +* @param {Float64Array} Z - the QD array +* @param {boolean} PP - ping-pong flag (0 or 1) +* @param {Float64Array} out - output array containing `DMIN`, `DMIN1`, `DMIN2`, `DN`, `DNM1`, and `DNM2` respectively +* @returns {Float64Array} output array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var out = new Float64Array( 6 ); +* var Z = new Float64Array( [ 5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0 ] ); +* +* dlasq6( 0, 3, Z, 0, out ); +* // out => [ 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var out = new Float64Array( 6 ); +* var Z = new Float64Array( [ 5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0 ] ); +* +* dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, 0 ); +* // out => [ 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] +*/ +declare var dlasq6: Routine; + + +// EXPORTS // + +export = dlasq6; diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/docs/types/test.ts b/lib/node_modules/@stdlib/lapack/base/dlasq6/docs/types/test.ts new file mode 100644 index 000000000000..9f222e54bf6b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/docs/types/test.ts @@ -0,0 +1,277 @@ +/* +* @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 dlasq6 = require( './index' ); + +// TESTS // + +// The function returns a Float64Array... +{ + const Z = new Float64Array( [ 5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0 ] ); + const out = new Float64Array( 6 ); + + dlasq6( 0, 3, Z, 0, out ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const Z = new Float64Array( 16 ); + const out = new Float64Array( 6 ); + + dlasq6( '5', 3, Z, 0, out ); // $ExpectError + dlasq6( true, 3, Z, 0, out ); // $ExpectError + dlasq6( false, 3, Z, 0, out ); // $ExpectError + dlasq6( null, 3, Z, 0, out ); // $ExpectError + dlasq6( undefined, 3, Z, 0, out ); // $ExpectError + dlasq6( [], 3, Z, 0, out ); // $ExpectError + dlasq6( {}, 3, Z, 0, out ); // $ExpectError + dlasq6( ( x: number ): number => x, 3, Z, 0, out ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const Z = new Float64Array( 16 ); + const out = new Float64Array( 6 ); + + dlasq6( 0, '5', Z, 0, out ); // $ExpectError + dlasq6( 0, true, Z, 0, out ); // $ExpectError + dlasq6( 0, false, Z, 0, out ); // $ExpectError + dlasq6( 0, null, Z, 0, out ); // $ExpectError + dlasq6( 0, undefined, Z, 0, out ); // $ExpectError + dlasq6( 0, [], Z, 0, out ); // $ExpectError + dlasq6( 0, {}, Z, 0, out ); // $ExpectError + dlasq6( 0, ( x: number ): number => x, Z, 0, out ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a Float64Array... +{ + const out = new Float64Array( 6 ); + + dlasq6( 0, 3, '5', 0, out ); // $ExpectError + dlasq6( 0, 3, 5, 0, out ); // $ExpectError + dlasq6( 0, 3, true, 0, out ); // $ExpectError + dlasq6( 0, 3, false, 0, out ); // $ExpectError + dlasq6( 0, 3, null, 0, out ); // $ExpectError + dlasq6( 0, 3, undefined, 0, out ); // $ExpectError + dlasq6( 0, 3, [], 0, out ); // $ExpectError + dlasq6( 0, 3, {}, 0, out ); // $ExpectError + dlasq6( 0, 3, ( x: number ): number => x, 0, out ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const Z = new Float64Array( 16 ); + const out = new Float64Array( 6 ); + + dlasq6( 0, 3, Z, '5', out ); // $ExpectError + dlasq6( 0, 3, Z, 5, out ); // $ExpectError + dlasq6( 0, 3, Z, null, out ); // $ExpectError + dlasq6( 0, 3, Z, undefined, out ); // $ExpectError + dlasq6( 0, 3, Z, [], out ); // $ExpectError + dlasq6( 0, 3, Z, {}, out ); // $ExpectError + dlasq6( 0, 3, Z, ( x: number ): number => x, out ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a Float64Array... +{ + const Z = new Float64Array( 16 ); + + dlasq6( 0, 3, Z, 0, '5' ); // $ExpectError + dlasq6( 0, 3, Z, 0, 5 ); // $ExpectError + dlasq6( 0, 3, Z, 0, true ); // $ExpectError + dlasq6( 0, 3, Z, 0, false ); // $ExpectError + dlasq6( 0, 3, Z, 0, null ); // $ExpectError + dlasq6( 0, 3, Z, 0, undefined ); // $ExpectError + dlasq6( 0, 3, Z, 0, [] ); // $ExpectError + dlasq6( 0, 3, Z, 0, {} ); // $ExpectError + dlasq6( 0, 3, Z, 0, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const Z = new Float64Array( 16 ); + const out = new Float64Array( 6 ); + + dlasq6(); // $ExpectError + dlasq6( 0 ); // $ExpectError + dlasq6( 0, 3 ); // $ExpectError + dlasq6( 0, 3, Z ); // $ExpectError + dlasq6( 0, 3, Z, 0 ); // $ExpectError + dlasq6( 0, 3, Z, 0, out, 1 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Float64Array... +{ + const Z = new Float64Array( [ 5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0 ] ); + const out = new Float64Array( 6 ); + + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, 0 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a number... +{ + const Z = new Float64Array( 16 ); + const out = new Float64Array( 6 ); + + dlasq6.ndarray( '5', 3, Z, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( true, 3, Z, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( false, 3, Z, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( null, 3, Z, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( undefined, 3, Z, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( [], 3, Z, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( {}, 3, Z, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( ( x: number ): number => x, 3, Z, 1, 0, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const Z = new Float64Array( 16 ); + const out = new Float64Array( 6 ); + + dlasq6.ndarray( 0, '5', Z, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, true, Z, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, false, Z, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, null, Z, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, undefined, Z, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, [], Z, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, {}, Z, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, ( x: number ): number => x, Z, 1, 0, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a Float64Array... +{ + const out = new Float64Array( 6 ); + + dlasq6.ndarray( 0, 3, '5', 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, 5, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, true, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, false, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, null, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, undefined, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, [], 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, {}, 1, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, ( x: number ): number => x, 1, 0, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a number... +{ + const Z = new Float64Array( 16 ); + const out = new Float64Array( 6 ); + + dlasq6.ndarray( 0, 3, Z, '5', 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, true, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, false, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, null, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, undefined, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, [], 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, {}, 0, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, ( x: number ): number => x, 0, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const Z = new Float64Array( 16 ); + const out = new Float64Array( 6 ); + + dlasq6.ndarray( 0, 3, Z, 1, '5', 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, true, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, false, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, null, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, undefined, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, [], 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, {}, 0, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, ( x: number ): number => x, 0, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const Z = new Float64Array( 16 ); + const out = new Float64Array( 6 ); + + dlasq6.ndarray( 0, 3, Z, 1, 0, '5', out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 5, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, null, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, undefined, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, [], out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, {}, out, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, ( x: number ): number => x, out, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a Float64Array... +{ + const Z = new Float64Array( 16 ); + + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, '5', 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, 5, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, true, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, false, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, null, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, undefined, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, [], 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, {}, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a number... +{ + const Z = new Float64Array( 16 ); + const out = new Float64Array( 6 ); + + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, '5', 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, true, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, false, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, null, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, undefined, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, [], 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, {}, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a number... +{ + const Z = new Float64Array( 16 ); + const out = new Float64Array( 6 ); + + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, '5' ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, true ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, false ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, null ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, undefined ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, [] ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, {} ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const Z = new Float64Array( 16 ); + const out = new Float64Array( 6 ); + + dlasq6.ndarray(); // $ExpectError + dlasq6.ndarray( 0 ); // $ExpectError + dlasq6.ndarray( 0, 3 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1 ); // $ExpectError + dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/examples/index.js b/lib/node_modules/@stdlib/lapack/base/dlasq6/examples/index.js new file mode 100644 index 000000000000..764766f50171 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/examples/index.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'; + +var Float64Array = require( '@stdlib/array/float64' ); +var dlasq6 = require( './../lib/' ); + +var Z = new Float64Array( [ 6, 0, 3, 0, 8, 0, 2, 0, 10, 0, 4, 0, 18, 0, 0, 0 ] ); + +var out = new Float64Array( 6 ); + +dlasq6( 0, 3, Z, 0, out ); +console.log( out ); + +// Redefine the `Z` array as it gets updated. +Z = new Float64Array( [ 6, 0, 3, 0, 8, 0, 2, 0, 10, 0, 4, 0, 18, 0, 0, 0 ] ); + +dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, 0 ); +console.log( out ); diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/lib/base.js b/lib/node_modules/@stdlib/lapack/base/dlasq6/lib/base.js new file mode 100644 index 000000000000..e56a30fb9482 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/lib/base.js @@ -0,0 +1,199 @@ +/** +* @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 dlamch = require( '@stdlib/lapack/base/dlamch' ); +var min = require( '@stdlib/math/base/special/min' ); + + +// VARIABLES // + +var SFMIN = dlamch( 'S' ); + + +// MAIN // + +/** +* Computes one dqd transform in ping-pong form. +* +* ## Notes +* +* - Z is a 1-D array of length >= 4*N0 storing interleaved q/e values. +* - PP is 0 for ping, 1 for pong. +* +* @private +* @param {integer} I0 - the first index +* @param {integer} N0 - the last index +* @param {Float64Array} Z - the QD array +* @param {integer} strideZ - stride length for `z` +* @param {NonNegativeInteger} offsetZ - starting index for `z` +* @param {boolean} PP - ping-pong flag (0 or 1) +* @param {Float64Array} out - output array containing `DMIN`, `DMIN1`, `DMIN2`, `DN`, `DNM1`, and `DNM2` respectively +* @param {integer} strideOut - stride length for `out` +* @param {NonNegativeInteger} offsetOut - starting index of `out` +* @returns {Float64Array} output array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var out = new Float64Array( 6 ); +* var Z = new Float64Array( [ 5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0 ] ); +* +* dlasq6( 0, 3, Z, 1, 0, 0, out, 1, 0 ); +* // out => [ 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] +*/ +function dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ) { + var dmin1; + var dmin2; + var dnm1; + var dnm2; + var emin; + var dmin; + var temp; + var j4p2; + var idx; + var j4; + var dn; + var d; + + // Quick return... + if ( ( N0 - I0 - 1 ) <= 0 ) { + return out; + } + + idx = offsetZ; + + j4 = offsetZ + ( strideZ*( ( 4*I0 ) + PP ) ); + emin = Z[ j4 + ( 4*strideZ ) ]; + d = Z[ j4 ]; + dmin = d; + + j4 = offsetZ + ( strideZ*( ( 4*I0 ) + 3 ) ); + + if ( PP === 0 ) { + for ( idx = ( 4*I0 ) + 3; idx <= ( 4*N0 ) - 9; idx += 4 ) { + Z[ j4 - ( 2*strideZ ) ] = d + Z[ j4 - strideZ ]; + if ( Z[ j4 - ( 2*strideZ ) ] === 0 ) { + Z[ j4 ] = 0; + d = Z[ j4 + strideZ ]; + dmin = d; + emin = 0; + } else if ( ( SFMIN*Z[ j4 + strideZ ] < Z[ j4 - ( 2*strideZ ) ] ) && + ( SFMIN*Z[ j4 - ( 2*strideZ ) ] < Z[ j4 + strideZ ] ) ) { + temp = Z[ j4 + strideZ ] / Z[ j4 - ( 2*strideZ ) ]; + Z[ j4 ] = Z[ j4 - strideZ ]*temp; + d *= temp; + } else { + Z[ j4 ] = Z[ j4 + strideZ ]*( Z[ j4 - strideZ ] / Z[ j4 - ( 2*strideZ ) ] ); + d = Z[ j4 + strideZ ]*( d / Z[ j4 - ( 2*strideZ ) ] ); + } + dmin = min( dmin, d ); + emin = min( emin, Z[ j4 ] ); + j4 += 4*strideZ; + } + } else { + for ( idx = ( 4*I0 ) + 3; idx <= ( 4*N0 ) - 9; idx += 4 ) { + Z[ j4 - ( 3*strideZ ) ] = d + Z[ j4 ]; + if ( Z[ j4 - ( 3*strideZ ) ] === 0 ) { + Z[ j4 - strideZ ] = 0; + d = Z[ j4 + ( 2*strideZ ) ]; + dmin = d; + emin = 0; + } else if ( ( SFMIN*Z[ j4 + ( 2*strideZ ) ] < Z[ j4 - ( 3*strideZ ) ] ) && + ( SFMIN*Z[ j4 - ( 3*strideZ ) ] < Z[ j4 + ( 2*strideZ ) ] ) ) { + temp = Z[ j4 + ( 2*strideZ ) ] / Z[ j4 - ( 3*strideZ ) ]; + Z[ j4 - strideZ ] = Z[ j4 ]*temp; + d *= temp; + } else { + Z[ j4 - strideZ ] = Z[ j4 + ( 2*strideZ ) ]*( Z[ j4 ] / Z[ j4 - ( 3*strideZ ) ] ); + d = Z[ j4 + ( 2*strideZ ) ]*( d / Z[ j4 - ( 3*strideZ ) ] ); + } + dmin = min( dmin, d ); + emin = min( emin, Z[ j4 - strideZ ] ); + j4 += 4*strideZ; + } + } + + // Unroll last two steps. + dnm2 = d; + dmin2 = dmin; + j4 = offsetZ + ( strideZ*( ( 4*N0 ) - 5 - PP ) ); + j4p2 = j4 + ( strideZ*( ( 2*PP ) - 1 ) ); + Z[ j4 - ( 2*strideZ ) ] = dnm2 + Z[ j4p2 ]; + if ( Z[ j4 - ( 2*strideZ ) ] === 0 ) { + Z[ j4 ] = 0; + dnm1 = Z[ j4p2 + ( 2*strideZ ) ]; + dmin = dnm1; + emin = 0; + } else if ( ( SFMIN*Z[ j4p2 + ( 2*strideZ ) ] < Z[ j4 - ( 2*strideZ ) ] ) && + ( SFMIN*Z[ j4 - ( 2*strideZ ) ] < Z[ j4p2 + ( 2*strideZ ) ] ) ) { + temp = Z[ j4p2 + ( 2*strideZ ) ] / Z[ j4 - ( 2*strideZ ) ]; + Z[ j4 ] = Z[ j4p2 ]*temp; + dnm1 = dnm2*temp; + } else { + Z[ j4 ] = Z[ j4p2 + ( 2*strideZ ) ]*( Z[ j4p2 ] / Z[ j4 - ( 2*strideZ ) ] ); + dnm1 = Z[ j4p2 + ( 2*strideZ ) ]*( dnm2 / Z[ j4 - ( 2*strideZ ) ] ); + } + dmin = min( dmin, dnm1 ); + + dmin1 = dmin; + j4 += 4*strideZ; + j4p2 = j4 + ( strideZ*( ( 2*PP ) - 1 ) ); + Z[ j4 - ( 2*strideZ ) ] = dnm1 + Z[ j4p2 ]; + if ( Z[ j4 - ( 2*strideZ ) ] === 0 ) { + Z[ j4 ] = 0; + dn = Z[ j4p2 + ( 2*strideZ ) ]; + dmin = dn; + emin = 0; + } else if ( ( SFMIN*Z[ j4p2 + ( 2*strideZ ) ] < Z[ j4 - ( 2*strideZ ) ] ) && + ( SFMIN*Z[ j4 - ( 2*strideZ ) ] < Z[ j4p2 + ( 2*strideZ ) ] ) ) { + temp = Z[ j4p2 + ( 2*strideZ ) ] / Z[ j4 - ( 2*strideZ ) ]; + Z[ j4 ] = Z[ j4p2 ]*temp; + dn = dnm1*temp; + } else { + Z[ j4 ] = Z[ j4p2 + ( 2*strideZ ) ]*( Z[ j4p2 ] / Z[ j4 - ( 2*strideZ ) ] ); + dn = Z[ j4p2 + ( 2*strideZ ) ]*( dnm1 / Z[ j4 - ( 2*strideZ ) ] ); + } + dmin = min( dmin, dn ); + + Z[ j4 + ( 2*strideZ ) ] = dn; + Z[ offsetZ + ( strideZ*( ( 4*( N0 ) ) + 3 - PP ) ) ] = emin; + + idx = offsetOut; + out[ idx ] = dmin; + idx += strideOut; + out[ idx ] = dmin1; + idx += strideOut; + out[ idx ] = dmin2; + idx += strideOut; + out[ idx ] = dn; + idx += strideOut; + out[ idx ] = dnm1; + idx += strideOut; + out[ idx ] = dnm2; + + return out; +} + + +// EXPORTS // + +module.exports = dlasq6; diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/lib/dlasq6.js b/lib/node_modules/@stdlib/lapack/base/dlasq6/lib/dlasq6.js new file mode 100644 index 000000000000..88d1ee79112c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/lib/dlasq6.js @@ -0,0 +1,59 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 base = require( './base.js' ); + + +// MAIN // + +/** +* Computes one dqd transform in ping-pong form. +* +* ## Notes +* +* - Z is a 1-D array of length >= 4*N0 storing interleaved q/e values. +* - PP is 0 for ping, 1 for pong. +* +* @param {integer} I0 - the first index +* @param {integer} N0 - the last index +* @param {Float64Array} Z - the QD array +* @param {boolean} PP - ping-pong flag (0 or 1) +* @param {Float64Array} out - output array containing `DMIN`, `DMIN1`, `DMIN2`, `DN`, `DNM1`, and `DNM2` respectively +* @returns {Float64Array} output array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var out = new Float64Array( 6 ); +* var Z = new Float64Array( [ 5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0 ] ); +* +* dlasq6( 0, 3, Z, 0, out ); +* // out => [ 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] +*/ +function dlasq6( I0, N0, Z, PP, out ) { + return base( I0, N0, Z, 1, 0, PP, out, 1, 0 ); +} + + +// EXPORTS // + +module.exports = dlasq6; diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/lib/index.js b/lib/node_modules/@stdlib/lapack/base/dlasq6/lib/index.js new file mode 100644 index 000000000000..eebc99c42290 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/lib/index.js @@ -0,0 +1,76 @@ +/** +* @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'; + +/** +* Compute one dqd transform in ping-pong form. +* +* ## Notes +* +* - Z is a 1-D array of length >= 4*N0 storing interleaved q/e values. +* - PP is 0 for ping, 1 for pong. +* +* @module @stdlib/lapack/base/dlasq6 +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dlasq6 = require( '@stdlib/lapack/base/dlasq6' ); +* +* var out = new Float64Array( 6 ); +* var Z = new Float64Array( [ 5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0 ] ); +* +* dlasq6( 0, 3, Z, 0, out ); +* // out => [ 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dlasq6 = require( '@stdlib/lapack/base/dlasq6' ); +* +* var out = new Float64Array( 6 ); +* var Z = new Float64Array( [ 5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0 ] ); +* +* dlasq6.ndarray( 0, 3, Z, 1, 0, 0, out, 1, 0 ); +* // out => [ 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] +*/ + + +// 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 dlasq6; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dlasq6 = main; +} else { + dlasq6 = tmp; +} + + +// EXPORTS // + +module.exports = dlasq6; + +// exports: { "ndarray": "dlasq6.ndarray" } diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/lib/main.js b/lib/node_modules/@stdlib/lapack/base/dlasq6/lib/main.js new file mode 100644 index 000000000000..14753c0bb9ca --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/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 dlasq6 = require( './dlasq6.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dlasq6, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dlasq6; diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/lib/ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlasq6/lib/ndarray.js new file mode 100644 index 000000000000..0df9fd020f06 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/lib/ndarray.js @@ -0,0 +1,63 @@ +/** +* @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 base = require( './base.js' ); + + +// MAIN // + +/** +* Computes one dqd transform in ping-pong form using alternative indexing semantics. +* +* ## Notes +* +* - Z is a 1-D array of length >= 4*N0 storing interleaved q/e values. +* - PP is 0 for ping, 1 for pong. +* +* @param {integer} I0 - the first index +* @param {integer} N0 - the last index +* @param {Float64Array} Z - the QD array +* @param {integer} strideZ - stride length for `z` +* @param {NonNegativeInteger} offsetZ - starting index for `z` +* @param {boolean} PP - ping-pong flag (0 or 1) +* @param {Float64Array} out - output array containing `DMIN`, `DMIN1`, `DMIN2`, `DN`, `DNM1`, and `DNM2` respectively +* @param {integer} strideOut - stride length for `out` +* @param {NonNegativeInteger} offsetOut - starting index of `out` +* @returns {Float64Array} output array +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var out = new Float64Array( 6 ); +* var Z = new Float64Array( [ 5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0 ] ); +* +* dlasq6( 0, 3, Z, 1, 0, 0, out, 1, 0 ); +* // out => [ 3.75, 3.75, 3.75, ~12.088, ~6.111, 3.75 ] +*/ +function dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ) { + return base( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); +} + + +// EXPORTS // + +module.exports = dlasq6; diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/package.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/package.json new file mode 100644 index 000000000000..0fdabdbced7f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/package.json @@ -0,0 +1,72 @@ +{ + "name": "@stdlib/lapack/base/dlasq6", + "version": "0.0.0", + "description": "Compute the one dqd transform in ping-pong form.", + "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", + "svd", + "decomposition", + "dlasq6", + "exchange", + "permute", + "permutedims", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "float64", + "double", + "float64array" + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/div_fallback_ping.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/div_fallback_ping.json new file mode 100644 index 000000000000..b4784c8ef6cd --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/div_fallback_ping.json @@ -0,0 +1,18 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ 1e-320, 0, 0, 0, 1, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0 ], + "strideZ": 1, + "offsetZ": 0, + "PP": 0, + "strideOut": 1, + "offsetOut": 0, + "expectedOut": [ + 9.9998886718268301e-321, + 9.9998886718268301e-321, + 9.9998886718268301e-321, + 8.1481481481481470, + 2.7500000000000000, + 1.0000000000000000 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/div_fallback_pong.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/div_fallback_pong.json new file mode 100644 index 000000000000..961cac196282 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/div_fallback_pong.json @@ -0,0 +1,18 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ 0, 1e-320, 0, 0, 0, 1, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0 ], + "strideZ": 1, + "offsetZ": 0, + "PP": 1, + "strideOut": 1, + "offsetOut": 0, + "expectedOut": [ + 9.9998886718268301e-321, + 9.9998886718268301e-321, + 9.9998886718268301e-321, + 8.1481481481481470, + 2.7500000000000000, + 1.0000000000000000 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/div_fallback_ping.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/div_fallback_ping.json new file mode 100644 index 000000000000..bc874ede0829 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/div_fallback_ping.json @@ -0,0 +1,57 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 1e-320, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 1, + 9999, + 0, + 9999, + 3, + 9999, + 0, + 9999, + 11, + 9999, + 0, + 9999, + 4, + 9999, + 0, + 9999, + 20, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideZ": 2, + "offsetZ": 0, + "PP": 0, + "strideOut": 2, + "offsetOut": 0, + "expectedOut": [ + 1e-320, + 9999, + 1e-320, + 9999, + 1e-320, + 9999, + 8.148148148148147, + 9999, + 2.75, + 9999, + 1, + 9999 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/div_fallback_pong.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/div_fallback_pong.json new file mode 100644 index 000000000000..cd858cf8ecd0 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/div_fallback_pong.json @@ -0,0 +1,57 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 0, + 9999, + 1e-320, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 1, + 9999, + 0, + 9999, + 3, + 9999, + 0, + 9999, + 11, + 9999, + 0, + 9999, + 4, + 9999, + 0, + 9999, + 20, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideZ": 2, + "offsetZ": 0, + "PP": 1, + "strideOut": 2, + "offsetOut": 0, + "expectedOut": [ + 1e-320, + 9999, + 1e-320, + 9999, + 1e-320, + 9999, + 8.148148148148147, + 9999, + 2.75, + 9999, + 1, + 9999 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/ping.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/ping.json new file mode 100644 index 000000000000..c0428a81b14f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/ping.json @@ -0,0 +1,57 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 5, + 9999, + 0, + 9999, + 7, + 9999, + 0, + 9999, + 9, + 9999, + 0, + 9999, + 3, + 9999, + 0, + 9999, + 11, + 9999, + 0, + 9999, + 4, + 9999, + 0, + 9999, + 20, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideZ": 2, + "offsetZ": 0, + "PP": 0, + "strideOut": 2, + "offsetOut": 0, + "expectedOut": [ + 3.75, + 9999, + 3.75, + 9999, + 3.75, + 9999, + 12.087912087912088, + 9999, + 6.111111111111111, + 9999, + 3.75, + 9999 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/pong.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/pong.json new file mode 100644 index 000000000000..812811530e6a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/pong.json @@ -0,0 +1,57 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 0, + 9999, + 5, + 9999, + 0, + 9999, + 7, + 9999, + 0, + 9999, + 9, + 9999, + 0, + 9999, + 3, + 9999, + 0, + 9999, + 11, + 9999, + 0, + 9999, + 4, + 9999, + 0, + 9999, + 20, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideZ": 2, + "offsetZ": 0, + "PP": 1, + "strideOut": 2, + "offsetOut": 0, + "expectedOut": [ + 3.75, + 9999, + 3.75, + 9999, + 3.75, + 9999, + 12.087912087912088, + 9999, + 6.111111111111111, + 9999, + 3.75, + 9999 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/quick_ret.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/quick_ret.json new file mode 100644 index 000000000000..01f57d52bcca --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/quick_ret.json @@ -0,0 +1,57 @@ +{ + "I0": 0, + "N0": 1, + "Z": [ + 5, + 9999, + 0, + 9999, + 7, + 9999, + 0, + 9999, + 9, + 9999, + 0, + 9999, + 3, + 9999, + 0, + 9999, + 11, + 9999, + 0, + 9999, + 4, + 9999, + 0, + 9999, + 20, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideZ": 2, + "offsetZ": 0, + "PP": 0, + "strideOut": 2, + "offsetOut": 0, + "expectedOut": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/zero_def_first_unroll.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/zero_def_first_unroll.json new file mode 100644 index 000000000000..218e425e79b6 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/zero_def_first_unroll.json @@ -0,0 +1,57 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 1e-300, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 1e+300, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideZ": 2, + "offsetZ": 0, + "PP": 0, + "strideOut": 2, + "offsetOut": 0, + "expectedOut": [ + 1e-300, + 9999, + 1e-300, + 9999, + 0, + 9999, + 1e+300, + 9999, + 1e-300, + 9999, + 0, + 9999 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/zero_deflation_ping.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/zero_deflation_ping.json new file mode 100644 index 000000000000..770882b07643 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/zero_deflation_ping.json @@ -0,0 +1,57 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 5, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 7, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideZ": 2, + "offsetZ": 0, + "PP": 0, + "strideOut": 2, + "offsetOut": 0, + "expectedOut": [ + 7, + 9999, + 0, + 9999, + 5, + 9999, + 7, + 9999, + 0, + 9999, + 5, + 9999 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/zero_deflation_pong.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/zero_deflation_pong.json new file mode 100644 index 000000000000..2cfe638354a9 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/large_strides/zero_deflation_pong.json @@ -0,0 +1,57 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 5, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999, + 7, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideZ": 2, + "offsetZ": 0, + "PP": 1, + "strideOut": 2, + "offsetOut": 0, + "expectedOut": [ + 7, + 9999, + 0, + 9999, + 5, + 9999, + 7, + 9999, + 0, + 9999, + 5, + 9999 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/div_fallback_ping.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/div_fallback_ping.json new file mode 100644 index 000000000000..ce77fb9085b3 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/div_fallback_ping.json @@ -0,0 +1,36 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 0, + 0, + 0, + 20, + 0, + 4, + 0, + 11, + 0, + 3, + 0, + 1, + 0, + 0, + 0, + 1e-320 + ], + "strideZ": -1, + "offsetZ": 15, + "PP": 0, + "strideOut": -1, + "offsetOut": 5, + "expectedOut": [ + 1, + 2.75, + 8.148148148148147, + 1e-320, + 1e-320, + 1e-320 + ], + "offsetExpectedOut": 5 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/div_fallback_pong.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/div_fallback_pong.json new file mode 100644 index 000000000000..278e4c342880 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/div_fallback_pong.json @@ -0,0 +1,36 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 0, + 0, + 20, + 0, + 4, + 0, + 11, + 0, + 3, + 0, + 1, + 0, + 0, + 0, + 1e-320, + 0 + ], + "strideZ": -1, + "offsetZ": 15, + "PP": 1, + "strideOut": -1, + "offsetOut": 5, + "expectedOut": [ + 1, + 2.75, + 8.148148148148147, + 1e-320, + 1e-320, + 1e-320 + ], + "offsetExpectedOut": 5 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/ping.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/ping.json new file mode 100644 index 000000000000..d22d57179a65 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/ping.json @@ -0,0 +1,36 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 0, + 0, + 0, + 20, + 0, + 4, + 0, + 11, + 0, + 3, + 0, + 9, + 0, + 7, + 0, + 5 + ], + "strideZ": -1, + "offsetZ": 15, + "PP": 0, + "strideOut": -1, + "offsetOut": 5, + "expectedOut": [ + 3.75, + 6.111111111111111, + 12.087912087912088, + 3.75, + 3.75, + 3.75 + ], + "offsetExpectedOut": 5 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/pong.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/pong.json new file mode 100644 index 000000000000..f7c9a042902c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/pong.json @@ -0,0 +1,36 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 0, + 0, + 20, + 0, + 4, + 0, + 11, + 0, + 3, + 0, + 9, + 0, + 7, + 0, + 5, + 0 + ], + "strideZ": -1, + "offsetZ": 15, + "PP": 1, + "strideOut": -1, + "offsetOut": 5, + "expectedOut": [ + 3.75, + 6.111111111111111, + 12.087912087912088, + 3.75, + 3.75, + 3.75 + ], + "offsetExpectedOut": 5 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/quick_ret.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/quick_ret.json new file mode 100644 index 000000000000..52f897ac28a2 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/quick_ret.json @@ -0,0 +1,36 @@ +{ + "I0": 0, + "N0": 1, + "Z": [ + 0, + 0, + 0, + 20, + 0, + 4, + 0, + 11, + 0, + 3, + 0, + 9, + 0, + 7, + 0, + 5 + ], + "strideZ": -1, + "offsetZ": 15, + "PP": 0, + "strideOut": -1, + "offsetOut": 5, + "expectedOut": [ + 0, + 0, + 0, + 0, + 0, + 0 + ], + "offsetExpectedOut": 5 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/zero_def_first_unroll.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/zero_def_first_unroll.json new file mode 100644 index 000000000000..55d9bedb5054 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/zero_def_first_unroll.json @@ -0,0 +1,36 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 0, + 0, + 0, + 1e+300, + 0, + 0, + 0, + 1e-300, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "strideZ": -1, + "offsetZ": 15, + "PP": 0, + "strideOut": -1, + "offsetOut": 5, + "expectedOut": [ + 0, + 1e-300, + 1e+300, + 0, + 1e-300, + 1e-300 + ], + "offsetExpectedOut": 5 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/zero_deflation_ping.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/zero_deflation_ping.json new file mode 100644 index 000000000000..415942c39fb7 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/zero_deflation_ping.json @@ -0,0 +1,36 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 0, + 0, + 0, + 7, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 0, + 0, + 0, + 0 + ], + "strideZ": -1, + "offsetZ": 15, + "PP": 0, + "strideOut": -1, + "offsetOut": 5, + "expectedOut": [ + 5, + 0, + 7, + 5, + 0, + 7 + ], + "offsetExpectedOut": 5 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/zero_deflation_pong.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/zero_deflation_pong.json new file mode 100644 index 000000000000..951c06edbe0e --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/negative_strides/zero_deflation_pong.json @@ -0,0 +1,36 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 0, + 0, + 7, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 5, + 0, + 0, + 0, + 0, + 0 + ], + "strideZ": -1, + "offsetZ": 15, + "PP": 1, + "strideOut": -1, + "offsetOut": 5, + "expectedOut": [ + 5, + 0, + 7, + 5, + 0, + 7 + ], + "offsetExpectedOut": 5 +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/div_fallback_ping.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/div_fallback_ping.json new file mode 100644 index 000000000000..3434ed3fe432 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/div_fallback_ping.json @@ -0,0 +1,37 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 9999, + 1e-320, + 0, + 0, + 0, + 1, + 0, + 3, + 0, + 11, + 0, + 4, + 0, + 20, + 0, + 0, + 0 + ], + "strideZ": 1, + "offsetZ": 1, + "PP": 0, + "strideOut": 1, + "offsetOut": 1, + "expectedOut": [ + 9999, + 1e-320, + 1e-320, + 1e-320, + 8.148148148148147, + 2.75, + 1 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/div_fallback_pong.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/div_fallback_pong.json new file mode 100644 index 000000000000..6e879e4ba914 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/div_fallback_pong.json @@ -0,0 +1,37 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 9999, + 0, + 1e-320, + 0, + 0, + 0, + 1, + 0, + 3, + 0, + 11, + 0, + 4, + 0, + 20, + 0, + 0 + ], + "strideZ": 1, + "offsetZ": 1, + "PP": 1, + "strideOut": 1, + "offsetOut": 1, + "expectedOut": [ + 9999, + 1e-320, + 1e-320, + 1e-320, + 8.148148148148147, + 2.75, + 1 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/ping.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/ping.json new file mode 100644 index 000000000000..111ae628f741 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/ping.json @@ -0,0 +1,37 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 9999, + 5, + 0, + 7, + 0, + 9, + 0, + 3, + 0, + 11, + 0, + 4, + 0, + 20, + 0, + 0, + 0 + ], + "strideZ": 1, + "offsetZ": 1, + "PP": 0, + "strideOut": 1, + "offsetOut": 1, + "expectedOut": [ + 9999, + 3.75, + 3.75, + 3.75, + 12.087912087912088, + 6.111111111111111, + 3.75 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/pong.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/pong.json new file mode 100644 index 000000000000..df2bfd7d3a17 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/pong.json @@ -0,0 +1,37 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 9999, + 0, + 5, + 0, + 7, + 0, + 9, + 0, + 3, + 0, + 11, + 0, + 4, + 0, + 20, + 0, + 0 + ], + "strideZ": 1, + "offsetZ": 1, + "PP": 1, + "strideOut": 1, + "offsetOut": 1, + "expectedOut": [ + 9999, + 3.75, + 3.75, + 3.75, + 12.087912087912088, + 6.111111111111111, + 3.75 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/quick_ret.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/quick_ret.json new file mode 100644 index 000000000000..e0be895408f1 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/quick_ret.json @@ -0,0 +1,37 @@ +{ + "I0": 0, + "N0": 1, + "Z": [ + 9999, + 5, + 0, + 7, + 0, + 9, + 0, + 3, + 0, + 11, + 0, + 4, + 0, + 20, + 0, + 0, + 0 + ], + "strideZ": 1, + "offsetZ": 1, + "PP": 0, + "strideOut": 1, + "offsetOut": 1, + "expectedOut": [ + 9999, + 0, + 0, + 0, + 0, + 0, + 0 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/zero_def_first_unroll.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/zero_def_first_unroll.json new file mode 100644 index 000000000000..fec517f62033 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/zero_def_first_unroll.json @@ -0,0 +1,37 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 9999, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 1e-300, + 0, + 0, + 0, + 1e+300, + 0, + 0, + 0 + ], + "strideZ": 1, + "offsetZ": 1, + "PP": 0, + "strideOut": 1, + "offsetOut": 1, + "expectedOut": [ + 9999, + 1e-300, + 1e-300, + 0, + 1e+300, + 1e-300, + 0 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/zero_deflation_ping.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/zero_deflation_ping.json new file mode 100644 index 000000000000..0a5d6fdc1a27 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/zero_deflation_ping.json @@ -0,0 +1,37 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 9999, + 0, + 0, + 0, + 0, + 5, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 7, + 0, + 0, + 0 + ], + "strideZ": 1, + "offsetZ": 1, + "PP": 0, + "strideOut": 1, + "offsetOut": 1, + "expectedOut": [ + 9999, + 7, + 0, + 5, + 7, + 0, + 5 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/zero_deflation_pong.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/zero_deflation_pong.json new file mode 100644 index 000000000000..e6519ca3f2ad --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/offsets/zero_deflation_pong.json @@ -0,0 +1,37 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ + 9999, + 0, + 0, + 0, + 0, + 0, + 5, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 7, + 0, + 0 + ], + "strideZ": 1, + "offsetZ": 1, + "PP": 1, + "strideOut": 1, + "offsetOut": 1, + "expectedOut": [ + 9999, + 7, + 0, + 5, + 7, + 0, + 5 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/ping.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/ping.json new file mode 100644 index 000000000000..60bd4df320cc --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/ping.json @@ -0,0 +1,18 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ 5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0 ], + "strideZ": 1, + "offsetZ": 0, + "PP": 0, + "strideOut": 1, + "offsetOut": 0, + "expectedOut": [ + 3.7500000000000000, + 3.7500000000000000, + 3.7500000000000000, + 12.087912087912088, + 6.1111111111111107, + 3.7500000000000000 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/pong.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/pong.json new file mode 100644 index 000000000000..7fd14a1c0282 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/pong.json @@ -0,0 +1,18 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ 0, 5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0 ], + "strideZ": 1, + "offsetZ": 0, + "PP": 1, + "strideOut": 1, + "offsetOut": 0, + "expectedOut": [ + 3.7500000000000000, + 3.7500000000000000, + 3.7500000000000000, + 12.087912087912088, + 6.1111111111111107, + 3.7500000000000000 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/quick_ret.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/quick_ret.json new file mode 100644 index 000000000000..c0fcca52e7da --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/quick_ret.json @@ -0,0 +1,18 @@ +{ + "I0": 0, + "N0": 1, + "Z": [ 5, 0, 7, 0, 9, 0, 3, 0, 11, 0, 4, 0, 20, 0, 0, 0 ], + "strideZ": 1, + "offsetZ": 0, + "PP": 0, + "strideOut": 1, + "offsetOut": 0, + "expectedOut": [ + 0, + 0, + 0, + 0, + 0, + 0 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/zero_def_first_unroll.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/zero_def_first_unroll.json new file mode 100644 index 000000000000..3d375c08b263 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/zero_def_first_unroll.json @@ -0,0 +1,18 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ 0, 0, 0, 0, 0, 0, 0, 0, 1e-300, 0, 0, 0, 1e300, 0, 0, 0 ], + "strideZ": 1, + "offsetZ": 0, + "PP": 0, + "strideOut": 1, + "offsetOut": 0, + "expectedOut": [ + 1e-300, + 1e-300, + 0, + 1e300, + 1e-300, + 0 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/zero_deflation_ping.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/zero_deflation_ping.json new file mode 100644 index 000000000000..6f2e42b55cce --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/zero_deflation_ping.json @@ -0,0 +1,18 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0 ], + "strideZ": 1, + "offsetZ": 0, + "PP": 0, + "strideOut": 1, + "offsetOut": 0, + "expectedOut": [ + 7, + 0, + 5, + 7, + 0, + 5 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/zero_deflation_pong.json b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/zero_deflation_pong.json new file mode 100644 index 000000000000..70c48a36be08 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/fixtures/zero_deflation_pong.json @@ -0,0 +1,18 @@ +{ + "I0": 0, + "N0": 3, + "Z": [ 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0 ], + "strideZ": 1, + "offsetZ": 0, + "PP": 1, + "strideOut": 1, + "offsetOut": 0, + "expectedOut": [ + 7, + 0, + 5, + 7, + 0, + 5 + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/test.dlasq6.js b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/test.dlasq6.js new file mode 100644 index 000000000000..353a48e0b667 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/test.dlasq6.js @@ -0,0 +1,219 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value-float64array' ); +var dlasq6 = require( './../lib/dlasq6.js' ); + + +// FIXTURES // + +var PING = require( './fixtures/ping.json' ); +var PONG = require( './fixtures/pong.json' ); +var QUICK_RET = require( './fixtures/quick_ret.json' ); +var ZER_DEF_PING = require( './fixtures/zero_deflation_ping.json' ); +var ZER_DEF_PONG = require( './fixtures/zero_deflation_pong.json' ); +var DIV_FALLBACK_PING = require( './fixtures/div_fallback_ping.json' ); +var DIV_FALLBACK_PONG = require( './fixtures/div_fallback_pong.json' ); +var ZERO_DEF_FIRST_UNROLL = require( './fixtures/zero_def_first_unroll.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dlasq6, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 5', function test( t ) { + t.strictEqual( dlasq6.length, 5, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form', function test( t ) { + var expected; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = PING; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + PP = data.PP; + + out = new Float64Array( 6 ); + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, PP, out ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + + data = PONG; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + PP = data.PP; + + out = new Float64Array( 6 ); + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, PP, out ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function quick returns if the gap between the first and last index is < 1', function test( t ) { + var expected; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = QUICK_RET; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + PP = data.PP; + + out = new Float64Array( 6 ); + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, PP, out ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form with zero deflation', function test( t ) { + var expected; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = ZER_DEF_PING; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + PP = data.PP; + + out = new Float64Array( 6 ); + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, PP, out ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + + data = ZER_DEF_PONG; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + PP = data.PP; + + out = new Float64Array( 6 ); + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, PP, out ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form with fallback to division', function test( t ) { + var expected; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = DIV_FALLBACK_PING; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + PP = data.PP; + + out = new Float64Array( 6 ); + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, PP, out ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + + data = DIV_FALLBACK_PONG; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + PP = data.PP; + + out = new Float64Array( 6 ); + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, PP, out ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form with fallback to division', function test( t ) { + var expected; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = ZERO_DEF_FIRST_UNROLL; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + PP = data.PP; + + out = new Float64Array( 6 ); + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, PP, out ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/test.js b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/test.js new file mode 100644 index 000000000000..a38cb015bede --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 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 dlasq6 = 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 dlasq6, '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 dlasq6.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 dlasq6 = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dlasq6, 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 dlasq6; + var main; + + main = require( './../lib/dlasq6.js' ); + + dlasq6 = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dlasq6, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/lapack/base/dlasq6/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/test.ndarray.js new file mode 100644 index 000000000000..38f228160fbf --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlasq6/test/test.ndarray.js @@ -0,0 +1,960 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2026 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var isAlmostSameValue = require( '@stdlib/assert/is-almost-same-value-float64array' ); +var dlasq6 = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var PING = require( './fixtures/ping.json' ); +var PONG = require( './fixtures/pong.json' ); +var QUICK_RET = require( './fixtures/quick_ret.json' ); +var ZER_DEF_PING = require( './fixtures/zero_deflation_ping.json' ); +var ZER_DEF_PONG = require( './fixtures/zero_deflation_pong.json' ); +var DIV_FALLBACK_PING = require( './fixtures/div_fallback_ping.json' ); +var DIV_FALLBACK_PONG = require( './fixtures/div_fallback_pong.json' ); +var ZERO_DEF_FIRST_UNROLL = require( './fixtures/zero_def_first_unroll.json' ); +var LAR_STR_PING = require( './fixtures/large_strides/ping.json' ); +var LAR_STR_PONG = require( './fixtures/large_strides/pong.json' ); +var LAR_STR_QUICK_RET = require( './fixtures/large_strides/quick_ret.json' ); +var LAR_STR_ZER_DEF_PING = require( './fixtures/large_strides/zero_deflation_ping.json' ); +var LAR_STR_ZER_DEF_PONG = require( './fixtures/large_strides/zero_deflation_pong.json' ); +var LAR_STR_DIV_FALLBACK_PING = require( './fixtures/large_strides/div_fallback_ping.json' ); +var LAR_STR_DIV_FALLBACK_PONG = require( './fixtures/large_strides/div_fallback_pong.json' ); +var LAR_STR_ZERO_DEF_FIRST_UNROLL = require( './fixtures/large_strides/zero_def_first_unroll.json' ); +var NEG_STR_PING = require( './fixtures/negative_strides/ping.json' ); +var NEG_STR_PONG = require( './fixtures/negative_strides/pong.json' ); +var NEG_STR_QUICK_RET = require( './fixtures/negative_strides/quick_ret.json' ); +var NEG_STR_ZER_DEF_PING = require( './fixtures/negative_strides/zero_deflation_ping.json' ); +var NEG_STR_ZER_DEF_PONG = require( './fixtures/negative_strides/zero_deflation_pong.json' ); +var NEG_STR_DIV_FALLBACK_PING = require( './fixtures/negative_strides/div_fallback_ping.json' ); +var NEG_STR_DIV_FALLBACK_PONG = require( './fixtures/negative_strides/div_fallback_pong.json' ); +var NEG_STR_ZERO_DEF_FIRST_UNROLL = require( './fixtures/negative_strides/zero_def_first_unroll.json' ); +var OFF_PING = require( './fixtures/offsets/ping.json' ); +var OFF_PONG = require( './fixtures/offsets/pong.json' ); +var OFF_QUICK_RET = require( './fixtures/offsets/quick_ret.json' ); +var OFF_ZER_DEF_PING = require( './fixtures/offsets/zero_deflation_ping.json' ); +var OFF_ZER_DEF_PONG = require( './fixtures/offsets/zero_deflation_pong.json' ); +var OFF_DIV_FALLBACK_PING = require( './fixtures/offsets/div_fallback_ping.json' ); +var OFF_DIV_FALLBACK_PONG = require( './fixtures/offsets/div_fallback_pong.json' ); +var OFF_ZERO_DEF_FIRST_UNROLL = require( './fixtures/offsets/zero_def_first_unroll.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dlasq6, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 9', function test( t ) { + t.strictEqual( dlasq6.length, 9, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = PING; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + + data = PONG; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function quick returns if the gap between the first and last index is < 1', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = QUICK_RET; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form with zero deflation', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = ZER_DEF_PING; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + + data = ZER_DEF_PONG; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form with fallback to division', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = DIV_FALLBACK_PING; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + + data = DIV_FALLBACK_PONG; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form with fallback to division', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = ZERO_DEF_FIRST_UNROLL; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form (large stride)', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = LAR_STR_PING; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( [ 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999 ] ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + + data = LAR_STR_PONG; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( [ 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999 ] ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function quick returns if the gap between the first and last index is < 1 (large stride)', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = LAR_STR_QUICK_RET; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( [ 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999 ] ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form with zero deflation (large stride)', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = LAR_STR_ZER_DEF_PING; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( [ 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999 ] ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + + data = LAR_STR_ZER_DEF_PONG; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( [ 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999 ] ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form with fallback to division (large stride)', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = LAR_STR_DIV_FALLBACK_PING; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( [ 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999 ] ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + + data = LAR_STR_DIV_FALLBACK_PONG; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( [ 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999 ] ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form with fallback to division (large stride)', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = LAR_STR_ZERO_DEF_FIRST_UNROLL; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( [ 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999, 0, 9999 ] ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form (negative stride)', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = NEG_STR_PING; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + + data = NEG_STR_PONG; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function quick returns if the gap between the first and last index is < 1 (negative stride)', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = NEG_STR_QUICK_RET; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form with zero deflation (negative stride)', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = NEG_STR_ZER_DEF_PING; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + + data = NEG_STR_ZER_DEF_PONG; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form with fallback to division (negative stride)', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = NEG_STR_DIV_FALLBACK_PING; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + + data = NEG_STR_DIV_FALLBACK_PONG; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form with fallback to division (negative stride)', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = NEG_STR_ZERO_DEF_FIRST_UNROLL; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 6 ); + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form (offset)', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = OFF_PING; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 7 ); + out[0] = 9999; + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + + data = OFF_PONG; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 7 ); + out[0] = 9999; + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function quick returns if the gap between the first and last index is < 1 (offset)', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = OFF_QUICK_RET; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 7 ); + out[0] = 9999; + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form with zero deflation (offset)', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = OFF_ZER_DEF_PING; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 7 ); + out[0] = 9999; + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + + data = OFF_ZER_DEF_PONG; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 7 ); + out[0] = 9999; + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form with fallback to division (offset)', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = OFF_DIV_FALLBACK_PING; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 7 ); + out[0] = 9999; + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + + data = OFF_DIV_FALLBACK_PONG; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 7 ); + out[0] = 9999; + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes one dqd transform in ping-pong form with fallback to division (offset)', function test( t ) { + var offsetOut; + var strideOut; + var expected; + var strideZ; + var offsetZ; + var data; + var out; + var I0; + var N0; + var PP; + var Z; + + data = OFF_ZERO_DEF_FIRST_UNROLL; + + I0 = data.I0; + N0 = data.N0; + Z = new Float64Array( data.Z ); + strideZ = data.strideZ; + offsetZ = data.offsetZ; + PP = data.PP; + + out = new Float64Array( 7 ); + out[0] = 9999; + strideOut = data.strideOut; + offsetOut = data.offsetOut; + + expected = new Float64Array( data.expectedOut ); + + dlasq6( I0, N0, Z, strideZ, offsetZ, PP, out, strideOut, offsetOut ); + t.strictEqual( isAlmostSameValue( out, expected, 1 ), true, 'returns expected value' ); + t.end(); +});