diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/README.md b/lib/node_modules/@stdlib/lapack/base/dlarf1f/README.md new file mode 100644 index 000000000000..4251787f8643 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/README.md @@ -0,0 +1,316 @@ + + +# dlarf1f + +
+ +In linear algebra, a `Householder transformation` (or an `elementary reflector`) is a linear transformation that describes a reflection about a plane or a hyperplane containing the origin. + +
+ + + +> Apply a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. + +
+ +## Usage + +```javascript +var dlarf1f = require( '@stdlib/lapack/base/dlarf1f' ); +``` + +#### dlarf1f( order, side, M, N, V, incv, tau, C, LDC, work ) + +Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +var work = new Float64Array( 3 ); + +var out = dlarf1f( 'row-major', 'left', 4, 3, V, 1, 1.0, C, 3, work ); +// returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +``` + +The function has the following parameters: + +- **order**: storage layout. +- **side**: use `left` to form `H * C` and `right` to from `C * H`. +- **M**: number of rows in `C`. +- **N**: number of columns in `C`. +- **V**: the vector `v` in the representation of `H` as a [`Float64Array`][mdn-float64array]. +- **incv**: stride length for `V`. If `incv` is negative, the elements of `V` are accessed in reverse order. +- **tau**: the value of `tau` in representation of `H`. +- **C**: input matrix stored in linear memory as a [`Float64Array`][mdn-float64array]. +- **LDC**: stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`). +- **work**: workspace [`Float64Array`][mdn-float64array]. + +The sign of the increment parameter `incv` determines the order in which elements of `V` are accessed. For example, to access elements in reverse order, + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +var work = new Float64Array( 3 ); + +var out = dlarf1f( 'row-major', 'left', 4, 3, V, -1, 1.0, C, 3, work ); +// returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +``` + +To perform strided access over `V`, provide an `abs(incv)` value greater than one. For example, to access every other element in `V`, + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +var V = new Float64Array( [ 0.5, 999, 0.5, 999, 0.5, 999, 0.5 ] ); +var work = new Float64Array( 3 ); + +var out = dlarf1f( 'row-major', 'left', 4, 3, V, 2, 1.0, C, 3, work ); +// returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +``` + +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 C0 = new Float64Array( [ 0.0, 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +var V0 = new Float64Array( [ 0.0, 0.5, 0.5, 0.5, 0.5 ] ); +var work0 = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + +// Create offset views... +var C1 = new Float64Array( C0.buffer, C0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var V1 = new Float64Array( V0.buffer, V0.BYTES_PER_ELEMENT*1 ); // start at 2nd element +var work1 = new Float64Array( work0.buffer, work0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +var our = dlarf1f( 'row-major', 'left', 4, 3, V1, 1, 1.0, C1, 3, work1 ); +// C0 => [ 0.0, -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +``` + +#### dlarf1f.ndarray( side, M, N, V, sv, ov, tau, C, sc1, sc2, oc, work, sw, ow ) + +Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C` using alternative indexing semantics. + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +var work = new Float64Array( 3 ); + +var out = dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); +// returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +``` + +The function has the following additional parameters: + +- **side**: use `left` to form `H * C` and `right` to from `C * H`. +- **M**: number of rows in `C`. +- **N**: number of columns in `C`. +- **V**: the vector `v` in the representation of `H` as a [`Float64Array`][mdn-float64array]. +- **sv**: stride length for `V`. +- **ov**: starting index for `V`. +- **tau**: the value of `tau` in representation of `H`. +- **C**: input matrix as a [`Float64Array`][mdn-float64array]. +- **sc1**: stride of the first dimension of `C`. +- **sc2**: stride of the second dimension of `C`. +- **oc**: starting index for `C`. +- **work**: workspace array as a [`Float64Array`][mdn-float64array]. +- **sw**: stride length for `work`. +- **ow**: starting index for `work`. + +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 C = new Float64Array( [ 0.0, 0.0, 0.0, 0.0, 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +var V = new Float64Array( [ 0.0, 0.0, 0.5, 0.5, 0.5, 0.5 ] ); +var work = new Float64Array( [ 0.0, 0.0, 0.0, 0.0 ] ); + +var out = dlarf1f.ndarray( 'left', 4, 3, V, 1, 2, 1.0, C, 3, 1, 4, work, 1, 0 ); +// C => [ 0.0, 0.0, 0.0, 0.0, -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +``` + +
+ + + +
+ +## Notes + +- `work` should have `N` indexed elements if side = `left` and `M` indexed elements if side = `right`. +- `V` should have `1 + (M-1) * abs(incv)` indexed elements if side = `left` and `1 + (N-1) * abs(incv)` indexed elements if side = `right`. +- `C` is overwritten by `H * C` if side = `left` and `C * H` if side = `right`. +- `dlarf1f()` corresponds to the [LAPACK][LAPACK] function [`dlarf1f`][lapack-dlarf1f]. + +
+ + + +
+ +## Examples + + + + + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var dlarf1f = require( '@stdlib/lapack/base/dlarf1f' ); + +// Specify matrix meta data: +var shape = [ 4, 3 ]; +var order = 'row-major'; +var strides = shape2strides( shape, order ); + +// Create a matrix stored in linear memory: +var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +console.log( ndarray2array( C, shape, strides, 0, order ) ); + +// Define the vector `v` and workspace array: +var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +var work = new Float64Array( 3 ); + +// Apply the elementary reflector: +dlarf1f( order, 'left', shape[ 0 ], shape[ 1 ], V, 1, 1.0, C, strides[ 0 ], work ); +console.log( ndarray2array( C, shape, strides, 0, order ) ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.js new file mode 100644 index 000000000000..c77192834718 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.js @@ -0,0 +1,127 @@ +/** +* @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 bench = require( '@stdlib/bench' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var Float64Array = require( '@stdlib/array/float64' ); +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 pkg = require( './../package.json' ).name; +var dlarf1f = require( './../lib/dlarf1f.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; +var SIDES = [ + 'left', + 'right' +]; +var opts = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @param {string} side - specifies the side (left or right) +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N, side ) { + var work = new Float64Array( N ); + var C = discreteUniform( N*N, 1.0, 10.0, opts ); + var V = new Float64Array( N ); + V[ N-1 ] = 1.0; // keeping only the last element non zero to ensure maximum iterations but minimum overflow + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + var z; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dlarf1f( order, side, N, N, V, 1, 1.0, C, N, work ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var side; + var min; + var max; + var ord; + var N; + var f; + var i; + var j; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( j = 0; j < SIDES.length; j++ ) { + side = SIDES[ j ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N, side ); + bench( pkg+'::square_matrix:order='+ord+',side='+side+',size='+(N*N), f ); + } + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..37f920536611 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/benchmark/benchmark.ndarray.js @@ -0,0 +1,141 @@ +/** +* @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 bench = require( '@stdlib/bench' ); +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var Float64Array = require( '@stdlib/array/float64' ); +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 pkg = require( './../package.json' ).name; +var dlarf1f = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var LAYOUTS = [ + 'row-major', + 'column-major' +]; +var SIDES = [ + 'left', + 'right' +]; +var opts = { + 'dtype': 'float64' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {string} order - storage layout +* @param {PositiveInteger} N - number of elements along each dimension +* @param {string} side - specifies the side (left or right) +* @returns {Function} benchmark function +*/ +function createBenchmark( order, N, side ) { + var work; + var sc1; + var sc2; + var C; + var V; + + work = new Float64Array( N ); + C = discreteUniform( N*N, 1.0, 10.0, opts ); + V = new Float64Array( N ); + V[ N-1 ] = 1.0; // keeping only the last element non zero to ensure maximum iterations but minimum overflow + if ( isColumnMajor( order ) ) { + sc1 = 1; + sc2 = N; + } else { // order === 'row-major' + sc1 = N; + sc2 = 1; + } + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var i; + var z; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = dlarf1f( side, N, N, V, 1, 0, 1.0, C, sc1, sc2, 0, work, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var side; + var min; + var max; + var ord; + var N; + var f; + var i; + var j; + var k; + + min = 1; // 10^min + max = 6; // 10^max + + for ( k = 0; k < LAYOUTS.length; k++ ) { + ord = LAYOUTS[ k ]; + for ( j = 0; j < SIDES.length; j++ ) { + side = SIDES[ j ]; + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( ord, N, side ); + bench( pkg+'::square_matrix:order='+ord+',side='+side+',size='+(N*N), f ); + } + } + } +} + +main(); diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/repl.txt b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/repl.txt new file mode 100644 index 000000000000..b9bff09e7751 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/repl.txt @@ -0,0 +1,116 @@ + +{{alias}}( order, side, M, N, V, incv, tau, C, LDC, work ) + Applies a real elementary reflector `H = I - tau * v * v ^ T` + to a real M by N matrix `C`. + + Parameters + ---------- + order: string + Storage layout. Must be either 'row-major' or 'column-major'. + + side: string + Specifies whether to form `H * C` ('left') or + `C * H` ('right'). + + M: integer + Number of rows in `C`. + + N: integer + Number of columns in `C`. + + V: Float64Array + The vector `v` in the representation of `H`. + + incv: integer + Stride length for `V`. + + tau: number + The value of `tau` in representation of `H`. + + C: Float64Array + Input matrix. + + LDC: integer + Stride of the first dimension of `C` (a.k.a., leading + dimension of the matrix `C`). + + work: Float64Array + Workspace array. + + Returns + ------- + C: Float64Array + Output matrix. + + Examples + -------- + > var C = new {{alias:@stdlib/array/float64}}( [ 1.0, 3.0, 2.0, 4.0 ] ); + > var V = new {{alias:@stdlib/array/float64}}( [ 0.5, 0.5 ] ); + > var work = new {{alias:@stdlib/array/float64}}( 2 ); + > {{alias}}( 'row-major', 'left', 2, 2, V, 1, 1.0, C, 2, work ) + [ -1.0, -2.0, 1.0, 1.5 ] + + +{{alias}}.ndarray( side, M, N, V, sv, ov, tau, C, sc1, sc2, oc, work, sw, ow ) + Applies a real elementary reflector `H = I - tau * v * v ^ T` + to a real M by N matrix `C` using alternative indexing semantics. + + Parameters + ---------- + side: string + Specifies whether to form `H * C` ('left') or `C * H` ('right'). + + M: integer + Number of rows in `C`. + + N: integer + Number of columns in `C`. + + V: Float64Array + The vector `v` in the representation of `H`. + + sv: integer + Stride length for `V`. + + ov: integer + Starting index for `V`. + + tau: number + The value of `tau` in representation of `H`. + + C: Float64Array + Input matrix. + + sc1: integer + Stride of the first dimension of `C`. + + sc2: integer + Stride of the second dimension of `C`. + + oc: integer + Starting index for `C`. + + work: Float64Array + Workspace array. + + sw: integer + Stride length for `work`. + + ow: integer + Starting index for `work`. + + Returns + ------- + C: Float64Array + Output matrix. + + Examples + -------- + > var C = new {{alias:@stdlib/array/float64}}( [ 1.0, 3.0, 2.0, 4.0 ] ); + > var V = new {{alias:@stdlib/array/float64}}( [ 0.5, 0.5 ] ); + > var work = new {{alias:@stdlib/array/float64}}( 2 ); + > {{alias}}.ndarray( 'left', 2, 2, V, 1, 0, 1.0, C, 2, 1, 0, work, 1, 0 ) + [ -1.0, -2.0, 1.0, 1.5 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/index.d.ts b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/index.d.ts new file mode 100644 index 000000000000..374f15b4a37f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/index.d.ts @@ -0,0 +1,127 @@ +/* +* @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. +*/ + +// TypeScript Version: 4.1 + +/** +* Must be either `'left'` or `'right'`. +*/ +type Side = 'left' | 'right'; + +/** +* Interface describing `dlarf1f`. +*/ +interface Routine { + /** + * Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. + * + * @param side - use `left` to form `H * C` and `right` to from `C * H` + * @param M - number of rows in `C` + * @param N - number of columns in `C` + * @param V - the vector `v` in the representation of `H` + * @param incv - stride length for `V` + * @param tau - the value of `tau` in representation of `H` + * @param C - input matrix + * @param ldc - leading dimension of `C` + * @param work - workspace array + * @returns `C * H` or `H * C` + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); + * var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); + * var work = new Float64Array( 3 ); + * + * dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, work ); + * // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] + */ + ( side: Side, M: number, N: number, V: Float64Array, incv: number, tau: number, C: Float64Array, ldc: number, work: Float64Array ): Float64Array; + + /** + * Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C` using alternative indexing semantics. + * + * @param side - use `left` to form `H * C` and `right` to from `C * H` + * @param M - number of rows in `C` + * @param N - number of columns in `C` + * @param V - the vector `v` in the representation of `H` + * @param strideV - stride length for `V` + * @param offsetV - starting index for `V` + * @param tau - the value of `tau` in representation of `H` + * @param C - input matrix + * @param strideC1 - stride of the first dimension of `C` + * @param strideC2 - stride of the second dimension of `C` + * @param offsetC - starting index for `C` + * @param work - workspace array + * @param strideWork - stride length for `work` + * @param offsetWork - starting index for `work` + * @returns `C * H` or `H * C` + * + * @example + * var Float64Array = require( '@stdlib/array/float64' ); + * + * var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); + * var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); + * var work = new Float64Array( 3 ); + * + * dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); + * // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] + */ + ndarray( side: Side, M: number, N: number, V: Float64Array, strideV: number, offsetV: number, tau: number, C: Float64Array, strideC1: number, strideC2: number, offsetC: number, work: Float64Array, strideWork: number, offsetWork: number ): Float64Array; +} + +/** +* Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. +* +* @param side - use `left` to form `H * C` and `right` to from `C * H` +* @param M - number of rows in `C` +* @param N - number of columns in `C` +* @param V - the vector `v` in the representation of `H` +* @param incv - stride length for `V` +* @param tau - the value of `tau` in representation of `H` +* @param C - input matrix +* @param ldc - leading dimension of `C` +* @param work - workspace array +* @returns `C * H` or `H * C` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +* var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +* var work = new Float64Array( 3 ); +* +* dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, work ); +* // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +* var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +* var work = new Float64Array( 3 ); +* +* dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); +* // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +*/ +declare var dlarf1f: Routine; + + +// EXPORTS // + +export = dlarf1f; diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/test.ts b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/test.ts new file mode 100644 index 000000000000..2a94efd1f844 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/docs/types/test.ts @@ -0,0 +1,422 @@ +/* +* @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. +*/ + +import dlarf1f = require( './index' ); + + +// TESTS // + +// The function returns a Float64Array... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 5, 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( true, 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( false, 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( null, 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( void 0, 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( [], 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( {}, 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( ( x: number ): number => x, 4, 3, V, 1, 1.0, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', '5', 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', true, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', false, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', null, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', void 0, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', [], 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', {}, 3, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', ( x: number ): number => x, 3, V, 1, 1.0, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', 4, '5', V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, true, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, false, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, null, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, void 0, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, [], V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, {}, V, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, ( x: number ): number => x, V, 1, 1.0, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a Float64Array... +{ + const C = new Float64Array( 12 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', 4, 3, '5', 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, 5, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, true, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, false, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, null, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, void 0, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, [], 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, {}, 1, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, ( x: number ): number => x, 1, 1.0, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', 4, 3, V, '5', 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, true, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, false, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, null, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, void 0, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, [], 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, {}, 1.0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, ( x: number ): number => x, 1.0, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', 4, 3, V, 1, '5', C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, true, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, false, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, null, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, void 0, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, [], C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, {}, C, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, ( x: number ): number => x, C, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a Float64Array... +{ + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', 4, 3, V, 1, 1.0, '5', 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, 5, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, true, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, false, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, null, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, void 0, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, [], 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, {}, 3, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, ( x: number ): number => x, 3, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided an eighth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, '5', work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, true, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, false, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, null, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, void 0, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, [], work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, {}, work ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, ( x: number ): number => x, work ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a Float64Array... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, '5' ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, 5 ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, true ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, false ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, null ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, void 0 ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, [] ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, {} ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f(); // $ExpectError + dlarf1f( 'left' ); // $ExpectError + dlarf1f( 'left', 4 ); // $ExpectError + dlarf1f( 'left', 4, 3 ); // $ExpectError + dlarf1f( 'left', 4, 3, V ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1 ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0 ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3 ); // $ExpectError + dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, work, 10 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Float64Array... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the `ndarray` method is provided a first argument which is not a string... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 5, 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( true, 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( false, 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( null, 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( void 0, 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( [], 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( {}, 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( ( x: number ): number => x, 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a second argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', '5', 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', true, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', false, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', null, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', void 0, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', [], 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', {}, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', ( x: number ): number => x, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a third argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, '5', V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, true, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, false, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, null, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, void 0, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, [], V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, {}, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, ( x: number ): number => x, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourth argument which is not a Float64Array... +{ + const C = new Float64Array( 12 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, '5', 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, 5, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, true, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, false, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, null, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, void 0, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, [], 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, {}, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, ( x: number ): number => x, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fifth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, '5', 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, true, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, false, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, null, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, void 0, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, [], 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, {}, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, ( x: number ): number => x, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, '5', 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, true, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, false, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, null, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, void 0, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, [], 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, {}, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, ( x: number ): number => x, 1.0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a seventh argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, '5', C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, true, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, false, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, null, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, void 0, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, [], C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, {}, C, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, ( x: number ): number => x, C, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an eighth argument which is not a Float64Array... +{ + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, '5', 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, 5, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, true, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, false, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, null, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, void 0, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, [], 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, {}, 3, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, ( x: number ): number => x, 3, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a ninth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, '5', 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, true, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, false, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, null, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, void 0, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, [], 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, {}, 1, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, ( x: number ): number => x, 1, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a tenth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, '5', 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, true, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, false, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, null, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, void 0, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, [], 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, {}, 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, ( x: number ): number => x, 0, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an eleventh argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, '5', work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, true, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, false, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, null, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, void 0, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, [], work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, {}, work, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, ( x: number ): number => x, work, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a twelfth argument which is not a Float64Array... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, '5', 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, 5, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, true, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, false, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, null, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, void 0, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, [], 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, {}, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a thirteenth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, '5', 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, true, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, false, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, null, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, void 0, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, [], 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, {}, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided a fourteenth argument which is not a number... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, '5' ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, true ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, false ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, null ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, void 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, [] ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, {} ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... +{ + const C = new Float64Array( 12 ); + const V = new Float64Array( 4 ); + const work = new Float64Array( 3 ); + dlarf1f.ndarray(); // $ExpectError + dlarf1f.ndarray( 'left' ); // $ExpectError + dlarf1f.ndarray( 'left', 4 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1 ); // $ExpectError + dlarf1f.ndarray( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/examples/index.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/examples/index.js new file mode 100644 index 000000000000..3a4d17bc6a8c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/examples/index.js @@ -0,0 +1,41 @@ +/** +* @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'; + +var Float64Array = require( '@stdlib/array/float64' ); +var ndarray2array = require( '@stdlib/ndarray/base/to-array' ); +var shape2strides = require( '@stdlib/ndarray/base/shape2strides' ); +var dlarf1f = require( './../lib' ); + +// Specify matrix meta data: +var shape = [ 4, 3 ]; +var order = 'row-major'; +var strides = shape2strides( shape, order ); + +// Create a matrix stored in linear memory: +var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +console.log( ndarray2array( C, shape, strides, 0, order ) ); + +// Define the vector `v` and workspace array: +var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +var work = new Float64Array( 3 ); + +// Apply the elementary reflector: +dlarf1f( order, 'left', shape[ 0 ], shape[ 1 ], V, 1, 1.0, C, strides[ 0 ], work ); +console.log( ndarray2array( C, shape, strides, 0, order ) ); diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js new file mode 100644 index 000000000000..2fc67bc6ea69 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/base.js @@ -0,0 +1,128 @@ +/** +* @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'; + +/* eslint-disable max-len */ + +// MODULES // + +var iladlc = require( '@stdlib/lapack/base/iladlc' ).ndarray; +var iladlr = require( '@stdlib/lapack/base/iladlr' ).ndarray; +var dgemv = require( '@stdlib/blas/base/dgemv' ).ndarray; +var dger = require( '@stdlib/blas/base/dger' ).ndarray; +var daxpy = require( '@stdlib/blas/base/daxpy' ).ndarray; +var dscal = require( '@stdlib/blas/base/dscal' ).ndarray; + + +// MAIN // + +/** +* Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. +* +* ## Notes +* +* - `work` should have `N` indexed elements if side = `left` and `M` indexed elements if side = `right`. +* - `V` should have `1 + (M-1) * abs(strideV)` indexed elements if side = `left` and `1 + (N-1) * abs(strideV)` indexed elements if side = `right`. +* - `C` is overwritten by `H * C` if side = `left` and `C * H` if side = `right`. +* +* @private +* @param {string} side - use `left` to form `H * C` and `right` to from `C * H` +* @param {NonNegativeInteger} M - number of rows in `C` +* @param {NonNegativeInteger} N - number of columns in `C` +* @param {Float64Array} V - the vector `v` in the representation of `H` +* @param {integer} strideV - stride length for `V` +* @param {NonNegativeInteger} offsetV - starting index for `V` +* @param {number} tau - the value of `tau` in representation of `H` +* @param {Float64Array} C - input matrix +* @param {integer} strideC1 - stride of the first dimension of `C` +* @param {integer} strideC2 - stride of the second dimension of `C` +* @param {NonNegativeInteger} offsetC - starting index for `C` +* @param {Float64Array} work - workspace array +* @param {integer} strideWork - stride length for `work` +* @param {NonNegativeInteger} offsetWork - starting index for `work` +* @returns {Float64Array} `C * H` or `H * C` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +* var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +* var work = new Float64Array( 3 ); +* +* var out = dlarf1f( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); +* // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +*/ +function dlarf1f( side, M, N, V, strideV, offsetV, tau, C, strideC1, strideC2, offsetC, work, strideWork, offsetWork ) { // eslint-disable-line max-params + var lastv; + var lastc; + var i; + + lastv = 1; + lastc = 0; + if ( tau !== 0.0 ) { + if ( side === 'left' ) { + lastv = M; + } else { + lastv = N; + } + + // i points to the last element in V + i = offsetV + ( ( lastv - 1 ) * strideV ); + + // Move i to the last non-zero element in V + while ( lastv > 0 && V[ i ] === 0.0 ) { + lastv -= 1; + i -= strideV; + } + if ( side === 'left' ) { + lastc = iladlc( lastv + 1, N, C, strideC1, strideC2, offsetC ) + 1; // to account for the difference between zero-based and one-based indexing + } else { + lastc = iladlr( M, lastv + 1, C, strideC1, strideC2, offsetC ) + 1; // to account for the difference between zero-based and one-based indexing + } + // lastc is zero if a matrix is filled with zeros + } + if ( lastc === 0 ) { + // Returns C unchanged if tau is zero or all elements in C are zero + return C; + } + if ( side === 'left' ) { + if ( lastv === 0 ) { + dscal( lastc, 1.0 - tau, C, strideC2, offsetC ); // scale the first row + } else { + dgemv( 'transpose', lastv-1, lastc, 1.0, C, strideC1, strideC2, offsetC + strideC1, V, strideV, offsetV + strideV, 0.0, work, strideWork, offsetWork ); // C( 1, 0 ) is accessed here + daxpy( lastc, 1.0, C, strideC2, offsetC, work, strideWork, offsetWork ); // operates on the first row of C + daxpy( lastc, -tau, work, strideWork, offsetWork, C, strideC2, offsetC ); // operates on the first row of C + dger( lastv-1, lastc, -tau, V, strideV, offsetV + strideV, work, strideWork, offsetWork, C, strideC1, strideC2, offsetC + strideC1 ); // C( 1, 0 ) is accessed here + } + } else if ( lastv === 0 ) { + dscal( lastc, 1.0 - tau, C, strideC1, offsetC ); // scale the first column + } else { + dgemv( 'no-transpose', lastc, lastv-1, 1.0, C, strideC1, strideC2, offsetC + strideC2, V, strideV, offsetV + strideV, 0.0, work, strideWork, offsetWork ); // C( 0, 1 ) is accessed here + daxpy( lastc, 1.0, C, strideC1, offsetC, work, strideWork, offsetWork ); // operates on the first column of C + daxpy( lastc, -tau, work, strideWork, offsetWork, C, strideC1, offsetC ); // operates on the first column of C + dger( lastc, lastv-1, -tau, work, strideWork, offsetWork, V, strideV, offsetV + strideV, C, strideC1, strideC2, offsetC + strideC2 ); // C( 0, 1 ) is accessed here + } + + return C; +} + + +// EXPORTS // + +module.exports = dlarf1f; diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js new file mode 100644 index 000000000000..aa563c71859a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/dlarf1f.js @@ -0,0 +1,104 @@ +/** +* @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 isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); +var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var max = require( '@stdlib/math/base/special/max' ); +var format = require( '@stdlib/string/format' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. +* +* ## Notes +* +* - `work` should have `N` indexed elements if side = `left` and `M` indexed elements if side = `right`. +* - `V` should have `1 + (M-1) * abs(incv)` indexed elements if side = `left` and `1 + (N-1) * abs(incv)` indexed elements if side = `right`. +* - `C` is overwritten by `H * C` if side = `left` and `C * H` if side = `right`. +* +* @param {string} order - storage layout +* @param {string} side - use `left` to form `H * C` and `right` to from `C * H` +* @param {NonNegativeInteger} M - number of rows in `C` +* @param {NonNegativeInteger} N - number of columns in `C` +* @param {Float64Array} V - the vector `v` in the representation of `H` +* @param {integer} incv - stride length for `V` +* @param {number} tau - the value of `tau` in representation of `H` +* @param {Float64Array} C - input matrix +* @param {PositiveInteger} LDC - stride of the first dimension of `C` (a.k.a., leading dimension of the matrix `C`) +* @param {Float64Array} work - workspace array +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must be a valid side +* @throws {RangeError} ninth argument must be greater than or equal to max(1,N) +* @throws {RangeError} fifth argument must not be zero +* @returns {Float64Array} `C * H` or `H * C` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +* var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +* var work = new Float64Array( 3 ); +* +* var out = dlarf1f( 'row-major', 'left', 4, 3, V, 1, 1.0, C, 3, work ); +* // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +*/ +function dlarf1f( order, side, M, N, V, incv, tau, C, LDC, work ) { + var sc1; + var sc2; + var ov; + + if ( !isLayout( order ) ) { + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); + } + if ( isRowMajor( order ) && LDC < max( 1, N ) ) { + throw new RangeError( format( 'invalid argument. Fourth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDC ) ); + } + if ( side !== 'left' && side !== 'right' ) { // TODO - refactor this to make use of an array if needed + throw new TypeError( format( 'invalid argument. Second argument must be a valid side (left or right). Value: `%s`.', side ) ); + } + if ( incv === 0 ) { + throw new RangeError( format( 'invalid argument. Fifth argument must not be zero' ) ); + } + if ( isColumnMajor( order ) ) { + sc1 = 1; + sc2 = LDC; + } else { // order === 'row-major' + sc1 = LDC; + sc2 = 1; + } + if ( side === 'left' ) { + ov = stride2offset( M, incv ); + } else { + ov = stride2offset( N, incv ); + } + return base( side, M, N, V, incv, ov, tau, C, sc1, sc2, 0, work, 1, 0 ); +} + + +// EXPORTS // + +module.exports = dlarf1f; diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/index.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/index.js new file mode 100644 index 000000000000..4f8dac29928f --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/index.js @@ -0,0 +1,65 @@ +/** +* @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'; + +/** +* LAPACK routine to apply a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. +* +* ## Notes +* +* - `work` should have `N` indexed elements if side = `left` and `M` indexed elements if side = `right`. +* - `V` should have `1 + (M-1) * abs(incv)` indexed elements if side = `left` and `1 + (N-1) * abs(incv)` indexed elements if side = `right`. +* - `C` is overwritten by `H * C` if side = `left` and `C * H` if side = `right`. +* +* @module @stdlib/lapack/base/dlarf1f +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dlarf1f = require( '@stdlib/lapack/base/dlarf1f' ); +* +* var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +* var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +* var work = new Float64Array( 3 ); +* +* var out = dlarf1f( 'left', 4, 3, V, 1, 1.0, C, 3, work ); +* // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.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 dlarf1f; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dlarf1f = main; +} else { + dlarf1f = tmp; +} + + +// EXPORTS // + +module.exports = dlarf1f; diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/main.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/main.js new file mode 100644 index 000000000000..147bc72d40e7 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/main.js @@ -0,0 +1,35 @@ +/** +* @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 setReadOnly = require( '@stdlib/utils/define-nonenumerable-read-only-property' ); +var dlarf1f = require( './dlarf1f.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dlarf1f, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dlarf1f; diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/ndarray.js new file mode 100644 index 000000000000..e338a9d1ed1a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/lib/ndarray.js @@ -0,0 +1,77 @@ +/** +* @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. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); + + +// MAIN // + +/** +* Applies a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`. +* +* ## Notes +* +* - `work` should have `N` indexed elements if side = `left` and `M` indexed elements if side = `right`. +* - `V` should have `1 + (M-1) * abs(strideV)` indexed elements if side = `left` and `1 + (N-1) * abs(strideV)` indexed elements if side = `right`. +* - `C` is overwritten by `H * C` if side = `left` and `C * H` if side = `right`. +* +* @param {string} side - use `left` to form `H * C` and `right` to from `C * H` +* @param {NonNegativeInteger} M - number of rows in `C` +* @param {NonNegativeInteger} N - number of columns in `C` +* @param {Float64Array} V - the vector `v` in the representation of `H` +* @param {integer} strideV - stride length for `V` +* @param {NonNegativeInteger} offsetV - starting index for `V` +* @param {number} tau - the value of `tau` in representation of `H` +* @param {Float64Array} C - input matrix +* @param {integer} strideC1 - stride of the first dimension of `C` +* @param {integer} strideC2 - stride of the second dimension of `C` +* @param {NonNegativeInteger} offsetC - starting index for `C` +* @param {Float64Array} work - workspace array +* @param {integer} strideWork - stride length for `work` +* @param {NonNegativeInteger} offsetWork - starting index for `work` +* @throws {TypeError} first argument must be a valid side +* @returns {Float64Array} `C * H` or `H * C` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); +* var V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); +* var work = new Float64Array( 3 ); +* +* var out = dlarf1f( 'left', 4, 3, V, 1, 0, 1.0, C, 3, 1, 0, work, 1, 0 ); +* // returns [ -4.5, -10.5, -16.5, -0.75, -1.75, -2.75, 0.25, -0.75, -1.75, 1.25, 0.25, -0.75 ] +*/ +function dlarf1f( side, M, N, V, strideV, offsetV, tau, C, strideC1, strideC2, offsetC, work, strideWork, offsetWork ) { // eslint-disable-line max-params + if ( side !== 'left' && side !== 'right' ) { // TODO - refactor this to make use of an array if needed + throw new TypeError( format( 'invalid argument. First argument must be a valid side (left or right). Value: `%s`.', side ) ); + } + return base( side, M, N, V, strideV, offsetV, tau, C, strideC1, strideC2, offsetC, work, strideWork, offsetWork ); +} + + +// EXPORTS // + +module.exports = dlarf1f; diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/package.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/package.json new file mode 100644 index 000000000000..38ac47aeb9f4 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/package.json @@ -0,0 +1,69 @@ +{ + "name": "@stdlib/lapack/base/dlarf1f", + "version": "0.0.0", + "description": "LAPACK routine to apply a real elementary reflector `H = I - tau * v * v ^ T` to a real M by N matrix `C`.", + "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", + "dlarf1f", + "reflector", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "matrix", + "float64", + "double", + "float64array" + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..f230201852fb --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_eq_zero_col_major.json @@ -0,0 +1,129 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 4, + 9999, + 7, + 9999, + 10, + 9999, + 2, + 9999, + 5, + 9999, + 8, + 9999, + 11, + 9999, + 3, + 9999, + 6, + 9999, + 9, + 9999, + 12, + 9999 + ], + "strideC1": 2, + "strideC2": 8, + "offsetC": 0, + "LDC": 4, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + 0.5, + 9999, + 4, + 9999, + 7, + 9999, + 10, + 9999, + 1, + 9999, + 5, + 9999, + 8, + 9999, + 11, + 9999, + 1.5, + 9999, + 6, + 9999, + 9, + 9999, + 12, + 9999 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..9a3f0e99e8b4 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_eq_zero_row_major.json @@ -0,0 +1,129 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999, + 10, + 9999, + 11, + 9999, + 12, + 9999 + ], + "strideC1": 6, + "strideC2": 2, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + 0.5, + 9999, + 1, + 9999, + 1.5, + 9999, + 4, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999, + 10, + 9999, + 11, + 9999, + 12, + 9999 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..be21a7c01c07 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_gt_zero_col_major.json @@ -0,0 +1,129 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999, + 10, + 9999, + 11, + 9999, + 12, + 9999 + ], + "strideC1": 2, + "strideC2": 8, + "offsetC": 0, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + -14, + 9999, + -28, + 9999, + -42, + 9999, + -56, + 9999, + -30, + 9999, + -64, + 9999, + -98, + 9999, + -132, + 9999, + -46, + 9999, + -100, + 9999, + -154, + 9999, + -208, + 9999 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..e0ce8e88131b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/left_lastv_gt_zero_row_major.json @@ -0,0 +1,129 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 5, + 9999, + 9, + 9999, + 2, + 9999, + 6, + 9999, + 10, + 9999, + 3, + 9999, + 7, + 9999, + 11, + 9999, + 4, + 9999, + 8, + 9999, + 12, + 9999 + ], + "strideC1": 6, + "strideC2": 2, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + -14, + 9999, + -30, + 9999, + -46, + 9999, + -28, + 9999, + -64, + 9999, + -100, + 9999, + -42, + 9999, + -98, + 9999, + -154, + 9999, + -56, + 9999, + -132, + 9999, + -208, + 9999 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..eb77bfacd104 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_eq_zero_col_major.json @@ -0,0 +1,129 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999, + 10, + 9999, + 11, + 9999, + 12, + 9999 + ], + "strideC1": 2, + "strideC2": 8, + "offsetC": 0, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + 0.5, + 9999, + 1, + 9999, + 1.5, + 9999, + 2, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999, + 10, + 9999, + 11, + 9999, + 12, + 9999 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..9b22037de65e --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_eq_zero_row_major.json @@ -0,0 +1,129 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 5, + 9999, + 9, + 9999, + 2, + 9999, + 6, + 9999, + 10, + 9999, + 3, + 9999, + 7, + 9999, + 11, + 9999, + 4, + 9999, + 8, + 9999, + 12, + 9999 + ], + "strideC1": 6, + "strideC2": 2, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + 0.5, + 9999, + 5, + 9999, + 9, + 9999, + 1, + 9999, + 6, + 9999, + 10, + 9999, + 1.5, + 9999, + 7, + 9999, + 11, + 9999, + 2, + 9999, + 8, + 9999, + 12, + 9999 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..9a2cd1b9f764 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_gt_zero_col_major.json @@ -0,0 +1,129 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 1, + 9999, + 2, + 9999, + 3, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 2, + 9999, + 3, + 9999, + 4, + 9999, + 5, + 9999, + 6, + 9999, + 7, + 9999, + 8, + 9999, + 9, + 9999, + 10, + 9999, + 11, + 9999, + 12, + 9999 + ], + "strideC1": 2, + "strideC2": 8, + "offsetC": 0, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + -18, + 9999, + -20, + 9999, + -22, + 9999, + -24, + 9999, + -33, + 9999, + -38, + 9999, + -43, + 9999, + -48, + 9999, + -48, + 9999, + -56, + 9999, + -64, + 9999, + -72, + 9999 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..81bce5049109 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/large_strides/right_lastv_gt_zero_row_major.json @@ -0,0 +1,129 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 1, + 9999, + 2, + 9999, + 3, + 9999 + ], + "strideV": 2, + "offsetV": 0, + "tau": 0.5, + "C": [ + 1, + 9999, + 5, + 9999, + 9, + 9999, + 2, + 9999, + 6, + 9999, + 10, + 9999, + 3, + 9999, + 7, + 9999, + 11, + 9999, + 4, + 9999, + 8, + 9999, + 12, + 9999 + ], + "strideC1": 6, + "strideC2": 2, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 9999, + 0, + 9999, + 0, + 9999, + 0, + 9999 + ], + "strideWork": 2, + "offsetWork": 0, + "C_out": [ + -18, + 9999, + -33, + 9999, + -48, + 9999, + -20, + 9999, + -38, + 9999, + -56, + 9999, + -22, + 9999, + -43, + 9999, + -64, + 9999, + -24, + 9999, + -48, + 9999, + -72, + 9999 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..e7253ea8e5ab --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_zero_col_major.json @@ -0,0 +1,38 @@ +{ + "order": "column-major", + + "side": "left", + + "M": 4, + "N": 3, + + "V": [ 0.0, 0.0, 0.0, 0.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 4.0, 7.0, 10.0, 2.0, 5.0, 8.0, 11.0, 3.0, 6.0, 9.0, 12.0 ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 0, + "LDC": 4, + "C_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ], + [ 10.0, 11.0, 12.0 ] + ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ 0.5, 4.0, 7.0, 10.0, 1.0, 5.0, 8.0, 11.0, 1.5, 6.0, 9.0, 12.0 ], + "C_out_mat": [ + [ 0.5, 1.0, 1.5 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ], + [ 10.0, 11.0, 12.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..590889d02d3a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_eq_zero_row_major.json @@ -0,0 +1,38 @@ +{ + "order": "row-major", + + "side": "left", + + "M": 4, + "N": 3, + + "V": [ 0.0, 0.0, 0.0, 0.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ], + [ 10.0, 11.0, 12.0 ] + ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ 0.5, 1.0, 1.5, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "C_out_mat": [ + [ 0.5, 1.0, 1.5 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ], + [ 10.0, 11.0, 12.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..9cdc98fc1bc5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_zero_col_major.json @@ -0,0 +1,42 @@ +{ + "order": "column-major", + + "side": "left", + + "M": 4, + "N": 3, + + "V": [ 1.0, 2.0, 3.0, 4.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 0, + "LDC": 4, + "C_mat": [ + [ 1.0, 5.0, 9.0 ], + [ 2.0, 6.0, 10.0 ], + [ 3.0, 7.0, 11.0 ], + [ 4.0, 8.0, 12.0 ] + ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ + -14.0, -28.0, -42.0, -56.0, + -30.0, -64.0, -98.0, -132.0, + -46.0, -100.0, -154.0, -208.0 + ], + "C_out_mat": [ + [ -14.0, -30.0, -46.0 ], + [ -28.0, -64.0, -100.0 ], + [ -42.0, -98.0, -154.0 ], + [ -56.0, -132.0, -208.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..0a19b0bf87d4 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/left_lastv_gt_zero_row_major.json @@ -0,0 +1,43 @@ +{ + "order": "row-major", + + "side": "left", + + "M": 4, + "N": 3, + + "V": [ 1.0, 2.0, 3.0, 4.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ 1.0, 5.0, 9.0 ], + [ 2.0, 6.0, 10.0 ], + [ 3.0, 7.0, 11.0 ], + [ 4.0, 8.0, 12.0 ] + ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ + -14.0, -30.0, -46.0, + -28.0, -64.0, -100.0, + -42.0, -98.0, -154.0, + -56.0, -132.0, -208.0 + ], + "C_out_mat": [ + [ -14.0, -30.0, -46.0 ], + [ -28.0, -64.0, -100.0 ], + [ -42.0, -98.0, -154.0 ], + [ -56.0, -132.0, -208.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..8d856581319a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_eq_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 3, + 6, + 9, + 12, + 2, + 5, + 8, + 11, + 1, + 4, + 7, + 10 + ], + "strideC1": 1, + "strideC2": -4, + "offsetC": 8, + "LDC": 4, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + 1.5, + 6, + 9, + 12, + 1, + 5, + 8, + 11, + 0.5, + 4, + 7, + 10 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..6a316d1569be --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_eq_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 10, + 11, + 12, + 7, + 8, + 9, + 4, + 5, + 6, + 1, + 2, + 3 + ], + "strideC1": -3, + "strideC2": 1, + "offsetC": 9, + "LDC": 3, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + 10, + 11, + 12, + 7, + 8, + 9, + 4, + 5, + 6, + 0.5, + 1, + 1.5 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..8b4550d38780 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_gt_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 1, + 2, + 3, + 4 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 9, + 10, + 11, + 12, + 5, + 6, + 7, + 8, + 1, + 2, + 3, + 4 + ], + "strideC1": 1, + "strideC2": -4, + "offsetC": 8, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + -46, + -100, + -154, + -208, + -30, + -64, + -98, + -132, + -14, + -28, + -42, + -56 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..096a533a3e7b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/left_lastv_gt_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 1, + 2, + 3, + 4 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 4, + 8, + 12, + 3, + 7, + 11, + 2, + 6, + 10, + 1, + 5, + 9 + ], + "strideC1": -3, + "strideC2": 1, + "offsetC": 9, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + -56, + -132, + -208, + -42, + -98, + -154, + -28, + -64, + -100, + -14, + -30, + -46 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..1653651cc96b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_eq_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 9, + 10, + 11, + 12, + 5, + 6, + 7, + 8, + 1, + 2, + 3, + 4 + ], + "strideC1": 1, + "strideC2": -4, + "offsetC": 8, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + 9, + 10, + 11, + 12, + 5, + 6, + 7, + 8, + 0.5, + 1, + 1.5, + 2 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..f66f8e40614c --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_eq_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 4, + 8, + 12, + 3, + 7, + 11, + 2, + 6, + 10, + 1, + 5, + 9 + ], + "strideC1": -3, + "strideC2": 1, + "offsetC": 9, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + 2, + 8, + 12, + 1.5, + 7, + 11, + 1, + 6, + 10, + 0.5, + 5, + 9 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..aad7f7861cdd --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_gt_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 1, + 2, + 3 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 9, + 10, + 11, + 12, + 5, + 6, + 7, + 8, + 1, + 2, + 3, + 4 + ], + "strideC1": 1, + "strideC2": -4, + "offsetC": 8, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + -48, + -56, + -64, + -72, + -33, + -38, + -43, + -48, + -18, + -20, + -22, + -24 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..662548dc8f0a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/mixed_strides/right_lastv_gt_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 1, + 2, + 3 + ], + "strideV": 1, + "offsetV": 0, + "tau": 0.5, + "C": [ + 4, + 8, + 12, + 3, + 7, + 11, + 2, + 6, + 10, + 1, + 5, + 9 + ], + "strideC1": -3, + "strideC2": 1, + "offsetC": 9, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 0, + "C_out": [ + -24, + -48, + -72, + -22, + -43, + -64, + -20, + -38, + -56, + -18, + -33, + -48 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..322908914c72 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_eq_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0, + 0 + ], + "strideV": -1, + "offsetV": 3, + "tau": 0.5, + "C": [ + 12, + 9, + 6, + 3, + 11, + 8, + 5, + 2, + 10, + 7, + 4, + 1 + ], + "strideC1": -1, + "strideC2": -4, + "offsetC": 11, + "LDC": 4, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 2, + "C_out": [ + 12, + 9, + 6, + 1.5, + 11, + 8, + 5, + 1, + 10, + 7, + 4, + 0.5 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..b41eef4ac9c5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_eq_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0, + 0 + ], + "strideV": -1, + "offsetV": 3, + "tau": 0.5, + "C": [ + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ], + "strideC1": -3, + "strideC2": -1, + "offsetC": 11, + "LDC": 3, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 2, + "C_out": [ + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 1.5, + 1, + 0.5 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..3f885d50ed5a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_gt_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 4, + 3, + 2, + 1 + ], + "strideV": -1, + "offsetV": 3, + "tau": 0.5, + "C": [ + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ], + "strideC1": -1, + "strideC2": -4, + "offsetC": 11, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 2, + "C_out": [ + -208, + -154, + -100, + -46, + -132, + -98, + -64, + -30, + -56, + -42, + -28, + -14 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..c35a607c9556 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/left_lastv_gt_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 4, + 3, + 2, + 1 + ], + "strideV": -1, + "offsetV": 3, + "tau": 0.5, + "C": [ + 12, + 8, + 4, + 11, + 7, + 3, + 10, + 6, + 2, + 9, + 5, + 1 + ], + "strideC1": -3, + "strideC2": -1, + "offsetC": 11, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 2, + "C_out": [ + -208, + -132, + -56, + -154, + -98, + -42, + -100, + -64, + -28, + -46, + -30, + -14 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..454418019bfd --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_eq_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0 + ], + "strideV": -1, + "offsetV": 2, + "tau": 0.5, + "C": [ + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ], + "strideC1": -1, + "strideC2": -4, + "offsetC": 11, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 3, + "C_out": [ + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 2, + 1.5, + 1, + 0.5 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..aa43f90b21fc --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_eq_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 0, + 0, + 0 + ], + "strideV": -1, + "offsetV": 2, + "tau": 0.5, + "C": [ + 12, + 8, + 4, + 11, + 7, + 3, + 10, + 6, + 2, + 9, + 5, + 1 + ], + "strideC1": -3, + "strideC2": -1, + "offsetC": 11, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 3, + "C_out": [ + 12, + 8, + 2, + 11, + 7, + 1.5, + 10, + 6, + 1, + 9, + 5, + 0.5 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..2b6a1c4f9362 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_gt_zero_col_major.json @@ -0,0 +1,98 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 3, + 2, + 1 + ], + "strideV": -1, + "offsetV": 2, + "tau": 0.5, + "C": [ + 12, + 11, + 10, + 9, + 8, + 7, + 6, + 5, + 4, + 3, + 2, + 1 + ], + "strideC1": -1, + "strideC2": -4, + "offsetC": 11, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 3, + "C_out": [ + -72, + -64, + -56, + -48, + -48, + -43, + -38, + -33, + -24, + -22, + -20, + -18 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..561a238b8f1e --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/negative_strides/right_lastv_gt_zero_row_major.json @@ -0,0 +1,98 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 3, + 2, + 1 + ], + "strideV": -1, + "offsetV": 2, + "tau": 0.5, + "C": [ + 12, + 8, + 4, + 11, + 7, + 3, + 10, + 6, + 2, + 9, + 5, + 1 + ], + "strideC1": -3, + "strideC2": -1, + "offsetC": 11, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 0, + 0, + 0, + 0 + ], + "strideWork": -1, + "offsetWork": 3, + "C_out": [ + -72, + -48, + -24, + -64, + -43, + -22, + -56, + -38, + -20, + -48, + -33, + -18 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..42f40da2e09b --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_eq_zero_col_major.json @@ -0,0 +1,102 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 9999, + 0, + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 4, + 7, + 10, + 2, + 5, + 8, + 11, + 3, + 6, + 9, + 12 + ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 1, + "LDC": 4, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + 0.5, + 4, + 7, + 10, + 1, + 5, + 8, + 11, + 1.5, + 6, + 9, + 12 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..4befe77602d8 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_eq_zero_row_major.json @@ -0,0 +1,102 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 9999, + 0, + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 + ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 1, + "LDC": 3, + "C_mat": [ + [ + 1, + 2, + 3 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + 0.5, + 1, + 1.5, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 + ], + "C_out_mat": [ + [ + 0.5, + 1, + 1.5 + ], + [ + 4, + 5, + 6 + ], + [ + 7, + 8, + 9 + ], + [ + 10, + 11, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..eddfa2e1c391 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_gt_zero_col_major.json @@ -0,0 +1,102 @@ +{ + "order": "column-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 9999, + 1, + 2, + 3, + 4 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 + ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 1, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + -14, + -28, + -42, + -56, + -30, + -64, + -98, + -132, + -46, + -100, + -154, + -208 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..2f95e1b1e4a5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/left_lastv_gt_zero_row_major.json @@ -0,0 +1,102 @@ +{ + "order": "row-major", + "side": "left", + "M": 4, + "N": 3, + "V": [ + 9999, + 1, + 2, + 3, + 4 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 5, + 9, + 2, + 6, + 10, + 3, + 7, + 11, + 4, + 8, + 12 + ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 1, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + -14, + -30, + -46, + -28, + -64, + -100, + -42, + -98, + -154, + -56, + -132, + -208 + ], + "C_out_mat": [ + [ + -14, + -30, + -46 + ], + [ + -28, + -64, + -100 + ], + [ + -42, + -98, + -154 + ], + [ + -56, + -132, + -208 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..6a21255deca5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_eq_zero_col_major.json @@ -0,0 +1,102 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 9999, + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 + ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 1, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + 0.5, + 1, + 1.5, + 2, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..dd21b4750c5e --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_eq_zero_row_major.json @@ -0,0 +1,102 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 9999, + 0, + 0, + 0 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 5, + 9, + 2, + 6, + 10, + 3, + 7, + 11, + 4, + 8, + 12 + ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 1, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + 0.5, + 5, + 9, + 1, + 6, + 10, + 1.5, + 7, + 11, + 2, + 8, + 12 + ], + "C_out_mat": [ + [ + 0.5, + 5, + 9 + ], + [ + 1, + 6, + 10 + ], + [ + 1.5, + 7, + 11 + ], + [ + 2, + 8, + 12 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..8e03d1dc0430 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_gt_zero_col_major.json @@ -0,0 +1,102 @@ +{ + "order": "column-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 9999, + 1, + 2, + 3 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12 + ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 1, + "LDC": 4, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + -18, + -20, + -22, + -24, + -33, + -38, + -43, + -48, + -48, + -56, + -64, + -72 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..646dacef2538 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/offsets/right_lastv_gt_zero_row_major.json @@ -0,0 +1,102 @@ +{ + "order": "row-major", + "side": "right", + "M": 4, + "N": 3, + "V": [ + 9999, + 1, + 2, + 3 + ], + "strideV": 1, + "offsetV": 1, + "tau": 0.5, + "C": [ + 9999, + 1, + 5, + 9, + 2, + 6, + 10, + 3, + 7, + 11, + 4, + 8, + 12 + ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 1, + "LDC": 3, + "C_mat": [ + [ + 1, + 5, + 9 + ], + [ + 2, + 6, + 10 + ], + [ + 3, + 7, + 11 + ], + [ + 4, + 8, + 12 + ] + ], + "work": [ + 9999, + 0, + 0, + 0, + 0 + ], + "strideWork": 1, + "offsetWork": 1, + "C_out": [ + 9999, + -18, + -33, + -48, + -20, + -38, + -56, + -22, + -43, + -64, + -24, + -48, + -72 + ], + "C_out_mat": [ + [ + -18, + -33, + -48 + ], + [ + -20, + -38, + -56 + ], + [ + -22, + -43, + -64 + ], + [ + -24, + -48, + -72 + ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_col_major.json new file mode 100644 index 000000000000..2c21c3d3e410 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_col_major.json @@ -0,0 +1,38 @@ +{ + "order": "column-major", + + "side": "right", + + "M": 4, + "N": 3, + + "V": [ 0.0, 0.0, 0.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 0, + "LDC": 4, + "C_mat": [ + [ 1.0, 5.0, 9.0 ], + [ 2.0, 6.0, 10.0 ], + [ 3.0, 7.0, 11.0 ], + [ 4.0, 8.0, 12.0 ] + ], + + "work": [ 0.0, 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ 0.5, 1.0, 1.5, 2.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "C_out_mat": [ + [ 0.5, 5.0, 9.0 ], + [ 1.0, 6.0, 10.0 ], + [ 1.5, 7.0, 11.0 ], + [ 2.0, 8.0, 12.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_row_major.json new file mode 100644 index 000000000000..dd34349079e5 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_eq_zero_row_major.json @@ -0,0 +1,38 @@ +{ + "order": "row-major", + + "side": "right", + + "M": 4, + "N": 3, + + "V": [ 0.0, 0.0, 0.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ 1.0, 5.0, 9.0 ], + [ 2.0, 6.0, 10.0 ], + [ 3.0, 7.0, 11.0 ], + [ 4.0, 8.0, 12.0 ] + ], + + "work": [ 0.0, 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ 0.5, 5.0, 9.0, 1.0, 6.0, 10.0, 1.5, 7.0, 11.0, 2.0, 8.0, 12.0 ], + "C_out_mat": [ + [ 0.5, 5.0, 9.0 ], + [ 1.0, 6.0, 10.0 ], + [ 1.5, 7.0, 11.0 ], + [ 2.0, 8.0, 12.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_col_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_col_major.json new file mode 100644 index 000000000000..a2e361ce3d26 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_col_major.json @@ -0,0 +1,38 @@ +{ + "order": "column-major", + + "side": "right", + + "M": 4, + "N": 3, + + "V": [ 1.0, 2.0, 3.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0 ], + "strideC1": 1, + "strideC2": 4, + "offsetC": 0, + "LDC": 4, + "C_mat": [ + [ 1.0, 5.0, 9.0 ], + [ 2.0, 6.0, 10.0 ], + [ 3.0, 7.0, 11.0 ], + [ 4.0, 8.0, 12.0 ] + ], + + "work": [ 0.0, 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ -18.0, -20.0, -22.0, -24.0, -33.0, -38.0, -43.0, -48.0, -48.0, -56.0, -64.0, -72.0 ], + "C_out_mat": [ + [ -18.0, -33.0, -48.0 ], + [ -20.0, -38.0, -56.0 ], + [ -22.0, -43.0, -64.0 ], + [ -24.0, -48.0, -72.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_row_major.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_row_major.json new file mode 100644 index 000000000000..d0c2d710718a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/right_lastv_gt_zero_row_major.json @@ -0,0 +1,38 @@ +{ + "order": "row-major", + + "side": "right", + + "M": 4, + "N": 3, + + "V": [ 1.0, 2.0, 3.0 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.5, + + "C": [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ 1.0, 5.0, 9.0 ], + [ 2.0, 6.0, 10.0 ], + [ 3.0, 7.0, 11.0 ], + [ 4.0, 8.0, 12.0 ] + ], + + "work": [ 0.0, 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ -18.0, -33.0, -48.0, -20.0, -38.0, -56.0, -22.0, -43.0, -64.0, -24.0, -48.0, -72.0 ], + "C_out_mat": [ + [ -18.0, -33.0, -48.0 ], + [ -20.0, -38.0, -56.0 ], + [ -22.0, -43.0, -64.0 ], + [ -24.0, -48.0, -72.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/tau_eq_zero.json b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/tau_eq_zero.json new file mode 100644 index 000000000000..05f1a7e1aa6a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/fixtures/tau_eq_zero.json @@ -0,0 +1,36 @@ +{ + "order": "row-major", + + "side": "left", + + "M": 3, + "N": 3, + + "V": [ 0.5, 0.5, 0.5 ], + "strideV": 1, + "offsetV": 0, + + "tau": 0.0, + + "C": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ], + "strideC1": 3, + "strideC2": 1, + "offsetC": 0, + "LDC": 3, + "C_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] + ], + + "work": [ 0.0, 0.0, 0.0 ], + "strideWork": 1, + "offsetWork": 0, + + "C_out": [ 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0 ], + "C_out_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 4.0, 5.0, 6.0 ], + [ 7.0, 8.0, 9.0 ] + ] +} diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js new file mode 100644 index 000000000000..d8e62d56f6d4 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.dlarf1f.js @@ -0,0 +1,369 @@ +/** +* @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. +*/ + +/* eslint-disable max-len, id-length */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var dlarf1f = require( './../lib/dlarf1f.js' ); + + +// FIXTURES // + +var TAU_EQ_ZERO = require( './fixtures/tau_eq_zero.json' ); +var LEFT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/left_lastv_eq_zero_row_major.json' ); +var LEFT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/left_lastv_eq_zero_col_major.json' ); +var LEFT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/left_lastv_gt_zero_row_major.json' ); +var LEFT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/left_lastv_gt_zero_col_major.json' ); +var RIGHT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/right_lastv_eq_zero_row_major.json' ); +var RIGHT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/right_lastv_eq_zero_col_major.json' ); +var RIGHT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/right_lastv_gt_zero_row_major.json' ); +var RIGHT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/right_lastv_gt_zero_col_major.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dlarf1f, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 10', function test( t ) { + t.strictEqual( dlarf1f.length, 10, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not a valid order', function test( t ) { + var values; + var work; + var V; + var C; + var i; + + C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); + V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); + work = new Float64Array( 3 ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dlarf1f( value, 'left', 3, 3, V, 1, 1.0, C, 3, work ); + }; + } +}); + +tape( 'the function throws an error if provided a second argument which is not a valid side', function test( t ) { + var values; + var work; + var V; + var C; + var i; + + C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); + V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); + work = new Float64Array( 3 ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dlarf1f( 'row-major', value, 3, 3, V, 1, 1.0, C, 3, work ); + }; + } +}); + +tape( 'the function throws an error if provided a ninth argument which is not a valid LDC value', function test( t ) { + var values; + var work; + var V; + var C; + var i; + + C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); + V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); + work = new Float64Array( 3 ); + + values = [ + 0, + 1, + 2 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dlarf1f( 'row-major', 'left', 3, 3, V, 1, 1.0, C, value, work ); + }; + } +}); + +tape( 'the function throws an error if provided a sixth argument which is not a valid incv value', function test( t ) { + var work; + var V; + var C; + + C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); + V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); + work = new Float64Array( 3 ); + + t.throws( badValue( 0 ), RangeError, 'throws an error when provided ' + 0 ); + t.end(); + + function badValue( value ) { + return function badValue() { + dlarf1f( 'row-major', 'left', 3, 3, V, value, 1.0, C, 3, work ); + }; + } +}); + +tape( 'the function returns the array unchanged if tau is zero', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = TAU_EQ_ZERO; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv = 0 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv = 0 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv > 0 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv > 0 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for right side, lastv = 0 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for right side, lastv = 0 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for right side, lastv > 0 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for right side, lastv > 0 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.order, data.side, data.M, data.N, V, data.strideV, data.tau, C, data.LDC, work ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.js new file mode 100644 index 000000000000..2bc5f6fbce25 --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/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 dlarf1f = 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 dlarf1f, '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 dlarf1f.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 dlarf1f = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dlarf1f, 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 dlarf1f; + var main; + + main = require( './../lib/dlarf1f.js' ); + + dlarf1f = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dlarf1f, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.ndarray.js b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.ndarray.js new file mode 100644 index 000000000000..2b26ee36112a --- /dev/null +++ b/lib/node_modules/@stdlib/lapack/base/dlarf1f/test/test.ndarray.js @@ -0,0 +1,994 @@ +/** +* @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. +*/ + +/* eslint-disable max-len, id-length */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float64Array = require( '@stdlib/array/float64' ); +var dlarf1f = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var TAU_EQ_ZERO = require( './fixtures/tau_eq_zero.json' ); +var LEFT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/left_lastv_eq_zero_row_major.json' ); +var LEFT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/left_lastv_eq_zero_col_major.json' ); +var LEFT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/left_lastv_gt_zero_row_major.json' ); +var LEFT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/left_lastv_gt_zero_col_major.json' ); +var RIGHT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/right_lastv_eq_zero_row_major.json' ); +var RIGHT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/right_lastv_eq_zero_col_major.json' ); +var RIGHT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/right_lastv_gt_zero_row_major.json' ); +var RIGHT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/right_lastv_gt_zero_col_major.json' ); + +var MIXED_STRIDES_RIGHT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/mixed_strides/right_lastv_gt_zero_row_major.json' ); +var NEGATIVE_STRIDES_RIGHT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/negative_strides/right_lastv_gt_zero_row_major.json' ); +var LARGE_STRIDES_RIGHT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/large_strides/right_lastv_gt_zero_row_major.json' ); +var OFFSETS_RIGHT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/offsets/right_lastv_gt_zero_row_major.json' ); + +var NEGATIVE_STRIDES_RIGHT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/negative_strides/right_lastv_gt_zero_col_major.json' ); +var MIXED_STRIDES_RIGHT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/mixed_strides/right_lastv_gt_zero_col_major.json' ); +var LARGE_STRIDES_RIGHT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/large_strides/right_lastv_gt_zero_col_major.json' ); +var OFFSETS_RIGHT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/offsets/right_lastv_gt_zero_col_major.json' ); + +var MIXED_STRIDES_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/mixed_strides/right_lastv_eq_zero_row_major.json' ); +var NEGATIVE_STRIDES_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/negative_strides/right_lastv_eq_zero_row_major.json' ); +var LARGE_STRIDES_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/large_strides/right_lastv_eq_zero_row_major.json' ); +var OFFSETS_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/offsets/right_lastv_eq_zero_row_major.json' ); + +var NEGATIVE_STRIDES_RIGHT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/negative_strides/right_lastv_eq_zero_col_major.json' ); +var MIXED_STRIDES_RIGHT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/mixed_strides/right_lastv_eq_zero_col_major.json' ); +var LARGE_STRIDES_RIGHT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/large_strides/right_lastv_eq_zero_col_major.json' ); +var OFFSETS_RIGHT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/offsets/right_lastv_eq_zero_col_major.json' ); + +var NEGATIVE_STRIDES_LEFT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/negative_strides/left_lastv_gt_zero_row_major.json' ); +var MIXED_STRIDES_LEFT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/mixed_strides/left_lastv_gt_zero_row_major.json' ); +var LARGE_STRIDES_LEFT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/large_strides/left_lastv_gt_zero_row_major.json' ); +var OFFSETS_LEFT_LASTV_GT_ZERO_ROW_MAJOR = require( './fixtures/offsets/left_lastv_gt_zero_row_major.json' ); + +var MIXED_STRIDES_LEFT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/mixed_strides/left_lastv_gt_zero_col_major.json' ); +var LARGE_STRIDES_LEFT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/large_strides/left_lastv_gt_zero_col_major.json' ); +var OFFSETS_LEFT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/offsets/left_lastv_gt_zero_col_major.json' ); +var NEGATIVE_STRIDES_LEFT_LASTV_GT_ZERO_COL_MAJOR = require( './fixtures/negative_strides/left_lastv_gt_zero_col_major.json' ); + +var MIXED_STRIDES_LEFT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/mixed_strides/left_lastv_eq_zero_row_major.json' ); +var LARGE_STRIDES_LEFT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/large_strides/left_lastv_eq_zero_row_major.json' ); +var OFFSETS_LEFT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/offsets/left_lastv_eq_zero_row_major.json' ); +var NEGATIVE_STRIDES_LEFT_LASTV_EQ_ZERO_ROW_MAJOR = require( './fixtures/negative_strides/left_lastv_eq_zero_row_major.json' ); + +var MIXED_STRIDES_LEFT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/mixed_strides/left_lastv_eq_zero_col_major.json' ); +var LARGE_STRIDES_LEFT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/large_strides/left_lastv_eq_zero_col_major.json' ); +var OFFSETS_LEFT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/offsets/left_lastv_eq_zero_col_major.json' ); +var NEGATIVE_STRIDES_LEFT_LASTV_EQ_ZERO_COL_MAJOR = require( './fixtures/negative_strides/left_lastv_eq_zero_col_major.json' ); + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof dlarf1f, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 14', function test( t ) { + t.strictEqual( dlarf1f.length, 14, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided a first argument which is not a valid side', function test( t ) { + var values; + var work; + var V; + var C; + var i; + + C = new Float64Array( [ 1.0, 5.0, 9.0, 2.0, 6.0, 10.0, 3.0, 7.0, 11.0, 4.0, 8.0, 12.0 ] ); + V = new Float64Array( [ 0.5, 0.5, 0.5, 0.5 ] ); + work = new Float64Array( 3 ); + + values = [ + 'foo', + 'bar', + 'beep', + 'boop', + -5, + NaN, + true, + false, + null, + void 0, + [], + {}, + function noop() {} + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + dlarf1f( 'row-major', value, 3, 3, V, 1, 1.0, C, 3, work ); + }; + } +}); + +tape( 'the function returns the array unchanged if tau is zero', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = TAU_EQ_ZERO; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv = 0 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv = 0 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv > 0 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for left side, lastv > 0 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LEFT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for right side, lastv = 0 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for right side, lastv = 0 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for right side, lastv > 0 (row-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function expected value for right side, lastv > 0 (column-major)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = RIGHT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv > 0 (row-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_RIGHT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv > 0 (row-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_RIGHT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv > 0 (row-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_RIGHT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv > 0 (row-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_RIGHT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv > 0 (column-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_RIGHT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv > 0 (column-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_RIGHT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv > 0 (column-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_RIGHT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv > 0 (column-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_RIGHT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (row-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (row-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (row-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (row-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_RIGHT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (column-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_RIGHT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (column-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_RIGHT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (column-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_RIGHT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for right side, lastv = 0 (column-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_RIGHT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (row-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_LEFT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (row-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_LEFT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (row-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_LEFT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (row-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_LEFT_LASTV_GT_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (column-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_LEFT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (column-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_LEFT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (column-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_LEFT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv > 0 (column-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_LEFT_LASTV_GT_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (row-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_LEFT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (row-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_LEFT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (row-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_LEFT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (row-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_LEFT_LASTV_EQ_ZERO_ROW_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (column-major, mixed strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = MIXED_STRIDES_LEFT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (column-major, large strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = LARGE_STRIDES_LEFT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (column-major, offsets)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = OFFSETS_LEFT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +}); + +tape( 'the function computes the expected value for left side, lastv = 0 (column-major, negative strides)', function test( t ) { + var expectedC; + var data; + var work; + var out; + var V; + var C; + + data = NEGATIVE_STRIDES_LEFT_LASTV_EQ_ZERO_COL_MAJOR; + + V = new Float64Array( data.V ); + C = new Float64Array( data.C ); + work = new Float64Array( data.work ); + + out = dlarf1f( data.side, data.M, data.N, V, data.strideV, data.offsetV, data.tau, C, data.strideC1, data.strideC2, data.offsetC, work, data.strideWork, data.offsetWork ); + expectedC = new Float64Array( data.C_out ); + + t.deepEqual( out, expectedC, 'returns expected value' ); + t.end(); +});