From 9a56828072aeddf54151c5c51e575f3b47c08428 Mon Sep 17 00:00:00 2001 From: aman-095 Date: Mon, 8 Jul 2024 16:07:25 +0530 Subject: [PATCH 01/25] feat: add BLAS Level 2 routine for strmv --- .../@stdlib/blas/base/strmv/README.md | 252 +++++++ .../blas/base/strmv/benchmark/benchmark.js | 104 +++ .../base/strmv/benchmark/benchmark.ndarray.js | 104 +++ .../@stdlib/blas/base/strmv/docs/repl.txt | 122 ++++ .../blas/base/strmv/docs/types/index.d.ts | 118 ++++ .../blas/base/strmv/docs/types/test.ts | 358 ++++++++++ .../@stdlib/blas/base/strmv/examples/index.js | 34 + .../@stdlib/blas/base/strmv/lib/index.js | 70 ++ .../@stdlib/blas/base/strmv/lib/main.js | 35 + .../@stdlib/blas/base/strmv/lib/ndarray.js | 184 +++++ .../@stdlib/blas/base/strmv/lib/strmv.js | 183 +++++ .../@stdlib/blas/base/strmv/package.json | 68 ++ .../test/fixtures/column_major_l_nt_nu.json | 14 + .../test/fixtures/column_major_l_nt_u.json | 14 + .../test/fixtures/column_major_l_t_nu.json | 14 + .../test/fixtures/column_major_l_t_u.json | 14 + .../test/fixtures/column_major_u_nt_nu.json | 14 + .../test/fixtures/column_major_u_nt_u.json | 14 + .../test/fixtures/column_major_u_t_nu.json | 14 + .../test/fixtures/column_major_u_t_u.json | 14 + .../strmv/test/fixtures/column_major_xn.json | 14 + .../strmv/test/fixtures/column_major_xt.json | 14 + .../test/fixtures/row_major_l_nt_nu.json | 14 + .../strmv/test/fixtures/row_major_l_nt_u.json | 14 + .../strmv/test/fixtures/row_major_l_t_nu.json | 14 + .../strmv/test/fixtures/row_major_l_t_u.json | 14 + .../test/fixtures/row_major_u_nt_nu.json | 14 + .../strmv/test/fixtures/row_major_u_nt_u.json | 14 + .../strmv/test/fixtures/row_major_u_t_nu.json | 14 + .../strmv/test/fixtures/row_major_u_t_u.json | 14 + .../strmv/test/fixtures/row_major_xn.json | 14 + .../strmv/test/fixtures/row_major_xt.json | 14 + .../@stdlib/blas/base/strmv/test/test.js | 82 +++ .../blas/base/strmv/test/test.ndarray.js | 666 ++++++++++++++++++ .../blas/base/strmv/test/test.strmv.js | 666 ++++++++++++++++++ 35 files changed, 3326 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/README.md create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/examples/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/package.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xn.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xt.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xn.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xt.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/test.js create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/test.strmv.js diff --git a/lib/node_modules/@stdlib/blas/base/strmv/README.md b/lib/node_modules/@stdlib/blas/base/strmv/README.md new file mode 100644 index 000000000000..9b85132f1ad0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/README.md @@ -0,0 +1,252 @@ + + +# strmv + +> Perform one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. + +
+ +## Usage + +```javascript +var strmv = require( '@stdlib/blas/base/strmv' ); +``` + +#### strmv( order, uplo, trans, diag, N, A, LDA, x, sx ) + +Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); + +var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); + +strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +// x => [ 14.0, 8.0, 3.0 ] +``` + +The function has the following parameters: + +- **order**: storage layout. +- **uplo**: specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced. +- **trans**: specifies whether the matrix `A` is a non-transpose, transpose, or conjugate-transpose. +- **diag**: specifies whether or not the matrix `A` is a unit triangular. +- **N**: number of elements along each dimension of `A`. +- **A**: input matrix stored in linear memory as a [`Float32Array`][mdn-float32array]. +- **lda**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **x**: input [`Float32Array`][mdn-float32array]. +- **sx**: index increment for `x`. + +The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); + +var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); + +strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, -1 ); +// x => [ 1.0, 4.0, 10.0 ] +``` + +Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. + + + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); + +// Initial arrays... +var x0 = new Float32Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); + +// Create offset views... +var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x1, 1 ); +// x0 => [ 1.0, 6.0, 3.0, 1.0 ] +``` + +#### strmv.ndarray( order, uplo, trans, diag, N, A, LDA, x, sx, ox ) + +Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. + +```javascript +var Float32Array = require( '@stdlib/array/float32' ); + +var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); + +strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, 1, 0 ); +// x => [ 14.0, 8.0, 3.0 ] +``` + +The function has the following additional parameters: + +- **ox**: starting index for `x`. + +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 Float32Array = require( '@stdlib/array/float32' ); + +var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); + +strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, -1, 2 ); +// x => [ 1.0, 4.0, 10.0 ] +``` + +
+ + + +
+ +## Notes + +- `strmv()` corresponds to the [BLAS][blas] level 2 function [`strmv`][strmv]. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var strmv = require( '@stdlib/blas/base/strmv' ); + +var opts = { + 'dtype': 'float32' +}; + +var N = 3; + +var A = discreteUniform( N*N, -10.0, 10.0, opts ); +var x = discreteUniform( N, -10.0, 10.0, opts ); + +strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +console.log( x ); +``` + +
+ + + + + +* * * + +
+ +## C APIs + + + +
+ +
+ + + + + +
+ +### Usage + +```c +TODO +``` + +#### TODO + +TODO. + +```c +TODO +``` + +TODO + +```c +TODO +``` + +
+ + + + + +
+ +
+ + + + + +
+ +### Examples + +```c +TODO +``` + +
+ + + +
+ + + + + + + + + + + + + + diff --git a/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.js new file mode 100644 index 000000000000..9c71430bacfb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.js @@ -0,0 +1,104 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var ones = require( '@stdlib/array/ones' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var pkg = require( './../package.json' ).name; +var strmv = require( './../lib/strmv.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var x = ones( N, options.dtype ); + var A = ones( N*N, options.dtype ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = strmv( 'row-major', 'upper', 'transpose', 'non-unit', N, A, N, x, 1 ); + if ( isnanf( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..c590c1e76ee5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js @@ -0,0 +1,104 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 isnanf = require( '@stdlib/math/base/assert/is-nanf' ); +var ones = require( '@stdlib/array/ones' ); +var pow = require( '@stdlib/math/base/special/pow' ); +var floor = require( '@stdlib/math/base/special/floor' ); +var pkg = require( './../package.json' ).name; +var strmv = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float32' +}; + + +// FUNCTIONS // + +/** +* Creates a benchmark function. +* +* @private +* @param {PositiveInteger} N - number of elements along each dimension +* @returns {Function} benchmark function +*/ +function createBenchmark( N ) { + var x = ones( N, options.dtype ); + var A = ones( N*N, options.dtype ); + return benchmark; + + /** + * Benchmark function. + * + * @private + * @param {Benchmark} b - benchmark instance + */ + function benchmark( b ) { + var z; + var i; + + b.tic(); + for ( i = 0; i < b.iterations; i++ ) { + z = strmv( 'row-major', 'upper', 'transpose', 'non-unit', N, A, N, 0, x, 1, 0 ); + if ( isnanf( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnanf( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var min; + var max; + var N; + var f; + var i; + + min = 1; // 10^min + max = 6; // 10^max + + for ( i = min; i <= max; i++ ) { + N = floor( pow( pow( 10, i ), 1.0/2.0 ) ); + f = createBenchmark( N ); + bench( pkg+':ndarray:size='+(N*N), f ); + } +} + +main(); diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt new file mode 100644 index 000000000000..21c1b7e8980c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt @@ -0,0 +1,122 @@ + +{{alias}}( ord, uplo, trans, diag, N, A, lda, x, sx ) + Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, + where `x` is an `N` element vector, and `A` is an `N` by `N` unit, + or non-unit, upper or lower triangular matrix. + + Indexing is relative to the first index. To introduce an offset, use typed + array views. + + If `N` is equal to `0`, the function returns `x` unchanged. + + Parameters + ---------- + ord: string + Row-major (C-style) or column-major (Fortran-style) order. Must be + either 'row-major' or 'column-major'. + + uplo: string + Specifies whether to reference the upper or lower triangular part of + `A`. + + trans: string + Specifies whether the matrix `A` is non-transpose, transpose, or + conjugate transpose. + + diag: string + Specifies whether or not `A` is unit triangular. + + N: integer + Number of elements along each dimension of `A`. + + A: Float32Array + Matrix. + + lda: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + x: Float32Array + Input vector. + + sx: integer + Index increment for `x`. + + Returns + ------- + x: Float32Array + Output vector. + + Examples + -------- + > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, 1.0 ] ); + > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 1.0 ] ); + > {{alias}}( 'row-major', 'upper', 'none', 'unit', 2, A, 2, x, 1 ) + [ 3.0, 1.0 ] + + +{{alias}}.ndarray( ord, uplo, trans, diag, N, A, lda, oa, x, sx, ox ) + Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, + using alternative indexing semantics, where `x` is an `N` element + vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower + triangular matrix. + + While typed array views mandate a view offset based on the underlying + buffer, the offset parameters support indexing semantics based on starting + indices. + + Parameters + ---------- + ord: string + Row-major (C-style) or column-major (Fortran-style) ord. Must be + either 'row-major' or 'column-major'. + + uplo: string + Specifies whether to reference the upper or lower triangular part of + `A`. + + trans: string + Specifies whether the matrix `A` is non-transpose, transpose, or + conjugate transpose. + + diag: string + Specifies whether or not `A` is unit triangular. + + N: integer + Number of elements along each dimension of `A`. + + A: Float32Array + Matrix. + + lda: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + oa: integer + Starting index for `A`. + + x: Float32Array + Input vector. + + sx: integer + Index increment for `x`. + + ox: integer + Starting index for `x`. + + Returns + ------- + x: Float32Array + Output array. + + Examples + -------- + > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, 1.0 ] ); + > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 1.0 ] ); + > var ord = 'row-major'; + > var uplo = 'upper'; + > {{alias}}.ndarray( ord, uplo, 'none', 'unit', 2, A, 2, 0, x, 1, 0 ) + [ 3.0, 1.0 ] + + See Also + -------- diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts new file mode 100644 index 000000000000..c00933a56371 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts @@ -0,0 +1,118 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +// TypeScript Version: 4.1 + +/// + +import { Layout, MatrixTriangle, TransposeOperation, DiagonalType } from '@stdlib/types/blas'; + +/** +* Interface describing `strmv`. +*/ +interface Routine { + /** + * Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. + * + * @param order - storage layout + * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced + * @param trans - specifies whether the matrix `A` is a non-transpose, transpose, or conjugate-transpose + * @param diag - specifies whether or not `A` is unit triangular + * @param N - number of elements along each dimension in the matrix `A` + * @param A - matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param x - first input array + * @param strideX - `x` stride length + * @returns `x` + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); + * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); + * + * strmv( row-major', 'upper', 'none', 'non-unit', 3, A, 3, x, 1 ); + * // x => [ 14.0, 8.0, 3.0 ] + */ + ( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number ): Float32Array; + + /** + * Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. + * + * @param order - storage layout + * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced + * @param trans - specifies whether the matrix `A` is a non-transpose, transpose, or conjugate-transpose + * @param diag - specifies whether or not `A` is unit triangular + * @param N - number of elements along each dimension in the matrix `A` + * @param A - matrix + * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param x - first input array + * @param strideX - `x` stride length + * @param offsetX - starting `x` index + * @returns `x` + * + * @example + * var Float32Array = require( '@stdlib/array/float32' ); + * + * var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); + * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); + * + * strmv.ndarray( row-major', 'upper', 'none', 'non-unit', 3, A, 3, 0, x, 1, 0 ); + * // x => [ 14.0, 8.0, 3.0 ] + */ + ndarray( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number, offsetX: number ): Float32Array; +} + +/** +* Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* +* @param order - storage layout +* @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced +* @param trans - specifies whether the matrix `A` is a non-transpose, transpose, or conjugate-transpose +* @param diag - specifies whether or not `A` is unit triangular +* @param N - number of elements along each dimension in the matrix `A` +* @param A - matrix +* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param x - first input array +* @param strideX - `x` stride length +* @returns `x` +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var A = new Float32Array( [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ] ); +* var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +* +* strmv( 'row-major', 'lower', 'none', 'non-unit', 3, A, 3, x, 1 ); +* // x => [ 1.0, 5.0, 15.0 ] +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var A = new Float32Array( [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ] ); +* var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +* +* strmv.ndarray( 'row-major', 'lower', 'none', 'non-unit', 3, A, 3, 0, x, 1, 0 ); +* // x => [ 1.0, 5.0, 15.0 ] +*/ +declare var strmv: Routine; + + +// EXPORTS // + +export = strmv; diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts new file mode 100644 index 000000000000..d2b0e692bb79 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts @@ -0,0 +1,358 @@ +/* +* @license Apache-2.0 +* +* Copyright (c) 2024 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 strmv = require( './index' ); + + +// TESTS // + +// The function returns a Float32Array... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectType Float32Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv( 10, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( true, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( false, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( null, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( undefined, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( [], 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( {}, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( ( x: number ): number => x, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a string... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv( 'row-major', 10, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', true, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', false, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', null, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', undefined, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', [], 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', {}, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', ( x: number ): number => x, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a string... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv( 'row-major', 'upper', 10, 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', true, 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', false, 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', null, 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', undefined, 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', [], 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', {}, 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', ( x: number ): number => x, 'unit', 10, A, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a string... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv( 'row-major', 'upper', 'none', 10, 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', true, 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', false, 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', null, 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', undefined, 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', [], 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', {}, 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', ( x: number ): number => x, 10, A, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv( 'row-major', 'upper', 'none', 'unit', '10', A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', true, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', false, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', null, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', undefined, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', [], A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', {}, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', ( x: number ): number => x, A, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a Float32Array... +{ + const x = new Float32Array( 10 ); + + strmv( 'row-major', 'upper', 'none', 'unit', 10, 10, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, '10', 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, true, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, false, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, null, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, undefined, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, [ '1' ], 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, {}, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, ( x: number ): number => x, 10, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, '10', x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, true, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, false, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, null, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, undefined, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, [], x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, {}, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, ( x: number ): number => x, x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eighth argument which is not a Float32Array... +{ + const A = new Float32Array( 20 ); + + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 10, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, '10', 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, true, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, false, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, null, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, undefined, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, [ '1' ], 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, {}, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, ( x: number ): number => x, 1 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, '10' ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, true ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, false ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, null ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, undefined ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, [] ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, {} ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv(); // $ExpectError + strmv( 'row-major' ); // $ExpectError + strmv( 'row-major', 'upper' ); // $ExpectError + strmv( 'row-major', 'upper', 'none' ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit' ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10 ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x ); // $ExpectError + strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, 1 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Float32Array... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, 0 ); // $ExpectType Float32Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv.ndarray( 10, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( true, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( false, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( null, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( undefined, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( [], 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( {}, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( ( x: number ): number => x, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a second argument which is not a string... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv.ndarray( 'row-major', 10, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', true, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', false, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', null, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', undefined, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', [], 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', {}, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', ( x: number ): number => x, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a third argument which is not a string... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv.ndarray( 'row-major', 'upper', 10, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', true, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', false, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', null, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', undefined, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', [], 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', {}, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', ( x: number ): number => x, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourth argument which is not a string... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv.ndarray( 'row-major', 'upper', 'none', 10, 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', true, 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', false, 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', null, 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', undefined, 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', [], 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', {}, 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', ( x: number ): number => x, 10, A, 10, x, 1 , 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fifth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', '10', A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', true, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', false, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', null, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', undefined, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', [], A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', {}, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', ( x: number ): number => x, A, 10, x, 1 , 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a sixth argument which is not a Float32Array... +{ + const x = new Float32Array( 10 ); + + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, 10, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, '10', 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, true, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, false, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, null, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, undefined, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, [ '1' ], 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, {}, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, ( x: number ): number => x, 10, x, 1 , 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a seventh argument which is not a number... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, '10', x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, true, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, false, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, null, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, undefined, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, [], x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, {}, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, ( x: number ): number => x, x, 1 , 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eighth argument which is not a Float32Array... +{ + const A = new Float32Array( 20 ); + + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 10, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, '10', 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, true, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, false, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, null, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, undefined, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, [ '1' ], 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, {}, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, ( x: number ): number => x, 1 , 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a ninth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, '10', 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, true, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, false, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, null, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, undefined, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, [], 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, {}, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a number... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, '10' ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, true ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, false ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, null ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, undefined ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, [] ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, {} ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, ( x: number ): number => x ); // $ExpectError +} + +// The compiler throws an error if the function is provided an unsupported number of arguments... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv.ndarray(); // $ExpectError + strmv.ndarray( 'row-major' ); // $ExpectError + strmv.ndarray( 'row-major', 'upper' ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none' ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit' ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/examples/index.js b/lib/node_modules/@stdlib/blas/base/strmv/examples/index.js new file mode 100644 index 000000000000..c801e500d78b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/examples/index.js @@ -0,0 +1,34 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var strmv = require( './../lib' ); + +var opts = { + 'dtype': 'float32' +}; + +var N = 3; + +var A = discreteUniform( N*N, -10.0, 10.0, opts ); +var x = discreteUniform( N, -10.0, 10.0, opts ); + +strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js new file mode 100644 index 000000000000..53b4a30662ae --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js @@ -0,0 +1,70 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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'; + +/** +* BLAS level 2 routine to perform one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* +* @module @stdlib/blas/base/strmv +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* var strmv = require( '@stdlib/blas/base/strmv' ); +* +* var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +* +* strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +* // x => [ 14.0, 8.0, 3.0 ] +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* var strmv = require( '@stdlib/blas/base/strmv' ); +* +* var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +* +* strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, 1, 0 ); +* // x => [ 14.0, 8.0, 3.0 ] +*/ + +// MODULES // + +var join = require( 'path' ).join; +var tryRequire = require( '@stdlib/utils/try-require' ); +var isError = require( '@stdlib/assert/is-error' ); +var main = require( './main.js' ); + + +// MAIN // + +var strmv; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + strmv = main; +} else { + strmv = tmp; +} + + +// EXPORTS // + +module.exports = strmv; + +// exports: { "ndarray": "strmv.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/main.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/main.js new file mode 100644 index 000000000000..1a3138d5e845 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/main.js @@ -0,0 +1,35 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 strmv = require( './strmv.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( strmv, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = strmv; diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js new file mode 100644 index 000000000000..cce92e3a6c16 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js @@ -0,0 +1,184 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 f32 = require( '@stdlib/number/float64/base/to-float32' ); +var max = require( '@stdlib/math/base/special/max' ); +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation'); +var isDiagonal = require( '@stdlib/blas/base/assert/is-diagonal-type' ); + + +// MAIN // + +/** +* Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* +* @param {string} order - storage layout +* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied +* @param {string} trans - specifies whether the matrix `A` is a none-transpose, transpose, or conjugate-transpose +* @param {string} diag - specifies whether or not the matrix `A` is a unit triangular +* @param {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {Float32Array} A - matrix +* @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {NonNegativeInteger} offsetA - index offset for `A` +* @param {Float32Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - index offset for `x` +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must specify whether the lower or upper triangular matrix is supplied +* @throws {RangeError} third argument must be a nonnegative integer +* @throws {RangeError} seventh argument must be non-zero +* @throws {RangeError} tenth argument must be non-zero +* @returns {Float32Array} `x` +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +* +* strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, 1, 0 ); +* // x => [ 14.0, 8.0, 3.0 ] +*/ +function strmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len + var temp; + var ix; + var jx; + var kx; + var i; + var j; + + if ( !isLayout( order ) ) { + throw new TypeError( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ); + } + if ( !isMatrixTriangle( uplo ) ) { + throw new TypeError( 'invalid argument. Second argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ); + } + if ( !isTransposeOperation( trans ) ) { + throw new TypeError( 'invalid argument. Third argument must specify whether the matrix is none-transpose, transpose, or conjugate-transpose. Value: `%s`.', trans ); + } + if ( !isDiagonal( diag ) ) { + throw new TypeError( 'invalid argument. Fourth argument must be a valid diagonal type. Value: `%s`.', diag ); + } + if ( N < 0 ) { + throw new RangeError( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', N ); + } + if ( LDA < max( 1, N ) ) { + throw new RangeError( 'invalid argument. Sixth argument must be greater than or equal to the maximum of 1 and the number of elements in the first dimension of `A`. Value: `%d`.', LDA ); + } + if ( strideX === 0 ) { + throw new RangeError( 'invalid argument. Seventh argument must be non-zero. Value: `%d`.', strideX ); + } + if ( N === 0 ) { + return x; + } + kx = offsetX; + if ( + ( order === 'column-major' && trans === 'none' && uplo === 'upper' ) || + ( order === 'row-major' && trans !== 'none' && uplo === 'lower' ) + ) { + jx = kx; + for ( j = 0; j < N; j++ ) { + if ( x[ jx ] !== 0.0 ) { + temp = x[ jx ]; + ix = kx; + for ( i = 0; i < j; i++ ) { + x[ ix ] += f32( temp * A[ offsetA + i + ( LDA * j ) ] ); + ix += strideX; + } + if ( diag === 'non-unit' ) { + x[ jx ] = f32( x[ jx ] * A[ offsetA + j + ( j * LDA ) ] ); + } + } + jx += strideX; + } + return x; + } + if ( + ( order === 'column-major' && trans === 'none' && uplo === 'lower' ) || + ( order === 'row-major' && trans !== 'none' && uplo === 'upper' ) + ) { + kx += ( N - 1 ) * strideX; + jx = kx; + for ( j = N - 1; j >= 0; j-- ) { + if ( x[ jx ] !== 0.0 ) { + temp = x[ jx ]; + ix = kx; + for ( i = N - 1; i > j; i-- ) { + x[ ix ] += f32( temp * A[ offsetA + i + ( LDA * j ) ] ); + ix -= strideX; + } + if ( diag === 'non-unit' ) { + x[ jx ] = f32( x[ jx ] * A[ offsetA + j + ( j * LDA ) ] ); + } + } + jx -= strideX; + } + return x; + } + if ( + ( order === 'column-major' && trans !== 'none' && uplo === 'upper' ) || + ( order === 'row-major' && trans === 'none' && uplo === 'lower' ) + ) { + jx = kx + ( ( N - 1 ) * strideX ); + for ( j = N - 1; j >= 0; j-- ) { + temp = x[ jx ]; + ix = jx; + if ( diag === 'non-unit' ) { + temp = f32( temp * A[ offsetA + j + ( j * LDA ) ] ); + } + for ( i = j - 1; i >= 0; i-- ) { + ix -= strideX; + temp = f32( temp + ( x[ ix ] * A[ offsetA + i + ( LDA * j ) ] ) ); // eslint-disable-line max-len + } + x[ jx ] = temp; + jx -= strideX; + } + return x; + } + if ( + ( order === 'column-major' && trans !== 'none' && uplo === 'lower' ) || + ( order === 'row-major' && trans === 'none' && uplo === 'upper' ) + ) { + jx = kx; + for ( j = 0; j < N; j++ ) { + temp = x[ jx ]; + ix = jx; + if ( diag === 'non-unit' ) { + temp = f32( temp * A[ offsetA + j + ( j * LDA ) ] ); + } + for ( i = j + 1; i < N; i++ ) { + ix += strideX; + temp = f32( temp + ( x[ ix ] * A[ offsetA + i + ( LDA * j ) ] ) ); // eslint-disable-line max-len + } + x[ jx ] = temp; + jx += strideX; + } + return x; + } +} + + +// EXPORTS // + +module.exports = strmv; diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js new file mode 100644 index 000000000000..9e66bfb73de7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js @@ -0,0 +1,183 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 f32 = require( '@stdlib/number/float64/base/to-float32' ); +var max = require( '@stdlib/math/base/special/max' ); +var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); +var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation'); +var isDiagonal = require( '@stdlib/blas/base/assert/is-diagonal-type' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset'); + + +// MAIN // + +/** +* Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* +* @param {string} order - storage layout +* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied +* @param {string} trans - specifies whether the matrix `A` is a non-transpose, transpose, or conjugate-transpose +* @param {string} diag - specifies whether or not the matrix `A` is a unit triangular +* @param {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {Float32Array} A - matrix +* @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Float32Array} x - first input array +* @param {integer} strideX - `x` stride length +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must specify whether the lower or upper triangular matrix is supplied +* @throws {RangeError} third argument must be a nonnegative integer +* @throws {RangeError} seventh argument must be non-zero +* @throws {RangeError} tenth argument must be non-zero +* @returns {Float32Array} `x` +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +* +* strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +* // x => [ 14.0, 8.0, 3.0 ] +*/ +function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { + var temp; + var ix; + var jx; + var kx; + var i; + var j; + + if ( !isLayout( order ) ) { + throw new TypeError( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ); + } + if ( !isMatrixTriangle( uplo ) ) { + throw new TypeError( 'invalid argument. Second argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ); + } + if ( !isTransposeOperation( trans ) ) { + throw new TypeError( 'invalid argument. Third argument must specify whether the matrix is none-transpose, transpose, or conjugate-transpose. Value: `%s`.', trans ); + } + if ( !isDiagonal( diag ) ) { + throw new TypeError( 'invalid argument. Fourth argument must be a valid diagonal type. Value: `%s`.', diag ); + } + if ( N < 0 ) { + throw new RangeError( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', N ); + } + if ( LDA < max( 1, N ) ) { + throw new RangeError( 'invalid argument. Sixth argument must be greater than or equal to the maximum of 1 and the number of elements in the first dimension of `A`. Value: `%d`.', LDA ); + } + if ( strideX === 0 ) { + throw new RangeError( 'invalid argument. Seventh argument must be non-zero. Value: `%d`.', strideX ); + } + if ( N === 0 ) { + return x; + } + kx = stride2offset( N, strideX ); + if ( + ( order === 'column-major' && trans === 'none' && uplo === 'upper' ) || + ( order === 'row-major' && trans !== 'none' && uplo === 'lower' ) + ) { + jx = kx; + for ( j = 0; j < N; j++ ) { + if ( x[ jx ] !== 0.0 ) { + temp = x[ jx ]; + ix = kx; + for ( i = 0; i < j; i++ ) { + x[ ix ] += f32( temp * A[ i + ( LDA * j ) ] ); + ix += strideX; + } + if ( diag === 'non-unit' ) { + x[ jx ] = f32( x[ jx ] * A[ ( j * LDA ) + j ] ); + } + } + jx += strideX; + } + return x; + } + if ( + ( order === 'column-major' && trans === 'none' && uplo === 'lower' ) || + ( order === 'row-major' && trans !== 'none' && uplo === 'upper' ) + ) { + kx += ( N - 1 ) * strideX; + jx = kx; + for ( j = N - 1; j >= 0; j-- ) { + if ( x[ jx ] !== 0.0 ) { + temp = x[ jx ]; + ix = kx; + for ( i = N - 1; i > j; i-- ) { + x[ ix ] += f32( temp * A[ i + ( LDA * j ) ] ); + ix -= strideX; + } + if ( diag === 'non-unit' ) { + x[ jx ] = f32( x[ jx ] * A[ ( j * LDA ) + j ] ); + } + } + jx -= strideX; + } + return x; + } + if ( + ( order === 'column-major' && trans !== 'none' && uplo === 'upper' ) || + ( order === 'row-major' && trans === 'none' && uplo === 'lower' ) + ) { + jx = kx + ( ( N - 1 ) * strideX ); + for ( j = N - 1; j >= 0; j-- ) { + temp = x[ jx ]; + ix = jx; + if ( diag === 'non-unit' ) { + temp = f32( temp * A[ ( j * LDA ) + j ] ); + } + for ( i = j - 1; i >= 0; i-- ) { + ix -= strideX; + temp = f32( temp + ( x[ ix ] * A[ i + ( LDA * j ) ] ) ); + } + x[ jx ] = temp; + jx -= strideX; + } + return x; + } + if ( + ( order === 'column-major' && trans !== 'none' && uplo === 'lower' ) || + ( order === 'row-major' && trans === 'none' && uplo === 'upper' ) + ) { + jx = kx; + for ( j = 0; j < N; j++ ) { + temp = x[ jx ]; + ix = jx; + if ( diag === 'non-unit' ) { + temp = f32( temp * A[ ( j * LDA ) + j ] ); + } + for ( i = j + 1; i < N; i++ ) { + ix += strideX; + temp = f32( temp + ( x[ ix ] * A[ i + ( LDA * j ) ] ) ); + } + x[ jx ] = temp; + jx += strideX; + } + return x; + } +} + + +// EXPORTS // + +module.exports = strmv; diff --git a/lib/node_modules/@stdlib/blas/base/strmv/package.json b/lib/node_modules/@stdlib/blas/base/strmv/package.json new file mode 100644 index 000000000000..66cfc9658164 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/blas/base/strmv", + "version": "0.0.0", + "description": "Perform one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.", + "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", + "blas", + "level 2", + "strmv", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "float32", + "float", + "float32array" + ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_nu.json new file mode 100644 index 000000000000..28c7879e0eed --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_nu.json @@ -0,0 +1,14 @@ +{ + "order": "column-major", + "trans": "none", + "diag": "non-unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 2.0, 3.0, 0.0, 4.0, 5.0, 0.0, 0.0, 6.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 10.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_u.json new file mode 100644 index 000000000000..5fd88f474523 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_u.json @@ -0,0 +1,14 @@ +{ + "order": "column-major", + "trans": "none", + "diag": "unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 2.0, 2.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 4.0, 7.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_nu.json new file mode 100644 index 000000000000..971b03a57717 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_nu.json @@ -0,0 +1,14 @@ +{ + "order": "column-major", + "trans": "transpose", + "diag": "non-unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 2.0, 3.0, 0.0, 4.0, 5.0, 0.0, 0.0, 6.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 14.0, 23.0, 18.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_u.json new file mode 100644 index 000000000000..a0002090b4be --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_u.json @@ -0,0 +1,14 @@ +{ + "order": "column-major", + "trans": "transpose", + "diag": "unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 14.0, 8.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json new file mode 100644 index 000000000000..3376c5fbb377 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json @@ -0,0 +1,14 @@ +{ + "order": "column-major", + "trans": "none", + "diag": "non-unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 14.0, 23.0, 18.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_u.json new file mode 100644 index 000000000000..4e71ba3df2d3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_u.json @@ -0,0 +1,14 @@ +{ + "order": "column-major", + "trans": "none", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 14.0, 8.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_nu.json new file mode 100644 index 000000000000..dd31956cbf60 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_nu.json @@ -0,0 +1,14 @@ +{ + "order": "column-major", + "trans": "transpose", + "diag": "non-unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 10.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_u.json new file mode 100644 index 000000000000..22f8c21ca2ed --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_u.json @@ -0,0 +1,14 @@ +{ + "order": "column-major", + "trans": "transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 4.0, 10.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xn.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xn.json new file mode 100644 index 000000000000..f90772bf622e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xn.json @@ -0,0 +1,14 @@ +{ + "order": "column-major", + "trans": "transpose", + "diag": "unit", + "uplo": "upper", + "strideX": -1, + "offsetA": 0, + "offsetX": 2, + "LDA": 3, + "N": 3, + "A": [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 ], + "x": [ 3.0, 2.0, 1.0 ], + "x_out": [ 10.0, 4.0, 1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xt.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xt.json new file mode 100644 index 000000000000..24262a526b03 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xt.json @@ -0,0 +1,14 @@ +{ + "order": "column-major", + "trans": "transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 2, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 ], + "x": [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ], + "x_out": [ 1.0, 0.0, 4.0, 0.0, 10.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_nu.json new file mode 100644 index 000000000000..404f5f3237ba --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_nu.json @@ -0,0 +1,14 @@ +{ + "order": "row-major", + "trans": "none", + "diag": "non-unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 8.0, 32.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_u.json new file mode 100644 index 000000000000..3663451cdc0d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_u.json @@ -0,0 +1,14 @@ +{ + "order": "row-major", + "trans": "none", + "diag": "unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 2.0, 1.0, 1.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 4.0, 7.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_nu.json new file mode 100644 index 000000000000..b7fba35a2d79 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_nu.json @@ -0,0 +1,14 @@ +{ + "order": "row-major", + "trans": "transpose", + "diag": "non-unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 17.0, 21.0, 18.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_u.json new file mode 100644 index 000000000000..789cc11add74 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_u.json @@ -0,0 +1,14 @@ +{ + "order": "row-major", + "trans": "transpose", + "diag": "unit", + "uplo": "lower", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 4.0, 1.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 14.0, 14.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_nu.json new file mode 100644 index 000000000000..f66dfdfdac62 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_nu.json @@ -0,0 +1,14 @@ +{ + "order": "row-major", + "trans": "none", + "diag": "non-unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 2.0, 3.0, 0.0, 4.0, 5.0, 0.0, 0.0, 6.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 14.0, 23.0, 18.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_u.json new file mode 100644 index 000000000000..3ce3c31258a4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_u.json @@ -0,0 +1,14 @@ +{ + "order": "row-major", + "trans": "none", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 14.0, 8.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_nu.json new file mode 100644 index 000000000000..8f4921208210 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_nu.json @@ -0,0 +1,14 @@ +{ + "order": "row-major", + "trans": "transpose", + "diag": "non-unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 2.0, 3.0, 0.0, 4.0, 5.0, 0.0, 0.0, 6.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 10.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_u.json new file mode 100644 index 000000000000..aa20e05b248a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_u.json @@ -0,0 +1,14 @@ +{ + "order": "row-major", + "trans": "transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 1, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 4.0, 10.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xn.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xn.json new file mode 100644 index 000000000000..6f8f9dafab40 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xn.json @@ -0,0 +1,14 @@ +{ + "order": "row-major", + "trans": "transpose", + "diag": "unit", + "uplo": "upper", + "strideX": -1, + "offsetA": 0, + "offsetX": 2, + "LDA": 3, + "N": 3, + "A": [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 14.0, 8.0, 3.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xt.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xt.json new file mode 100644 index 000000000000..b0120582e0c7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xt.json @@ -0,0 +1,14 @@ +{ + "order": "row-major", + "trans": "transpose", + "diag": "unit", + "uplo": "upper", + "strideX": 2, + "offsetA": 0, + "offsetX": 0, + "LDA": 3, + "N": 3, + "A": [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ], + "x": [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ], + "x_out": [ 1.0, 0.0, 4.0, 0.0, 10.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/test.js b/lib/node_modules/@stdlib/blas/base/strmv/test/test.js new file mode 100644 index 000000000000..a47f0dd99f32 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/test.js @@ -0,0 +1,82 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 strmv = 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 strmv, '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 strmv.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 strmv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( strmv, 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 strmv; + var main; + + main = require( './../lib/strmv.js' ); + + strmv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( strmv, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js new file mode 100644 index 000000000000..6c28a944ced1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js @@ -0,0 +1,666 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float32Array = require( '@stdlib/array/float32' ); +var EPS = require( '@stdlib/constants/float32/eps' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var strmv = require( './../lib/ndarray.js' ); + + +// FIXTURES // + +var rlntnu = require( './fixtures/row_major_l_nt_nu.json' ); +var rltnu = require( './fixtures/row_major_l_t_nu.json' ); +var rlntu = require( './fixtures/row_major_l_nt_u.json' ); +var rltu = require( './fixtures/row_major_l_t_u.json' ); +var runtnu = require( './fixtures/row_major_u_nt_nu.json' ); +var runtu = require( './fixtures/row_major_u_nt_u.json' ); +var rutnu = require( './fixtures/row_major_u_t_nu.json' ); +var rutu = require( './fixtures/row_major_u_t_u.json' ); +var rxt = require( './fixtures/row_major_xt.json' ); +var rxn = require( './fixtures/row_major_xn.json' ); + +var clntnu = require( './fixtures/column_major_l_nt_nu.json' ); +var cltnu = require( './fixtures/column_major_l_t_nu.json' ); +var clntu = require( './fixtures/column_major_l_nt_u.json' ); +var cltu = require( './fixtures/column_major_l_t_u.json' ); +var cuntnu = require( './fixtures/column_major_u_nt_nu.json' ); +var cuntu = require( './fixtures/column_major_u_nt_u.json' ); +var cutnu = require( './fixtures/column_major_u_t_nu.json' ); +var cutu = require( './fixtures/column_major_u_t_u.json' ); +var cxt = require( './fixtures/column_major_xt.json' ); +var cxn = require( './fixtures/column_major_xn.json' ); + + +// FUNCTIONS // + +/** +* Tests for element-wise approximate equality. +* +* @private +* @param {Object} t - test object +* @param {Collection} actual - actual values +* @param {Collection} expected - expected values +* @param {number} rtol - relative tolerance +*/ +function isApprox( t, actual, expected, rtol ) { + var delta; + var tol; + var i; + + t.strictEqual( actual.length, expected.length, 'returns expected value' ); + for ( i = 0; i < expected.length; i++ ) { + if ( actual[ i ] === expected[ i ] ) { + t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' ); + } else { + delta = abs( actual[ i ] - expected[ i ] ); + tol = rtol * EPS * abs( expected[ i ] ); + t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' ); + } + } +} + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof strmv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 11', function test( t ) { + t.strictEqual( strmv.length, 11, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + 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() { + strmv( value, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float32Array( rutu.x ), rutu.strideX, rutu.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + 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() { + strmv( rutu.order, value, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float32Array( rutu.x ), rutu.strideX, rutu.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + 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() { + strmv( rutu.order, rutu.uplo, value, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float32Array( rutu.x ), rutu.strideX, rutu.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourth argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + 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() { + strmv( rutu.order, rutu.uplo, rutu.trans, value, rutu.N, new Float32Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float32Array( rutu.x ), rutu.strideX, rutu.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { + var values; + var i; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, value, new Float32Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float32Array( rutu.x ), rutu.strideX, rutu.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid seventh argument', function test( t ) { + var values; + var i; + + values = [ + 2, + 1, + 0, + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), value, new Float32Array( rutu.x ), rutu.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid tenth argument', function test( t ) { + var values; + var i; + + values = [ + 0 + ]; + + 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() { + strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float32Array( rutu.x ), value, rutu.offsetX ); + }; + } +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, none, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rlntnu.A ); + x = new Float32Array( rlntnu.x ); + + expected = new Float32Array( rlntnu.x_out ); + + out = strmv( rlntnu.order, rlntnu.uplo, rlntnu.trans, rlntnu.diag, rlntnu.N, a, rlntnu.LDA, rlntnu.offsetA, x, rlntnu.strideX, rlntnu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, none, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( clntnu.A ); + x = new Float32Array( clntnu.x ); + + expected = new Float32Array( clntnu.x_out ); + + out = strmv( clntnu.order, clntnu.uplo, clntnu.trans, clntnu.diag, clntnu.N, a, clntnu.LDA, clntnu.offsetA, x, clntnu.strideX, clntnu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, transpose, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rltnu.A ); + x = new Float32Array( rltnu.x ); + + expected = new Float32Array( rltnu.x_out ); + + out = strmv( rltnu.order, rltnu.uplo, rltnu.trans, rltnu.diag, rltnu.N, a, rltnu.LDA, rltnu.offsetA, x, rltnu.strideX, rltnu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, transpose, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cltnu.A ); + x = new Float32Array( cltnu.x ); + + expected = new Float32Array( cltnu.x_out ); + + out = strmv( cltnu.order, cltnu.uplo, cltnu.trans, cltnu.diag, cltnu.N, a, cltnu.LDA, cltnu.offsetA, x, cltnu.strideX, cltnu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, none, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rlntu.A ); + x = new Float32Array( rlntu.x ); + + expected = new Float32Array( rlntu.x_out ); + + out = strmv( rlntu.order, rlntu.uplo, rlntu.trans, rlntu.diag, rlntu.N, a, rlntu.LDA, rlntu.offsetA, x, rlntu.strideX, rlntu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, none, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( clntu.A ); + x = new Float32Array( clntu.x ); + + expected = new Float32Array( clntu.x_out ); + + out = strmv( clntu.order, clntu.uplo, clntu.trans, clntu.diag, clntu.N, a, clntu.LDA, clntu.offsetA, x, clntu.strideX, clntu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, transpose, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rltu.A ); + x = new Float32Array( rltu.x ); + + expected = new Float32Array( rltu.x_out ); + + out = strmv( rltu.order, rltu.uplo, rltu.trans, rltu.diag, rltu.N, a, rltu.LDA, rltu.offsetA, x, rltu.strideX, rltu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, transpose, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cltu.A ); + x = new Float32Array( cltu.x ); + + expected = new Float32Array( cltu.x_out ); + + out = strmv( cltu.order, cltu.uplo, cltu.trans, cltu.diag, cltu.N, a, cltu.LDA, cltu.offsetA, x, cltu.strideX, cltu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, none, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( runtnu.A ); + x = new Float32Array( runtnu.x ); + + expected = new Float32Array( runtnu.x_out ); + + out = strmv( runtnu.order, runtnu.uplo, runtnu.trans, runtnu.diag, runtnu.N, a, runtnu.LDA, runtnu.offsetA, x, runtnu.strideX, runtnu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, none, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cuntnu.A ); + x = new Float32Array( cuntnu.x ); + + expected = new Float32Array( cuntnu.x_out ); + + out = strmv( cuntnu.order, cuntnu.uplo, cuntnu.trans, cuntnu.diag, cuntnu.N, a, cuntnu.LDA, cuntnu.offsetA, x, cuntnu.strideX, cuntnu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, none, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( runtu.A ); + x = new Float32Array( runtu.x ); + + expected = new Float32Array( runtu.x_out ); + + out = strmv( runtu.order, runtu.uplo, runtu.trans, runtu.diag, runtu.N, a, runtu.LDA, runtu.offsetA, x, runtu.strideX, runtu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, none, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cuntu.A ); + x = new Float32Array( cuntu.x ); + + expected = new Float32Array( cuntu.x_out ); + + out = strmv( cuntu.order, cuntu.uplo, cuntu.trans, cuntu.diag, cuntu.N, a, cuntu.LDA, cuntu.offsetA, x, cuntu.strideX, cuntu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, transpose, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rutnu.A ); + x = new Float32Array( rutnu.x ); + + expected = new Float32Array( rutnu.x_out ); + + out = strmv( rutnu.order, rutnu.uplo, rutnu.trans, rutnu.diag, rutnu.N, a, rutnu.LDA, rutnu.offsetA, x, rutnu.strideX, rutnu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, transpose, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cutnu.A ); + x = new Float32Array( cutnu.x ); + + expected = new Float32Array( cutnu.x_out ); + + out = strmv( cutnu.order, cutnu.uplo, cutnu.trans, cutnu.diag, cutnu.N, a, cutnu.LDA, cutnu.offsetA, x, cutnu.strideX, cutnu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, transpose, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rutu.A ); + x = new Float32Array( rutu.x ); + + expected = new Float32Array( rutu.x_out ); + + out = strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, a, rutu.LDA, rutu.offsetA, x, rutu.strideX, rutu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, transpose, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cutu.A ); + x = new Float32Array( cutu.x ); + + expected = new Float32Array( cutu.x_out ); + + out = strmv( cutu.order, cutu.uplo, cutu.trans, cutu.diag, cutu.N, a, cutu.LDA, cutu.offsetA, x, cutu.strideX, cutu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, sx=2)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rxt.A ); + x = new Float32Array( rxt.x ); + + expected = new Float32Array( rxt.x_out ); + + out = strmv( rxt.order, rxt.uplo, rxt.trans, rxt.diag, rxt.N, a, rxt.LDA, rxt.offsetA, x, rxt.strideX, rxt.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, sx=2)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cxt.A ); + x = new Float32Array( cxt.x ); + + expected = new Float32Array( cxt.x_out ); + + out = strmv( cxt.order, cxt.uplo, cxt.trans, cxt.diag, cxt.N, a, cxt.LDA, cxt.offsetA, x, cxt.strideX, cxt.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector', function test( t ) { + var out; + var a; + var x; + + a = new Float32Array( rutu.A ); + x = new Float32Array( rutu.x ); + + out = strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, a, rutu.LDA, rutu.offsetA, x, rutu.strideX, rutu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rutu.A ); + x = new Float32Array( rutu.x ); + + expected = new Float32Array( rutu.x ); + + out = strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, 0, a, rutu.LDA, rutu.offsetA, x, rutu.strideX, rutu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cutu.A ); + x = new Float32Array( cutu.x ); + + expected = new Float32Array( cutu.x ); + + out = strmv( cutu.order, cutu.uplo, cutu.trans, cutu.diag, 0, a, cutu.LDA, cutu.offsetA, x, cutu.strideX, cutu.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (row-major)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rxn.A ); + x = new Float32Array( rxn.x ); + + expected = new Float32Array( rxn.x_out ); + + out = strmv( rxn.order, rxn.uplo, rxn.trans, rxn.diag, rxn.N, a, rxn.LDA, rxn.offsetA, x, rxn.strideX, rxn.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (column-major)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cxn.A ); + x = new Float32Array( cxn.x ); + + expected = new Float32Array( cxn.x_out ); + + out = strmv( cxn.order, cxn.uplo, cxn.trans, cxn.diag, cxn.N, a, cxn.LDA, cxn.offsetA, x, cxn.strideX, cxn.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/test.strmv.js b/lib/node_modules/@stdlib/blas/base/strmv/test/test.strmv.js new file mode 100644 index 000000000000..bde02f5a5ea4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/test.strmv.js @@ -0,0 +1,666 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +/* eslint-disable max-len */ + +'use strict'; + +// MODULES // + +var tape = require( 'tape' ); +var Float32Array = require( '@stdlib/array/float32' ); +var EPS = require( '@stdlib/constants/float32/eps' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var strmv = require( './../lib/strmv.js' ); + + +// FIXTURES // + +var rlntnu = require( './fixtures/row_major_l_nt_nu.json' ); +var rltnu = require( './fixtures/row_major_l_t_nu.json' ); +var rlntu = require( './fixtures/row_major_l_nt_u.json' ); +var rltu = require( './fixtures/row_major_l_t_u.json' ); +var runtnu = require( './fixtures/row_major_u_nt_nu.json' ); +var runtu = require( './fixtures/row_major_u_nt_u.json' ); +var rutnu = require( './fixtures/row_major_u_t_nu.json' ); +var rutu = require( './fixtures/row_major_u_t_u.json' ); +var rxt = require( './fixtures/row_major_xt.json' ); +var rxn = require( './fixtures/row_major_xn.json' ); + +var clntnu = require( './fixtures/column_major_l_nt_nu.json' ); +var cltnu = require( './fixtures/column_major_l_t_nu.json' ); +var clntu = require( './fixtures/column_major_l_nt_u.json' ); +var cltu = require( './fixtures/column_major_l_t_u.json' ); +var cuntnu = require( './fixtures/column_major_u_nt_nu.json' ); +var cuntu = require( './fixtures/column_major_u_nt_u.json' ); +var cutnu = require( './fixtures/column_major_u_t_nu.json' ); +var cutu = require( './fixtures/column_major_u_t_u.json' ); +var cxt = require( './fixtures/column_major_xt.json' ); +var cxn = require( './fixtures/column_major_xn.json' ); + + +// FUNCTIONS // + +/** +* Tests for element-wise approximate equality. +* +* @private +* @param {Object} t - test object +* @param {Collection} actual - actual values +* @param {Collection} expected - expected values +* @param {number} rtol - relative tolerance +*/ +function isApprox( t, actual, expected, rtol ) { + var delta; + var tol; + var i; + + t.strictEqual( actual.length, expected.length, 'returns expected value' ); + for ( i = 0; i < expected.length; i++ ) { + if ( actual[ i ] === expected[ i ] ) { + t.strictEqual( actual[ i ], expected[ i ], 'returns expected value' ); + } else { + delta = abs( actual[ i ] - expected[ i ] ); + tol = rtol * EPS * abs( expected[ i ] ); + t.ok( delta <= tol, 'within tolerance. actual: '+actual[ i ]+'. expected: '+expected[ i ]+'. delta: '+delta+'. tol: '+tol+'.' ); + } + } +} + + +// TESTS // + +tape( 'main export is a function', function test( t ) { + t.ok( true, __filename ); + t.strictEqual( typeof strmv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 9', function test( t ) { + t.strictEqual( strmv.length, 9, 'returns expected value' ); + t.end(); +}); + +tape( 'the function throws an error if provided an invalid first argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + 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() { + strmv( value, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, new Float32Array( rutu.x ), rutu.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid second argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + 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() { + strmv( rutu.order, value, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, new Float32Array( rutu.x ), rutu.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid third argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + 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() { + strmv( rutu.order, rutu.uplo, value, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, new Float32Array( rutu.x ), rutu.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fourth argument', function test( t ) { + var values; + var i; + + values = [ + 'foo', + 'bar', + 'beep', + 'boop' + ]; + + 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() { + strmv( rutu.order, rutu.uplo, rutu.trans, value, rutu.N, new Float32Array( rutu.A ), rutu.LDA, new Float32Array( rutu.x ), rutu.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { + var values; + var i; + + values = [ + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, value, new Float32Array( rutu.A ), rutu.LDA, new Float32Array( rutu.x ), rutu.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid seventh argument', function test( t ) { + var values; + var i; + + values = [ + 2, + 1, + 0, + -1, + -2, + -3 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), value, new Float32Array( rutu.x ), rutu.strideX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid ninth argument', function test( t ) { + var values; + var i; + + values = [ + 0 + ]; + + 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() { + strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, new Float32Array( rutu.x ), value ); + }; + } +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, none, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rlntnu.A ); + x = new Float32Array( rlntnu.x ); + + expected = new Float32Array( rlntnu.x_out ); + + out = strmv( rlntnu.order, rlntnu.uplo, rlntnu.trans, rlntnu.diag, rlntnu.N, a, rlntnu.LDA, x, rlntnu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, none, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( clntnu.A ); + x = new Float32Array( clntnu.x ); + + expected = new Float32Array( clntnu.x_out ); + + out = strmv( clntnu.order, clntnu.uplo, clntnu.trans, clntnu.diag, clntnu.N, a, clntnu.LDA, x, clntnu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, transpose, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rltnu.A ); + x = new Float32Array( rltnu.x ); + + expected = new Float32Array( rltnu.x_out ); + + out = strmv( rltnu.order, rltnu.uplo, rltnu.trans, rltnu.diag, rltnu.N, a, rltnu.LDA, x, rltnu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, transpose, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cltnu.A ); + x = new Float32Array( cltnu.x ); + + expected = new Float32Array( cltnu.x_out ); + + out = strmv( cltnu.order, cltnu.uplo, cltnu.trans, cltnu.diag, cltnu.N, a, cltnu.LDA, x, cltnu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, none, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rlntu.A ); + x = new Float32Array( rlntu.x ); + + expected = new Float32Array( rlntu.x_out ); + + out = strmv( rlntu.order, rlntu.uplo, rlntu.trans, rlntu.diag, rlntu.N, a, rlntu.LDA, x, rlntu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, none, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( clntu.A ); + x = new Float32Array( clntu.x ); + + expected = new Float32Array( clntu.x_out ); + + out = strmv( clntu.order, clntu.uplo, clntu.trans, clntu.diag, clntu.N, a, clntu.LDA, x, clntu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, transpose, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rltu.A ); + x = new Float32Array( rltu.x ); + + expected = new Float32Array( rltu.x_out ); + + out = strmv( rltu.order, rltu.uplo, rltu.trans, rltu.diag, rltu.N, a, rltu.LDA, x, rltu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, transpose, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cltu.A ); + x = new Float32Array( cltu.x ); + + expected = new Float32Array( cltu.x_out ); + + out = strmv( cltu.order, cltu.uplo, cltu.trans, cltu.diag, cltu.N, a, cltu.LDA, x, cltu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, none, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( runtnu.A ); + x = new Float32Array( runtnu.x ); + + expected = new Float32Array( runtnu.x_out ); + + out = strmv( runtnu.order, runtnu.uplo, runtnu.trans, runtnu.diag, runtnu.N, a, runtnu.LDA, x, runtnu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, none, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cuntnu.A ); + x = new Float32Array( cuntnu.x ); + + expected = new Float32Array( cuntnu.x_out ); + + out = strmv( cuntnu.order, cuntnu.uplo, cuntnu.trans, cuntnu.diag, cuntnu.N, a, cuntnu.LDA, x, cuntnu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, none, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( runtu.A ); + x = new Float32Array( runtu.x ); + + expected = new Float32Array( runtu.x_out ); + + out = strmv( runtu.order, runtu.uplo, runtu.trans, runtu.diag, runtu.N, a, runtu.LDA, x, runtu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, none, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cuntu.A ); + x = new Float32Array( cuntu.x ); + + expected = new Float32Array( cuntu.x_out ); + + out = strmv( cuntu.order, cuntu.uplo, cuntu.trans, cuntu.diag, cuntu.N, a, cuntu.LDA, x, cuntu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, transpose, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rutnu.A ); + x = new Float32Array( rutnu.x ); + + expected = new Float32Array( rutnu.x_out ); + + out = strmv( rutnu.order, rutnu.uplo, rutnu.trans, rutnu.diag, rutnu.N, a, rutnu.LDA, x, rutnu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, transpose, non-unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cutnu.A ); + x = new Float32Array( cutnu.x ); + + expected = new Float32Array( cutnu.x_out ); + + out = strmv( cutnu.order, cutnu.uplo, cutnu.trans, cutnu.diag, cutnu.N, a, cutnu.LDA, x, cutnu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, transpose, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rutu.A ); + x = new Float32Array( rutu.x ); + + expected = new Float32Array( rutu.x_out ); + + out = strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, a, rutu.LDA, x, rutu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, transpose, unit)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cutu.A ); + x = new Float32Array( cutu.x ); + + expected = new Float32Array( cutu.x_out ); + + out = strmv( cutu.order, cutu.uplo, cutu.trans, cutu.diag, cutu.N, a, cutu.LDA, x, cutu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, sx=2)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rxt.A ); + x = new Float32Array( rxt.x ); + + expected = new Float32Array( rxt.x_out ); + + out = strmv( rxt.order, rxt.uplo, rxt.trans, rxt.diag, rxt.N, a, rxt.LDA, x, rxt.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, sx=2)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cxt.A ); + x = new Float32Array( cxt.x ); + + expected = new Float32Array( cxt.x_out ); + + out = strmv( cxt.order, cxt.uplo, cxt.trans, cxt.diag, cxt.N, a, cxt.LDA, x, cxt.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector', function test( t ) { + var out; + var a; + var x; + + a = new Float32Array( rutu.A ); + x = new Float32Array( rutu.x ); + + out = strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, a, rutu.LDA, x, rutu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero, the function returns the second input vector unchanged (row-major)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rutu.A ); + x = new Float32Array( rutu.x ); + + expected = new Float32Array( rutu.x ); + + out = strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, 0, a, rutu.LDA, x, rutu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'if `N` is zero, the function returns the second input vector unchanged (column-major)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cutu.A ); + x = new Float32Array( cutu.x ); + + expected = new Float32Array( cutu.x ); + + out = strmv( cutu.order, cutu.uplo, cutu.trans, cutu.diag, 0, a, cutu.LDA, x, cutu.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + t.deepEqual( x, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (row-major)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( rxn.A ); + x = new Float32Array( rxn.x ); + + expected = new Float32Array( rxn.x_out ); + + out = strmv( rxn.order, rxn.uplo, rxn.trans, rxn.diag, rxn.N, a, rxn.LDA, x, rxn.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (column-major)', function test( t ) { + var expected; + var out; + var a; + var x; + + a = new Float32Array( cxn.A ); + x = new Float32Array( cxn.x ); + + expected = new Float32Array( cxn.x_out ); + + out = strmv( cxn.order, cxn.uplo, cxn.trans, cxn.diag, cxn.N, a, cxn.LDA, x, cxn.strideX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); From d63f9c38833edc0d8c0f1c900a6a65e6b44e92ac Mon Sep 17 00:00:00 2001 From: aman-095 Date: Mon, 8 Jul 2024 16:17:43 +0530 Subject: [PATCH 02/25] docs: update descriptions --- lib/node_modules/@stdlib/blas/base/strmv/README.md | 6 +++--- lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt | 4 ++-- .../@stdlib/blas/base/strmv/docs/types/index.d.ts | 6 +++--- lib/node_modules/@stdlib/blas/base/strmv/lib/index.js | 2 +- lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js | 2 +- lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js | 2 +- lib/node_modules/@stdlib/blas/base/strmv/package.json | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/README.md b/lib/node_modules/@stdlib/blas/base/strmv/README.md index 9b85132f1ad0..833f5ec0503c 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/strmv/README.md @@ -20,7 +20,7 @@ limitations under the License. # strmv -> Perform one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +> Perform one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.
@@ -32,7 +32,7 @@ var strmv = require( '@stdlib/blas/base/strmv' ); #### strmv( order, uplo, trans, diag, N, A, LDA, x, sx ) -Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. ```javascript var Float32Array = require( '@stdlib/array/float32' ); @@ -88,7 +88,7 @@ strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x1, 1 ); #### strmv.ndarray( order, uplo, trans, diag, N, A, LDA, x, sx, ox ) -Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. ```javascript var Float32Array = require( '@stdlib/array/float32' ); diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt index 21c1b7e8980c..7dbd11187572 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt @@ -1,6 +1,6 @@ {{alias}}( ord, uplo, trans, diag, N, A, lda, x, sx ) - Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, + Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. @@ -56,7 +56,7 @@ {{alias}}.ndarray( ord, uplo, trans, diag, N, A, lda, oa, x, sx, ox ) - Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, + Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts index c00933a56371..f1e0e12e4593 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts @@ -27,7 +27,7 @@ import { Layout, MatrixTriangle, TransposeOperation, DiagonalType } from '@stdli */ interface Routine { /** - * Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. + * Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param order - storage layout * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced @@ -52,7 +52,7 @@ interface Routine { ( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number ): Float32Array; /** - * Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. + * Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param order - storage layout * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced @@ -79,7 +79,7 @@ interface Routine { } /** -* Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param order - storage layout * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js index 53b4a30662ae..63f0d107bedc 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* BLAS level 2 routine to perform one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* BLAS level 2 routine to perform one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @module @stdlib/blas/base/strmv * diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js index cce92e3a6c16..4b36bb17e1f7 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js @@ -31,7 +31,7 @@ var isDiagonal = require( '@stdlib/blas/base/assert/is-diagonal-type' ); // MAIN // /** -* Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param {string} order - storage layout * @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js index 9e66bfb73de7..4e120322f138 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js @@ -32,7 +32,7 @@ var stride2offset = require( '@stdlib/strided/base/stride2offset'); // MAIN // /** -* Performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param {string} order - storage layout * @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied diff --git a/lib/node_modules/@stdlib/blas/base/strmv/package.json b/lib/node_modules/@stdlib/blas/base/strmv/package.json index 66cfc9658164..75c8f9a24ba0 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/package.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/base/strmv", "version": "0.0.0", - "description": "Perform one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.", + "description": "Perform one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", From 201a7e959fa8875888e28f45c95fd82a0c2eaa58 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Tue, 9 Jul 2024 12:24:52 -0700 Subject: [PATCH 03/25] fix: update error messages, descriptions, and slight refactor --- .../@stdlib/blas/base/strmv/lib/index.js | 2 +- .../@stdlib/blas/base/strmv/lib/ndarray.js | 56 ++++++++++--------- 2 files changed, 32 insertions(+), 26 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js index 63f0d107bedc..6f2bc0cb3e64 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* BLAS level 2 routine to perform one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* BLAS level 2 routine to perform one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @module @stdlib/blas/base/strmv * diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js index 4b36bb17e1f7..cf180245ba7b 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js @@ -26,27 +26,31 @@ var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation'); var isDiagonal = require( '@stdlib/blas/base/assert/is-diagonal-type' ); +var format = require( '@stdlib/string/format' ); // MAIN // /** -* Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param {string} order - storage layout * @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied -* @param {string} trans - specifies whether the matrix `A` is a none-transpose, transpose, or conjugate-transpose -* @param {string} diag - specifies whether or not the matrix `A` is a unit triangular +* @param {string} trans - specifies whether the matrix `A` is transposed, conjugate-transposed, or not transposed +* @param {string} diag - specifies whether the matrix `A` is unit diagonal * @param {NonNegativeInteger} N - number of elements along each dimension of `A` -* @param {Float32Array} A - matrix +* @param {Float32Array} A - input matrix * @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) * @param {NonNegativeInteger} offsetA - index offset for `A` -* @param {Float32Array} x - first input array +* @param {Float32Array} x - input vector * @param {integer} strideX - `x` stride length * @param {NonNegativeInteger} offsetX - index offset for `x` * @throws {TypeError} first argument must be a valid order * @throws {TypeError} second argument must specify whether the lower or upper triangular matrix is supplied -* @throws {RangeError} third argument must be a nonnegative integer +* @throws {TypeError} third argument must be a valid transpose operation +* @throws {TypeError} fourth argument must be a valid diagonal type +* @throws {RangeError} fifth argument must be a nonnegative integer +* @throws {RangeError} sixth argument must be greater than or equal to max(1,N) * @throws {RangeError} seventh argument must be non-zero * @throws {RangeError} tenth argument must be non-zero * @returns {Float32Array} `x` @@ -61,6 +65,7 @@ var isDiagonal = require( '@stdlib/blas/base/assert/is-diagonal-type' ); * // x => [ 14.0, 8.0, 3.0 ] */ function strmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len + var nonunit; var temp; var ix; var jx; @@ -69,29 +74,30 @@ function strmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offset var j; if ( !isLayout( order ) ) { - throw new TypeError( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ); + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } if ( !isMatrixTriangle( uplo ) ) { - throw new TypeError( 'invalid argument. Second argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ); + throw new TypeError( format( 'invalid argument. Second argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); } if ( !isTransposeOperation( trans ) ) { - throw new TypeError( 'invalid argument. Third argument must specify whether the matrix is none-transpose, transpose, or conjugate-transpose. Value: `%s`.', trans ); + throw new TypeError( format( 'invalid argument. Third argument must be a valid transpose operation. Value: `%s`.', trans ) ); } if ( !isDiagonal( diag ) ) { - throw new TypeError( 'invalid argument. Fourth argument must be a valid diagonal type. Value: `%s`.', diag ); + throw new TypeError( format( 'invalid argument. Fourth argument must be a valid diagonal type. Value: `%s`.', diag ) ); } if ( N < 0 ) { - throw new RangeError( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', N ); + throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', N ) ); } if ( LDA < max( 1, N ) ) { - throw new RangeError( 'invalid argument. Sixth argument must be greater than or equal to the maximum of 1 and the number of elements in the first dimension of `A`. Value: `%d`.', LDA ); + throw new RangeError( format( 'invalid argument. Sixth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) ); } if ( strideX === 0 ) { - throw new RangeError( 'invalid argument. Seventh argument must be non-zero. Value: `%d`.', strideX ); + throw new RangeError( format( 'invalid argument. Tenth argument must be non-zero. Value: `%d`.', strideX ) ); } if ( N === 0 ) { return x; } + nonunit = ( diag === 'non-unit' ); kx = offsetX; if ( ( order === 'column-major' && trans === 'none' && uplo === 'upper' ) || @@ -103,11 +109,11 @@ function strmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offset temp = x[ jx ]; ix = kx; for ( i = 0; i < j; i++ ) { - x[ ix ] += f32( temp * A[ offsetA + i + ( LDA * j ) ] ); + x[ ix ] += f32( temp * A[ offsetA+i+(LDA*j) ] ); ix += strideX; } - if ( diag === 'non-unit' ) { - x[ jx ] = f32( x[ jx ] * A[ offsetA + j + ( j * LDA ) ] ); + if ( nonunit ) { + x[ jx ] = f32( x[ jx ] * A[ offsetA+j+(LDA*j) ] ); } } jx += strideX; @@ -125,11 +131,11 @@ function strmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offset temp = x[ jx ]; ix = kx; for ( i = N - 1; i > j; i-- ) { - x[ ix ] += f32( temp * A[ offsetA + i + ( LDA * j ) ] ); + x[ ix ] += f32( temp * A[ offsetA+i+(LDA*j) ] ); ix -= strideX; } - if ( diag === 'non-unit' ) { - x[ jx ] = f32( x[ jx ] * A[ offsetA + j + ( j * LDA ) ] ); + if ( nonunit ) { + x[ jx ] = f32( x[ jx ] * A[ offsetA+j+(LDA*j) ] ); } } jx -= strideX; @@ -144,12 +150,12 @@ function strmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offset for ( j = N - 1; j >= 0; j-- ) { temp = x[ jx ]; ix = jx; - if ( diag === 'non-unit' ) { - temp = f32( temp * A[ offsetA + j + ( j * LDA ) ] ); + if ( nonunit ) { + temp = f32( temp * A[ offsetA+j+(j*LDA) ] ); } for ( i = j - 1; i >= 0; i-- ) { ix -= strideX; - temp = f32( temp + ( x[ ix ] * A[ offsetA + i + ( LDA * j ) ] ) ); // eslint-disable-line max-len + temp = f32( temp + f32( x[ ix ] * A[ offsetA+i+(j*LDA) ] ) ); } x[ jx ] = temp; jx -= strideX; @@ -164,12 +170,12 @@ function strmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offset for ( j = 0; j < N; j++ ) { temp = x[ jx ]; ix = jx; - if ( diag === 'non-unit' ) { - temp = f32( temp * A[ offsetA + j + ( j * LDA ) ] ); + if ( nonunit ) { + temp = f32( temp * A[ offsetA+j+(j*LDA) ] ); } for ( i = j + 1; i < N; i++ ) { ix += strideX; - temp = f32( temp + ( x[ ix ] * A[ offsetA + i + ( LDA * j ) ] ) ); // eslint-disable-line max-len + temp = f32( temp + f32( x[ ix ] * A[ offsetA+i+(j*LDA) ] ) ); } x[ jx ] = temp; jx += strideX; From ba111b3663b9fc3faa147a151735bab2469ba635 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Tue, 9 Jul 2024 12:32:59 -0700 Subject: [PATCH 04/25] fix: update error messages, descriptions, and style --- .../@stdlib/blas/base/strmv/lib/ndarray.js | 7 +-- .../@stdlib/blas/base/strmv/lib/strmv.js | 59 ++++++++++--------- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js index cf180245ba7b..2ac546773482 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js @@ -37,7 +37,7 @@ var format = require( '@stdlib/string/format' ); * @param {string} order - storage layout * @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied * @param {string} trans - specifies whether the matrix `A` is transposed, conjugate-transposed, or not transposed -* @param {string} diag - specifies whether the matrix `A` is unit diagonal +* @param {string} diag - specifies whether the matrix `A` has a unit diagonal * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {Float32Array} A - input matrix * @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) @@ -50,8 +50,7 @@ var format = require( '@stdlib/string/format' ); * @throws {TypeError} third argument must be a valid transpose operation * @throws {TypeError} fourth argument must be a valid diagonal type * @throws {RangeError} fifth argument must be a nonnegative integer -* @throws {RangeError} sixth argument must be greater than or equal to max(1,N) -* @throws {RangeError} seventh argument must be non-zero +* @throws {RangeError} seventh argument must be greater than or equal to max(1,N) * @throws {RangeError} tenth argument must be non-zero * @returns {Float32Array} `x` * @@ -89,7 +88,7 @@ function strmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offset throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', N ) ); } if ( LDA < max( 1, N ) ) { - throw new RangeError( format( 'invalid argument. Sixth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) ); + throw new RangeError( format( 'invalid argument. Seventh argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) ); } if ( strideX === 0 ) { throw new RangeError( format( 'invalid argument. Tenth argument must be non-zero. Value: `%d`.', strideX ) ); diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js index 4e120322f138..d06b11dd53bc 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js @@ -27,27 +27,30 @@ var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation'); var isDiagonal = require( '@stdlib/blas/base/assert/is-diagonal-type' ); var stride2offset = require( '@stdlib/strided/base/stride2offset'); +var format = require( '@stdlib/string/format' ); // MAIN // /** -* Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param {string} order - storage layout * @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied -* @param {string} trans - specifies whether the matrix `A` is a non-transpose, transpose, or conjugate-transpose -* @param {string} diag - specifies whether or not the matrix `A` is a unit triangular +* @param {string} trans - specifies whether the matrix `A` is transposed, conjugate-transposed, or not transposed +* @param {string} diag - specifies whether the matrix `A` has a unit diagonal * @param {NonNegativeInteger} N - number of elements along each dimension of `A` -* @param {Float32Array} A - matrix +* @param {Float32Array} A - input matrix * @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) -* @param {Float32Array} x - first input array +* @param {Float32Array} x - input vector * @param {integer} strideX - `x` stride length * @throws {TypeError} first argument must be a valid order * @throws {TypeError} second argument must specify whether the lower or upper triangular matrix is supplied -* @throws {RangeError} third argument must be a nonnegative integer -* @throws {RangeError} seventh argument must be non-zero -* @throws {RangeError} tenth argument must be non-zero +* @throws {TypeError} third argument must be a valid transpose operation +* @throws {TypeError} fourth argument must be a valid diagonal type +* @throws {RangeError} fifth argument must be a nonnegative integer +* @throws {RangeError} seventh argument must be greater than or equal to max(1,N) +* @throws {RangeError} ninth argument must be non-zero * @returns {Float32Array} `x` * * @example @@ -60,6 +63,7 @@ var stride2offset = require( '@stdlib/strided/base/stride2offset'); * // x => [ 14.0, 8.0, 3.0 ] */ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { + var nonunit; var temp; var ix; var jx; @@ -68,29 +72,30 @@ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { var j; if ( !isLayout( order ) ) { - throw new TypeError( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ); + throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } if ( !isMatrixTriangle( uplo ) ) { - throw new TypeError( 'invalid argument. Second argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ); + throw new TypeError( format( 'invalid argument. Second argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); } if ( !isTransposeOperation( trans ) ) { - throw new TypeError( 'invalid argument. Third argument must specify whether the matrix is none-transpose, transpose, or conjugate-transpose. Value: `%s`.', trans ); + throw new TypeError( format( 'invalid argument. Third argument must be a valid transpose operation. Value: `%s`.', trans ) ); } if ( !isDiagonal( diag ) ) { - throw new TypeError( 'invalid argument. Fourth argument must be a valid diagonal type. Value: `%s`.', diag ); + throw new TypeError( format( 'invalid argument. Fourth argument must be a valid diagonal type. Value: `%s`.', diag ) ); } if ( N < 0 ) { - throw new RangeError( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', N ); + throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', N ) ); } if ( LDA < max( 1, N ) ) { - throw new RangeError( 'invalid argument. Sixth argument must be greater than or equal to the maximum of 1 and the number of elements in the first dimension of `A`. Value: `%d`.', LDA ); + throw new RangeError( format( 'invalid argument. Seventh argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) ); } if ( strideX === 0 ) { - throw new RangeError( 'invalid argument. Seventh argument must be non-zero. Value: `%d`.', strideX ); + throw new RangeError( format( 'invalid argument. Ninth argument must be non-zero. Value: `%d`.', strideX ) ); } if ( N === 0 ) { return x; } + nonunit = ( diag === 'non-unit' ); kx = stride2offset( N, strideX ); if ( ( order === 'column-major' && trans === 'none' && uplo === 'upper' ) || @@ -102,11 +107,11 @@ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { temp = x[ jx ]; ix = kx; for ( i = 0; i < j; i++ ) { - x[ ix ] += f32( temp * A[ i + ( LDA * j ) ] ); + x[ ix ] += f32( temp * A[ i+(LDA*j) ] ); ix += strideX; } - if ( diag === 'non-unit' ) { - x[ jx ] = f32( x[ jx ] * A[ ( j * LDA ) + j ] ); + if ( nonunit ) { + x[ jx ] = f32( x[ jx ] * A[ (j*LDA)+j ] ); } } jx += strideX; @@ -124,11 +129,11 @@ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { temp = x[ jx ]; ix = kx; for ( i = N - 1; i > j; i-- ) { - x[ ix ] += f32( temp * A[ i + ( LDA * j ) ] ); + x[ ix ] += f32( temp * A[ i+(LDA*j) ] ); ix -= strideX; } - if ( diag === 'non-unit' ) { - x[ jx ] = f32( x[ jx ] * A[ ( j * LDA ) + j ] ); + if ( nonunit ) { + x[ jx ] = f32( x[ jx ] * A[ (j*LDA)+j ] ); } } jx -= strideX; @@ -143,12 +148,12 @@ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { for ( j = N - 1; j >= 0; j-- ) { temp = x[ jx ]; ix = jx; - if ( diag === 'non-unit' ) { - temp = f32( temp * A[ ( j * LDA ) + j ] ); + if ( nonunit ) { + temp = f32( temp * A[ (j*LDA)+j ] ); } for ( i = j - 1; i >= 0; i-- ) { ix -= strideX; - temp = f32( temp + ( x[ ix ] * A[ i + ( LDA * j ) ] ) ); + temp = f32( temp + f32( x[ ix ] * A[ i+(LDA*j) ] ) ); } x[ jx ] = temp; jx -= strideX; @@ -163,12 +168,12 @@ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { for ( j = 0; j < N; j++ ) { temp = x[ jx ]; ix = jx; - if ( diag === 'non-unit' ) { - temp = f32( temp * A[ ( j * LDA ) + j ] ); + if ( nonunit ) { + temp = f32( temp * A[ (j*LDA)+j ] ); } for ( i = j + 1; i < N; i++ ) { ix += strideX; - temp = f32( temp + ( x[ ix ] * A[ i + ( LDA * j ) ] ) ); + temp = f32( temp + f32( x[ ix ] * A[ i+(LDA*j) ] ) ); } x[ jx ] = temp; jx += strideX; From b7dc939c9ce1f8fa942c5156a6ea8d8e78ce9ee6 Mon Sep 17 00:00:00 2001 From: aman-095 Date: Thu, 11 Jul 2024 17:31:41 +0530 Subject: [PATCH 05/25] refactor: update implementation --- .../@stdlib/blas/base/strmv/lib/base.js | 159 ++++++++++++++++++ .../@stdlib/blas/base/strmv/lib/ndarray.js | 96 +---------- .../@stdlib/blas/base/strmv/lib/strmv.js | 93 +--------- 3 files changed, 163 insertions(+), 185 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/lib/base.js diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js new file mode 100644 index 000000000000..17c04049d693 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js @@ -0,0 +1,159 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 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 f32 = require( '@stdlib/number/float64/base/to-float32' ); + + +// MAIN // + +/** +* Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* +* @param {string} order - storage layout +* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied +* @param {string} trans - specifies whether the matrix `A` is transposed, conjugate-transposed, or not transposed +* @param {string} diag - specifies whether the matrix `A` has a unit diagonal +* @param {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {Float32Array} A - input matrix +* @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {NonNegativeInteger} offsetA - index offset for `A` +* @param {Float32Array} x - input vector +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - index offset for `x` +* @throws {TypeError} first argument must be a valid order +* @throws {TypeError} second argument must specify whether the lower or upper triangular matrix is supplied +* @throws {TypeError} third argument must be a valid transpose operation +* @throws {TypeError} fourth argument must be a valid diagonal type +* @throws {RangeError} fifth argument must be a nonnegative integer +* @throws {RangeError} seventh argument must be greater than or equal to max(1,N) +* @throws {RangeError} tenth argument must be non-zero +* @returns {Float32Array} `x` +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +* +* strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, 1, 0 ); +* // x => [ 14.0, 8.0, 3.0 ] +*/ +function strmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len + var nonunit; + var temp; + var ix; + var jx; + var kx; + var i; + var j; + + nonunit = ( diag === 'non-unit' ); + kx = offsetX; + if ( + ( order === 'column-major' && trans === 'none' && uplo === 'upper' ) || + ( order === 'row-major' && trans !== 'none' && uplo === 'lower' ) + ) { + jx = kx; + for ( j = 0; j < N; j++ ) { + if ( x[ jx ] !== 0.0 ) { + temp = x[ jx ]; + ix = kx; + for ( i = 0; i < j; i++ ) { + x[ ix ] += f32( temp * A[ offsetA+i+(LDA*j) ] ); + ix += strideX; + } + if ( nonunit ) { + x[ jx ] = f32( x[ jx ] * A[ offsetA+j+(LDA*j) ] ); + } + } + jx += strideX; + } + return x; + } + if ( + ( order === 'column-major' && trans === 'none' && uplo === 'lower' ) || + ( order === 'row-major' && trans !== 'none' && uplo === 'upper' ) + ) { + kx += ( N - 1 ) * strideX; + jx = kx; + for ( j = N - 1; j >= 0; j-- ) { + if ( x[ jx ] !== 0.0 ) { + temp = x[ jx ]; + ix = kx; + for ( i = N - 1; i > j; i-- ) { + x[ ix ] += f32( temp * A[ offsetA+i+(LDA*j) ] ); + ix -= strideX; + } + if ( nonunit ) { + x[ jx ] = f32( x[ jx ] * A[ offsetA+j+(LDA*j) ] ); + } + } + jx -= strideX; + } + return x; + } + if ( + ( order === 'column-major' && trans !== 'none' && uplo === 'upper' ) || + ( order === 'row-major' && trans === 'none' && uplo === 'lower' ) + ) { + jx = kx + ( ( N - 1 ) * strideX ); + for ( j = N - 1; j >= 0; j-- ) { + temp = x[ jx ]; + ix = jx; + if ( nonunit ) { + temp = f32( temp * A[ offsetA+j+(j*LDA) ] ); + } + for ( i = j - 1; i >= 0; i-- ) { + ix -= strideX; + temp = f32( temp + f32( x[ ix ] * A[ offsetA+i+(j*LDA) ] ) ); + } + x[ jx ] = temp; + jx -= strideX; + } + return x; + } + if ( + ( order === 'column-major' && trans !== 'none' && uplo === 'lower' ) || + ( order === 'row-major' && trans === 'none' && uplo === 'upper' ) + ) { + jx = kx; + for ( j = 0; j < N; j++ ) { + temp = x[ jx ]; + ix = jx; + if ( nonunit ) { + temp = f32( temp * A[ offsetA+j+(j*LDA) ] ); + } + for ( i = j + 1; i < N; i++ ) { + ix += strideX; + temp = f32( temp + f32( x[ ix ] * A[ offsetA+i+(j*LDA) ] ) ); + } + x[ jx ] = temp; + jx += strideX; + } + return x; + } +} + + +// EXPORTS // + +module.exports = strmv; diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js index 2ac546773482..f2669eabd527 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js @@ -20,13 +20,13 @@ // MODULES // -var f32 = require( '@stdlib/number/float64/base/to-float32' ); var max = require( '@stdlib/math/base/special/max' ); var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation'); var isDiagonal = require( '@stdlib/blas/base/assert/is-diagonal-type' ); var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); // MAIN // @@ -64,14 +64,6 @@ var format = require( '@stdlib/string/format' ); * // x => [ 14.0, 8.0, 3.0 ] */ function strmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len - var nonunit; - var temp; - var ix; - var jx; - var kx; - var i; - var j; - if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } @@ -96,91 +88,7 @@ function strmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offset if ( N === 0 ) { return x; } - nonunit = ( diag === 'non-unit' ); - kx = offsetX; - if ( - ( order === 'column-major' && trans === 'none' && uplo === 'upper' ) || - ( order === 'row-major' && trans !== 'none' && uplo === 'lower' ) - ) { - jx = kx; - for ( j = 0; j < N; j++ ) { - if ( x[ jx ] !== 0.0 ) { - temp = x[ jx ]; - ix = kx; - for ( i = 0; i < j; i++ ) { - x[ ix ] += f32( temp * A[ offsetA+i+(LDA*j) ] ); - ix += strideX; - } - if ( nonunit ) { - x[ jx ] = f32( x[ jx ] * A[ offsetA+j+(LDA*j) ] ); - } - } - jx += strideX; - } - return x; - } - if ( - ( order === 'column-major' && trans === 'none' && uplo === 'lower' ) || - ( order === 'row-major' && trans !== 'none' && uplo === 'upper' ) - ) { - kx += ( N - 1 ) * strideX; - jx = kx; - for ( j = N - 1; j >= 0; j-- ) { - if ( x[ jx ] !== 0.0 ) { - temp = x[ jx ]; - ix = kx; - for ( i = N - 1; i > j; i-- ) { - x[ ix ] += f32( temp * A[ offsetA+i+(LDA*j) ] ); - ix -= strideX; - } - if ( nonunit ) { - x[ jx ] = f32( x[ jx ] * A[ offsetA+j+(LDA*j) ] ); - } - } - jx -= strideX; - } - return x; - } - if ( - ( order === 'column-major' && trans !== 'none' && uplo === 'upper' ) || - ( order === 'row-major' && trans === 'none' && uplo === 'lower' ) - ) { - jx = kx + ( ( N - 1 ) * strideX ); - for ( j = N - 1; j >= 0; j-- ) { - temp = x[ jx ]; - ix = jx; - if ( nonunit ) { - temp = f32( temp * A[ offsetA+j+(j*LDA) ] ); - } - for ( i = j - 1; i >= 0; i-- ) { - ix -= strideX; - temp = f32( temp + f32( x[ ix ] * A[ offsetA+i+(j*LDA) ] ) ); - } - x[ jx ] = temp; - jx -= strideX; - } - return x; - } - if ( - ( order === 'column-major' && trans !== 'none' && uplo === 'lower' ) || - ( order === 'row-major' && trans === 'none' && uplo === 'upper' ) - ) { - jx = kx; - for ( j = 0; j < N; j++ ) { - temp = x[ jx ]; - ix = jx; - if ( nonunit ) { - temp = f32( temp * A[ offsetA+j+(j*LDA) ] ); - } - for ( i = j + 1; i < N; i++ ) { - ix += strideX; - temp = f32( temp + f32( x[ ix ] * A[ offsetA+i+(j*LDA) ] ) ); - } - x[ jx ] = temp; - jx += strideX; - } - return x; - } + return base( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offsetX ); } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js index d06b11dd53bc..b779f378cb81 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js @@ -20,7 +20,6 @@ // MODULES // -var f32 = require( '@stdlib/number/float64/base/to-float32' ); var max = require( '@stdlib/math/base/special/max' ); var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); @@ -28,6 +27,7 @@ var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-opera var isDiagonal = require( '@stdlib/blas/base/assert/is-diagonal-type' ); var stride2offset = require( '@stdlib/strided/base/stride2offset'); var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); // MAIN // @@ -63,13 +63,7 @@ var format = require( '@stdlib/string/format' ); * // x => [ 14.0, 8.0, 3.0 ] */ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { - var nonunit; - var temp; - var ix; - var jx; var kx; - var i; - var j; if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); @@ -95,91 +89,8 @@ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { if ( N === 0 ) { return x; } - nonunit = ( diag === 'non-unit' ); kx = stride2offset( N, strideX ); - if ( - ( order === 'column-major' && trans === 'none' && uplo === 'upper' ) || - ( order === 'row-major' && trans !== 'none' && uplo === 'lower' ) - ) { - jx = kx; - for ( j = 0; j < N; j++ ) { - if ( x[ jx ] !== 0.0 ) { - temp = x[ jx ]; - ix = kx; - for ( i = 0; i < j; i++ ) { - x[ ix ] += f32( temp * A[ i+(LDA*j) ] ); - ix += strideX; - } - if ( nonunit ) { - x[ jx ] = f32( x[ jx ] * A[ (j*LDA)+j ] ); - } - } - jx += strideX; - } - return x; - } - if ( - ( order === 'column-major' && trans === 'none' && uplo === 'lower' ) || - ( order === 'row-major' && trans !== 'none' && uplo === 'upper' ) - ) { - kx += ( N - 1 ) * strideX; - jx = kx; - for ( j = N - 1; j >= 0; j-- ) { - if ( x[ jx ] !== 0.0 ) { - temp = x[ jx ]; - ix = kx; - for ( i = N - 1; i > j; i-- ) { - x[ ix ] += f32( temp * A[ i+(LDA*j) ] ); - ix -= strideX; - } - if ( nonunit ) { - x[ jx ] = f32( x[ jx ] * A[ (j*LDA)+j ] ); - } - } - jx -= strideX; - } - return x; - } - if ( - ( order === 'column-major' && trans !== 'none' && uplo === 'upper' ) || - ( order === 'row-major' && trans === 'none' && uplo === 'lower' ) - ) { - jx = kx + ( ( N - 1 ) * strideX ); - for ( j = N - 1; j >= 0; j-- ) { - temp = x[ jx ]; - ix = jx; - if ( nonunit ) { - temp = f32( temp * A[ (j*LDA)+j ] ); - } - for ( i = j - 1; i >= 0; i-- ) { - ix -= strideX; - temp = f32( temp + f32( x[ ix ] * A[ i+(LDA*j) ] ) ); - } - x[ jx ] = temp; - jx -= strideX; - } - return x; - } - if ( - ( order === 'column-major' && trans !== 'none' && uplo === 'lower' ) || - ( order === 'row-major' && trans === 'none' && uplo === 'upper' ) - ) { - jx = kx; - for ( j = 0; j < N; j++ ) { - temp = x[ jx ]; - ix = jx; - if ( nonunit ) { - temp = f32( temp * A[ (j*LDA)+j ] ); - } - for ( i = j + 1; i < N; i++ ) { - ix += strideX; - temp = f32( temp + f32( x[ ix ] * A[ i+(LDA*j) ] ) ); - } - x[ jx ] = temp; - jx += strideX; - } - return x; - } + return base( order, uplo, trans, diag, N, A, LDA, 0, x, strideX, kx ); } From bd03f9a2bd89d8daa784a911f26630c87207245f Mon Sep 17 00:00:00 2001 From: aman-095 Date: Thu, 11 Jul 2024 17:33:06 +0530 Subject: [PATCH 06/25] docs: add comment for lint --- lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js index f2669eabd527..07d101ec93fb 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js @@ -88,7 +88,7 @@ function strmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offset if ( N === 0 ) { return x; } - return base( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offsetX ); + return base( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offsetX ); // eslint-disable-line max-len } From 171d2fd5bce817f0b2d90c292876e73e0a87d2d0 Mon Sep 17 00:00:00 2001 From: aman-095 Date: Thu, 11 Jul 2024 18:35:29 +0530 Subject: [PATCH 07/25] docs: update descriptions --- .../@stdlib/blas/base/strmv/docs/repl.txt | 12 +++---- .../blas/base/strmv/docs/types/index.d.ts | 33 ++++++++++--------- .../@stdlib/blas/base/strmv/lib/base.js | 4 +-- .../@stdlib/blas/base/strmv/lib/ndarray.js | 4 +-- 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt index 7dbd11187572..a34ca3149936 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt @@ -1,7 +1,7 @@ {{alias}}( ord, uplo, trans, diag, N, A, lda, x, sx ) - Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, - where `x` is an `N` element vector, and `A` is an `N` by `N` unit, + Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, + where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. Indexing is relative to the first index. To introduce an offset, use typed @@ -30,7 +30,7 @@ Number of elements along each dimension of `A`. A: Float32Array - Matrix. + Input matrix. lda: integer Stride of the first dimension of `A` (a.k.a., leading dimension of the @@ -56,9 +56,9 @@ {{alias}}.ndarray( ord, uplo, trans, diag, N, A, lda, oa, x, sx, ox ) - Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, + Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element - vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower + vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. While typed array views mandate a view offset based on the underlying @@ -86,7 +86,7 @@ Number of elements along each dimension of `A`. A: Float32Array - Matrix. + Input matrix. lda: integer Stride of the first dimension of `A` (a.k.a., leading dimension of the diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts index f1e0e12e4593..83eb0f4f306f 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts @@ -27,16 +27,16 @@ import { Layout, MatrixTriangle, TransposeOperation, DiagonalType } from '@stdli */ interface Routine { /** - * Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. + * Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param order - storage layout * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced - * @param trans - specifies whether the matrix `A` is a non-transpose, transpose, or conjugate-transpose - * @param diag - specifies whether or not `A` is unit triangular + * @param trans - specifies whether the matrix `A` is transposed, conjugate-transposed, or not transposed + * @param diag - specifies whether the matrix `A` has a unit diagonal * @param N - number of elements along each dimension in the matrix `A` - * @param A - matrix + * @param A - input matrix * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) - * @param x - first input array + * @param x - input vector * @param strideX - `x` stride length * @returns `x` * @@ -52,18 +52,19 @@ interface Routine { ( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number ): Float32Array; /** - * Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. + * Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param order - storage layout * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced - * @param trans - specifies whether the matrix `A` is a non-transpose, transpose, or conjugate-transpose - * @param diag - specifies whether or not `A` is unit triangular + * @param trans - specifies whether the matrix `A` is transposed, conjugate-transposed, or not transposed + * @param diag - specifies whether the matrix `A` has a unit diagonal * @param N - number of elements along each dimension in the matrix `A` - * @param A - matrix + * @param A - input matrix * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) - * @param x - first input array + * @param offsetA - starting index for `A` + * @param x - input vector * @param strideX - `x` stride length - * @param offsetX - starting `x` index + * @param offsetX - starting index for `x` * @returns `x` * * @example @@ -79,16 +80,16 @@ interface Routine { } /** -* Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param order - storage layout * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced -* @param trans - specifies whether the matrix `A` is a non-transpose, transpose, or conjugate-transpose -* @param diag - specifies whether or not `A` is unit triangular +* @param trans - specifies whether the matrix `A` is transposed, conjugate-transposed, or not transposed +* @param diag - specifies whether the matrix `A` has a unit diagonal * @param N - number of elements along each dimension in the matrix `A` -* @param A - matrix +* @param A - input matrix * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) -* @param x - first input array +* @param x - input vector * @param strideX - `x` stride length * @returns `x` * diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js index 17c04049d693..6d6c5a593d89 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js @@ -35,10 +35,10 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' ); * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {Float32Array} A - input matrix * @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) -* @param {NonNegativeInteger} offsetA - index offset for `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` * @param {Float32Array} x - input vector * @param {integer} strideX - `x` stride length -* @param {NonNegativeInteger} offsetX - index offset for `x` +* @param {NonNegativeInteger} offsetX - starting index for `x` * @throws {TypeError} first argument must be a valid order * @throws {TypeError} second argument must specify whether the lower or upper triangular matrix is supplied * @throws {TypeError} third argument must be a valid transpose operation diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js index 07d101ec93fb..b948a980b850 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js @@ -41,10 +41,10 @@ var base = require( './base.js' ); * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {Float32Array} A - input matrix * @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) -* @param {NonNegativeInteger} offsetA - index offset for `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` * @param {Float32Array} x - input vector * @param {integer} strideX - `x` stride length -* @param {NonNegativeInteger} offsetX - index offset for `x` +* @param {NonNegativeInteger} offsetX - starting index for `x` * @throws {TypeError} first argument must be a valid order * @throws {TypeError} second argument must specify whether the lower or upper triangular matrix is supplied * @throws {TypeError} third argument must be a valid transpose operation From 230ce8a46d4c5788be3f94dd3bc22933875d579b Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Sat, 13 Jul 2024 04:20:01 -0700 Subject: [PATCH 08/25] refactor: support separate stride arguments for inner and outer dimensions --- .../@stdlib/blas/base/strmv/lib/base.js | 158 +++++---- .../@stdlib/blas/base/strmv/lib/index.js | 2 +- .../@stdlib/blas/base/strmv/lib/ndarray.js | 26 +- .../@stdlib/blas/base/strmv/lib/strmv.js | 23 +- .../test/fixtures/column_major_l_nt_nu.json | 2 + .../test/fixtures/column_major_l_nt_u.json | 2 + .../test/fixtures/column_major_l_t_nu.json | 2 + .../test/fixtures/column_major_l_t_u.json | 2 + .../test/fixtures/column_major_u_nt_nu.json | 2 + .../test/fixtures/column_major_u_nt_u.json | 2 + .../test/fixtures/column_major_u_t_nu.json | 2 + .../test/fixtures/column_major_u_t_u.json | 2 + .../strmv/test/fixtures/column_major_xn.json | 2 + .../strmv/test/fixtures/column_major_xt.json | 2 + .../test/fixtures/row_major_l_nt_nu.json | 2 + .../strmv/test/fixtures/row_major_l_nt_u.json | 2 + .../strmv/test/fixtures/row_major_l_t_nu.json | 2 + .../strmv/test/fixtures/row_major_l_t_u.json | 2 + .../test/fixtures/row_major_u_nt_nu.json | 2 + .../strmv/test/fixtures/row_major_u_nt_u.json | 2 + .../strmv/test/fixtures/row_major_u_t_nu.json | 2 + .../strmv/test/fixtures/row_major_u_t_u.json | 2 + .../strmv/test/fixtures/row_major_xn.json | 2 + .../strmv/test/fixtures/row_major_xt.json | 2 + .../blas/base/strmv/test/test.ndarray.js | 310 +++++++++++------- 25 files changed, 342 insertions(+), 217 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js index 6d6c5a593d89..6fc0330ce964 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js @@ -29,125 +29,143 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' ); * Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param {string} order - storage layout -* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied -* @param {string} trans - specifies whether the matrix `A` is transposed, conjugate-transposed, or not transposed -* @param {string} diag - specifies whether the matrix `A` has a unit diagonal +* @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix +* @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {string} diag - specifies whether `A` has a unit diagonal * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {Float32Array} A - input matrix -* @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` * @param {NonNegativeInteger} offsetA - starting index for `A` * @param {Float32Array} x - input vector * @param {integer} strideX - `x` stride length * @param {NonNegativeInteger} offsetX - starting index for `x` -* @throws {TypeError} first argument must be a valid order -* @throws {TypeError} second argument must specify whether the lower or upper triangular matrix is supplied -* @throws {TypeError} third argument must be a valid transpose operation -* @throws {TypeError} fourth argument must be a valid diagonal type -* @throws {RangeError} fifth argument must be a nonnegative integer -* @throws {RangeError} seventh argument must be greater than or equal to max(1,N) -* @throws {RangeError} tenth argument must be non-zero * @returns {Float32Array} `x` * * @example * var Float32Array = require( '@stdlib/array/float32' ); * -* var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * -* strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, 1, 0 ); +* strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ -function strmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len +function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len + var isRowMajor; + var isColMajor; var nonunit; - var temp; - var ix; - var jx; - var kx; - var i; - var j; + var tmp; + var sa0; + var sa1; + var ix0; + var ix1; + var i0; + var i1; + var oa; + var ox; + // Note on variable naming convention: sa#, ix#, i# where # corresponds to the loop number, with `0` being the innermost loop... + + isRowMajor = ( order === 'row-major' ); + isColMajor = ( order === 'column-major' ); nonunit = ( diag === 'non-unit' ); - kx = offsetX; + + if ( isRowMajor ) { + // For row-major matrices, the last dimension has the fastest changing index... + sa0 = strideA2; // stride for innermost loop + sa1 = strideA1; // stride for outermost loop + } else { // isColMajor + // For column-major matrices, the first dimension has the fastest changing index... + sa0 = strideA1; // stride for innermost loop + sa1 = strideA2; // stride for outermost loop + } + + ox = offsetX; if ( - ( order === 'column-major' && trans === 'none' && uplo === 'upper' ) || - ( order === 'row-major' && trans !== 'none' && uplo === 'lower' ) + ( isColMajor && trans === 'none' && uplo === 'upper' ) || + ( isRowMajor && trans !== 'none' && uplo === 'lower' ) ) { - jx = kx; - for ( j = 0; j < N; j++ ) { - if ( x[ jx ] !== 0.0 ) { - temp = x[ jx ]; - ix = kx; - for ( i = 0; i < j; i++ ) { - x[ ix ] += f32( temp * A[ offsetA+i+(LDA*j) ] ); - ix += strideX; + ix1 = ox; + for ( i1 = 0; i1 < N; i1++ ) { + if ( x[ ix1 ] !== 0.0 ) { + tmp = x[ ix1 ]; + oa = offsetA + (sa1*i1); + ix0 = ox; + for ( i0 = 0; i0 < i1; i0++ ) { + x[ ix0 ] += f32( tmp * A[ oa+(sa0*i0) ] ); + ix0 += strideX; } if ( nonunit ) { - x[ jx ] = f32( x[ jx ] * A[ offsetA+j+(LDA*j) ] ); + x[ ix1 ] = f32( x[ ix1 ] * A[ oa+(sa0*i1) ] ); } } - jx += strideX; + ix1 += strideX; } return x; } if ( - ( order === 'column-major' && trans === 'none' && uplo === 'lower' ) || - ( order === 'row-major' && trans !== 'none' && uplo === 'upper' ) + ( isColMajor && trans === 'none' && uplo === 'lower' ) || + ( isRowMajor && trans !== 'none' && uplo === 'upper' ) ) { - kx += ( N - 1 ) * strideX; - jx = kx; - for ( j = N - 1; j >= 0; j-- ) { - if ( x[ jx ] !== 0.0 ) { - temp = x[ jx ]; - ix = kx; - for ( i = N - 1; i > j; i-- ) { - x[ ix ] += f32( temp * A[ offsetA+i+(LDA*j) ] ); - ix -= strideX; + ox += ( N - 1 ) * strideX; + ix1 = ox; + for ( i1 = N-1; i1 >= 0; i1-- ) { + if ( x[ ix1 ] !== 0.0 ) { + tmp = x[ ix1 ]; + oa = offsetA + (sa1*i1); + ix0 = ox; + for ( i0 = N-1; i0 > i1; i0-- ) { + x[ ix0 ] += f32( tmp * A[ oa+(sa0*i0) ] ); + ix0 -= strideX; } if ( nonunit ) { - x[ jx ] = f32( x[ jx ] * A[ offsetA+j+(LDA*j) ] ); + x[ ix1 ] = f32( x[ ix1 ] * A[ oa+(sa0*i1) ] ); } } - jx -= strideX; + ix1 -= strideX; } return x; } if ( - ( order === 'column-major' && trans !== 'none' && uplo === 'upper' ) || - ( order === 'row-major' && trans === 'none' && uplo === 'lower' ) + ( isColMajor && trans !== 'none' && uplo === 'upper' ) || + ( isRowMajor && trans === 'none' && uplo === 'lower' ) ) { - jx = kx + ( ( N - 1 ) * strideX ); - for ( j = N - 1; j >= 0; j-- ) { - temp = x[ jx ]; - ix = jx; + ix1 = ox + ( ( N - 1 ) * strideX ); + for ( i1 = N-1; i1 >= 0; i1-- ) { + tmp = x[ ix1 ]; + oa = offsetA + (sa1*i1); + ix0 = ix1; if ( nonunit ) { - temp = f32( temp * A[ offsetA+j+(j*LDA) ] ); + tmp = f32( tmp * A[ oa+(sa0*i1) ] ); } - for ( i = j - 1; i >= 0; i-- ) { - ix -= strideX; - temp = f32( temp + f32( x[ ix ] * A[ offsetA+i+(j*LDA) ] ) ); + for ( i0 = i1-1; i0 >= 0; i0-- ) { + ix0 -= strideX; + tmp = f32( tmp + f32( x[ ix0 ] * A[ oa+(sa0*i0) ] ) ); } - x[ jx ] = temp; - jx -= strideX; + x[ ix1 ] = tmp; + ix1 -= strideX; } return x; } if ( - ( order === 'column-major' && trans !== 'none' && uplo === 'lower' ) || - ( order === 'row-major' && trans === 'none' && uplo === 'upper' ) + ( isColMajor && trans !== 'none' && uplo === 'lower' ) || + ( isRowMajor && trans === 'none' && uplo === 'upper' ) ) { - jx = kx; - for ( j = 0; j < N; j++ ) { - temp = x[ jx ]; - ix = jx; + ix1 = ox; + for ( i1 = 0; i1 < N; i1++ ) { + tmp = x[ ix1 ]; + oa = offsetA + (sa1*i1); + ix0 = ix1; if ( nonunit ) { - temp = f32( temp * A[ offsetA+j+(j*LDA) ] ); + tmp = f32( tmp * A[ oa+(sa0*i1) ] ); } - for ( i = j + 1; i < N; i++ ) { - ix += strideX; - temp = f32( temp + f32( x[ ix ] * A[ offsetA+i+(j*LDA) ] ) ); + for ( i0 = i1+1; i0 < N; i0++ ) { + ix0 += strideX; + tmp = f32( tmp + f32( x[ ix0 ] * A[ oa+(sa0*i0) ] ) ); } - x[ jx ] = temp; - jx += strideX; + x[ ix1 ] = tmp; + ix1 += strideX; } return x; } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js index 6f2bc0cb3e64..7964c63a0eb9 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js @@ -40,7 +40,7 @@ * var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * -* strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, 1, 0 ); +* strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js index b948a980b850..fb88f1425551 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js @@ -20,7 +20,6 @@ // MODULES // -var max = require( '@stdlib/math/base/special/max' ); var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation'); @@ -35,12 +34,13 @@ var base = require( './base.js' ); * Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param {string} order - storage layout -* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied -* @param {string} trans - specifies whether the matrix `A` is transposed, conjugate-transposed, or not transposed -* @param {string} diag - specifies whether the matrix `A` has a unit diagonal +* @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix +* @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {string} diag - specifies whether `A` has a unit diagonal * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {Float32Array} A - input matrix -* @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {integer} strideA1 - stride of the first dimension of `A` +* @param {integer} strideA2 - stride of the second dimension of `A` * @param {NonNegativeInteger} offsetA - starting index for `A` * @param {Float32Array} x - input vector * @param {integer} strideX - `x` stride length @@ -50,20 +50,19 @@ var base = require( './base.js' ); * @throws {TypeError} third argument must be a valid transpose operation * @throws {TypeError} fourth argument must be a valid diagonal type * @throws {RangeError} fifth argument must be a nonnegative integer -* @throws {RangeError} seventh argument must be greater than or equal to max(1,N) -* @throws {RangeError} tenth argument must be non-zero +* @throws {RangeError} eleventh argument must be non-zero * @returns {Float32Array} `x` * * @example * var Float32Array = require( '@stdlib/array/float32' ); * -* var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * -* strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, 1, 0 ); +* strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ -function strmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len +function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } @@ -79,16 +78,13 @@ function strmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offset if ( N < 0 ) { throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', N ) ); } - if ( LDA < max( 1, N ) ) { - throw new RangeError( format( 'invalid argument. Seventh argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) ); - } if ( strideX === 0 ) { - throw new RangeError( format( 'invalid argument. Tenth argument must be non-zero. Value: `%d`.', strideX ) ); + throw new RangeError( format( 'invalid argument. Eleventh argument must be non-zero. Value: `%d`.', strideX ) ); } if ( N === 0 ) { return x; } - return base( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offsetX ); // eslint-disable-line max-len + return base( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js index b779f378cb81..efd631c2394d 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js @@ -36,9 +36,9 @@ var base = require( './base.js' ); * Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param {string} order - storage layout -* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied -* @param {string} trans - specifies whether the matrix `A` is transposed, conjugate-transposed, or not transposed -* @param {string} diag - specifies whether the matrix `A` has a unit diagonal +* @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix +* @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param {string} diag - specifies whether `A` has a unit diagonal * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {Float32Array} A - input matrix * @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) @@ -56,14 +56,16 @@ var base = require( './base.js' ); * @example * var Float32Array = require( '@stdlib/array/float32' ); * -* var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * * strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); * // x => [ 14.0, 8.0, 3.0 ] */ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { - var kx; + var sa1; + var sa2; + var ox; if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); @@ -89,8 +91,15 @@ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { if ( N === 0 ) { return x; } - kx = stride2offset( N, strideX ); - return base( order, uplo, trans, diag, N, A, LDA, 0, x, strideX, kx ); + if ( order === 'column-major' ) { + sa1 = 1; + sa2 = LDA; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; + } + ox = stride2offset( N, strideX ); + return base( order, uplo, trans, diag, N, A, sa1, sa2, 0, x, strideX, ox ); } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_nu.json index 28c7879e0eed..e4cb9599af6c 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_nu.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_nu.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 1, + "strideA2": 3, "N": 3, "A": [ 1.0, 2.0, 3.0, 0.0, 4.0, 5.0, 0.0, 0.0, 6.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_u.json index 5fd88f474523..b4974e92614d 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_u.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_u.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 1, + "strideA2": 3, "N": 3, "A": [ 1.0, 2.0, 2.0, 0.0, 1.0, 1.0, 0.0, 0.0, 1.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_nu.json index 971b03a57717..f43bed3bcf48 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_nu.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_nu.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 1, + "strideA2": 3, "N": 3, "A": [ 1.0, 2.0, 3.0, 0.0, 4.0, 5.0, 0.0, 0.0, 6.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_u.json index a0002090b4be..8f1400bc40e7 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_u.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_t_u.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 1, + "strideA2": 3, "N": 3, "A": [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json index 3376c5fbb377..dee8f9abec27 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 1, + "strideA2": 3, "N": 3, "A": [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_u.json index 4e71ba3df2d3..a2902d4e523c 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_u.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_u.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 1, + "strideA2": 3, "N": 3, "A": [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_nu.json index dd31956cbf60..92c5e1acd392 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_nu.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_nu.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 1, + "strideA2": 3, "N": 3, "A": [ 1.0, 0.0, 0.0, 2.0, 4.0, 0.0, 3.0, 5.0, 6.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_u.json index 22f8c21ca2ed..c395300a07ab 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_u.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_t_u.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 1, + "strideA2": 3, "N": 3, "A": [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xn.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xn.json index f90772bf622e..90fd6cefe031 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xn.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xn.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 2, "LDA": 3, + "strideA1": 1, + "strideA2": 3, "N": 3, "A": [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 ], "x": [ 3.0, 2.0, 1.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xt.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xt.json index 24262a526b03..2a993cbf7c5f 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xt.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_xt.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 1, + "strideA2": 3, "N": 3, "A": [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 2.0, 1.0 ], "x": [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_nu.json index 404f5f3237ba..ffc825265eeb 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_nu.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_nu.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 3, + "strideA2": 1, "N": 3, "A": [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_u.json index 3663451cdc0d..12099c6147ff 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_u.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_u.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 3, + "strideA2": 1, "N": 3, "A": [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 2.0, 1.0, 1.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_nu.json index b7fba35a2d79..d6429a1ee234 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_nu.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_nu.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 3, + "strideA2": 1, "N": 3, "A": [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_u.json index 789cc11add74..2cd0a30d3c88 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_u.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_t_u.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 3, + "strideA2": 1, "N": 3, "A": [ 1.0, 0.0, 0.0, 2.0, 1.0, 0.0, 3.0, 4.0, 1.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_nu.json index f66dfdfdac62..56cb500e6a54 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_nu.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_nu.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 3, + "strideA2": 1, "N": 3, "A": [ 1.0, 2.0, 3.0, 0.0, 4.0, 5.0, 0.0, 0.0, 6.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_u.json index 3ce3c31258a4..8bf0c9a7af0e 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_u.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_u.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 3, + "strideA2": 1, "N": 3, "A": [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_nu.json index 8f4921208210..350bc599d057 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_nu.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_nu.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 3, + "strideA2": 1, "N": 3, "A": [ 1.0, 2.0, 3.0, 0.0, 4.0, 5.0, 0.0, 0.0, 6.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_u.json index aa20e05b248a..3216211b81ae 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_u.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_t_u.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 3, + "strideA2": 1, "N": 3, "A": [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xn.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xn.json index 6f8f9dafab40..6f9608e918a7 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xn.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xn.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 2, "LDA": 3, + "strideA1": 3, + "strideA2": 1, "N": 3, "A": [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ], "x": [ 1.0, 2.0, 3.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xt.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xt.json index b0120582e0c7..6e31d5f93c78 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xt.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_xt.json @@ -7,6 +7,8 @@ "offsetA": 0, "offsetX": 0, "LDA": 3, + "strideA1": 3, + "strideA2": 1, "N": 3, "A": [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ], "x": [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ], diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js index 6c28a944ced1..624cb2d8d967 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js @@ -91,15 +91,18 @@ tape( 'main export is a function', function test( t ) { t.end(); }); -tape( 'the function has an arity of 11', function test( t ) { - t.strictEqual( strmv.length, 11, 'returns expected value' ); +tape( 'the function has an arity of 12', function test( t ) { + t.strictEqual( strmv.length, 12, 'returns expected value' ); t.end(); }); tape( 'the function throws an error if provided an invalid first argument', function test( t ) { var values; + var data; var i; + data = rutu; + values = [ 'foo', 'bar', @@ -114,15 +117,18 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - strmv( value, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float32Array( rutu.x ), rutu.strideX, rutu.offsetX ); + strmv( value, data.uplo, data.trans, data.diag, data.N, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); }; } }); tape( 'the function throws an error if provided an invalid second argument', function test( t ) { var values; + var data; var i; + data = rutu; + values = [ 'foo', 'bar', @@ -137,15 +143,18 @@ tape( 'the function throws an error if provided an invalid second argument', fun function badValue( value ) { return function badValue() { - strmv( rutu.order, value, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float32Array( rutu.x ), rutu.strideX, rutu.offsetX ); + strmv( data.order, value, data.trans, data.diag, data.N, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); }; } }); tape( 'the function throws an error if provided an invalid third argument', function test( t ) { var values; + var data; var i; + data = rutu; + values = [ 'foo', 'bar', @@ -160,15 +169,18 @@ tape( 'the function throws an error if provided an invalid third argument', func function badValue( value ) { return function badValue() { - strmv( rutu.order, rutu.uplo, value, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float32Array( rutu.x ), rutu.strideX, rutu.offsetX ); + strmv( data.order, data.uplo, value, data.diag, data.N, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); }; } }); tape( 'the function throws an error if provided an invalid fourth argument', function test( t ) { var values; + var data; var i; + data = rutu; + values = [ 'foo', 'bar', @@ -183,41 +195,19 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun function badValue( value ) { return function badValue() { - strmv( rutu.order, rutu.uplo, rutu.trans, value, rutu.N, new Float32Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float32Array( rutu.x ), rutu.strideX, rutu.offsetX ); + strmv( data.order, data.uplo, data.trans, value, data.N, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); }; } }); tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { var values; + var data; var i; - values = [ - -1, - -2, - -3 - ]; - - for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); - } - t.end(); - - function badValue( value ) { - return function badValue() { - strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, value, new Float32Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float32Array( rutu.x ), rutu.strideX, rutu.offsetX ); - }; - } -}); - -tape( 'the function throws an error if provided an invalid seventh argument', function test( t ) { - var values; - var i; + data = rutu; values = [ - 2, - 1, - 0, -1, -2, -3 @@ -230,15 +220,18 @@ tape( 'the function throws an error if provided an invalid seventh argument', fu function badValue( value ) { return function badValue() { - strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), value, new Float32Array( rutu.x ), rutu.strideX ); + strmv( data.order, data.uplo, data.trans, data.diag, value, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); }; } }); -tape( 'the function throws an error if provided an invalid tenth argument', function test( t ) { +tape( 'the function throws an error if provided an invalid eleventh argument', function test( t ) { var values; + var data; var i; + data = rutu; + values = [ 0 ]; @@ -250,23 +243,26 @@ tape( 'the function throws an error if provided an invalid tenth argument', func function badValue( value ) { return function badValue() { - strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float32Array( rutu.x ), value, rutu.offsetX ); + strmv( data.order, data.uplo, data.trans, data.diag, data.N, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), value, data.offsetX ); }; } }); tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, none, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rlntnu.A ); - x = new Float32Array( rlntnu.x ); + data = rlntnu; - expected = new Float32Array( rlntnu.x_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( rlntnu.order, rlntnu.uplo, rlntnu.trans, rlntnu.diag, rlntnu.N, a, rlntnu.LDA, rlntnu.offsetA, x, rlntnu.strideX, rlntnu.offsetX ); + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -275,16 +271,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, none, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( clntnu.A ); - x = new Float32Array( clntnu.x ); + data = clntnu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( clntnu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( clntnu.order, clntnu.uplo, clntnu.trans, clntnu.diag, clntnu.N, a, clntnu.LDA, clntnu.offsetA, x, clntnu.strideX, clntnu.offsetX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -293,16 +292,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, transpose, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rltnu.A ); - x = new Float32Array( rltnu.x ); + data = rltnu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( rltnu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( rltnu.order, rltnu.uplo, rltnu.trans, rltnu.diag, rltnu.N, a, rltnu.LDA, rltnu.offsetA, x, rltnu.strideX, rltnu.offsetX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -311,16 +313,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, transpose, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cltnu.A ); - x = new Float32Array( cltnu.x ); + data = cltnu; - expected = new Float32Array( cltnu.x_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( cltnu.order, cltnu.uplo, cltnu.trans, cltnu.diag, cltnu.N, a, cltnu.LDA, cltnu.offsetA, x, cltnu.strideX, cltnu.offsetX ); + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -329,16 +334,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, none, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rlntu.A ); - x = new Float32Array( rlntu.x ); + data = rlntu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( rlntu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( rlntu.order, rlntu.uplo, rlntu.trans, rlntu.diag, rlntu.N, a, rlntu.LDA, rlntu.offsetA, x, rlntu.strideX, rlntu.offsetX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -347,16 +355,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, none, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( clntu.A ); - x = new Float32Array( clntu.x ); + data = clntu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( clntu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( clntu.order, clntu.uplo, clntu.trans, clntu.diag, clntu.N, a, clntu.LDA, clntu.offsetA, x, clntu.strideX, clntu.offsetX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -365,16 +376,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, transpose, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rltu.A ); - x = new Float32Array( rltu.x ); + data = rltu; - expected = new Float32Array( rltu.x_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( rltu.order, rltu.uplo, rltu.trans, rltu.diag, rltu.N, a, rltu.LDA, rltu.offsetA, x, rltu.strideX, rltu.offsetX ); + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -383,16 +397,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, transpose, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cltu.A ); - x = new Float32Array( cltu.x ); + data = cltu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( cltu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( cltu.order, cltu.uplo, cltu.trans, cltu.diag, cltu.N, a, cltu.LDA, cltu.offsetA, x, cltu.strideX, cltu.offsetX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -401,16 +418,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, none, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( runtnu.A ); - x = new Float32Array( runtnu.x ); + data = runtnu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( runtnu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( runtnu.order, runtnu.uplo, runtnu.trans, runtnu.diag, runtnu.N, a, runtnu.LDA, runtnu.offsetA, x, runtnu.strideX, runtnu.offsetX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -419,16 +439,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, none, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cuntnu.A ); - x = new Float32Array( cuntnu.x ); + data = cuntnu; - expected = new Float32Array( cuntnu.x_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( cuntnu.order, cuntnu.uplo, cuntnu.trans, cuntnu.diag, cuntnu.N, a, cuntnu.LDA, cuntnu.offsetA, x, cuntnu.strideX, cuntnu.offsetX ); + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -437,16 +460,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, none, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( runtu.A ); - x = new Float32Array( runtu.x ); + data = runtu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( runtu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( runtu.order, runtu.uplo, runtu.trans, runtu.diag, runtu.N, a, runtu.LDA, runtu.offsetA, x, runtu.strideX, runtu.offsetX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -455,16 +481,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, none, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cuntu.A ); - x = new Float32Array( cuntu.x ); + data = cuntu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( cuntu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( cuntu.order, cuntu.uplo, cuntu.trans, cuntu.diag, cuntu.N, a, cuntu.LDA, cuntu.offsetA, x, cuntu.strideX, cuntu.offsetX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -473,16 +502,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, transpose, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rutnu.A ); - x = new Float32Array( rutnu.x ); + data = rutnu; - expected = new Float32Array( rutnu.x_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( rutnu.order, rutnu.uplo, rutnu.trans, rutnu.diag, rutnu.N, a, rutnu.LDA, rutnu.offsetA, x, rutnu.strideX, rutnu.offsetX ); + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -491,16 +523,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, transpose, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cutnu.A ); - x = new Float32Array( cutnu.x ); + data = cutnu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( cutnu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( cutnu.order, cutnu.uplo, cutnu.trans, cutnu.diag, cutnu.N, a, cutnu.LDA, cutnu.offsetA, x, cutnu.strideX, cutnu.offsetX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -509,16 +544,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, transpose, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rutu.A ); - x = new Float32Array( rutu.x ); + data = rutu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( rutu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, a, rutu.LDA, rutu.offsetA, x, rutu.strideX, rutu.offsetX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -527,16 +565,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, transpose, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cutu.A ); - x = new Float32Array( cutu.x ); + data = cutu; - expected = new Float32Array( cutu.x_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( cutu.order, cutu.uplo, cutu.trans, cutu.diag, cutu.N, a, cutu.LDA, cutu.offsetA, x, cutu.strideX, cutu.offsetX ); + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -545,16 +586,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, sx=2)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rxt.A ); - x = new Float32Array( rxt.x ); + data = rxt; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( rxt.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( rxt.order, rxt.uplo, rxt.trans, rxt.diag, rxt.N, a, rxt.LDA, rxt.offsetA, x, rxt.strideX, rxt.offsetX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -563,16 +607,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, sx=2)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cxt.A ); - x = new Float32Array( cxt.x ); + data = cxt; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( cxt.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( cxt.order, cxt.uplo, cxt.trans, cxt.diag, cxt.N, a, cxt.LDA, cxt.offsetA, x, cxt.strideX, cxt.offsetX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -580,14 +627,17 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x }); tape( 'the function returns a reference to the second input vector', function test( t ) { + var data; var out; var a; var x; - a = new Float32Array( rutu.A ); - x = new Float32Array( rutu.x ); + data = rutu; - out = strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, a, rutu.LDA, rutu.offsetA, x, rutu.strideX, rutu.offsetX ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); t.end(); @@ -595,16 +645,19 @@ tape( 'the function returns a reference to the second input vector', function te tape( 'if `N` is zero, the function returns the second input vector unchanged (row-major)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rutu.A ); - x = new Float32Array( rutu.x ); + data = rutu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( rutu.x ); + expected = new Float32Array( data.x ); - out = strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, 0, a, rutu.LDA, rutu.offsetA, x, rutu.strideX, rutu.offsetX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, 0, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); t.deepEqual( x, expected, 'returns expected value' ); @@ -613,16 +666,19 @@ tape( 'if `N` is zero, the function returns the second input vector unchanged (r tape( 'if `N` is zero, the function returns the second input vector unchanged (column-major)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cutu.A ); - x = new Float32Array( cutu.x ); + data = cutu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( cutu.x ); + expected = new Float32Array( data.x ); - out = strmv( cutu.order, cutu.uplo, cutu.trans, cutu.diag, 0, a, cutu.LDA, cutu.offsetA, x, cutu.strideX, cutu.offsetX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, 0, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); t.deepEqual( x, expected, 'returns expected value' ); @@ -631,16 +687,19 @@ tape( 'if `N` is zero, the function returns the second input vector unchanged (c tape( 'the function supports complex access patterns (row-major)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rxn.A ); - x = new Float32Array( rxn.x ); + data = rxn; - expected = new Float32Array( rxn.x_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( rxn.order, rxn.uplo, rxn.trans, rxn.diag, rxn.N, a, rxn.LDA, rxn.offsetA, x, rxn.strideX, rxn.offsetX ); + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -649,16 +708,19 @@ tape( 'the function supports complex access patterns (row-major)', function test tape( 'the function supports complex access patterns (column-major)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cxn.A ); - x = new Float32Array( cxn.x ); + data = cxn; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( cxn.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( cxn.order, cxn.uplo, cxn.trans, cxn.diag, cxn.N, a, cxn.LDA, cxn.offsetA, x, cxn.strideX, cxn.offsetX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); From ff9548dff94a84f74a06f92c4ba412068b00940c Mon Sep 17 00:00:00 2001 From: aman-095 Date: Mon, 15 Jul 2024 11:06:21 +0530 Subject: [PATCH 09/25] docs: update README based on the implementation changes --- .../@stdlib/blas/base/strmv/README.md | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/README.md b/lib/node_modules/@stdlib/blas/base/strmv/README.md index 833f5ec0503c..31014d9464d6 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/strmv/README.md @@ -20,7 +20,7 @@ limitations under the License. # strmv -> Perform one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +> Perform one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.
@@ -32,7 +32,7 @@ var strmv = require( '@stdlib/blas/base/strmv' ); #### strmv( order, uplo, trans, diag, N, A, LDA, x, sx ) -Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. ```javascript var Float32Array = require( '@stdlib/array/float32' ); @@ -47,14 +47,14 @@ strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); The function has the following parameters: - **order**: storage layout. -- **uplo**: specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced. -- **trans**: specifies whether the matrix `A` is a non-transpose, transpose, or conjugate-transpose. -- **diag**: specifies whether or not the matrix `A` is a unit triangular. +- **uplo**: specifies whether `A` is an upper or lower triangular matrix. +- **trans**: specifies whether `A` should be transposed, conjugate-transposed, or not transposed. +- **diag**: specifies whether `A` has a unit diagonal. - **N**: number of elements along each dimension of `A`. - **A**: input matrix stored in linear memory as a [`Float32Array`][mdn-float32array]. - **lda**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). -- **x**: input [`Float32Array`][mdn-float32array]. -- **sx**: index increment for `x`. +- **x**: input vector [`Float32Array`][mdn-float32array]. +- **sx**: `x` stride length. The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, @@ -86,9 +86,9 @@ strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x1, 1 ); // x0 => [ 1.0, 6.0, 3.0, 1.0 ] ``` -#### strmv.ndarray( order, uplo, trans, diag, N, A, LDA, x, sx, ox ) +#### strmv.ndarray( order, uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox ) -Performs one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. ```javascript var Float32Array = require( '@stdlib/array/float32' ); @@ -96,12 +96,15 @@ var Float32Array = require( '@stdlib/array/float32' ); var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, 1, 0 ); +strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); // x => [ 14.0, 8.0, 3.0 ] ``` The function has the following additional parameters: +- **sa1**: stride of the first dimension of `A`. +- **sa2**: stride of the second dimension of `A`. +- **oa**: starting index for `A`. - **ox**: starting index for `x`. 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, @@ -112,7 +115,7 @@ var Float32Array = require( '@stdlib/array/float32' ); var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, -1, 2 ); +strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); // x => [ 1.0, 4.0, 10.0 ] ``` From 8a981050fc46c525d9f82d64a3cc1f677dd32bbf Mon Sep 17 00:00:00 2001 From: aman-095 Date: Mon, 15 Jul 2024 12:27:17 +0530 Subject: [PATCH 10/25] docs: update descriptions and examples --- .../base/strmv/benchmark/benchmark.ndarray.js | 2 +- .../@stdlib/blas/base/strmv/docs/repl.txt | 42 ++-- .../blas/base/strmv/docs/types/index.d.ts | 25 ++- .../blas/base/strmv/docs/types/test.ts | 208 ++++++++++-------- .../@stdlib/blas/base/strmv/package.json | 2 +- 5 files changed, 156 insertions(+), 123 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js index c590c1e76ee5..b87df38d6611 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js @@ -62,7 +62,7 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - z = strmv( 'row-major', 'upper', 'transpose', 'non-unit', N, A, N, 0, x, 1, 0 ); + z = strmv( 'row-major', 'upper', 'transpose', 'non-unit', N, A, N, 1, 0, x, 1, 0 ); if ( isnanf( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt index a34ca3149936..b24b8a0e6dd7 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt @@ -1,8 +1,8 @@ {{alias}}( ord, uplo, trans, diag, N, A, lda, x, sx ) Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, - where `x` is an `N` element vector and `A` is an `N` by `N` unit, - or non-unit, upper or lower triangular matrix. + where `x` is an `N` element vector and `A` is an `N` by `N` unit, or + non-unit, upper or lower triangular matrix. Indexing is relative to the first index. To introduce an offset, use typed array views. @@ -16,15 +16,14 @@ either 'row-major' or 'column-major'. uplo: string - Specifies whether to reference the upper or lower triangular part of - `A`. + Specifies whether `A` is an upper or lower triangular matrix. trans: string - Specifies whether the matrix `A` is non-transpose, transpose, or - conjugate transpose. + Specifies whether `A` should be transposed, conjugate-transposed, or + not transposed. diag: string - Specifies whether or not `A` is unit triangular. + Specifies whether `A` has a unit diagonal. N: integer Number of elements along each dimension of `A`. @@ -55,11 +54,11 @@ [ 3.0, 1.0 ] -{{alias}}.ndarray( ord, uplo, trans, diag, N, A, lda, oa, x, sx, ox ) +{{alias}}.ndarray( ord, uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox ) Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, - using alternative indexing semantics, where `x` is an `N` element - vector and `A` is an `N` by `N` unit, or non-unit, upper or lower - triangular matrix. + using alternative indexing semantics, where `x` is an `N` element vector + and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular + matrix. While typed array views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting @@ -68,19 +67,18 @@ Parameters ---------- ord: string - Row-major (C-style) or column-major (Fortran-style) ord. Must be + Row-major (C-style) or column-major (Fortran-style) order. Must be either 'row-major' or 'column-major'. uplo: string - Specifies whether to reference the upper or lower triangular part of - `A`. + Specifies whether `A` is an upper or lower triangular matrix. trans: string - Specifies whether the matrix `A` is non-transpose, transpose, or - conjugate transpose. + Specifies whether `A` should be transposed, conjugate-transposed, or + not transposed. diag: string - Specifies whether or not `A` is unit triangular. + Specifies whether `A` has a unit diagonal. N: integer Number of elements along each dimension of `A`. @@ -88,9 +86,11 @@ A: Float32Array Input matrix. - lda: integer - Stride of the first dimension of `A` (a.k.a., leading dimension of the - matrix `A`). + sa1: integer + Stride of the first dimension of `A`. + + sa2: integer + Stride of the second dimension of `A`. oa: integer Starting index for `A`. @@ -115,7 +115,7 @@ > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 1.0 ] ); > var ord = 'row-major'; > var uplo = 'upper'; - > {{alias}}.ndarray( ord, uplo, 'none', 'unit', 2, A, 2, 0, x, 1, 0 ) + > {{alias}}.ndarray( ord, uplo, 'none', 'unit', 2, A, 2, 1, 0, x, 1, 0 ) [ 3.0, 1.0 ] See Also diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts index 83eb0f4f306f..f865449f873f 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts @@ -30,9 +30,9 @@ interface Routine { * Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param order - storage layout - * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced - * @param trans - specifies whether the matrix `A` is transposed, conjugate-transposed, or not transposed - * @param diag - specifies whether the matrix `A` has a unit diagonal + * @param uplo - specifies whether `A` is an upper or lower triangular matrix + * @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed + * @param diag - specifies whether `A` has a unit diagonal * @param N - number of elements along each dimension in the matrix `A` * @param A - input matrix * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) @@ -55,12 +55,13 @@ interface Routine { * Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param order - storage layout - * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced - * @param trans - specifies whether the matrix `A` is transposed, conjugate-transposed, or not transposed - * @param diag - specifies whether the matrix `A` has a unit diagonal + * @param uplo - specifies whether `A` is an upper or lower triangular matrix + * @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed + * @param diag - specifies whether `A` has a unit diagonal * @param N - number of elements along each dimension in the matrix `A` * @param A - input matrix - * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param strideA1 - stride of the first dimension of `A` + * @param strideA2 - stride of the first dimension of `A` * @param offsetA - starting index for `A` * @param x - input vector * @param strideX - `x` stride length @@ -73,7 +74,7 @@ interface Routine { * var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * - * strmv.ndarray( row-major', 'upper', 'none', 'non-unit', 3, A, 3, 0, x, 1, 0 ); + * strmv.ndarray( row-major', 'upper', 'none', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ ndarray( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number, offsetX: number ): Float32Array; @@ -83,9 +84,9 @@ interface Routine { * Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param order - storage layout -* @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced -* @param trans - specifies whether the matrix `A` is transposed, conjugate-transposed, or not transposed -* @param diag - specifies whether the matrix `A` has a unit diagonal +* @param uplo - specifies whether `A` is an upper or lower triangular matrix +* @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed +* @param diag - specifies whether `A` has a unit diagonal * @param N - number of elements along each dimension in the matrix `A` * @param A - input matrix * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) @@ -108,7 +109,7 @@ interface Routine { * var A = new Float32Array( [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ] ); * var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); * -* strmv.ndarray( 'row-major', 'lower', 'none', 'non-unit', 3, A, 3, 0, x, 1, 0 ); +* strmv.ndarray( 'row-major', 'lower', 'none', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 1.0, 5.0, 15.0 ] */ declare var strmv: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts index d2b0e692bb79..1e7e29556af8 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts @@ -186,7 +186,7 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, 0 ); // $ExpectType Float32Array + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectType Float32Array } // The compiler throws an error if the function is provided a first argument which is not a string... @@ -194,14 +194,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 10, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( true, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( false, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( null, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( undefined, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( [], 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( {}, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( ( x: number ): number => x, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 10, 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( true, 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( false, 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( null, 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( undefined, 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( [], 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( {}, 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( ( x: number ): number => x, 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not a string... @@ -209,14 +209,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 10, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', true, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', false, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', null, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', undefined, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', [], 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', {}, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', ( x: number ): number => x, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 10, 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', true, 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', false, 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', null, 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', undefined, 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', [], 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', {}, 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', ( x: number ): number => x, 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a third argument which is not a string... @@ -224,14 +224,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 10, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', true, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', false, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', null, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', undefined, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', [], 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', {}, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', ( x: number ): number => x, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 10, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', true, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', false, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', null, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', undefined, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', [], 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', {}, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', ( x: number ): number => x, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a fourth argument which is not a string... @@ -239,14 +239,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 10, 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', true, 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', false, 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', null, 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', undefined, 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', [], 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', {}, 10, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', ( x: number ): number => x, 10, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', true, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', false, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', null, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', undefined, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', [], 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', {}, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', ( x: number ): number => x, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a fifth argument which is not a number... @@ -254,29 +254,29 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', '10', A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', true, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', false, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', null, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', undefined, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', [], A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', {}, A, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', ( x: number ): number => x, A, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', '10', A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', true, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', false, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', null, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', undefined, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', [], A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', {}, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', ( x: number ): number => x, A, 10, 1, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a sixth argument which is not a Float32Array... { const x = new Float32Array( 10 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, 10, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, '10', 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, true, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, false, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, null, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, undefined, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, [ '1' ], 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, {}, 10, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, ( x: number ): number => x, 10, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, 10, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, '10', 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, true, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, false, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, null, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, undefined, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, [ '1' ], 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, {}, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, ( x: number ): number => x, 10, 1, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a seventh argument which is not a number... @@ -284,29 +284,29 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, '10', x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, true, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, false, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, null, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, undefined, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, [], x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, {}, x, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, ( x: number ): number => x, x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, '10', 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, true, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, false, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, null, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, undefined, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, [], 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, {}, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, ( x: number ): number => x, 1, 0, x, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a eighth argument which is not a Float32Array... +// The compiler throws an error if the function is provided a eighth argument which is not a number... { + const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 10, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, '10', 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, true, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, false, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, null, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, undefined, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, [ '1' ], 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, {}, 1 , 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, ( x: number ): number => x, 1 , 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, '10', 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, true, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, false, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, null, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, undefined, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, [], 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, {}, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, ( x: number ): number => x, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a ninth argument which is not a number... @@ -314,29 +314,59 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, '10', 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, true, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, false, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, null, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, undefined, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, [], 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, {}, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, ( x: number ): number => x, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, '10', x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, true, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, false, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, null, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, undefined, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, [], x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, {}, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, ( x: number ): number => x, x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a tenth argument which is not a Float32Array... +{ + const A = new Float32Array( 20 ); + + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, 10, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, '10', 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, true, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, false, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, null, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, undefined, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, [ '1' ], 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, {}, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a eleventh argument which is not a number... +{ + const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); + + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, '10', 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, true, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, false, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, null, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, undefined, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, [], 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, {}, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, ( x: number ): number => x, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a tenth argument which is not a number... +// The compiler throws an error if the function is provided a twelfth argument which is not a number... { const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, '10' ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, true ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, false ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, null ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, undefined ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, [] ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, {} ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, ( x: number ): number => x ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, '10' ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, true ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, false ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, null ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, undefined ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, [] ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, {} ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... @@ -352,7 +382,9 @@ import strmv = require( './index' ); strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10 ); // $ExpectError strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A ); // $ExpectError strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, 0, 10 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0, 10 ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/package.json b/lib/node_modules/@stdlib/blas/base/strmv/package.json index 75c8f9a24ba0..8904db91e85b 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/package.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/base/strmv", "version": "0.0.0", - "description": "Perform one of the matrix-vector operations `x = A*x`, or `x = A**T*x`, `x` is an `N` element vector, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.", + "description": "Perform one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", From 3d798fb5d6dfe522d23188f2a8066bf184f85e00 Mon Sep 17 00:00:00 2001 From: aman-095 Date: Mon, 15 Jul 2024 17:12:58 +0530 Subject: [PATCH 11/25] test: add tests for ndarray implementation --- .../column_major_complex_access_pattern.json | 15 + .../strmv/test/fixtures/column_major_oa.json | 15 + .../test/fixtures/column_major_sa1_sa2.json | 15 + .../test/fixtures/column_major_sa1_sa2n.json | 15 + .../test/fixtures/column_major_sa1n_sa2.json | 15 + .../test/fixtures/column_major_sa1n_sa2n.json | 15 + .../row_major_complex_access_pattern.json | 15 + .../strmv/test/fixtures/row_major_oa.json | 15 + .../test/fixtures/row_major_sa1_sa2.json | 15 + .../test/fixtures/row_major_sa1_sa2n.json | 15 + .../test/fixtures/row_major_sa1n_sa2.json | 15 + .../test/fixtures/row_major_sa1n_sa2n.json | 15 + .../blas/base/strmv/test/test.ndarray.js | 268 +++++++++++++++- .../blas/base/strmv/test/test.strmv.js | 290 ++++++++++++------ 14 files changed, 636 insertions(+), 102 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2n.json diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_complex_access_pattern.json new file mode 100644 index 000000000000..bd56208c3258 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_complex_access_pattern.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "trans": "none", + "diag": "non-unit", + "uplo": "lower", + "strideA1": -2, + "strideA2": -5, + "offsetA": 14, + "strideX": -1, + "offsetX": 2, + "N": 3, + "A": [ 6, 999, 0, 999, 0, 5, 999, 4, 999, 0, 3, 999, 2, 999, 1 ], + "x": [ 3.0, 2.0, 1.0 ], + "x_out": [ 31.0, 10.0, 1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_oa.json new file mode 100644 index 000000000000..4b8d19c8d89f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_oa.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "trans": "none", + "diag": "non-unit", + "uplo": "lower", + "strideA1": 2, + "strideA2": 6, + "offsetA": 7, + "strideX": 1, + "offsetX": 0, + "N": 3, + "A": [ 999, 999, 999, 999, 999, 999, 999, 1, 999, 2, 999, 3, 999, 0, 999, 4, 999, 5, 999, 0, 999, 0, 999, 6, 999, 999, 999, 999, 999, 999 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 10.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2.json new file mode 100644 index 000000000000..00e256135f52 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "trans": "none", + "diag": "non-unit", + "uplo": "lower", + "strideA1": 2, + "strideA2": 5, + "offsetA": 0, + "strideX": 1, + "offsetX": 0, + "N": 3, + "A": [ 1, 999, 2, 999, 3, 0, 999, 4, 999, 5, 0, 999, 0, 999, 6 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 10.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2n.json new file mode 100644 index 000000000000..3312c9907fe0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2n.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "trans": "none", + "diag": "non-unit", + "uplo": "lower", + "strideA1": 2, + "strideA2": -5, + "offsetA": 10, + "strideX": 1, + "offsetX": 0, + "N": 3, + "A": [ 0, 999, 0, 999, 6, 0, 999, 4, 999, 5, 1, 999, 2, 999, 3 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 10.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2.json new file mode 100644 index 000000000000..ab7834a398ed --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "trans": "none", + "diag": "non-unit", + "uplo": "lower", + "strideA1": -2, + "strideA2": 5, + "offsetA": 4, + "strideX": 1, + "offsetX": 0, + "N": 3, + "A": [ 3, 999, 2, 999, 1, 5, 999, 4, 999, 0, 6, 999, 0, 999, 0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 10.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2n.json new file mode 100644 index 000000000000..528cfa82ee8c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2n.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "trans": "none", + "diag": "non-unit", + "uplo": "lower", + "strideA1": -2, + "strideA2": -5, + "offsetA": 14, + "strideX": 1, + "offsetX": 0, + "N": 3, + "A": [ 6, 999, 0, 999, 0, 5, 999, 4, 999, 0, 3, 999, 2, 999, 1 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 10.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_complex_access_pattern.json new file mode 100644 index 000000000000..1462d25d42ac --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_complex_access_pattern.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "trans": "none", + "diag": "non-unit", + "uplo": "lower", + "strideA1": -6, + "strideA2": -1, + "offsetA": 14, + "strideX": -1, + "offsetX": 2, + "N": 3, + "A": [ 6, 5, 3, 999, 999, 999, 0, 4, 2, 999, 999, 999, 0, 0, 1 ], + "x": [ 3.0, 2.0, 1.0 ], + "x_out": [ 31.0, 10.0, 1.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_oa.json new file mode 100644 index 000000000000..9ee4d5f8e5c0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_oa.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "trans": "none", + "diag": "non-unit", + "uplo": "lower", + "strideA1": 10, + "strideA2": 1, + "offsetA": 6, + "strideX": 1, + "offsetX": 0, + "N": 3, + "A": [ 999, 999, 999, 999, 999, 999, 1, 0, 0, 999, 999, 999, 999, 999, 999, 999, 2, 4, 0, 999, 999, 999, 999, 999, 999, 999, 3, 5, 6, 999 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 10.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2.json new file mode 100644 index 000000000000..b6dc460bb661 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "trans": "none", + "diag": "non-unit", + "uplo": "lower", + "strideA1": 6, + "strideA2": 1, + "offsetA": 0, + "strideX": 1, + "offsetX": 0, + "N": 3, + "A": [ 1, 0, 0, 999, 999, 999, 2, 4, 0, 999, 999, 999, 3, 5, 6 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 10.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2n.json new file mode 100644 index 000000000000..c485972e2a4b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2n.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "trans": "none", + "diag": "non-unit", + "uplo": "lower", + "strideA1": 6, + "strideA2": -1, + "offsetA": 2, + "strideX": 1, + "offsetX": 0, + "N": 3, + "A": [ 0, 0, 1, 999, 999, 999, 0, 4, 2, 999, 999, 999, 6, 5, 3 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 10.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2.json new file mode 100644 index 000000000000..7487cf253384 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "trans": "none", + "diag": "non-unit", + "uplo": "lower", + "strideA1": -6, + "strideA2": 1, + "offsetA": 12, + "strideX": 1, + "offsetX": 0, + "N": 3, + "A": [ 3, 5, 6, 999, 999, 999, 2, 4, 0, 999, 999, 999, 1, 0, 0 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 10.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2n.json new file mode 100644 index 000000000000..b96ee54d43fc --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2n.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "trans": "none", + "diag": "non-unit", + "uplo": "lower", + "strideA1": -6, + "strideA2": -1, + "offsetA": 14, + "strideX": 1, + "offsetX": 0, + "N": 3, + "A": [ 6, 5, 3, 999, 999, 999, 0, 4, 2, 999, 999, 999, 0, 0, 1 ], + "x": [ 1.0, 2.0, 3.0 ], + "x_out": [ 1.0, 10.0, 31.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js index 624cb2d8d967..aa56b722e824 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js @@ -41,6 +41,12 @@ var rutnu = require( './fixtures/row_major_u_t_nu.json' ); var rutu = require( './fixtures/row_major_u_t_u.json' ); var rxt = require( './fixtures/row_major_xt.json' ); var rxn = require( './fixtures/row_major_xn.json' ); +var roa = require( './fixtures/row_major_oa.json' ); +var rsa1sa2 = require( './fixtures/row_major_sa1_sa2.json' ); +var rsa1nsa2 = require( './fixtures/row_major_sa1n_sa2.json' ); +var rsa1sa2n = require( './fixtures/row_major_sa1_sa2n.json' ); +var rsa1nsa2n = require( './fixtures/row_major_sa1n_sa2n.json' ); +var rcap = require( './fixtures/row_major_complex_access_pattern.json' ); var clntnu = require( './fixtures/column_major_l_nt_nu.json' ); var cltnu = require( './fixtures/column_major_l_t_nu.json' ); @@ -52,6 +58,12 @@ var cutnu = require( './fixtures/column_major_u_t_nu.json' ); var cutu = require( './fixtures/column_major_u_t_u.json' ); var cxt = require( './fixtures/column_major_xt.json' ); var cxn = require( './fixtures/column_major_xn.json' ); +var coa = require( './fixtures/column_major_oa.json' ); +var csa1sa2 = require( './fixtures/column_major_sa1_sa2.json' ); +var csa1nsa2 = require( './fixtures/column_major_sa1n_sa2.json' ); +var csa1sa2n = require( './fixtures/column_major_sa1_sa2n.json' ); +var csa1nsa2n = require( './fixtures/column_major_sa1_sa2n.json' ); +var ccap = require( './fixtures/column_major_complex_access_pattern.json' ); // FUNCTIONS // @@ -685,7 +697,217 @@ tape( 'if `N` is zero, the function returns the second input vector unchanged (c t.end(); }); -tape( 'the function supports complex access patterns (row-major)', function test( t ) { +tape( 'the function supports specifying stride of the first and the second dimension of `A` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1sa2; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports specifying stride of the first and the second dimension of `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1sa2; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports a negative `strideA1` parameter (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1nsa2; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports a negative `strideA1` parameter (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1nsa2; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports a negative `strideA2` parameter (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1sa2n; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports a negative `strideA2` parameter (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1sa2n; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports negative strides for `A` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rsa1nsa2n; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports negative strides for `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = csa1nsa2n; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports an `A` offset (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = roa; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports an `A` offset (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = coa; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports a negative `x` stride value (row-major)', function test( t ) { var expected; var data; var out; @@ -706,7 +928,7 @@ tape( 'the function supports complex access patterns (row-major)', function test t.end(); }); -tape( 'the function supports complex access patterns (column-major)', function test( t ) { +tape( 'the function supports a negative `x` stride (column-major)', function test( t ) { var expected; var data; var out; @@ -726,3 +948,45 @@ tape( 'the function supports complex access patterns (column-major)', function t t.end(); }); + +tape( 'the function supports complex access patterns (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = rcap; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); + +tape( 'the function supports complex access patterns (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = ccap; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + t.strictEqual( out, x, 'returns expected value' ); + isApprox( t, x, expected, 2.0 ); + + t.end(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/test.strmv.js b/lib/node_modules/@stdlib/blas/base/strmv/test/test.strmv.js index bde02f5a5ea4..999f0552f2c9 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/test.strmv.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/test.strmv.js @@ -98,8 +98,11 @@ tape( 'the function has an arity of 9', function test( t ) { tape( 'the function throws an error if provided an invalid first argument', function test( t ) { var values; + var data; var i; + data = rutu; + values = [ 'foo', 'bar', @@ -114,15 +117,18 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - strmv( value, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, new Float32Array( rutu.x ), rutu.strideX ); + strmv( value, data.uplo, data.trans, data.diag, data.N, new Float32Array( data.A ), data.LDA, new Float32Array( data.x ), data.strideX ); }; } }); tape( 'the function throws an error if provided an invalid second argument', function test( t ) { var values; + var data; var i; + data = rutu; + values = [ 'foo', 'bar', @@ -137,15 +143,18 @@ tape( 'the function throws an error if provided an invalid second argument', fun function badValue( value ) { return function badValue() { - strmv( rutu.order, value, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, new Float32Array( rutu.x ), rutu.strideX ); + strmv( data.order, value, data.trans, data.diag, data.N, new Float32Array( data.A ), data.LDA, new Float32Array( data.x ), data.strideX ); }; } }); tape( 'the function throws an error if provided an invalid third argument', function test( t ) { var values; + var data; var i; + data = rutu; + values = [ 'foo', 'bar', @@ -160,15 +169,18 @@ tape( 'the function throws an error if provided an invalid third argument', func function badValue( value ) { return function badValue() { - strmv( rutu.order, rutu.uplo, value, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, new Float32Array( rutu.x ), rutu.strideX ); + strmv( data.order, data.uplo, value, data.diag, data.N, new Float32Array( data.A ), data.LDA, new Float32Array( data.x ), data.strideX ); }; } }); tape( 'the function throws an error if provided an invalid fourth argument', function test( t ) { var values; + var data; var i; + data = rutu; + values = [ 'foo', 'bar', @@ -183,15 +195,18 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun function badValue( value ) { return function badValue() { - strmv( rutu.order, rutu.uplo, rutu.trans, value, rutu.N, new Float32Array( rutu.A ), rutu.LDA, new Float32Array( rutu.x ), rutu.strideX ); + strmv( data.order, data.uplo, data.trans, value, data.N, new Float32Array( data.A ), data.LDA, new Float32Array( data.x ), data.strideX ); }; } }); tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { var values; + var data; var i; + data = rutu; + values = [ -1, -2, @@ -205,15 +220,18 @@ tape( 'the function throws an error if provided an invalid fifth argument', func function badValue( value ) { return function badValue() { - strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, value, new Float32Array( rutu.A ), rutu.LDA, new Float32Array( rutu.x ), rutu.strideX ); + strmv( data.order, data.uplo, data.trans, data.diag, value, new Float32Array( data.A ), data.LDA, new Float32Array( data.x ), data.strideX ); }; } }); tape( 'the function throws an error if provided an invalid seventh argument', function test( t ) { var values; + var data; var i; + data = rutu; + values = [ 2, 1, @@ -230,15 +248,18 @@ tape( 'the function throws an error if provided an invalid seventh argument', fu function badValue( value ) { return function badValue() { - strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), value, new Float32Array( rutu.x ), rutu.strideX ); + strmv( data.order, data.uplo, data.trans, data.diag, data.N, new Float32Array( data.A ), value, new Float32Array( data.x ), data.strideX ); }; } }); tape( 'the function throws an error if provided an invalid ninth argument', function test( t ) { var values; + var data; var i; + data = rutu; + values = [ 0 ]; @@ -250,23 +271,26 @@ tape( 'the function throws an error if provided an invalid ninth argument', func function badValue( value ) { return function badValue() { - strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float32Array( rutu.A ), rutu.LDA, new Float32Array( rutu.x ), value ); + strmv( data.order, data.uplo, data.trans, data.diag, data.N, new Float32Array( data.A ), data.LDA, new Float32Array( data.x ), value ); }; } }); tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, none, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rlntnu.A ); - x = new Float32Array( rlntnu.x ); + data = rlntnu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( rlntnu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( rlntnu.order, rlntnu.uplo, rlntnu.trans, rlntnu.diag, rlntnu.N, a, rlntnu.LDA, x, rlntnu.strideX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -275,16 +299,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, none, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( clntnu.A ); - x = new Float32Array( clntnu.x ); + data = clntnu; - expected = new Float32Array( clntnu.x_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( clntnu.order, clntnu.uplo, clntnu.trans, clntnu.diag, clntnu.N, a, clntnu.LDA, x, clntnu.strideX ); + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -293,16 +320,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, transpose, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rltnu.A ); - x = new Float32Array( rltnu.x ); + data = rltnu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( rltnu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( rltnu.order, rltnu.uplo, rltnu.trans, rltnu.diag, rltnu.N, a, rltnu.LDA, x, rltnu.strideX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -311,16 +341,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, transpose, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cltnu.A ); - x = new Float32Array( cltnu.x ); + data = cltnu; - expected = new Float32Array( cltnu.x_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( cltnu.order, cltnu.uplo, cltnu.trans, cltnu.diag, cltnu.N, a, cltnu.LDA, x, cltnu.strideX ); + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -329,16 +362,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, none, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rlntu.A ); - x = new Float32Array( rlntu.x ); + data = rlntu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( rlntu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( rlntu.order, rlntu.uplo, rlntu.trans, rlntu.diag, rlntu.N, a, rlntu.LDA, x, rlntu.strideX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -347,16 +383,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, none, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( clntu.A ); - x = new Float32Array( clntu.x ); + data = clntu; - expected = new Float32Array( clntu.x_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( clntu.order, clntu.uplo, clntu.trans, clntu.diag, clntu.N, a, clntu.LDA, x, clntu.strideX ); + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -365,16 +404,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, transpose, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rltu.A ); - x = new Float32Array( rltu.x ); + data = rltu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( rltu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( rltu.order, rltu.uplo, rltu.trans, rltu.diag, rltu.N, a, rltu.LDA, x, rltu.strideX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -383,16 +425,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, transpose, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cltu.A ); - x = new Float32Array( cltu.x ); + data = cltu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( cltu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( cltu.order, cltu.uplo, cltu.trans, cltu.diag, cltu.N, a, cltu.LDA, x, cltu.strideX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -401,16 +446,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, none, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( runtnu.A ); - x = new Float32Array( runtnu.x ); + data = runtnu; - expected = new Float32Array( runtnu.x_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( runtnu.order, runtnu.uplo, runtnu.trans, runtnu.diag, runtnu.N, a, runtnu.LDA, x, runtnu.strideX ); + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -419,16 +467,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, none, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cuntnu.A ); - x = new Float32Array( cuntnu.x ); + data = cuntnu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( cuntnu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( cuntnu.order, cuntnu.uplo, cuntnu.trans, cuntnu.diag, cuntnu.N, a, cuntnu.LDA, x, cuntnu.strideX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -437,16 +488,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, none, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( runtu.A ); - x = new Float32Array( runtu.x ); + data = runtu; - expected = new Float32Array( runtu.x_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( runtu.order, runtu.uplo, runtu.trans, runtu.diag, runtu.N, a, runtu.LDA, x, runtu.strideX ); + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -455,16 +509,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, none, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cuntu.A ); - x = new Float32Array( cuntu.x ); + data = cuntu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( cuntu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( cuntu.order, cuntu.uplo, cuntu.trans, cuntu.diag, cuntu.N, a, cuntu.LDA, x, cuntu.strideX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -473,16 +530,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, transpose, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rutnu.A ); - x = new Float32Array( rutnu.x ); + data = rutnu; - expected = new Float32Array( rutnu.x_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( rutnu.order, rutnu.uplo, rutnu.trans, rutnu.diag, rutnu.N, a, rutnu.LDA, x, rutnu.strideX ); + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -491,16 +551,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, transpose, non-unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cutnu.A ); - x = new Float32Array( cutnu.x ); + data = cutnu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( cutnu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( cutnu.order, cutnu.uplo, cutnu.trans, cutnu.diag, cutnu.N, a, cutnu.LDA, x, cutnu.strideX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -509,16 +572,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, transpose, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rutu.A ); - x = new Float32Array( rutu.x ); + data = rutu; - expected = new Float32Array( rutu.x_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, a, rutu.LDA, x, rutu.strideX ); + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -527,16 +593,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, transpose, unit)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cutu.A ); - x = new Float32Array( cutu.x ); + data = cutu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( cutu.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( cutu.order, cutu.uplo, cutu.trans, cutu.diag, cutu.N, a, cutu.LDA, x, cutu.strideX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -545,16 +614,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, sx=2)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rxt.A ); - x = new Float32Array( rxt.x ); + data = rxt; - expected = new Float32Array( rxt.x_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( rxt.order, rxt.uplo, rxt.trans, rxt.diag, rxt.N, a, rxt.LDA, x, rxt.strideX ); + expected = new Float32Array( data.x_out ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -563,16 +635,19 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, sx=2)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cxt.A ); - x = new Float32Array( cxt.x ); + data = cxt; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( cxt.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( cxt.order, cxt.uplo, cxt.trans, cxt.diag, cxt.N, a, cxt.LDA, x, cxt.strideX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -580,14 +655,17 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x }); tape( 'the function returns a reference to the second input vector', function test( t ) { + var data; var out; var a; var x; - a = new Float32Array( rutu.A ); - x = new Float32Array( rutu.x ); + data = rutu; - out = strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, a, rutu.LDA, x, rutu.strideX ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); t.end(); @@ -595,16 +673,19 @@ tape( 'the function returns a reference to the second input vector', function te tape( 'if `N` is zero, the function returns the second input vector unchanged (row-major)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rutu.A ); - x = new Float32Array( rutu.x ); + data = rutu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( rutu.x ); + expected = new Float32Array( data.x ); - out = strmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, 0, a, rutu.LDA, x, rutu.strideX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, 0, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); t.deepEqual( x, expected, 'returns expected value' ); @@ -613,52 +694,61 @@ tape( 'if `N` is zero, the function returns the second input vector unchanged (r tape( 'if `N` is zero, the function returns the second input vector unchanged (column-major)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cutu.A ); - x = new Float32Array( cutu.x ); + data = cutu; - expected = new Float32Array( cutu.x ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - out = strmv( cutu.order, cutu.uplo, cutu.trans, cutu.diag, 0, a, cutu.LDA, x, cutu.strideX ); + expected = new Float32Array( data.x ); + + out = strmv( data.order, data.uplo, data.trans, data.diag, 0, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); t.deepEqual( x, expected, 'returns expected value' ); t.end(); }); -tape( 'the function supports complex access patterns (row-major)', function test( t ) { +tape( 'the function supports a negative `x` stride (row-major)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( rxn.A ); - x = new Float32Array( rxn.x ); + data = rxn; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( rxn.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( rxn.order, rxn.uplo, rxn.trans, rxn.diag, rxn.N, a, rxn.LDA, x, rxn.strideX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); t.end(); }); -tape( 'the function supports complex access patterns (column-major)', function test( t ) { +tape( 'the function supports a negative `x` stride (column-major)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float32Array( cxn.A ); - x = new Float32Array( cxn.x ); + data = cxn; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); - expected = new Float32Array( cxn.x_out ); + expected = new Float32Array( data.x_out ); - out = strmv( cxn.order, cxn.uplo, cxn.trans, cxn.diag, cxn.N, a, cxn.LDA, x, cxn.strideX ); + out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.LDA, x, data.strideX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); From f4cd3ff438c9b47fdce462b539db8dd33ffbdd44 Mon Sep 17 00:00:00 2001 From: aman-095 Date: Mon, 15 Jul 2024 17:27:43 +0530 Subject: [PATCH 12/25] docs: update description corresponding to change in trans type --- .../@stdlib/blas/base/strmv/README.md | 12 +- .../@stdlib/blas/base/strmv/docs/repl.txt | 4 +- .../blas/base/strmv/docs/types/index.d.ts | 8 +- .../blas/base/strmv/docs/types/test.ts | 350 +++++++++--------- .../@stdlib/blas/base/strmv/examples/index.js | 2 +- .../@stdlib/blas/base/strmv/lib/base.js | 2 +- .../@stdlib/blas/base/strmv/lib/index.js | 4 +- .../@stdlib/blas/base/strmv/lib/ndarray.js | 2 +- .../@stdlib/blas/base/strmv/lib/strmv.js | 2 +- .../column_major_complex_access_pattern.json | 2 +- .../test/fixtures/column_major_l_nt_nu.json | 2 +- .../test/fixtures/column_major_l_nt_u.json | 2 +- .../strmv/test/fixtures/column_major_oa.json | 2 +- .../test/fixtures/column_major_sa1_sa2.json | 2 +- .../test/fixtures/column_major_sa1_sa2n.json | 2 +- .../test/fixtures/column_major_sa1n_sa2.json | 2 +- .../test/fixtures/column_major_sa1n_sa2n.json | 2 +- .../test/fixtures/column_major_u_nt_nu.json | 2 +- .../test/fixtures/column_major_u_nt_u.json | 2 +- .../row_major_complex_access_pattern.json | 2 +- .../test/fixtures/row_major_l_nt_nu.json | 2 +- .../strmv/test/fixtures/row_major_l_nt_u.json | 2 +- .../strmv/test/fixtures/row_major_oa.json | 2 +- .../test/fixtures/row_major_sa1_sa2.json | 2 +- .../test/fixtures/row_major_sa1_sa2n.json | 2 +- .../test/fixtures/row_major_sa1n_sa2.json | 2 +- .../test/fixtures/row_major_sa1n_sa2n.json | 2 +- .../test/fixtures/row_major_u_nt_nu.json | 2 +- .../strmv/test/fixtures/row_major_u_nt_u.json | 2 +- 29 files changed, 213 insertions(+), 213 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/README.md b/lib/node_modules/@stdlib/blas/base/strmv/README.md index 31014d9464d6..8bbe4b7b5dd3 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/strmv/README.md @@ -40,7 +40,7 @@ var Float32Array = require( '@stdlib/array/float32' ); var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); // x => [ 14.0, 8.0, 3.0 ] ``` @@ -64,7 +64,7 @@ var Float32Array = require( '@stdlib/array/float32' ); var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, -1 ); +strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, -1 ); // x => [ 1.0, 4.0, 10.0 ] ``` @@ -82,7 +82,7 @@ var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // Create offset views... var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x1, 1 ); +strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); // x0 => [ 1.0, 6.0, 3.0, 1.0 ] ``` @@ -96,7 +96,7 @@ var Float32Array = require( '@stdlib/array/float32' ); var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); +strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); // x => [ 14.0, 8.0, 3.0 ] ``` @@ -115,7 +115,7 @@ var Float32Array = require( '@stdlib/array/float32' ); var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); +strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); // x => [ 1.0, 4.0, 10.0 ] ``` @@ -152,7 +152,7 @@ var N = 3; var A = discreteUniform( N*N, -10.0, 10.0, opts ); var x = discreteUniform( N, -10.0, 10.0, opts ); -strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); console.log( x ); ``` diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt index b24b8a0e6dd7..73238d632541 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt @@ -50,7 +50,7 @@ -------- > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, 1.0 ] ); > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 1.0 ] ); - > {{alias}}( 'row-major', 'upper', 'none', 'unit', 2, A, 2, x, 1 ) + > {{alias}}( 'row-major', 'upper', 'no-transpose', 'unit', 2, A, 2, x, 1 ) [ 3.0, 1.0 ] @@ -115,7 +115,7 @@ > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 1.0 ] ); > var ord = 'row-major'; > var uplo = 'upper'; - > {{alias}}.ndarray( ord, uplo, 'none', 'unit', 2, A, 2, 1, 0, x, 1, 0 ) + > {{alias}}.ndarray( ord, uplo, 'no-transpose', 'unit', 2, A, 2, 1, 0, x, 1, 0 ) [ 3.0, 1.0 ] See Also diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts index f865449f873f..a1c12876ee1c 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts @@ -46,7 +46,7 @@ interface Routine { * var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * - * strmv( row-major', 'upper', 'none', 'non-unit', 3, A, 3, x, 1 ); + * strmv( row-major', 'upper', 'no-transpose', 'non-unit', 3, A, 3, x, 1 ); * // x => [ 14.0, 8.0, 3.0 ] */ ( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number ): Float32Array; @@ -74,7 +74,7 @@ interface Routine { * var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * - * strmv.ndarray( row-major', 'upper', 'none', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); + * strmv.ndarray( row-major', 'upper', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ ndarray( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number, offsetX: number ): Float32Array; @@ -100,7 +100,7 @@ interface Routine { * var A = new Float32Array( [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ] ); * var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); * -* strmv( 'row-major', 'lower', 'none', 'non-unit', 3, A, 3, x, 1 ); +* strmv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, A, 3, x, 1 ); * // x => [ 1.0, 5.0, 15.0 ] * * @example @@ -109,7 +109,7 @@ interface Routine { * var A = new Float32Array( [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ] ); * var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); * -* strmv.ndarray( 'row-major', 'lower', 'none', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); +* strmv.ndarray( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 1.0, 5.0, 15.0 ] */ declare var strmv: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts index 1e7e29556af8..7de87d59a115 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts @@ -26,7 +26,7 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectType Float32Array + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectType Float32Array } // The compiler throws an error if the function is provided a first argument which is not a string... @@ -34,14 +34,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv( 10, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - strmv( true, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - strmv( false, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - strmv( null, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - strmv( undefined, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - strmv( [], 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - strmv( {}, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - strmv( ( x: number ): number => x, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 10, 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( true, 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( false, 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( null, 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( undefined, 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( [], 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( {}, 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( ( x: number ): number => x, 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not a string... @@ -49,14 +49,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv( 'row-major', 10, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', true, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', false, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', null, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', undefined, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', [], 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', {}, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', ( x: number ): number => x, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 10, 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', true, 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', false, 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', null, 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', undefined, 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', [], 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', {}, 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', ( x: number ): number => x, 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a third argument which is not a string... @@ -79,14 +79,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv( 'row-major', 'upper', 'none', 10, 10, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', true, 10, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', false, 10, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', null, 10, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', undefined, 10, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', [], 10, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', {}, 10, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', ( x: number ): number => x, 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 10, 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', true, 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', false, 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', null, 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', undefined, 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', [], 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', {}, 10, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', ( x: number ): number => x, 10, A, 10, x, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a fifth argument which is not a number... @@ -94,29 +94,29 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv( 'row-major', 'upper', 'none', 'unit', '10', A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', true, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', false, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', null, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', undefined, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', [], A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', {}, A, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', ( x: number ): number => x, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', '10', A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', true, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', false, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', null, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', undefined, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', [], A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', {}, A, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', ( x: number ): number => x, A, 10, x, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a sixth argument which is not a Float32Array... { const x = new Float32Array( 10 ); - strmv( 'row-major', 'upper', 'none', 'unit', 10, 10, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, '10', 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, true, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, false, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, null, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, undefined, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, [ '1' ], 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, {}, 10, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, ( x: number ): number => x, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, '10', 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, true, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, false, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, null, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, undefined, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, [ '1' ], 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, {}, 10, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, ( x: number ): number => x, 10, x, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a seventh argument which is not a number... @@ -124,29 +124,29 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, '10', x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, true, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, false, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, null, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, undefined, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, [], x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, {}, x, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, ( x: number ): number => x, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, '10', x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, true, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, false, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, null, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, undefined, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, [], x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, {}, x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, ( x: number ): number => x, x, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a eighth argument which is not a Float32Array... { const A = new Float32Array( 20 ); - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 10, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, '10', 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, true, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, false, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, null, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, undefined, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, [ '1' ], 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, {}, 1 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, ( x: number ): number => x, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 10, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, '10', 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, true, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, false, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, null, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, undefined, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, [ '1' ], 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, {}, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, ( x: number ): number => x, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a ninth argument which is not a number... @@ -154,14 +154,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, '10' ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, true ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, false ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, null ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, undefined ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, [] ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, {} ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, ( x: number ): number => x ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, '10' ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, true ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, false ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, null ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, undefined ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, [] ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, {} ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... @@ -172,13 +172,13 @@ import strmv = require( './index' ); strmv(); // $ExpectError strmv( 'row-major' ); // $ExpectError strmv( 'row-major', 'upper' ); // $ExpectError - strmv( 'row-major', 'upper', 'none' ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit' ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10 ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x ); // $ExpectError - strmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, 1 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose' ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit' ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10 ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x ); // $ExpectError + strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1, 1 ); // $ExpectError } // Attached to main export is an `ndarray` method which returns a Float32Array... @@ -186,7 +186,7 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectType Float32Array + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectType Float32Array } // The compiler throws an error if the function is provided a first argument which is not a string... @@ -194,14 +194,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 10, 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( true, 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( false, 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( null, 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( undefined, 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( [], 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( {}, 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( ( x: number ): number => x, 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 10, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( true, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( false, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( null, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( undefined, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( [], 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( {}, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( ( x: number ): number => x, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not a string... @@ -209,14 +209,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 10, 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', true, 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', false, 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', null, 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', undefined, 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', [], 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', {}, 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', ( x: number ): number => x, 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 10, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', true, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', false, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', null, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', undefined, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', [], 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', {}, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', ( x: number ): number => x, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a third argument which is not a string... @@ -239,14 +239,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', true, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', false, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', null, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', undefined, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', [], 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', {}, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', ( x: number ): number => x, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', true, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', false, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', null, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', undefined, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', [], 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', {}, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', ( x: number ): number => x, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a fifth argument which is not a number... @@ -254,29 +254,29 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', '10', A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', true, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', false, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', null, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', undefined, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', [], A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', {}, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', ( x: number ): number => x, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', '10', A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', true, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', false, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', null, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', undefined, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', [], A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', {}, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', ( x: number ): number => x, A, 10, 1, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a sixth argument which is not a Float32Array... { const x = new Float32Array( 10 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, 10, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, '10', 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, true, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, false, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, null, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, undefined, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, [ '1' ], 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, {}, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, ( x: number ): number => x, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, '10', 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, true, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, false, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, null, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, undefined, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, [ '1' ], 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, {}, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, ( x: number ): number => x, 10, 1, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a seventh argument which is not a number... @@ -284,14 +284,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, '10', 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, true, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, false, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, null, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, undefined, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, [], 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, {}, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, ( x: number ): number => x, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, '10', 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, true, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, false, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, null, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, undefined, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, [], 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, {}, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, ( x: number ): number => x, 1, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a eighth argument which is not a number... @@ -299,14 +299,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, '10', 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, true, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, false, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, null, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, undefined, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, [], 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, {}, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, ( x: number ): number => x, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, '10', 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, true, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, false, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, null, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, undefined, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, [], 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, {}, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, ( x: number ): number => x, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a ninth argument which is not a number... @@ -314,29 +314,29 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, '10', x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, true, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, false, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, null, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, undefined, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, [], x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, {}, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, ( x: number ): number => x, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, '10', x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, true, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, false, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, null, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, undefined, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, [], x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, {}, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, ( x: number ): number => x, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a tenth argument which is not a Float32Array... { const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, 10, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, '10', 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, true, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, false, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, null, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, undefined, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, [ '1' ], 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, {}, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, 10, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, '10', 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, true, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, false, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, null, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, undefined, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, [ '1' ], 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, {}, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a eleventh argument which is not a number... @@ -344,14 +344,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, '10', 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, true, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, false, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, null, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, undefined, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, [], 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, {}, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, ( x: number ): number => x, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, '10', 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, true, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, false, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, null, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, undefined, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, [], 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, {}, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, ( x: number ): number => x, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a twelfth argument which is not a number... @@ -359,14 +359,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, '10' ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, true ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, false ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, null ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, undefined ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, [] ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, {} ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, ( x: number ): number => x ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, '10' ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, true ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, false ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, null ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, undefined ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, [] ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, {} ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... @@ -377,14 +377,14 @@ import strmv = require( './index' ); strmv.ndarray(); // $ExpectError strmv.ndarray( 'row-major' ); // $ExpectError strmv.ndarray( 'row-major', 'upper' ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none' ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit' ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 1, 0, x, 1, 0, 10 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose' ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit' ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1 ); // $ExpectError + strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0, 10 ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/examples/index.js b/lib/node_modules/@stdlib/blas/base/strmv/examples/index.js index c801e500d78b..d474e37d80b4 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/examples/index.js @@ -30,5 +30,5 @@ var N = 3; var A = discreteUniform( N*N, -10.0, 10.0, opts ); var x = discreteUniform( N, -10.0, 10.0, opts ); -strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js index 6fc0330ce964..3bbdecdbe83f 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js @@ -48,7 +48,7 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' ); * var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * -* strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); +* strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js index 7964c63a0eb9..c2ad55ea4fd7 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js @@ -30,7 +30,7 @@ * var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * -* strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +* strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); * // x => [ 14.0, 8.0, 3.0 ] * * @example @@ -40,7 +40,7 @@ * var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * -* strmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); +* strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js index fb88f1425551..8e27cbcdcddf 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js @@ -59,7 +59,7 @@ var base = require( './base.js' ); * var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * -* strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); +* strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js index efd631c2394d..5d20992de99c 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js @@ -59,7 +59,7 @@ var base = require( './base.js' ); * var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * -* strmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +* strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); * // x => [ 14.0, 8.0, 3.0 ] */ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_complex_access_pattern.json index bd56208c3258..27a2e9cc91e8 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_complex_access_pattern.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_complex_access_pattern.json @@ -1,6 +1,6 @@ { "order": "column-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideA1": -2, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_nu.json index e4cb9599af6c..1f85b5550d91 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_nu.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_nu.json @@ -1,6 +1,6 @@ { "order": "column-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideX": 1, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_u.json index b4974e92614d..026735b9badc 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_u.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_l_nt_u.json @@ -1,6 +1,6 @@ { "order": "column-major", - "trans": "none", + "trans": "no-transpose", "diag": "unit", "uplo": "lower", "strideX": 1, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_oa.json index 4b8d19c8d89f..8513fc653ed3 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_oa.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_oa.json @@ -1,6 +1,6 @@ { "order": "column-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideA1": 2, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2.json index 00e256135f52..f83b9134b59b 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2.json @@ -1,6 +1,6 @@ { "order": "column-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideA1": 2, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2n.json index 3312c9907fe0..b911bab43e9f 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2n.json @@ -1,6 +1,6 @@ { "order": "column-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideA1": 2, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2.json index ab7834a398ed..09ebe2c83fd6 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2.json @@ -1,6 +1,6 @@ { "order": "column-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideA1": -2, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2n.json index 528cfa82ee8c..c41ec6f24164 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2n.json @@ -1,6 +1,6 @@ { "order": "column-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideA1": -2, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json index dee8f9abec27..cbbc1b3e3d8b 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json @@ -1,6 +1,6 @@ { "order": "column-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "upper", "strideX": 1, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_u.json index a2902d4e523c..28367ca0cc0e 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_u.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_u.json @@ -1,6 +1,6 @@ { "order": "column-major", - "trans": "none", + "trans": "no-transpose", "diag": "unit", "uplo": "upper", "strideX": 1, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_complex_access_pattern.json index 1462d25d42ac..54d4b4ec9805 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_complex_access_pattern.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_complex_access_pattern.json @@ -1,6 +1,6 @@ { "order": "row-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideA1": -6, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_nu.json index ffc825265eeb..07cb4c70bfb5 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_nu.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_nu.json @@ -1,6 +1,6 @@ { "order": "row-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideX": 1, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_u.json index 12099c6147ff..94e7a6c28a02 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_u.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_l_nt_u.json @@ -1,6 +1,6 @@ { "order": "row-major", - "trans": "none", + "trans": "no-transpose", "diag": "unit", "uplo": "lower", "strideX": 1, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_oa.json index 9ee4d5f8e5c0..f334c8f70992 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_oa.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_oa.json @@ -1,6 +1,6 @@ { "order": "row-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideA1": 10, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2.json index b6dc460bb661..1d64b7029d7e 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2.json @@ -1,6 +1,6 @@ { "order": "row-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideA1": 6, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2n.json index c485972e2a4b..ac74875f17ea 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2n.json @@ -1,6 +1,6 @@ { "order": "row-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideA1": 6, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2.json index 7487cf253384..93f0200157b6 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2.json @@ -1,6 +1,6 @@ { "order": "row-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideA1": -6, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2n.json index b96ee54d43fc..9f320ee1adad 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2n.json @@ -1,6 +1,6 @@ { "order": "row-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideA1": -6, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_nu.json index 56cb500e6a54..9d0ffaf69264 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_nu.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_nu.json @@ -1,6 +1,6 @@ { "order": "row-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "upper", "strideX": 1, diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_u.json index 8bf0c9a7af0e..0bef3befccd2 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_u.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_u_nt_u.json @@ -1,6 +1,6 @@ { "order": "row-major", - "trans": "none", + "trans": "no-transpose", "diag": "unit", "uplo": "upper", "strideX": 1, From 5213b7e250a4b437a37b0c320dc1c613911592a4 Mon Sep 17 00:00:00 2001 From: aman-095 Date: Mon, 15 Jul 2024 17:45:14 +0530 Subject: [PATCH 13/25] docs: update descriptions for trans variable --- .../@stdlib/blas/base/strmv/lib/base.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js index 3bbdecdbe83f..ebcb20862139 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js @@ -83,8 +83,8 @@ function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, ox = offsetX; if ( - ( isColMajor && trans === 'none' && uplo === 'upper' ) || - ( isRowMajor && trans !== 'none' && uplo === 'lower' ) + ( isColMajor && trans === 'no-transpose' && uplo === 'upper' ) || + ( isRowMajor && trans !== 'no-transpose' && uplo === 'lower' ) ) { ix1 = ox; for ( i1 = 0; i1 < N; i1++ ) { @@ -105,8 +105,8 @@ function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, return x; } if ( - ( isColMajor && trans === 'none' && uplo === 'lower' ) || - ( isRowMajor && trans !== 'none' && uplo === 'upper' ) + ( isColMajor && trans === 'no-transpose' && uplo === 'lower' ) || + ( isRowMajor && trans !== 'no-transpose' && uplo === 'upper' ) ) { ox += ( N - 1 ) * strideX; ix1 = ox; @@ -128,8 +128,8 @@ function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, return x; } if ( - ( isColMajor && trans !== 'none' && uplo === 'upper' ) || - ( isRowMajor && trans === 'none' && uplo === 'lower' ) + ( isColMajor && trans !== 'no-transpose' && uplo === 'upper' ) || + ( isRowMajor && trans === 'no-transpose' && uplo === 'lower' ) ) { ix1 = ox + ( ( N - 1 ) * strideX ); for ( i1 = N-1; i1 >= 0; i1-- ) { @@ -149,8 +149,8 @@ function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, return x; } if ( - ( isColMajor && trans !== 'none' && uplo === 'lower' ) || - ( isRowMajor && trans === 'none' && uplo === 'upper' ) + ( isColMajor && trans !== 'no-transpose' && uplo === 'lower' ) || + ( isRowMajor && trans === 'no-transpose' && uplo === 'upper' ) ) { ix1 = ox; for ( i1 = 0; i1 < N; i1++ ) { From 6b41886a6b827e363459ec7e0beaf9cbe5323f61 Mon Sep 17 00:00:00 2001 From: aman-095 Date: Mon, 15 Jul 2024 17:52:01 +0530 Subject: [PATCH 14/25] docs: resolve lint error --- lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt index 73238d632541..303b0d8a1fa0 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt @@ -115,7 +115,8 @@ > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 1.0 ] ); > var ord = 'row-major'; > var uplo = 'upper'; - > {{alias}}.ndarray( ord, uplo, 'no-transpose', 'unit', 2, A, 2, 1, 0, x, 1, 0 ) + > var trans = 'no-transpose'; + > {{alias}}.ndarray( ord, uplo, trans, 'unit', 2, A, 2, 1, 0, x, 1, 0 ) [ 3.0, 1.0 ] See Also From b0f52d15baa04aae6cee97a54c3c34660fcd552d Mon Sep 17 00:00:00 2001 From: aman-095 Date: Fri, 26 Jul 2024 10:47:15 +0530 Subject: [PATCH 15/25] chore: apply review changes --- lib/node_modules/@stdlib/blas/base/strmv/lib/base.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js index ebcb20862139..dc0d47dea0de 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js @@ -93,7 +93,7 @@ function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, oa = offsetA + (sa1*i1); ix0 = ox; for ( i0 = 0; i0 < i1; i0++ ) { - x[ ix0 ] += f32( tmp * A[ oa+(sa0*i0) ] ); + x[ ix0 ] = f32( x[ ix0 ] + f32( tmp * A[ oa+(sa0*i0) ] ) ); ix0 += strideX; } if ( nonunit ) { @@ -116,7 +116,7 @@ function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, oa = offsetA + (sa1*i1); ix0 = ox; for ( i0 = N-1; i0 > i1; i0-- ) { - x[ ix0 ] += f32( tmp * A[ oa+(sa0*i0) ] ); + x[ ix0 ] = f32( x[ ix0 ] + f32( tmp * A[ oa+(sa0*i0) ] ) ); ix0 -= strideX; } if ( nonunit ) { From e10c507ce300d3e128100eb6e74e1859ef68b3b4 Mon Sep 17 00:00:00 2001 From: aman-095 Date: Tue, 30 Jul 2024 11:37:59 +0530 Subject: [PATCH 16/25] refactor: update parameter for ndarray, and base implementations --- .../@stdlib/blas/base/strmv/README.md | 6 +- .../base/strmv/benchmark/benchmark.ndarray.js | 2 +- .../@stdlib/blas/base/strmv/docs/repl.txt | 9 +- .../blas/base/strmv/docs/types/index.d.ts | 7 +- .../blas/base/strmv/docs/types/test.ts | 234 ++++++++---------- .../@stdlib/blas/base/strmv/lib/base.js | 29 +-- .../@stdlib/blas/base/strmv/lib/index.js | 2 +- .../@stdlib/blas/base/strmv/lib/ndarray.js | 34 ++- .../@stdlib/blas/base/strmv/lib/strmv.js | 6 +- .../column_major_complex_access_pattern.json | 1 - .../strmv/test/fixtures/column_major_oa.json | 1 - .../test/fixtures/column_major_sa1_sa2.json | 1 - .../test/fixtures/column_major_sa1_sa2n.json | 1 - .../test/fixtures/column_major_sa1n_sa2.json | 1 - .../test/fixtures/column_major_sa1n_sa2n.json | 1 - .../test/fixtures/column_major_u_nt_nu.json | 1 - .../row_major_complex_access_pattern.json | 1 - .../strmv/test/fixtures/row_major_oa.json | 1 - .../test/fixtures/row_major_sa1_sa2.json | 1 - .../test/fixtures/row_major_sa1_sa2n.json | 1 - .../test/fixtures/row_major_sa1n_sa2.json | 1 - .../test/fixtures/row_major_sa1n_sa2n.json | 1 - .../blas/base/strmv/test/test.ndarray.js | 112 ++++----- 23 files changed, 192 insertions(+), 262 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/README.md b/lib/node_modules/@stdlib/blas/base/strmv/README.md index 8bbe4b7b5dd3..a5bcbb0a7cb1 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/strmv/README.md @@ -86,7 +86,7 @@ strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); // x0 => [ 1.0, 6.0, 3.0, 1.0 ] ``` -#### strmv.ndarray( order, uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox ) +#### strmv.ndarray( uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox ) Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. @@ -96,7 +96,7 @@ var Float32Array = require( '@stdlib/array/float32' ); var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); +strmv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); // x => [ 14.0, 8.0, 3.0 ] ``` @@ -115,7 +115,7 @@ var Float32Array = require( '@stdlib/array/float32' ); var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); +strmv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); // x => [ 1.0, 4.0, 10.0 ] ``` diff --git a/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js index b87df38d6611..8209b15da447 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/benchmark/benchmark.ndarray.js @@ -62,7 +62,7 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - z = strmv( 'row-major', 'upper', 'transpose', 'non-unit', N, A, N, 1, 0, x, 1, 0 ); + z = strmv( 'upper', 'transpose', 'non-unit', N, A, N, 1, 0, x, 1, 0 ); if ( isnanf( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt index 303b0d8a1fa0..e89f100d9581 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt @@ -54,7 +54,7 @@ [ 3.0, 1.0 ] -{{alias}}.ndarray( ord, uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox ) +{{alias}}.ndarray( uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox ) Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular @@ -66,10 +66,6 @@ Parameters ---------- - ord: string - Row-major (C-style) or column-major (Fortran-style) order. Must be - either 'row-major' or 'column-major'. - uplo: string Specifies whether `A` is an upper or lower triangular matrix. @@ -113,10 +109,9 @@ -------- > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, 1.0 ] ); > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 1.0 ] ); - > var ord = 'row-major'; > var uplo = 'upper'; > var trans = 'no-transpose'; - > {{alias}}.ndarray( ord, uplo, trans, 'unit', 2, A, 2, 1, 0, x, 1, 0 ) + > {{alias}}.ndarray( uplo, trans, 'unit', 2, A, 2, 1, 0, x, 1, 0 ) [ 3.0, 1.0 ] See Also diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts index a1c12876ee1c..2e3fc309568e 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts @@ -54,7 +54,6 @@ interface Routine { /** * Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * - * @param order - storage layout * @param uplo - specifies whether `A` is an upper or lower triangular matrix * @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed * @param diag - specifies whether `A` has a unit diagonal @@ -74,10 +73,10 @@ interface Routine { * var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * - * strmv.ndarray( row-major', 'upper', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); + * strmv.ndarray( 'upper', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ - ndarray( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number, offsetX: number ): Float32Array; + ndarray( uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number, offsetX: number ): Float32Array; } /** @@ -109,7 +108,7 @@ interface Routine { * var A = new Float32Array( [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ] ); * var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); * -* strmv.ndarray( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); +* strmv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 1.0, 5.0, 15.0 ] */ declare var strmv: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts index 7de87d59a115..3b3d0a1af336 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts @@ -186,7 +186,7 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectType Float32Array + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectType Float32Array } // The compiler throws an error if the function is provided a first argument which is not a string... @@ -194,14 +194,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 10, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( true, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( false, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( null, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( undefined, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( [], 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( {}, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( ( x: number ): number => x, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 10, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( true, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( false, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( null, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( undefined, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( [], 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( {}, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( ( x: number ): number => x, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not a string... @@ -209,14 +209,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 10, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', true, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', false, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', null, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', undefined, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', [], 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', {}, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', ( x: number ): number => x, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 10, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', true, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', false, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', null, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', undefined, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', [], 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', {}, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', ( x: number ): number => x, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a third argument which is not a string... @@ -224,59 +224,59 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 10, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', true, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', false, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', null, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', undefined, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', [], 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', {}, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', ( x: number ): number => x, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', true, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', false, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', null, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', undefined, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', [], 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', {}, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', ( x: number ): number => x, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a fourth argument which is not a string... +// The compiler throws an error if the function is provided a fourth argument which is not a number... { const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', true, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', false, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', null, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', undefined, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', [], 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', {}, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', ( x: number ): number => x, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', '10', A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', true, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', false, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', null, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', undefined, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', [], A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', {}, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', ( x: number ): number => x, A, 10, 1, 0, x, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a fifth argument which is not a number... +// The compiler throws an error if the function is provided a fifth argument which is not a Float32Array... { const x = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', '10', A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', true, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', false, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', null, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', undefined, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', [], A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', {}, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', ( x: number ): number => x, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, '10', 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, true, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, false, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, null, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, undefined, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, [ '1' ], 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, {}, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, ( x: number ): number => x, 10, 1, 0, x, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a sixth argument which is not a Float32Array... +// The compiler throws an error if the function is provided a sixth argument which is not a number... { const x = new Float32Array( 10 ); + const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, '10', 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, true, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, false, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, null, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, undefined, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, [ '1' ], 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, {}, 10, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, ( x: number ): number => x, 10, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, '10', 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, true, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, false, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, null, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, undefined, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, [], 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, {}, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, ( x: number ): number => x, 1, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a seventh argument which is not a number... @@ -284,14 +284,14 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, '10', 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, true, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, false, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, null, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, undefined, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, [], 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, {}, 1, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, ( x: number ): number => x, 1, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, '10', 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, true, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, false, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, null, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, undefined, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, [], 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, {}, 0, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, ( x: number ): number => x, 0, x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a eighth argument which is not a number... @@ -299,74 +299,59 @@ import strmv = require( './index' ); const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, '10', 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, true, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, false, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, null, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, undefined, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, [], 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, {}, 0, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, ( x: number ): number => x, 0, x, 1, 0 ); // $ExpectError -} - -// The compiler throws an error if the function is provided a ninth argument which is not a number... -{ - const x = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, '10', x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, true, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, false, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, null, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, undefined, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, [], x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, {}, x, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, ( x: number ): number => x, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, '10', x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, true, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, false, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, null, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, undefined, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, [], x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, {}, x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, ( x: number ): number => x, x, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a tenth argument which is not a Float32Array... +// The compiler throws an error if the function is provided a ninth argument which is not a Float32Array... { const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, 10, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, '10', 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, true, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, false, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, null, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, undefined, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, [ '1' ], 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, {}, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, 10, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, '10', 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, true, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, false, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, null, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, undefined, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, [ '1' ], 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, {}, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a eleventh argument which is not a number... +// The compiler throws an error if the function is provided a tenth argument which is not a number... { const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, '10', 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, true, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, false, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, null, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, undefined, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, [], 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, {}, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, ( x: number ): number => x, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, '10', 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, true, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, false, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, null, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, undefined, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, [], 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, {}, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, ( x: number ): number => x, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a twelfth argument which is not a number... +// The compiler throws an error if the function is provided a eleventh argument which is not a number... { const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, '10' ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, true ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, false ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, null ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, undefined ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, [] ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, {} ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, ( x: number ): number => x ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, '10' ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, true ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, false ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, null ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, undefined ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, [] ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, {} ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... @@ -375,16 +360,15 @@ import strmv = require( './index' ); const A = new Float32Array( 20 ); strmv.ndarray(); // $ExpectError - strmv.ndarray( 'row-major' ); // $ExpectError - strmv.ndarray( 'row-major', 'upper' ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose' ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit' ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1 ); // $ExpectError - strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0, 10 ); // $ExpectError + strmv.ndarray( 'upper' ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose' ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit' ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1 ); // $ExpectError + strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0, 10 ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js index dc0d47dea0de..24e5d0e8d2bd 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js @@ -20,6 +20,8 @@ // MODULES // +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var isColMajor = require( '@stdlib/ndarray/base/assert/is-column-major' ); var f32 = require( '@stdlib/number/float64/base/to-float32' ); @@ -28,7 +30,6 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' ); /** * Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * -* @param {string} order - storage layout * @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix * @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed * @param {string} diag - specifies whether `A` has a unit diagonal @@ -48,12 +49,10 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' ); * var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * -* strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); +* strmv( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ -function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len - var isRowMajor; - var isColMajor; +function strmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len var nonunit; var tmp; var sa0; @@ -67,11 +66,9 @@ function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, // Note on variable naming convention: sa#, ix#, i# where # corresponds to the loop number, with `0` being the innermost loop... - isRowMajor = ( order === 'row-major' ); - isColMajor = ( order === 'column-major' ); nonunit = ( diag === 'non-unit' ); - if ( isRowMajor ) { + if ( isRowMajor( [ strideA1, strideA2 ] ) ) { // For row-major matrices, the last dimension has the fastest changing index... sa0 = strideA2; // stride for innermost loop sa1 = strideA1; // stride for outermost loop @@ -83,8 +80,8 @@ function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, ox = offsetX; if ( - ( isColMajor && trans === 'no-transpose' && uplo === 'upper' ) || - ( isRowMajor && trans !== 'no-transpose' && uplo === 'lower' ) + ( isColMajor( [ strideA1, strideA2 ] ) && trans === 'no-transpose' && uplo === 'upper' ) || + ( isRowMajor( [ strideA1, strideA2 ] ) && trans !== 'no-transpose' && uplo === 'lower' ) ) { ix1 = ox; for ( i1 = 0; i1 < N; i1++ ) { @@ -105,8 +102,8 @@ function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, return x; } if ( - ( isColMajor && trans === 'no-transpose' && uplo === 'lower' ) || - ( isRowMajor && trans !== 'no-transpose' && uplo === 'upper' ) + ( isColMajor( [ strideA1, strideA2 ] ) && trans === 'no-transpose' && uplo === 'lower' ) || + ( isRowMajor( [ strideA1, strideA2 ] ) && trans !== 'no-transpose' && uplo === 'upper' ) ) { ox += ( N - 1 ) * strideX; ix1 = ox; @@ -128,8 +125,8 @@ function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, return x; } if ( - ( isColMajor && trans !== 'no-transpose' && uplo === 'upper' ) || - ( isRowMajor && trans === 'no-transpose' && uplo === 'lower' ) + ( isColMajor( [ strideA1, strideA2 ] ) && trans !== 'no-transpose' && uplo === 'upper' ) || + ( isRowMajor( [ strideA1, strideA2 ] ) && trans === 'no-transpose' && uplo === 'lower' ) ) { ix1 = ox + ( ( N - 1 ) * strideX ); for ( i1 = N-1; i1 >= 0; i1-- ) { @@ -149,8 +146,8 @@ function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, return x; } if ( - ( isColMajor && trans !== 'no-transpose' && uplo === 'lower' ) || - ( isRowMajor && trans === 'no-transpose' && uplo === 'upper' ) + ( isColMajor( [ strideA1, strideA2 ] ) && trans !== 'no-transpose' && uplo === 'lower' ) || + ( isRowMajor( [ strideA1, strideA2 ] ) && trans === 'no-transpose' && uplo === 'upper' ) ) { ix1 = ox; for ( i1 = 0; i1 < N; i1++ ) { diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js index c2ad55ea4fd7..f894d69581e9 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js @@ -40,7 +40,7 @@ * var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * -* strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); +* strmv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js index 8e27cbcdcddf..00894a800809 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js @@ -20,9 +20,8 @@ // MODULES // -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); -var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation'); +var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation' ); var isDiagonal = require( '@stdlib/blas/base/assert/is-diagonal-type' ); var format = require( '@stdlib/string/format' ); var base = require( './base.js' ); @@ -33,7 +32,6 @@ var base = require( './base.js' ); /** * Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * -* @param {string} order - storage layout * @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix * @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed * @param {string} diag - specifies whether `A` has a unit diagonal @@ -45,12 +43,11 @@ var base = require( './base.js' ); * @param {Float32Array} x - input vector * @param {integer} strideX - `x` stride length * @param {NonNegativeInteger} offsetX - starting index for `x` -* @throws {TypeError} first argument must be a valid order -* @throws {TypeError} second argument must specify whether the lower or upper triangular matrix is supplied -* @throws {TypeError} third argument must be a valid transpose operation -* @throws {TypeError} fourth argument must be a valid diagonal type -* @throws {RangeError} fifth argument must be a nonnegative integer -* @throws {RangeError} eleventh argument must be non-zero +* @throws {TypeError} first argument must specify whether the lower or upper triangular matrix is supplied +* @throws {TypeError} second argument must be a valid transpose operation +* @throws {TypeError} third argument must be a valid diagonal type +* @throws {RangeError} fourth argument must be a nonnegative integer +* @throws {RangeError} tenth argument must be non-zero * @returns {Float32Array} `x` * * @example @@ -59,32 +56,29 @@ var base = require( './base.js' ); * var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // => [ [ 1.0, 2.0, 3.0 ], [ 0.0, 1.0, 2.0 ], [ 0.0, 0.0, 1.0 ] ] * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * -* strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); +* strmv( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ -function strmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len - if ( !isLayout( order ) ) { - throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); - } +function strmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len if ( !isMatrixTriangle( uplo ) ) { - throw new TypeError( format( 'invalid argument. Second argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); + throw new TypeError( format( 'invalid argument. First argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) ); } if ( !isTransposeOperation( trans ) ) { - throw new TypeError( format( 'invalid argument. Third argument must be a valid transpose operation. Value: `%s`.', trans ) ); + throw new TypeError( format( 'invalid argument. Second argument must be a valid transpose operation. Value: `%s`.', trans ) ); } if ( !isDiagonal( diag ) ) { - throw new TypeError( format( 'invalid argument. Fourth argument must be a valid diagonal type. Value: `%s`.', diag ) ); + throw new TypeError( format( 'invalid argument. Third argument must be a valid diagonal type. Value: `%s`.', diag ) ); } if ( N < 0 ) { - throw new RangeError( format( 'invalid argument. Fifth argument must be a nonnegative integer. Value: `%d`.', N ) ); + throw new RangeError( format( 'invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.', N ) ); } if ( strideX === 0 ) { - throw new RangeError( format( 'invalid argument. Eleventh argument must be non-zero. Value: `%d`.', strideX ) ); + throw new RangeError( format( 'invalid argument. Tenth argument must be non-zero. Value: `%d`.', strideX ) ); } if ( N === 0 ) { return x; } - return base( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ); // eslint-disable-line max-len + return base( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js index 5d20992de99c..4079f3a27ec8 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js @@ -23,9 +23,9 @@ var max = require( '@stdlib/math/base/special/max' ); var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); -var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation'); +var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation' ); var isDiagonal = require( '@stdlib/blas/base/assert/is-diagonal-type' ); -var stride2offset = require( '@stdlib/strided/base/stride2offset'); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); var format = require( '@stdlib/string/format' ); var base = require( './base.js' ); @@ -99,7 +99,7 @@ function strmv( order, uplo, trans, diag, N, A, LDA, x, strideX ) { sa2 = 1; } ox = stride2offset( N, strideX ); - return base( order, uplo, trans, diag, N, A, sa1, sa2, 0, x, strideX, ox ); + return base( uplo, trans, diag, N, A, sa1, sa2, 0, x, strideX, ox ); } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_complex_access_pattern.json index 27a2e9cc91e8..fbfeb4e86d8f 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_complex_access_pattern.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_complex_access_pattern.json @@ -1,5 +1,4 @@ { - "order": "column-major", "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_oa.json index 8513fc653ed3..d2c2ab29e078 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_oa.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_oa.json @@ -1,5 +1,4 @@ { - "order": "column-major", "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2.json index f83b9134b59b..3653ba1b270a 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2.json @@ -1,5 +1,4 @@ { - "order": "column-major", "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2n.json index b911bab43e9f..69a3f6b4166a 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1_sa2n.json @@ -1,5 +1,4 @@ { - "order": "column-major", "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2.json index 09ebe2c83fd6..5262cb1d4dab 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2.json @@ -1,5 +1,4 @@ { - "order": "column-major", "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2n.json index c41ec6f24164..9e26fe112a9c 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_sa1n_sa2n.json @@ -1,5 +1,4 @@ { - "order": "column-major", "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json index cbbc1b3e3d8b..2df3a9a12246 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json @@ -1,5 +1,4 @@ { - "order": "column-major", "trans": "no-transpose", "diag": "non-unit", "uplo": "upper", diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_complex_access_pattern.json index 54d4b4ec9805..c2aed04ac974 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_complex_access_pattern.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_complex_access_pattern.json @@ -1,5 +1,4 @@ { - "order": "row-major", "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_oa.json index f334c8f70992..fdbc41a79943 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_oa.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_oa.json @@ -1,5 +1,4 @@ { - "order": "row-major", "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2.json index 1d64b7029d7e..bd2a70b57393 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2.json @@ -1,5 +1,4 @@ { - "order": "row-major", "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2n.json index ac74875f17ea..87d036861387 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1_sa2n.json @@ -1,5 +1,4 @@ { - "order": "row-major", "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2.json index 93f0200157b6..954c9c09556a 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2.json @@ -1,5 +1,4 @@ { - "order": "row-major", "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2n.json index 9f320ee1adad..44d83b8a3bf7 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/row_major_sa1n_sa2n.json @@ -1,5 +1,4 @@ { - "order": "row-major", "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js index aa56b722e824..e55eb88bb9aa 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js @@ -103,8 +103,8 @@ tape( 'main export is a function', function test( t ) { t.end(); }); -tape( 'the function has an arity of 12', function test( t ) { - t.strictEqual( strmv.length, 12, 'returns expected value' ); +tape( 'the function has an arity of 11', function test( t ) { + t.strictEqual( strmv.length, 11, 'returns expected value' ); t.end(); }); @@ -129,7 +129,7 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - strmv( value, data.uplo, data.trans, data.diag, data.N, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); + strmv( value, data.trans, data.diag, data.N, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); }; } }); @@ -155,7 +155,7 @@ tape( 'the function throws an error if provided an invalid second argument', fun function badValue( value ) { return function badValue() { - strmv( data.order, value, data.trans, data.diag, data.N, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); + strmv( data.uplo, value, data.diag, data.N, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); }; } }); @@ -181,7 +181,7 @@ tape( 'the function throws an error if provided an invalid third argument', func function badValue( value ) { return function badValue() { - strmv( data.order, data.uplo, value, data.diag, data.N, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); + strmv( data.uplo, data.trans, value, data.N, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); }; } }); @@ -193,32 +193,6 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun data = rutu; - values = [ - 'foo', - 'bar', - 'beep', - 'boop' - ]; - - 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() { - strmv( data.order, data.uplo, data.trans, value, data.N, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); - }; - } -}); - -tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { - var values; - var data; - var i; - - data = rutu; - values = [ -1, -2, @@ -232,12 +206,12 @@ tape( 'the function throws an error if provided an invalid fifth argument', func function badValue( value ) { return function badValue() { - strmv( data.order, data.uplo, data.trans, data.diag, value, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); + strmv( data.uplo, data.trans, data.diag, value, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); }; } }); -tape( 'the function throws an error if provided an invalid eleventh argument', function test( t ) { +tape( 'the function throws an error if provided an invalid tenth argument', function test( t ) { var values; var data; var i; @@ -255,7 +229,7 @@ tape( 'the function throws an error if provided an invalid eleventh argument', f function badValue( value ) { return function badValue() { - strmv( data.order, data.uplo, data.trans, data.diag, data.N, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), value, data.offsetX ); + strmv( data.uplo, data.trans, data.diag, data.N, new Float32Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), value, data.offsetX ); }; } }); @@ -274,7 +248,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -295,7 +269,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -316,7 +290,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -337,7 +311,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -358,7 +332,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -379,7 +353,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -400,7 +374,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -421,7 +395,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -442,7 +416,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -463,7 +437,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -484,7 +458,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -505,7 +479,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -526,7 +500,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -547,7 +521,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -568,7 +542,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -589,7 +563,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -610,7 +584,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -631,7 +605,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -649,7 +623,7 @@ tape( 'the function returns a reference to the second input vector', function te a = new Float32Array( data.A ); x = new Float32Array( data.x ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); t.end(); @@ -669,7 +643,7 @@ tape( 'if `N` is zero, the function returns the second input vector unchanged (r expected = new Float32Array( data.x ); - out = strmv( data.order, data.uplo, data.trans, data.diag, 0, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, 0, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); t.deepEqual( x, expected, 'returns expected value' ); @@ -690,7 +664,7 @@ tape( 'if `N` is zero, the function returns the second input vector unchanged (c expected = new Float32Array( data.x ); - out = strmv( data.order, data.uplo, data.trans, data.diag, 0, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, 0, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); t.deepEqual( x, expected, 'returns expected value' ); @@ -711,7 +685,7 @@ tape( 'the function supports specifying stride of the first and the second dimen expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -732,7 +706,7 @@ tape( 'the function supports specifying stride of the first and the second dimen expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -753,7 +727,7 @@ tape( 'the function supports a negative `strideA1` parameter (row-major)', funct expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -774,7 +748,7 @@ tape( 'the function supports a negative `strideA1` parameter (column-major)', fu expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -795,7 +769,7 @@ tape( 'the function supports a negative `strideA2` parameter (row-major)', funct expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -816,7 +790,7 @@ tape( 'the function supports a negative `strideA2` parameter (column-major)', fu expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -837,7 +811,7 @@ tape( 'the function supports negative strides for `A` (row-major)', function tes expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -858,7 +832,7 @@ tape( 'the function supports negative strides for `A` (column-major)', function expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -879,7 +853,7 @@ tape( 'the function supports an `A` offset (row-major)', function test( t ) { expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -900,7 +874,7 @@ tape( 'the function supports an `A` offset (column-major)', function test( t ) { expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -921,7 +895,7 @@ tape( 'the function supports a negative `x` stride value (row-major)', function expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -942,7 +916,7 @@ tape( 'the function supports a negative `x` stride (column-major)', function tes expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -963,7 +937,7 @@ tape( 'the function supports complex access patterns (row-major)', function test expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); @@ -984,7 +958,7 @@ tape( 'the function supports complex access patterns (column-major)', function t expected = new Float32Array( data.x_out ); - out = strmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = strmv( data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); t.strictEqual( out, x, 'returns expected value' ); isApprox( t, x, expected, 2.0 ); From 83c9070fb1e456f3d7b042226eb3d733b258f56c Mon Sep 17 00:00:00 2001 From: aman-095 Date: Tue, 30 Jul 2024 11:56:26 +0530 Subject: [PATCH 17/25] test: update test --- .../blas/base/strmv/test/fixtures/column_major_u_nt_nu.json | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json index 2df3a9a12246..cbbc1b3e3d8b 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/fixtures/column_major_u_nt_nu.json @@ -1,4 +1,5 @@ { + "order": "column-major", "trans": "no-transpose", "diag": "non-unit", "uplo": "upper", From 9516cd539e6c667e875829209d156d17e09b0440 Mon Sep 17 00:00:00 2001 From: aman-095 Date: Tue, 30 Jul 2024 18:16:40 +0530 Subject: [PATCH 18/25] docs: update descriptions --- .../@stdlib/blas/base/strmv/README.md | 6 ++--- .../@stdlib/blas/base/strmv/docs/repl.txt | 2 +- .../blas/base/strmv/docs/types/index.d.ts | 6 ++--- .../blas/base/strmv/docs/types/test.ts | 6 ++--- .../@stdlib/blas/base/strmv/lib/base.js | 23 ++++++++++--------- .../@stdlib/blas/base/strmv/lib/index.js | 2 +- .../@stdlib/blas/base/strmv/lib/ndarray.js | 2 +- .../@stdlib/blas/base/strmv/lib/strmv.js | 2 +- .../@stdlib/blas/base/strmv/package.json | 2 +- 9 files changed, 26 insertions(+), 25 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/README.md b/lib/node_modules/@stdlib/blas/base/strmv/README.md index a5bcbb0a7cb1..64f8ee75b326 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/strmv/README.md @@ -20,7 +20,7 @@ limitations under the License. # strmv -> Perform one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +> Perform one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.
@@ -32,7 +32,7 @@ var strmv = require( '@stdlib/blas/base/strmv' ); #### strmv( order, uplo, trans, diag, N, A, LDA, x, sx ) -Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. ```javascript var Float32Array = require( '@stdlib/array/float32' ); @@ -88,7 +88,7 @@ strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); #### strmv.ndarray( uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox ) -Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, using alternative indexing semantics, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. ```javascript var Float32Array = require( '@stdlib/array/float32' ); diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt index e89f100d9581..a1906b2d24da 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt @@ -56,7 +56,7 @@ {{alias}}.ndarray( uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox ) Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, - using alternative indexing semantics, where `x` is an `N` element vector + using alternative indexing semantics and where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts index 2e3fc309568e..efe1ded86b82 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts @@ -27,7 +27,7 @@ import { Layout, MatrixTriangle, TransposeOperation, DiagonalType } from '@stdli */ interface Routine { /** - * Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. + * Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param order - storage layout * @param uplo - specifies whether `A` is an upper or lower triangular matrix @@ -52,7 +52,7 @@ interface Routine { ( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number ): Float32Array; /** - * Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. + * Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, using alternative indexing semantics and where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param uplo - specifies whether `A` is an upper or lower triangular matrix * @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed @@ -80,7 +80,7 @@ interface Routine { } /** -* Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param order - storage layout * @param uplo - specifies whether `A` is an upper or lower triangular matrix diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts index 3b3d0a1af336..11e7513d2ca8 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/test.ts @@ -134,7 +134,7 @@ import strmv = require( './index' ); strmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, ( x: number ): number => x, x, 1 ); // $ExpectError } -// The compiler throws an error if the function is provided a eighth argument which is not a Float32Array... +// The compiler throws an error if the function is provided an eighth argument which is not a Float32Array... { const A = new Float32Array( 20 ); @@ -294,7 +294,7 @@ import strmv = require( './index' ); strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, ( x: number ): number => x, 0, x, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a eighth argument which is not a number... +// The compiler throws an error if the function is provided an eighth argument which is not a number... { const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); @@ -339,7 +339,7 @@ import strmv = require( './index' ); strmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, ( x: number ): number => x, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a eleventh argument which is not a number... +// The compiler throws an error if the function is provided an eleventh argument which is not a number... { const x = new Float32Array( 10 ); const A = new Float32Array( 20 ); diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js index 24e5d0e8d2bd..e3148b347fc0 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js @@ -21,14 +21,13 @@ // MODULES // var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); -var isColMajor = require( '@stdlib/ndarray/base/assert/is-column-major' ); var f32 = require( '@stdlib/number/float64/base/to-float32' ); // MAIN // /** -* Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix * @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed @@ -54,6 +53,7 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' ); */ function strmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len var nonunit; + var isrm; var tmp; var sa0; var sa1; @@ -66,9 +66,10 @@ function strmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX // Note on variable naming convention: sa#, ix#, i# where # corresponds to the loop number, with `0` being the innermost loop... + isrm = isRowMajor( [ strideA1, strideA2 ] ); nonunit = ( diag === 'non-unit' ); - if ( isRowMajor( [ strideA1, strideA2 ] ) ) { + if ( isrm ) { // For row-major matrices, the last dimension has the fastest changing index... sa0 = strideA2; // stride for innermost loop sa1 = strideA1; // stride for outermost loop @@ -80,8 +81,8 @@ function strmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX ox = offsetX; if ( - ( isColMajor( [ strideA1, strideA2 ] ) && trans === 'no-transpose' && uplo === 'upper' ) || - ( isRowMajor( [ strideA1, strideA2 ] ) && trans !== 'no-transpose' && uplo === 'lower' ) + ( !isrm && trans === 'no-transpose' && uplo === 'upper' ) || + ( isrm && trans !== 'no-transpose' && uplo === 'lower' ) ) { ix1 = ox; for ( i1 = 0; i1 < N; i1++ ) { @@ -102,8 +103,8 @@ function strmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX return x; } if ( - ( isColMajor( [ strideA1, strideA2 ] ) && trans === 'no-transpose' && uplo === 'lower' ) || - ( isRowMajor( [ strideA1, strideA2 ] ) && trans !== 'no-transpose' && uplo === 'upper' ) + ( !isrm && trans === 'no-transpose' && uplo === 'lower' ) || + ( isrm && trans !== 'no-transpose' && uplo === 'upper' ) ) { ox += ( N - 1 ) * strideX; ix1 = ox; @@ -125,8 +126,8 @@ function strmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX return x; } if ( - ( isColMajor( [ strideA1, strideA2 ] ) && trans !== 'no-transpose' && uplo === 'upper' ) || - ( isRowMajor( [ strideA1, strideA2 ] ) && trans === 'no-transpose' && uplo === 'lower' ) + ( !isrm && trans !== 'no-transpose' && uplo === 'upper' ) || + ( isrm && trans === 'no-transpose' && uplo === 'lower' ) ) { ix1 = ox + ( ( N - 1 ) * strideX ); for ( i1 = N-1; i1 >= 0; i1-- ) { @@ -146,8 +147,8 @@ function strmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX return x; } if ( - ( isColMajor( [ strideA1, strideA2 ] ) && trans !== 'no-transpose' && uplo === 'lower' ) || - ( isRowMajor( [ strideA1, strideA2 ] ) && trans === 'no-transpose' && uplo === 'upper' ) + ( !isrm && trans !== 'no-transpose' && uplo === 'lower' ) || + ( isrm && trans === 'no-transpose' && uplo === 'upper' ) ) { ix1 = ox; for ( i1 = 0; i1 < N; i1++ ) { diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js index f894d69581e9..b06424d1cc4d 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* BLAS level 2 routine to perform one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* BLAS level 2 routine to perform one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @module @stdlib/blas/base/strmv * diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js index 00894a800809..4899c8427abb 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js @@ -30,7 +30,7 @@ var base = require( './base.js' ); // MAIN // /** -* Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix * @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js index 4079f3a27ec8..46687163db4e 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js @@ -33,7 +33,7 @@ var base = require( './base.js' ); // MAIN // /** -* Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +* Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * * @param {string} order - storage layout * @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix diff --git a/lib/node_modules/@stdlib/blas/base/strmv/package.json b/lib/node_modules/@stdlib/blas/base/strmv/package.json index 8904db91e85b..d2c2c8b39336 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/package.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/base/strmv", "version": "0.0.0", - "description": "Perform one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.", + "description": "Perform one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", From cc2f4e2e8d6d697a8061a1968b61f1c5ec49a12c Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 31 Jul 2024 23:36:25 -0700 Subject: [PATCH 19/25] refactor: remove final implied branch and update descriptions --- .../@stdlib/blas/base/strmv/examples/index.js | 7 +++- .../@stdlib/blas/base/strmv/lib/base.js | 37 +++++++++---------- .../@stdlib/blas/base/strmv/lib/ndarray.js | 2 +- .../@stdlib/blas/base/strmv/lib/strmv.js | 4 +- 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/examples/index.js b/lib/node_modules/@stdlib/blas/base/strmv/examples/index.js index d474e37d80b4..42a53ae5de0d 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/examples/index.js @@ -25,10 +25,13 @@ var opts = { 'dtype': 'float32' }; -var N = 3; +var N = 5; var A = discreteUniform( N*N, -10.0, 10.0, opts ); var x = discreteUniform( N, -10.0, 10.0, opts ); -strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); +strmv( 'column-major', 'upper', 'no-transpose', 'unit', N, A, N, x, 1 ); +console.log( x ); + +strmv.ndarray( 'upper', 'no-transpose', 'unit', N, A, 1, N, 0, x, 1, 0 ); console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js index e3148b347fc0..bdbbe34f9d65 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/base.js @@ -29,6 +29,7 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' ); /** * Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. * +* @private * @param {string} uplo - specifies whether `A` is an upper or lower triangular matrix * @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed * @param {string} diag - specifies whether `A` has a unit diagonal @@ -78,8 +79,8 @@ function strmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX sa0 = strideA1; // stride for innermost loop sa1 = strideA2; // stride for outermost loop } - ox = offsetX; + if ( ( !isrm && trans === 'no-transpose' && uplo === 'upper' ) || ( isrm && trans !== 'no-transpose' && uplo === 'lower' ) @@ -146,27 +147,23 @@ function strmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX } return x; } - if ( - ( !isrm && trans !== 'no-transpose' && uplo === 'lower' ) || - ( isrm && trans === 'no-transpose' && uplo === 'upper' ) - ) { - ix1 = ox; - for ( i1 = 0; i1 < N; i1++ ) { - tmp = x[ ix1 ]; - oa = offsetA + (sa1*i1); - ix0 = ix1; - if ( nonunit ) { - tmp = f32( tmp * A[ oa+(sa0*i1) ] ); - } - for ( i0 = i1+1; i0 < N; i0++ ) { - ix0 += strideX; - tmp = f32( tmp + f32( x[ ix0 ] * A[ oa+(sa0*i0) ] ) ); - } - x[ ix1 ] = tmp; - ix1 += strideX; + // ( !isrm && trans !== 'no-transpose' && uplo === 'lower' ) || ( isrm && trans === 'no-transpose' && uplo === 'upper' ) + ix1 = ox; + for ( i1 = 0; i1 < N; i1++ ) { + tmp = x[ ix1 ]; + oa = offsetA + (sa1*i1); + ix0 = ix1; + if ( nonunit ) { + tmp = f32( tmp * A[ oa+(sa0*i1) ] ); } - return x; + for ( i0 = i1+1; i0 < N; i0++ ) { + ix0 += strideX; + tmp = f32( tmp + f32( x[ ix0 ] * A[ oa+(sa0*i0) ] ) ); + } + x[ ix1 ] = tmp; + ix1 += strideX; } + return x; } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js index 4899c8427abb..b3d926607656 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js @@ -43,7 +43,7 @@ var base = require( './base.js' ); * @param {Float32Array} x - input vector * @param {integer} strideX - `x` stride length * @param {NonNegativeInteger} offsetX - starting index for `x` -* @throws {TypeError} first argument must specify whether the lower or upper triangular matrix is supplied +* @throws {TypeError} first argument must specify whether a lower or upper triangular matrix is supplied * @throws {TypeError} second argument must be a valid transpose operation * @throws {TypeError} third argument must be a valid diagonal type * @throws {RangeError} fourth argument must be a nonnegative integer diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js index 46687163db4e..9dedb5fc81d8 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/strmv.js @@ -20,7 +20,7 @@ // MODULES // -var max = require( '@stdlib/math/base/special/max' ); +var max = require( '@stdlib/math/base/special/fast/max' ); var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); var isTransposeOperation = require( '@stdlib/blas/base/assert/is-transpose-operation' ); @@ -45,7 +45,7 @@ var base = require( './base.js' ); * @param {Float32Array} x - input vector * @param {integer} strideX - `x` stride length * @throws {TypeError} first argument must be a valid order -* @throws {TypeError} second argument must specify whether the lower or upper triangular matrix is supplied +* @throws {TypeError} second argument must specify whether a lower or upper triangular matrix is supplied * @throws {TypeError} third argument must be a valid transpose operation * @throws {TypeError} fourth argument must be a valid diagonal type * @throws {RangeError} fifth argument must be a nonnegative integer From d1d02069b725c4d2b2a03abb17b5e00c44d04960 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 31 Jul 2024 23:37:31 -0700 Subject: [PATCH 20/25] docs: update example --- lib/node_modules/@stdlib/blas/base/strmv/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/README.md b/lib/node_modules/@stdlib/blas/base/strmv/README.md index 64f8ee75b326..5cd531153652 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/strmv/README.md @@ -147,12 +147,15 @@ var opts = { 'dtype': 'float32' }; -var N = 3; +var N = 5; var A = discreteUniform( N*N, -10.0, 10.0, opts ); var x = discreteUniform( N, -10.0, 10.0, opts ); -strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); +strmv( 'column-major', 'upper', 'no-transpose', 'unit', N, A, N, x, 1 ); +console.log( x ); + +strmv.ndarray( 'upper', 'no-transpose', 'unit', N, A, 1, N, 0, x, 1, 0 ); console.log( x ); ``` From 2249bd10e9ce43f80872928c68b50002f54eda1b Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 31 Jul 2024 23:42:12 -0700 Subject: [PATCH 21/25] fix: add missing parameters --- lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts index efe1ded86b82..0a1941a4ef5f 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/types/index.d.ts @@ -76,7 +76,7 @@ interface Routine { * strmv.ndarray( 'upper', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ - ndarray( uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number, offsetX: number ): Float32Array; + ndarray( uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float32Array, strideA1: number, strideA2: number, offsetA: number, x: Float32Array, strideX: number, offsetX: number ): Float32Array; } /** From fdd226b71f38ee67d35aba46a030e3a97140e572 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 31 Jul 2024 23:43:08 -0700 Subject: [PATCH 22/25] feat!: change `none` to `no-transpose` --- lib/node_modules/@stdlib/types/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/types/index.d.ts b/lib/node_modules/@stdlib/types/index.d.ts index 0fa093e57f1f..ace8293b5847 100644 --- a/lib/node_modules/@stdlib/types/index.d.ts +++ b/lib/node_modules/@stdlib/types/index.d.ts @@ -1319,11 +1319,11 @@ declare module '@stdlib/types/blas' { * * ## Notes * - * - **none**: no transposition. + * - **no-transpose**: no transposition. * - **transpose**: transposition. * - **conjugate-transpose**: conjugate transposition. */ - type TransposeOperation = 'none' | 'transpose' | 'conjugate-transpose'; + type TransposeOperation = 'no-transpose' | 'transpose' | 'conjugate-transpose'; } /** From 1150eafd401a216581a9e73f44bdacd1dff825b3 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 31 Jul 2024 23:45:48 -0700 Subject: [PATCH 23/25] docs: update copy --- lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt index a1906b2d24da..326c0cd60208 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt @@ -44,7 +44,7 @@ Returns ------- x: Float32Array - Output vector. + Input vector. Examples -------- @@ -103,7 +103,7 @@ Returns ------- x: Float32Array - Output array. + Input vector. Examples -------- From cdba11c80fdbc9e574a840fe6d5264ffd37d6e84 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 31 Jul 2024 23:55:06 -0700 Subject: [PATCH 24/25] test: update descriptions --- .../blas/base/strmv/test/test.ndarray.js | 58 +++++++++---------- .../blas/base/strmv/test/test.strmv.js | 42 +++++++------- 2 files changed, 50 insertions(+), 50 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js index e55eb88bb9aa..23db4a1bc4cf 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js @@ -234,7 +234,7 @@ tape( 'the function throws an error if provided an invalid tenth argument', func } }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, none, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, lower, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -255,7 +255,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, none, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, lower, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -276,7 +276,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, transpose, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, lower, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -297,7 +297,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, transpose, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, lower, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -318,7 +318,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, none, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, lower, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -339,7 +339,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, none, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, lower, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -360,7 +360,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, transpose, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, lower, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -381,7 +381,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, transpose, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, lower, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -402,7 +402,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, none, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, upper, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -423,7 +423,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, none, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, upper, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -444,7 +444,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, none, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, upper, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -465,7 +465,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, none, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, upper, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -486,7 +486,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, transpose, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, upper, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -507,7 +507,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, transpose, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, upper, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -528,7 +528,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, transpose, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, upper, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -549,7 +549,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, transpose, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, upper, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -570,7 +570,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, sx=2)', function test( t ) { +tape( 'the function supports specifying an `x` stride (row-major)', function test( t ) { var expected; var data; var out; @@ -591,7 +591,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, sx=2)', function test( t ) { +tape( 'the function supports specifying an `x` stride (column-major)', function test( t ) { var expected; var data; var out; @@ -612,7 +612,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function returns a reference to the second input vector', function test( t ) { +tape( 'the function returns a reference to the input vector', function test( t ) { var data; var out; var a; @@ -629,7 +629,7 @@ tape( 'the function returns a reference to the second input vector', function te t.end(); }); -tape( 'if `N` is zero, the function returns the second input vector unchanged (row-major)', function test( t ) { +tape( 'if `N` is zero, the function returns the input vector unchanged (row-major)', function test( t ) { var expected; var data; var out; @@ -650,7 +650,7 @@ tape( 'if `N` is zero, the function returns the second input vector unchanged (r t.end(); }); -tape( 'if `N` is zero, the function returns the second input vector unchanged (column-major)', function test( t ) { +tape( 'if `N` is zero, the function returns the input vector unchanged (column-major)', function test( t ) { var expected; var data; var out; @@ -671,7 +671,7 @@ tape( 'if `N` is zero, the function returns the second input vector unchanged (c t.end(); }); -tape( 'the function supports specifying stride of the first and the second dimension of `A` (row-major)', function test( t ) { +tape( 'the function supports specifying stride of the first and second dimensions of `A` (row-major)', function test( t ) { var expected; var data; var out; @@ -692,7 +692,7 @@ tape( 'the function supports specifying stride of the first and the second dimen t.end(); }); -tape( 'the function supports specifying stride of the first and the second dimension of `A` (column-major)', function test( t ) { +tape( 'the function supports specifying stride of the first and second dimensions of `A` (column-major)', function test( t ) { var expected; var data; var out; @@ -713,7 +713,7 @@ tape( 'the function supports specifying stride of the first and the second dimen t.end(); }); -tape( 'the function supports a negative `strideA1` parameter (row-major)', function test( t ) { +tape( 'the function supports a negative stride for the first dimension of `A` (row-major)', function test( t ) { var expected; var data; var out; @@ -734,7 +734,7 @@ tape( 'the function supports a negative `strideA1` parameter (row-major)', funct t.end(); }); -tape( 'the function supports a negative `strideA1` parameter (column-major)', function test( t ) { +tape( 'the function supports a negative stride for the first dimension of `A` (column-major)', function test( t ) { var expected; var data; var out; @@ -755,7 +755,7 @@ tape( 'the function supports a negative `strideA1` parameter (column-major)', fu t.end(); }); -tape( 'the function supports a negative `strideA2` parameter (row-major)', function test( t ) { +tape( 'the function supports a negative stride for the second dimension of `A` (row-major)', function test( t ) { var expected; var data; var out; @@ -776,7 +776,7 @@ tape( 'the function supports a negative `strideA2` parameter (row-major)', funct t.end(); }); -tape( 'the function supports a negative `strideA2` parameter (column-major)', function test( t ) { +tape( 'the function supports a negative stride for the second dimension of `A` (column-major)', function test( t ) { var expected; var data; var out; @@ -881,7 +881,7 @@ tape( 'the function supports an `A` offset (column-major)', function test( t ) { t.end(); }); -tape( 'the function supports a negative `x` stride value (row-major)', function test( t ) { +tape( 'the function supports a negative `x` stride (row-major)', function test( t ) { var expected; var data; var out; @@ -902,7 +902,7 @@ tape( 'the function supports a negative `x` stride value (row-major)', function t.end(); }); -tape( 'the function supports a negative `x` stride (column-major)', function test( t ) { +tape( 'the function supports a negative `x` (column-major)', function test( t ) { var expected; var data; var out; diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/test.strmv.js b/lib/node_modules/@stdlib/blas/base/strmv/test/test.strmv.js index 999f0552f2c9..f497804304fa 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/test.strmv.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/test.strmv.js @@ -276,7 +276,7 @@ tape( 'the function throws an error if provided an invalid ninth argument', func } }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, none, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, lower, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -297,7 +297,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, none, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, lower, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -318,7 +318,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, transpose, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, lower, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -339,7 +339,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, transpose, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, lower, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -360,7 +360,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, none, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, lower, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -381,7 +381,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, none, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, lower, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -402,7 +402,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, lower, transpose, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, lower, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -423,7 +423,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, lower, transpose, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, lower, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -444,7 +444,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, none, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, upper, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -465,7 +465,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, none, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, upper, no transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -486,7 +486,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, none, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, upper, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -507,7 +507,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, none, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, upper, no transpose, unit)', function test( t ) { var expected; var data; var out; @@ -528,7 +528,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, transpose, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, upper, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -549,7 +549,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, transpose, non-unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, upper, transpose, non-unit)', function test( t ) { var expected; var data; var out; @@ -570,7 +570,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, upper, transpose, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (row-major, upper, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -591,7 +591,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, upper, transpose, unit)', function test( t ) { +tape( 'the function performs one of the matrix-vector operations `x = A*x` or `x = A**T*x` (column-major, upper, transpose, unit)', function test( t ) { var expected; var data; var out; @@ -612,7 +612,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (row-major, sx=2)', function test( t ) { +tape( 'the function supports specifying an `x` stride (row-major)', function test( t ) { var expected; var data; var out; @@ -633,7 +633,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x = A**T*x`, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix (column-major, sx=2)', function test( t ) { +tape( 'the function supports specifying an `x` stride (column-major)', function test( t ) { var expected; var data; var out; @@ -654,7 +654,7 @@ tape( 'the function performs one of the matrix-vector operation `x = A*x`, or `x t.end(); }); -tape( 'the function returns a reference to the second input vector', function test( t ) { +tape( 'the function returns a reference to the input vector', function test( t ) { var data; var out; var a; @@ -671,7 +671,7 @@ tape( 'the function returns a reference to the second input vector', function te t.end(); }); -tape( 'if `N` is zero, the function returns the second input vector unchanged (row-major)', function test( t ) { +tape( 'if `N` is zero, the function returns the input vector unchanged (row-major)', function test( t ) { var expected; var data; var out; @@ -692,7 +692,7 @@ tape( 'if `N` is zero, the function returns the second input vector unchanged (r t.end(); }); -tape( 'if `N` is zero, the function returns the second input vector unchanged (column-major)', function test( t ) { +tape( 'if `N` is zero, the function returns the input vector unchanged (column-major)', function test( t ) { var expected; var data; var out; From 9bf2c4dae7428b5be844895d566f3a15eb68e95a Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Wed, 31 Jul 2024 23:56:54 -0700 Subject: [PATCH 25/25] docs: update descriptions --- lib/node_modules/@stdlib/blas/base/strmv/README.md | 8 ++++---- lib/node_modules/@stdlib/blas/base/strmv/package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/strmv/README.md b/lib/node_modules/@stdlib/blas/base/strmv/README.md index 5cd531153652..40138deb6e69 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/strmv/README.md @@ -20,7 +20,7 @@ limitations under the License. # strmv -> Perform one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +> Perform one of the matrix-vector operations `x = A*x` or `x = A^T*x`.
@@ -88,7 +88,7 @@ strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); #### strmv.ndarray( uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox ) -Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, using alternative indexing semantics, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. +Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, using alternative indexing semantics and where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix. ```javascript var Float32Array = require( '@stdlib/array/float32' ); @@ -127,7 +127,7 @@ strmv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); ## Notes -- `strmv()` corresponds to the [BLAS][blas] level 2 function [`strmv`][strmv]. +- `strmv()` corresponds to the [BLAS][blas] level 2 function [`strmv`][blas-strmv].
@@ -247,7 +247,7 @@ TODO [blas]: http://www.netlib.org/blas -[strmv]: https://www.netlib.org/lapack/explore-html/d6/d1c/group__trmv_ga7b90369d2b2b19f78f168e10dd9eb8ad.html#ga7b90369d2b2b19f78f168e10dd9eb8ad +[blas-strmv]: https://www.netlib.org/lapack/explore-html/d6/d1c/group__trmv_ga7b90369d2b2b19f78f168e10dd9eb8ad.html#ga7b90369d2b2b19f78f168e10dd9eb8ad [mdn-float32array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array diff --git a/lib/node_modules/@stdlib/blas/base/strmv/package.json b/lib/node_modules/@stdlib/blas/base/strmv/package.json index d2c2c8b39336..bb3c30eb55db 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/package.json +++ b/lib/node_modules/@stdlib/blas/base/strmv/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/base/strmv", "version": "0.0.0", - "description": "Perform one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.", + "description": "Perform one of the matrix-vector operations `x = A*x` or `x = A^T*x`.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors",