From b930c92c732dfe0b694ffbb8f9f5b51e615bb43f Mon Sep 17 00:00:00 2001 From: aman-095 Date: Tue, 9 Jul 2024 10:58:17 +0530 Subject: [PATCH 01/13] feat: add BLAS Level 2 routine for dtrmv --- .../@stdlib/blas/base/dtrmv/README.md | 252 +++++++ .../blas/base/dtrmv/benchmark/benchmark.js | 104 +++ .../base/dtrmv/benchmark/benchmark.ndarray.js | 104 +++ .../@stdlib/blas/base/dtrmv/docs/repl.txt | 122 ++++ .../blas/base/dtrmv/docs/types/index.d.ts | 118 ++++ .../blas/base/dtrmv/docs/types/test.ts | 358 ++++++++++ .../@stdlib/blas/base/dtrmv/examples/index.js | 34 + .../@stdlib/blas/base/dtrmv/lib/dtrmv.js | 182 +++++ .../@stdlib/blas/base/dtrmv/lib/index.js | 70 ++ .../@stdlib/blas/base/dtrmv/lib/main.js | 35 + .../@stdlib/blas/base/dtrmv/lib/ndarray.js | 183 +++++ .../@stdlib/blas/base/dtrmv/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 + .../dtrmv/test/fixtures/column_major_xn.json | 14 + .../dtrmv/test/fixtures/column_major_xt.json | 14 + .../test/fixtures/row_major_l_nt_nu.json | 14 + .../dtrmv/test/fixtures/row_major_l_nt_u.json | 14 + .../dtrmv/test/fixtures/row_major_l_t_nu.json | 14 + .../dtrmv/test/fixtures/row_major_l_t_u.json | 14 + .../test/fixtures/row_major_u_nt_nu.json | 14 + .../dtrmv/test/fixtures/row_major_u_nt_u.json | 14 + .../dtrmv/test/fixtures/row_major_u_t_nu.json | 14 + .../dtrmv/test/fixtures/row_major_u_t_u.json | 14 + .../dtrmv/test/fixtures/row_major_xn.json | 14 + .../dtrmv/test/fixtures/row_major_xt.json | 14 + .../blas/base/dtrmv/test/test.dtrmv.js | 666 ++++++++++++++++++ .../@stdlib/blas/base/dtrmv/test/test.js | 82 +++ .../blas/base/dtrmv/test/test.ndarray.js | 666 ++++++++++++++++++ 35 files changed, 3324 insertions(+) create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/README.md create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/examples/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/lib/index.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/lib/main.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/package.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_xn.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_xt.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_nt_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_nt_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_t_nu.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_t_u.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_xn.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_xt.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/test.dtrmv.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/test.js create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/README.md b/lib/node_modules/@stdlib/blas/base/dtrmv/README.md new file mode 100644 index 000000000000..318c75b36136 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/README.md @@ -0,0 +1,252 @@ + + +# dtrmv + +> 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. + +
+ +## Usage + +```javascript +var dtrmv = require( '@stdlib/blas/base/dtrmv' ); +``` + +#### dtrmv( 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. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + +dtrmv( '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 `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 [`Float64Array`][mdn-float64array]. +- **lda**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). +- **x**: input [`Float64Array`][mdn-float64array]. +- **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 Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + +dtrmv( '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 Float64Array = require( '@stdlib/array/float64' ); + +// Initial arrays... +var x0 = new Float64Array( [ 1.0, 1.0, 1.0, 1.0 ] ); +var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); + +// Create offset views... +var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element + +dtrmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x1, 1 ); +// x0 => [ 1.0, 6.0, 3.0, 1.0 ] +``` + +#### dtrmv.ndarray( order, uplo, trans, diag, N, A, LDA, 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. + +```javascript +var Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + +dtrmv.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 Float64Array = require( '@stdlib/array/float64' ); + +var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + +dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, -1, 2 ); +// x => [ 1.0, 4.0, 10.0 ] +``` + +
+ + + +
+ +## Notes + +- `dtrmv()` corresponds to the [BLAS][blas] level 2 function [`dtrmv`][dtrmv]. + +
+ + + +
+ +## Examples + + + +```javascript +var discreteUniform = require( '@stdlib/random/array/discrete-uniform' ); +var dtrmv = require( '@stdlib/blas/base/dtrmv' ); + +var opts = { + 'dtype': 'float64' +}; + +var N = 3; + +var A = discreteUniform( N*N, -10.0, 10.0, opts ); +var x = discreteUniform( N, -10.0, 10.0, opts ); + +dtrmv( '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/dtrmv/benchmark/benchmark.js b/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.js new file mode 100644 index 000000000000..d0d2fbb1cf89 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +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 dtrmv = require( './../lib/dtrmv.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// 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 = dtrmv( 'row-major', 'upper', 'transpose', 'non-unit', N, A, N, x, 1 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var 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/dtrmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.ndarray.js new file mode 100644 index 000000000000..e81a7d0d3076 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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 isnan = require( '@stdlib/math/base/assert/is-nan' ); +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 dtrmv = require( './../lib/ndarray.js' ); + + +// VARIABLES // + +var options = { + 'dtype': 'float64' +}; + + +// 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 = dtrmv( 'row-major', 'upper', 'transpose', 'non-unit', N, A, N, 0, x, 1, 0 ); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + } + b.toc(); + if ( isnan( z[ i%z.length ] ) ) { + b.fail( 'should not return NaN' ); + } + b.pass( 'benchmark finished' ); + b.end(); + } +} + + +// MAIN // + +/** +* Main execution sequence. +* +* @private +*/ +function main() { + var 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/dtrmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt new file mode 100644 index 000000000000..fee8fe7d3806 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt @@ -0,0 +1,122 @@ + +{{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. + + 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: Float64Array + Matrix. + + lda: integer + Stride of the first dimension of `A` (a.k.a., leading dimension of the + matrix `A`). + + x: Float64Array + Input vector. + + sx: integer + Index increment for `x`. + + Returns + ------- + x: Float64Array + Output vector. + + Examples + -------- + > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); + > var A = new {{alias:@stdlib/array/float64}}( [ 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 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. + + 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: Float64Array + 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: Float64Array + Input vector. + + sx: integer + Index increment for `x`. + + ox: integer + Starting index for `x`. + + Returns + ------- + x: Float64Array + Output array. + + Examples + -------- + > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); + > var A = new {{alias:@stdlib/array/float64}}( [ 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/dtrmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts new file mode 100644 index 000000000000..a618e11db5e9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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 `dtrmv`. +*/ +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 `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 Float64Array = require( '@stdlib/array/float64' ); + * + * var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); + * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + * + * dtrmv( 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: Float64Array, LDA: number, x: Float64Array, strideX: number ): Float64Array; + + /** + * 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 `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 Float64Array = require( '@stdlib/array/float64' ); + * + * var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); + * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); + * + * dtrmv.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: Float64Array, LDA: number, x: Float64Array, strideX: number, offsetX: number ): Float64Array; +} + +/** +* 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 `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 Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ] ); +* var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +* +* dtrmv( 'row-major', 'lower', 'none', 'non-unit', 3, A, 3, x, 1 ); +* // x => [ 1.0, 5.0, 15.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ] ); +* var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +* +* dtrmv.ndarray( 'row-major', 'lower', 'none', 'non-unit', 3, A, 3, 0, x, 1, 0 ); +* // x => [ 1.0, 5.0, 15.0 ] +*/ +declare var dtrmv: Routine; + + +// EXPORTS // + +export = dtrmv; diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts new file mode 100644 index 000000000000..204d8f44ed1f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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 dtrmv = require( './index' ); + + +// TESTS // + +// The function returns a Float64Array... +{ + const x = new Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv( 10, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( true, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( false, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( null, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( undefined, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( [], 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( {}, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( ( 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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv( 'row-major', 10, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', true, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', false, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', null, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', undefined, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', [], 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', {}, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( '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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv( 'row-major', 'upper', 10, 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', true, 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', false, 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', null, 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', undefined, 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', [], 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', {}, 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( '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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv( 'row-major', 'upper', 'none', 10, 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', true, 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', false, 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', null, 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', undefined, 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', [], 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', {}, 10, A, 10, x, 1 ); // $ExpectError + dtrmv( '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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv( 'row-major', 'upper', 'none', 'unit', '10', A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', true, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', false, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', null, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', undefined, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', [], A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', {}, A, 10, x, 1 ); // $ExpectError + dtrmv( '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 Float64Array... +{ + const x = new Float64Array( 10 ); + + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, 10, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, '10', 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, true, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, false, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, null, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, undefined, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, [ '1' ], 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, {}, 10, x, 1 ); // $ExpectError + dtrmv( '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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, '10', x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, true, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, false, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, null, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, undefined, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, [], x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, {}, x, 1 ); // $ExpectError + dtrmv( '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 Float64Array... +{ + const A = new Float64Array( 20 ); + + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 10, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, '10', 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, true, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, false, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, null, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, undefined, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, [ '1' ], 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, {}, 1 ); // $ExpectError + dtrmv( '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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, '10' ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, true ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, false ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, null ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, undefined ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, [] ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, {} ); // $ExpectError + dtrmv( '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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv(); // $ExpectError + dtrmv( 'row-major' ); // $ExpectError + dtrmv( 'row-major', 'upper' ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none' ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit' ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x ); // $ExpectError + dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, 1 ); // $ExpectError +} + +// Attached to main export is an `ndarray` method which returns a Float64Array... +{ + const x = new Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, 0 ); // $ExpectType Float64Array +} + +// The compiler throws an error if the function is provided a first argument which is not a string... +{ + const x = new Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv.ndarray( 10, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( true, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( false, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( null, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( undefined, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( [], 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( {}, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv.ndarray( 'row-major', 10, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', true, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', false, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', null, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', undefined, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', [], 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', {}, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv.ndarray( 'row-major', 'upper', 10, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', true, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', false, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', null, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', undefined, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', [], 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', {}, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv.ndarray( 'row-major', 'upper', 'none', 10, 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', true, 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', false, 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', null, 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', undefined, 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', [], 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', {}, 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', '10', A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', true, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', false, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', null, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', undefined, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', [], A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', {}, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.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 Float64Array... +{ + const x = new Float64Array( 10 ); + + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, 10, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, '10', 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, true, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, false, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, null, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, undefined, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, [ '1' ], 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, {}, 10, x, 1 , 0 ); // $ExpectError + dtrmv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, '10', x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, true, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, false, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, null, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, undefined, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, [], x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, {}, x, 1 , 0 ); // $ExpectError + dtrmv.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 Float64Array... +{ + const A = new Float64Array( 20 ); + + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 10, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, '10', 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, true, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, false, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, null, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, undefined, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, [ '1' ], 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, {}, 1 , 0 ); // $ExpectError + dtrmv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, '10', 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, true, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, false, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, null, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, undefined, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, [], 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, {}, 0 ); // $ExpectError + dtrmv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, '10' ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, true ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, false ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, null ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, undefined ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, [] ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, {} ); // $ExpectError + dtrmv.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 Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv.ndarray(); // $ExpectError + dtrmv.ndarray( 'row-major' ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper' ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none' ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit' ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, 0, 10 ); // $ExpectError +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/examples/index.js b/lib/node_modules/@stdlib/blas/base/dtrmv/examples/index.js new file mode 100644 index 000000000000..0dffb3af9d00 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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 dtrmv = require( './../lib' ); + +var opts = { + 'dtype': 'float64' +}; + +var N = 3; + +var A = discreteUniform( N*N, -10.0, 10.0, opts ); +var x = discreteUniform( N, -10.0, 10.0, opts ); + +dtrmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.js new file mode 100644 index 000000000000..1d9992b02238 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.js @@ -0,0 +1,182 @@ +/** +* @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 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 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 `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 {Float64Array} A - matrix +* @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Float64Array} 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 {Float64Array} `x` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* +* dtrmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +* // x => [ 14.0, 8.0, 3.0 ] +*/ +function dtrmv( 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 ] += ( temp * A[ i + ( LDA * j ) ] ); + ix += strideX; + } + if ( diag === 'non-unit' ) { + 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 ] += ( temp * A[ i + ( LDA * j ) ] ); + ix -= strideX; + } + if ( diag === 'non-unit' ) { + 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 *= A[ ( j * LDA ) + j ]; + } + for ( i = j - 1; i >= 0; i-- ) { + ix -= strideX; + 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 *= A[ ( j * LDA ) + j ]; + } + for ( i = j + 1; i < N; i++ ) { + ix += strideX; + temp += ( x[ ix ] * A[ i + ( LDA * j ) ] ); + } + x[ jx ] = temp; + jx += strideX; + } + return x; + } +} + + +// EXPORTS // + +module.exports = dtrmv; diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/index.js new file mode 100644 index 000000000000..660419af01b2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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 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/dtrmv +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dtrmv = require( '@stdlib/blas/base/dtrmv' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* +* dtrmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +* // x => [ 14.0, 8.0, 3.0 ] +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* var dtrmv = require( '@stdlib/blas/base/dtrmv' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* +* dtrmv.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 dtrmv; +var tmp = tryRequire( join( __dirname, './native.js' ) ); +if ( isError( tmp ) ) { + dtrmv = main; +} else { + dtrmv = tmp; +} + + +// EXPORTS // + +module.exports = dtrmv; + +// exports: { "ndarray": "dtrmv.ndarray" } diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/main.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/main.js new file mode 100644 index 000000000000..2318cb22a5a8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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 dtrmv = require( './dtrmv.js' ); +var ndarray = require( './ndarray.js' ); + + +// MAIN // + +setReadOnly( dtrmv, 'ndarray', ndarray ); + + +// EXPORTS // + +module.exports = dtrmv; diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js new file mode 100644 index 000000000000..214d3e36ef96 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.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 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 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 {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {Float64Array} 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 {Float64Array} 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 {Float64Array} `x` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* +* dtrmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, 1, 0 ); +* // x => [ 14.0, 8.0, 3.0 ] +*/ +function dtrmv( 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 ] += ( temp * A[ offsetA + i + ( LDA * j ) ] ); + ix += strideX; + } + if ( diag === 'non-unit' ) { + 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 ] += ( temp * A[ offsetA + i + ( LDA * j ) ] ); + ix -= strideX; + } + if ( diag === 'non-unit' ) { + 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 *= A[ offsetA + j + ( j * LDA ) ]; + } + for ( i = j - 1; i >= 0; i-- ) { + ix -= strideX; + temp += ( x[ ix ] * A[ offsetA + 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 *= A[ offsetA + j + ( j * LDA ) ]; + } + for ( i = j + 1; i < N; i++ ) { + ix += strideX; + temp += ( x[ ix ] * A[ offsetA + i + ( LDA * j ) ] ); + } + x[ jx ] = temp; + jx += strideX; + } + return x; + } +} + + +// EXPORTS // + +module.exports = dtrmv; diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/package.json b/lib/node_modules/@stdlib/blas/base/dtrmv/package.json new file mode 100644 index 000000000000..2209c39bedc4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/package.json @@ -0,0 +1,68 @@ +{ + "name": "@stdlib/blas/base/dtrmv", + "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.", + "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", + "dtrmv", + "linear", + "algebra", + "subroutines", + "array", + "ndarray", + "float32", + "float", + "float32array" + ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_nt_nu.json new file mode 100644 index 000000000000..28c7879e0eed --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_nt_u.json new file mode 100644 index 000000000000..5fd88f474523 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_l_t_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_t_nu.json new file mode 100644 index 000000000000..971b03a57717 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_l_t_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_t_u.json new file mode 100644 index 000000000000..a0002090b4be --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_nt_nu.json new file mode 100644 index 000000000000..3376c5fbb377 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_nt_u.json new file mode 100644 index 000000000000..4e71ba3df2d3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_u_t_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_t_nu.json new file mode 100644 index 000000000000..dd31956cbf60 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_u_t_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_t_u.json new file mode 100644 index 000000000000..22f8c21ca2ed --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_xn.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_xn.json new file mode 100644 index 000000000000..f90772bf622e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_xt.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_xt.json new file mode 100644 index 000000000000..24262a526b03 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_nt_nu.json new file mode 100644 index 000000000000..404f5f3237ba --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_nt_u.json new file mode 100644 index 000000000000..3663451cdc0d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_l_t_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_t_nu.json new file mode 100644 index 000000000000..b7fba35a2d79 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_l_t_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_t_u.json new file mode 100644 index 000000000000..789cc11add74 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_nt_nu.json new file mode 100644 index 000000000000..f66dfdfdac62 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_nt_u.json new file mode 100644 index 000000000000..3ce3c31258a4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_u_t_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_t_nu.json new file mode 100644 index 000000000000..8f4921208210 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_u_t_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_t_u.json new file mode 100644 index 000000000000..aa20e05b248a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_xn.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_xn.json new file mode 100644 index 000000000000..6f8f9dafab40 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_xt.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_xt.json new file mode 100644 index 000000000000..b0120582e0c7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/test.dtrmv.js b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.dtrmv.js new file mode 100644 index 000000000000..82778875337e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.dtrmv.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 Float64Array = require( '@stdlib/array/float64' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var dtrmv = require( './../lib/dtrmv.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 dtrmv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 9', function test( t ) { + t.strictEqual( dtrmv.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() { + dtrmv( value, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, new Float64Array( 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() { + dtrmv( rutu.order, value, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, new Float64Array( 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() { + dtrmv( rutu.order, rutu.uplo, value, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, new Float64Array( 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() { + dtrmv( rutu.order, rutu.uplo, rutu.trans, value, rutu.N, new Float64Array( rutu.A ), rutu.LDA, new Float64Array( 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() { + dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, value, new Float64Array( rutu.A ), rutu.LDA, new Float64Array( 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() { + dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), value, new Float64Array( 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() { + dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, new Float64Array( 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 Float64Array( rlntnu.A ); + x = new Float64Array( rlntnu.x ); + + expected = new Float64Array( rlntnu.x_out ); + + out = dtrmv( 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 Float64Array( clntnu.A ); + x = new Float64Array( clntnu.x ); + + expected = new Float64Array( clntnu.x_out ); + + out = dtrmv( 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 Float64Array( rltnu.A ); + x = new Float64Array( rltnu.x ); + + expected = new Float64Array( rltnu.x_out ); + + out = dtrmv( 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 Float64Array( cltnu.A ); + x = new Float64Array( cltnu.x ); + + expected = new Float64Array( cltnu.x_out ); + + out = dtrmv( 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 Float64Array( rlntu.A ); + x = new Float64Array( rlntu.x ); + + expected = new Float64Array( rlntu.x_out ); + + out = dtrmv( 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 Float64Array( clntu.A ); + x = new Float64Array( clntu.x ); + + expected = new Float64Array( clntu.x_out ); + + out = dtrmv( 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 Float64Array( rltu.A ); + x = new Float64Array( rltu.x ); + + expected = new Float64Array( rltu.x_out ); + + out = dtrmv( 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 Float64Array( cltu.A ); + x = new Float64Array( cltu.x ); + + expected = new Float64Array( cltu.x_out ); + + out = dtrmv( 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 Float64Array( runtnu.A ); + x = new Float64Array( runtnu.x ); + + expected = new Float64Array( runtnu.x_out ); + + out = dtrmv( 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 Float64Array( cuntnu.A ); + x = new Float64Array( cuntnu.x ); + + expected = new Float64Array( cuntnu.x_out ); + + out = dtrmv( 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 Float64Array( runtu.A ); + x = new Float64Array( runtu.x ); + + expected = new Float64Array( runtu.x_out ); + + out = dtrmv( 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 Float64Array( cuntu.A ); + x = new Float64Array( cuntu.x ); + + expected = new Float64Array( cuntu.x_out ); + + out = dtrmv( 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 Float64Array( rutnu.A ); + x = new Float64Array( rutnu.x ); + + expected = new Float64Array( rutnu.x_out ); + + out = dtrmv( 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 Float64Array( cutnu.A ); + x = new Float64Array( cutnu.x ); + + expected = new Float64Array( cutnu.x_out ); + + out = dtrmv( 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 Float64Array( rutu.A ); + x = new Float64Array( rutu.x ); + + expected = new Float64Array( rutu.x_out ); + + out = dtrmv( 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 Float64Array( cutu.A ); + x = new Float64Array( cutu.x ); + + expected = new Float64Array( cutu.x_out ); + + out = dtrmv( 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 Float64Array( rxt.A ); + x = new Float64Array( rxt.x ); + + expected = new Float64Array( rxt.x_out ); + + out = dtrmv( 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 Float64Array( cxt.A ); + x = new Float64Array( cxt.x ); + + expected = new Float64Array( cxt.x_out ); + + out = dtrmv( 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 Float64Array( rutu.A ); + x = new Float64Array( rutu.x ); + + out = dtrmv( 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 Float64Array( rutu.A ); + x = new Float64Array( rutu.x ); + + expected = new Float64Array( rutu.x ); + + out = dtrmv( 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 Float64Array( cutu.A ); + x = new Float64Array( cutu.x ); + + expected = new Float64Array( cutu.x ); + + out = dtrmv( 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 Float64Array( rxn.A ); + x = new Float64Array( rxn.x ); + + expected = new Float64Array( rxn.x_out ); + + out = dtrmv( 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 Float64Array( cxn.A ); + x = new Float64Array( cxn.x ); + + expected = new Float64Array( cxn.x_out ); + + out = dtrmv( 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(); +}); diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.js b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.js new file mode 100644 index 000000000000..f10cb164883c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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 dtrmv = 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 dtrmv, '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 dtrmv.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 dtrmv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dtrmv, 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 dtrmv; + var main; + + main = require( './../lib/dtrmv.js' ); + + dtrmv = proxyquire( './../lib', { + '@stdlib/utils/try-require': tryRequire + }); + + t.strictEqual( dtrmv, main, 'returns expected value' ); + t.end(); + + function tryRequire() { + return new Error( 'Cannot find module' ); + } +}); diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js new file mode 100644 index 000000000000..3e19c22c502d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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 Float64Array = require( '@stdlib/array/float64' ); +var EPS = require( '@stdlib/constants/float64/eps' ); +var abs = require( '@stdlib/math/base/special/abs' ); +var dtrmv = 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 dtrmv, 'function', 'main export is a function' ); + t.end(); +}); + +tape( 'the function has an arity of 11', function test( t ) { + t.strictEqual( dtrmv.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() { + dtrmv( value, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float64Array( 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() { + dtrmv( rutu.order, value, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float64Array( 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() { + dtrmv( rutu.order, rutu.uplo, value, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float64Array( 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() { + dtrmv( rutu.order, rutu.uplo, rutu.trans, value, rutu.N, new Float64Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float64Array( 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() { + dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, value, new Float64Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float64Array( 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() { + dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), value, new Float64Array( 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() { + dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float64Array( 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 Float64Array( rlntnu.A ); + x = new Float64Array( rlntnu.x ); + + expected = new Float64Array( rlntnu.x_out ); + + out = dtrmv( 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 Float64Array( clntnu.A ); + x = new Float64Array( clntnu.x ); + + expected = new Float64Array( clntnu.x_out ); + + out = dtrmv( 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 Float64Array( rltnu.A ); + x = new Float64Array( rltnu.x ); + + expected = new Float64Array( rltnu.x_out ); + + out = dtrmv( 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 Float64Array( cltnu.A ); + x = new Float64Array( cltnu.x ); + + expected = new Float64Array( cltnu.x_out ); + + out = dtrmv( 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 Float64Array( rlntu.A ); + x = new Float64Array( rlntu.x ); + + expected = new Float64Array( rlntu.x_out ); + + out = dtrmv( 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 Float64Array( clntu.A ); + x = new Float64Array( clntu.x ); + + expected = new Float64Array( clntu.x_out ); + + out = dtrmv( 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 Float64Array( rltu.A ); + x = new Float64Array( rltu.x ); + + expected = new Float64Array( rltu.x_out ); + + out = dtrmv( 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 Float64Array( cltu.A ); + x = new Float64Array( cltu.x ); + + expected = new Float64Array( cltu.x_out ); + + out = dtrmv( 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 Float64Array( runtnu.A ); + x = new Float64Array( runtnu.x ); + + expected = new Float64Array( runtnu.x_out ); + + out = dtrmv( 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 Float64Array( cuntnu.A ); + x = new Float64Array( cuntnu.x ); + + expected = new Float64Array( cuntnu.x_out ); + + out = dtrmv( 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 Float64Array( runtu.A ); + x = new Float64Array( runtu.x ); + + expected = new Float64Array( runtu.x_out ); + + out = dtrmv( 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 Float64Array( cuntu.A ); + x = new Float64Array( cuntu.x ); + + expected = new Float64Array( cuntu.x_out ); + + out = dtrmv( 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 Float64Array( rutnu.A ); + x = new Float64Array( rutnu.x ); + + expected = new Float64Array( rutnu.x_out ); + + out = dtrmv( 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 Float64Array( cutnu.A ); + x = new Float64Array( cutnu.x ); + + expected = new Float64Array( cutnu.x_out ); + + out = dtrmv( 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 Float64Array( rutu.A ); + x = new Float64Array( rutu.x ); + + expected = new Float64Array( rutu.x_out ); + + out = dtrmv( 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 Float64Array( cutu.A ); + x = new Float64Array( cutu.x ); + + expected = new Float64Array( cutu.x_out ); + + out = dtrmv( 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 Float64Array( rxt.A ); + x = new Float64Array( rxt.x ); + + expected = new Float64Array( rxt.x_out ); + + out = dtrmv( 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 Float64Array( cxt.A ); + x = new Float64Array( cxt.x ); + + expected = new Float64Array( cxt.x_out ); + + out = dtrmv( 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 Float64Array( rutu.A ); + x = new Float64Array( rutu.x ); + + out = dtrmv( 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 Float64Array( rutu.A ); + x = new Float64Array( rutu.x ); + + expected = new Float64Array( rutu.x ); + + out = dtrmv( 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 Float64Array( cutu.A ); + x = new Float64Array( cutu.x ); + + expected = new Float64Array( cutu.x ); + + out = dtrmv( 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 Float64Array( rxn.A ); + x = new Float64Array( rxn.x ); + + expected = new Float64Array( rxn.x_out ); + + out = dtrmv( 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 Float64Array( cxn.A ); + x = new Float64Array( cxn.x ); + + expected = new Float64Array( cxn.x_out ); + + out = dtrmv( 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(); +}); From c195a644484e0d7fdb0a7d6f842bed26be9efaed Mon Sep 17 00:00:00 2001 From: aman-095 Date: Thu, 11 Jul 2024 18:18:56 +0530 Subject: [PATCH 02/13] refactor: update implementations and apply review changes --- .../@stdlib/blas/base/dtrmv/lib/base.js | 154 ++++++++++++++++++ .../@stdlib/blas/base/dtrmv/lib/dtrmv.js | 125 +++----------- .../@stdlib/blas/base/dtrmv/lib/index.js | 2 +- .../@stdlib/blas/base/dtrmv/lib/ndarray.js | 124 +++----------- 4 files changed, 195 insertions(+), 210 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js new file mode 100644 index 000000000000..9f29baae290a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js @@ -0,0 +1,154 @@ +/** +* @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'; + +// 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, or 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 {Float64Array} 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 {Float64Array} 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 {Float64Array} `x` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); +* +* dtrmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, 1, 0 ); +* // x => [ 14.0, 8.0, 3.0 ] +*/ +function dtrmv( 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 ] += ( temp * A[ offsetA + i + ( LDA * j ) ] ); + ix += strideX; + } + if ( nonunit ) { + 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 ] += ( temp * A[ offsetA+i+(LDA*j) ] ); + ix -= strideX; + } + if ( nonunit ) { + 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 *= A[ offsetA+j+(LDA*j) ]; + } + for ( i = j - 1; i >= 0; i-- ) { + ix -= strideX; + temp += ( x[ ix ] * A[ offsetA+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 *= A[ offsetA+j+(LDA*j) ]; + } + for ( i = j + 1; i < N; i++ ) { + ix += strideX; + temp += ( x[ ix ] * A[ offsetA+i+(LDA*j) ] ); + } + x[ jx ] = temp; + jx += strideX; + } + return x; + } +} + + +// EXPORTS // + +module.exports = dtrmv; diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.js index 1d9992b02238..eec7bb23f899 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.js @@ -26,27 +26,31 @@ 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' ); +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 the upper or lower triangular part of `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} 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 {Float64Array} A - matrix +* @param {Float64Array} A - input matrix * @param {integer} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) -* @param {Float64Array} x - first input array +* @param {Float64Array} 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 {Float64Array} `x` * * @example @@ -59,121 +63,34 @@ var stride2offset = require( '@stdlib/strided/base/stride2offset'); * // x => [ 14.0, 8.0, 3.0 ] */ function dtrmv( 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 ); + 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; } 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 ] += ( temp * A[ i + ( LDA * j ) ] ); - ix += strideX; - } - if ( diag === 'non-unit' ) { - 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 ] += ( temp * A[ i + ( LDA * j ) ] ); - ix -= strideX; - } - if ( diag === 'non-unit' ) { - 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 *= A[ ( j * LDA ) + j ]; - } - for ( i = j - 1; i >= 0; i-- ) { - ix -= strideX; - 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 *= A[ ( j * LDA ) + j ]; - } - for ( i = j + 1; i < N; i++ ) { - ix += strideX; - temp += ( 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 ); } diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/index.js index 660419af01b2..9e13f4b33d28 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv * diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js index 214d3e36ef96..2d016734aa8e 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js @@ -25,28 +25,32 @@ 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 // /** -* 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, or 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 {Float64Array} A - matrix +* @param {Float64Array} 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 {Float64Array} x - first input array +* @param {Float64Array} 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 {RangeError} seventh 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} tenth argument must be non-zero * @returns {Float64Array} `x` * @@ -60,121 +64,31 @@ var isDiagonal = require( '@stdlib/blas/base/assert/is-diagonal-type' ); * // x => [ 14.0, 8.0, 3.0 ] */ function dtrmv( 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 ); + 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. Tenth 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 ] += ( temp * A[ offsetA + i + ( LDA * j ) ] ); - ix += strideX; - } - if ( diag === 'non-unit' ) { - 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 ] += ( temp * A[ offsetA + i + ( LDA * j ) ] ); - ix -= strideX; - } - if ( diag === 'non-unit' ) { - 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 *= A[ offsetA + j + ( j * LDA ) ]; - } - for ( i = j - 1; i >= 0; i-- ) { - ix -= strideX; - temp += ( x[ ix ] * A[ offsetA + 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 *= A[ offsetA + j + ( j * LDA ) ]; - } - for ( i = j + 1; i < N; i++ ) { - ix += strideX; - temp += ( x[ ix ] * A[ offsetA + i + ( LDA * j ) ] ); - } - x[ jx ] = temp; - jx += strideX; - } - return x; - } + return base( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offsetX ); // eslint-disable-line max-len } From 52c3f86b6c7579de8580627f5ba58962ecfc12dc Mon Sep 17 00:00:00 2001 From: aman-095 Date: Thu, 11 Jul 2024 18:27:07 +0530 Subject: [PATCH 03/13] docs: update descriptions --- .../@stdlib/blas/base/dtrmv/docs/repl.txt | 8 ++-- .../blas/base/dtrmv/docs/types/index.d.ts | 37 ++++++++++--------- .../@stdlib/blas/base/dtrmv/lib/base.js | 4 +- .../@stdlib/blas/base/dtrmv/lib/ndarray.js | 4 +- 4 files changed, 27 insertions(+), 26 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt index fee8fe7d3806..b7ddf0ff8d02 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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 @@ -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 diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts index a618e11db5e9..fcdd46fb8303 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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 `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 uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied + * @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: Float64Array, LDA: number, x: Float64Array, strideX: number ): Float64Array; /** - * 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 `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 uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied + * @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 offsetA - starting index for `A` * @param x - first input array * @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 `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 uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied +* @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/dtrmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js index 9f29baae290a..921bcfed23c3 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js @@ -30,10 +30,10 @@ * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {Float64Array} 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 {Float64Array} 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/dtrmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js index 2d016734aa8e..53477bfe0169 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js @@ -41,10 +41,10 @@ var base = require( './base.js' ); * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {Float64Array} 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 {Float64Array} 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 e3ff3d89c09943ba0f2d6ddcf3fb66e2fad41746 Mon Sep 17 00:00:00 2001 From: aman-095 Date: Thu, 11 Jul 2024 18:38:02 +0530 Subject: [PATCH 04/13] docs: update descriptions --- lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt index b7ddf0ff8d02..20e15e17c7c5 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt @@ -30,7 +30,7 @@ Number of elements along each dimension of `A`. A: Float64Array - Matrix. + Input matrix. lda: integer Stride of the first dimension of `A` (a.k.a., leading dimension of the @@ -86,7 +86,7 @@ Number of elements along each dimension of `A`. A: Float64Array - Matrix. + Input matrix. lda: integer Stride of the first dimension of `A` (a.k.a., leading dimension of the From 1d6841ccaf1da49e08ab22e0f140ea7662973f45 Mon Sep 17 00:00:00 2001 From: aman-095 Date: Mon, 15 Jul 2024 19:00:18 +0530 Subject: [PATCH 05/13] refactor: update implementation for ndarray, add test, and update descriptions --- .../@stdlib/blas/base/dtrmv/README.md | 35 +- .../base/dtrmv/benchmark/benchmark.ndarray.js | 2 +- .../@stdlib/blas/base/dtrmv/docs/repl.txt | 45 +- .../blas/base/dtrmv/docs/types/index.d.ts | 31 +- .../blas/base/dtrmv/docs/types/test.ts | 366 ++++++----- .../@stdlib/blas/base/dtrmv/examples/index.js | 2 +- .../@stdlib/blas/base/dtrmv/lib/base.js | 158 ++--- .../@stdlib/blas/base/dtrmv/lib/dtrmv.js | 25 +- .../@stdlib/blas/base/dtrmv/lib/index.js | 4 +- .../@stdlib/blas/base/dtrmv/lib/ndarray.js | 26 +- .../@stdlib/blas/base/dtrmv/package.json | 8 +- .../column_major_complex_access_pattern.json | 15 + .../test/fixtures/column_major_l_nt_nu.json | 4 +- .../test/fixtures/column_major_l_nt_u.json | 4 +- .../test/fixtures/column_major_l_t_nu.json | 2 + .../test/fixtures/column_major_l_t_u.json | 2 + .../dtrmv/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 + .../test/fixtures/column_major_u_nt_nu.json | 4 +- .../test/fixtures/column_major_u_nt_u.json | 4 +- .../test/fixtures/column_major_u_t_nu.json | 2 + .../test/fixtures/column_major_u_t_u.json | 2 + .../dtrmv/test/fixtures/column_major_xn.json | 2 + .../dtrmv/test/fixtures/column_major_xt.json | 2 + .../row_major_complex_access_pattern.json | 15 + .../test/fixtures/row_major_l_nt_nu.json | 4 +- .../dtrmv/test/fixtures/row_major_l_nt_u.json | 4 +- .../dtrmv/test/fixtures/row_major_l_t_nu.json | 2 + .../dtrmv/test/fixtures/row_major_l_t_u.json | 2 + .../dtrmv/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 + .../test/fixtures/row_major_u_nt_nu.json | 4 +- .../dtrmv/test/fixtures/row_major_u_nt_u.json | 4 +- .../dtrmv/test/fixtures/row_major_u_t_nu.json | 2 + .../dtrmv/test/fixtures/row_major_u_t_u.json | 2 + .../dtrmv/test/fixtures/row_major_xn.json | 2 + .../dtrmv/test/fixtures/row_major_xt.json | 2 + .../blas/base/dtrmv/test/test.dtrmv.js | 290 ++++++--- .../blas/base/dtrmv/test/test.ndarray.js | 574 ++++++++++++++---- 45 files changed, 1249 insertions(+), 553 deletions(-) create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1n_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_complex_access_pattern.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_oa.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1_sa2n.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1n_sa2.json create mode 100644 lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1n_sa2n.json diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/README.md b/lib/node_modules/@stdlib/blas/base/dtrmv/README.md index 318c75b36136..217613d5e22f 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/README.md @@ -20,7 +20,7 @@ limitations under the License. # dtrmv -> 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 dtrmv = require( '@stdlib/blas/base/dtrmv' ); #### dtrmv( 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 Float64Array = require( '@stdlib/array/float64' ); @@ -40,21 +40,21 @@ var Float64Array = require( '@stdlib/array/float64' ); var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -dtrmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +dtrmv( 'row-major', 'upper', 'no-transpose', '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 `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 [`Float64Array`][mdn-float64array]. - **lda**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). -- **x**: input [`Float64Array`][mdn-float64array]. -- **sx**: index increment for `x`. +- **x**: input vector [`Float64Array`][mdn-float64array]. +- **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, @@ -64,7 +64,7 @@ var Float64Array = require( '@stdlib/array/float64' ); var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -dtrmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, -1 ); +dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, -1 ); // x => [ 1.0, 4.0, 10.0 ] ``` @@ -82,13 +82,13 @@ var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); // Create offset views... var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element -dtrmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x1, 1 ); +dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); // x0 => [ 1.0, 6.0, 3.0, 1.0 ] ``` -#### dtrmv.ndarray( order, uplo, trans, diag, N, A, LDA, x, sx, ox ) +#### dtrmv.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 Float64Array = require( '@stdlib/array/float64' ); @@ -96,12 +96,15 @@ var Float64Array = require( '@stdlib/array/float64' ); var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, 1, 0 ); +dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', '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 Float64Array = require( '@stdlib/array/float64' ); var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, -1, 2 ); +dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); // x => [ 1.0, 4.0, 10.0 ] ``` @@ -149,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 ); -dtrmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); console.log( x ); ``` @@ -241,7 +244,7 @@ TODO [blas]: http://www.netlib.org/blas -[dtrmv]: https://www.netlib.org/lapack/explore-html/d6/d1c/group__trmv_ga73370bd6dca01abe05d54ecd1d91ce9a.html#ga73370bd6dca01abe05d54ecd1d91ce9a +[dtrmv]: https://www.netlib.org/lapack/explore-html/d6/d1c/group__trmv_ga7b90369d2b2b19f78f168e10dd9eb8ad.html#ga7b90369d2b2b19f78f168e10dd9eb8ad [mdn-float64array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.ndarray.js index e81a7d0d3076..201247c3c824 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.ndarray.js @@ -62,7 +62,7 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - z = dtrmv( 'row-major', 'upper', 'transpose', 'non-unit', N, A, N, 0, x, 1, 0 ); + z = dtrmv( 'row-major', 'upper', 'transpose', 'non-unit', N, A, N, 1, 0, x, 1, 0 ); if ( isnan( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt index 20e15e17c7c5..1bd95dece4e9 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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`. @@ -51,15 +50,15 @@ -------- > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); > var A = new {{alias:@stdlib/array/float64}}( [ 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 ] -{{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: Float64Array 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,8 @@ > var A = new {{alias:@stdlib/array/float64}}( [ 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 ) + > var trans = 'no-transpose'; + > {{alias}}.ndarray( ord, 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/dtrmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts index fcdd46fb8303..269131d0cb4b 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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 supplied - * @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`) @@ -46,7 +46,7 @@ interface Routine { * var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * - * dtrmv( row-major', 'upper', 'none', 'non-unit', 3, A, 3, x, 1 ); + * dtrmv( 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: Float64Array, LDA: number, x: Float64Array, strideX: number ): Float64Array; @@ -55,14 +55,15 @@ 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 supplied - * @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 - first input array + * @param x - input vector * @param strideX - `x` stride length * @param offsetX - starting index for `x` * @returns `x` @@ -73,7 +74,7 @@ interface Routine { * var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * - * dtrmv.ndarray( row-major', 'upper', 'none', 'non-unit', 3, A, 3, 0, x, 1, 0 ); + * dtrmv.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: Float64Array, LDA: number, x: Float64Array, strideX: number, offsetX: number ): Float64Array; @@ -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 supplied -* @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`) @@ -99,7 +100,7 @@ interface Routine { * var A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ] ); * var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); * -* dtrmv( 'row-major', 'lower', 'none', 'non-unit', 3, A, 3, x, 1 ); +* dtrmv( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, A, 3, x, 1 ); * // x => [ 1.0, 5.0, 15.0 ] * * @example @@ -108,7 +109,7 @@ interface Routine { * var A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ] ); * var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); * -* dtrmv.ndarray( 'row-major', 'lower', 'none', 'non-unit', 3, A, 3, 0, x, 1, 0 ); +* dtrmv.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 dtrmv: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts index 204d8f44ed1f..6a15939238e0 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts @@ -26,7 +26,7 @@ import dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectType Float64Array + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectType Float64Array } // The compiler throws an error if the function is provided a first argument which is not a string... @@ -34,14 +34,14 @@ import dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv( 10, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - dtrmv( true, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - dtrmv( false, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - dtrmv( null, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - dtrmv( undefined, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - dtrmv( [], 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - dtrmv( {}, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - dtrmv( ( x: number ): number => x, 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 10, 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( true, 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( false, 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( null, 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( undefined, 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( [], 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( {}, 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( ( 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 dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv( 'row-major', 10, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', true, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', false, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', null, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', undefined, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', [], 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', {}, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', ( x: number ): number => x, 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 10, 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', true, 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', false, 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', null, 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', undefined, 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', [], 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', {}, 'no-transpose', 'unit', 10, A, 10, x, 1 ); // $ExpectError + dtrmv( '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 dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv( 'row-major', 'upper', 'none', 10, 10, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', true, 10, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', false, 10, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', null, 10, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', undefined, 10, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', [], 10, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', {}, 10, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', ( x: number ): number => x, 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 10, 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', true, 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', false, 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', null, 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', undefined, 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', [], 10, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', {}, 10, A, 10, x, 1 ); // $ExpectError + dtrmv( '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 dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv( 'row-major', 'upper', 'none', 'unit', '10', A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', true, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', false, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', null, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', undefined, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', [], A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', {}, A, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', ( x: number ): number => x, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', '10', A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', true, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', false, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', null, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', undefined, A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', [], A, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', {}, A, 10, x, 1 ); // $ExpectError + dtrmv( '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 Float64Array... { const x = new Float64Array( 10 ); - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, 10, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, '10', 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, true, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, false, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, null, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, undefined, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, [ '1' ], 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, {}, 10, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, ( x: number ): number => x, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, '10', 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, true, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, false, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, null, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, undefined, 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, [ '1' ], 10, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, {}, 10, x, 1 ); // $ExpectError + dtrmv( '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 dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, '10', x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, true, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, false, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, null, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, undefined, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, [], x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, {}, x, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, ( x: number ): number => x, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, '10', x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, true, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, false, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, null, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, undefined, x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, [], x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, {}, x, 1 ); // $ExpectError + dtrmv( '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 Float64Array... { const A = new Float64Array( 20 ); - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 10, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, '10', 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, true, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, false, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, null, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, undefined, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, [ '1' ], 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, {}, 1 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, ( x: number ): number => x, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 10, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, '10', 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, true, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, false, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, null, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, undefined, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, [ '1' ], 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, {}, 1 ); // $ExpectError + dtrmv( '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 dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, '10' ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, true ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, false ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, null ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, undefined ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, [] ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, {} ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, ( x: number ): number => x ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, '10' ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, true ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, false ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, null ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, undefined ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, [] ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, {} ); // $ExpectError + dtrmv( '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 dtrmv = require( './index' ); dtrmv(); // $ExpectError dtrmv( 'row-major' ); // $ExpectError dtrmv( 'row-major', 'upper' ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none' ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit' ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10 ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x ); // $ExpectError - dtrmv( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, 1 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose' ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit' ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10 ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x ); // $ExpectError + dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, x, 1, 1 ); // $ExpectError } // Attached to main export is an `ndarray` method which returns a Float64Array... @@ -186,7 +186,7 @@ import dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, 0 ); // $ExpectType Float64Array + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectType Float64Array } // The compiler throws an error if the function is provided a first argument which is not a string... @@ -194,14 +194,14 @@ import dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 10, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( true, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( false, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( null, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( undefined, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( [], 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( {}, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( ( x: number ): number => x, 'upper', 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 10, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( true, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( false, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( null, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( undefined, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( [], 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( {}, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.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 dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 10, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', true, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', false, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', null, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', undefined, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', [], 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', {}, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', ( x: number ): number => x, 'none', 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 10, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', true, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', false, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', null, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', undefined, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', [], 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', {}, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.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... @@ -224,14 +224,14 @@ import dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 10, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', true, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', false, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', null, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', undefined, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', [], 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', {}, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', ( x: number ): number => x, 'unit', 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 10, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', true, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', false, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', null, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', undefined, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', [], 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', {}, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.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 dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 'none', 10, 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', true, 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', false, 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', null, 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', undefined, 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', [], 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', {}, 10, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', ( x: number ): number => x, 10, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', true, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', false, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', null, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', undefined, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', [], 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', {}, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.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 dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', '10', A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', true, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', false, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', null, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', undefined, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', [], A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', {}, A, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', ( x: number ): number => x, A, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', '10', A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', true, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', false, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', null, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', undefined, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', [], A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', {}, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.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 Float64Array... { const x = new Float64Array( 10 ); - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, 10, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, '10', 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, true, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, false, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, null, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, undefined, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, [ '1' ], 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, {}, 10, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, ( x: number ): number => x, 10, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, '10', 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, true, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, false, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, null, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, undefined, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, [ '1' ], 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, {}, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.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,29 +284,29 @@ import dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, '10', x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, true, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, false, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, null, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, undefined, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, [], x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, {}, x, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, ( x: number ): number => x, x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, '10', 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, true, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, false, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, null, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, undefined, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, [], 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, {}, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.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 Float64Array... +// The compiler throws an error if the function is provided a eighth argument which is not a number... { + const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, 10, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, '10', 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, true, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, false, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, null, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, undefined, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, [ '1' ], 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, {}, 1 , 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, ( x: number ): number => x, 1 , 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, '10', 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, true, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, false, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, null, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, undefined, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, [], 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, {}, 0, x, 1, 0 ); // $ExpectError + dtrmv.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,59 @@ import dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, '10', 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, true, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, false, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, null, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, undefined, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, [], 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, {}, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, ( x: number ): number => x, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, '10', x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, true, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, false, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, null, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, undefined, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, [], x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, {}, x, 1, 0 ); // $ExpectError + dtrmv.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 Float64Array... +{ + const A = new Float64Array( 20 ); + + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, 10, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, '10', 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, true, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, false, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, null, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, undefined, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, [ '1' ], 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, {}, 1, 0 ); // $ExpectError + dtrmv.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... +{ + const x = new Float64Array( 10 ); + const A = new Float64Array( 20 ); + + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, '10', 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, true, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, false, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, null, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, undefined, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, [], 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, {}, 0 ); // $ExpectError + dtrmv.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 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 Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, '10' ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, true ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, false ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, null ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, undefined ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, [] ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, {} ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, ( x: number ): number => x ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, '10' ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, true ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, false ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, null ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, undefined ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, [] ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, {} ); // $ExpectError + dtrmv.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... @@ -347,12 +377,14 @@ import dtrmv = require( './index' ); dtrmv.ndarray(); // $ExpectError dtrmv.ndarray( 'row-major' ); // $ExpectError dtrmv.ndarray( 'row-major', 'upper' ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none' ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit' ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 10, A, 10, x, 1, 0, 10 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose' ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit' ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x ); // $ExpectError + dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1 ); // $ExpectError + dtrmv.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/dtrmv/examples/index.js b/lib/node_modules/@stdlib/blas/base/dtrmv/examples/index.js index 0dffb3af9d00..470aacbfba7c 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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 ); -dtrmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); console.log( x ); diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js index 921bcfed23c3..39ed9cb6e97e 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js @@ -24,125 +24,143 @@ * 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, or conjugate-transposed, or not-transposed -* @param {string} diag - specifies whether `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 {Float64Array} 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 {Float64Array} 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 {Float64Array} `x` * * @example * var Float64Array = require( '@stdlib/array/float64' ); * -* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var A = new Float64Array( [ 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 Float64Array( [ 1.0, 2.0, 3.0 ] ); * -* dtrmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, 1, 0 ); +* dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ -function dtrmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len +function dtrmv( 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 === 'no-transpose' && uplo === 'upper' ) || + ( isRowMajor && trans !== 'no-transpose' && 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 ] += ( 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 ] += ( tmp * A[ oa+(sa0*i0) ] ); + ix0 += strideX; } if ( nonunit ) { - x[ jx ] *= A[ offsetA + j + ( j * LDA ) ]; + 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 === 'no-transpose' && uplo === 'lower' ) || + ( isRowMajor && trans !== 'no-transpose' && 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 ] += ( 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 ] += ( tmp * A[ oa+(sa0*i0) ] ); + ix0 -= strideX; } if ( nonunit ) { - x[ jx ] *= A[ offsetA+j+(LDA*j) ]; + 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 !== 'no-transpose' && uplo === 'upper' ) || + ( isRowMajor && trans === 'no-transpose' && 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 *= A[ offsetA+j+(LDA*j) ]; + tmp *= A[ oa+(sa0*i1) ]; } - for ( i = j - 1; i >= 0; i-- ) { - ix -= strideX; - temp += ( x[ ix ] * A[ offsetA+i+(LDA*j) ] ); + for ( i0 = i1-1; i0 >= 0; i0-- ) { + ix0 -= strideX; + tmp += ( 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 !== 'no-transpose' && uplo === 'lower' ) || + ( isRowMajor && trans === 'no-transpose' && 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 *= A[ offsetA+j+(LDA*j) ]; + tmp *= A[ oa+(sa0*i1) ]; } - for ( i = j + 1; i < N; i++ ) { - ix += strideX; - temp += ( x[ ix ] * A[ offsetA+i+(LDA*j) ] ); + for ( i0 = i1+1; i0 < N; i0++ ) { + ix0 += strideX; + tmp += ( 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/dtrmv/lib/dtrmv.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.js index eec7bb23f899..993abc3ea30b 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.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 {Float64Array} 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 Float64Array = require( '@stdlib/array/float64' ); * -* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var A = new Float64Array( [ 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 Float64Array( [ 1.0, 2.0, 3.0 ] ); * -* dtrmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +* dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); * // x => [ 14.0, 8.0, 3.0 ] */ function dtrmv( 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 dtrmv( 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/dtrmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/index.js index 9e13f4b33d28..75dec73d4dc4 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/index.js @@ -30,7 +30,7 @@ * var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * -* dtrmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, x, 1 ); +* dtrmv( '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 Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * -* dtrmv.ndarray( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, 1, 0 ); +* dtrmv.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/dtrmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js index 53477bfe0169..0aec498bba1d 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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, or conjugate-transposed, or not-transposed -* @param {string} diag - specifies whether `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 {Float64Array} 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 {Float64Array} 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 {Float64Array} `x` * * @example * var Float64Array = require( '@stdlib/array/float64' ); * -* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); +* var A = new Float64Array( [ 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 Float64Array( [ 1.0, 2.0, 3.0 ] ); * -* dtrmv( 'row-major', 'upper', 'none', 'unit', 3, A, 3, 0, x, 1, 0 ); +* dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ -function dtrmv( order, uplo, trans, diag, N, A, LDA, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len +function dtrmv( 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 dtrmv( 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/dtrmv/package.json b/lib/node_modules/@stdlib/blas/base/dtrmv/package.json index 2209c39bedc4..a61534fb43fe 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/package.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/base/dtrmv", "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", @@ -61,8 +61,8 @@ "subroutines", "array", "ndarray", - "float32", - "float", - "float32array" + "float64", + "double", + "float64array" ] } diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_complex_access_pattern.json new file mode 100644 index 000000000000..27a2e9cc91e8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_complex_access_pattern.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "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/dtrmv/test/fixtures/column_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_nt_nu.json index 28c7879e0eed..1f85b5550d91 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_nt_nu.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_nt_nu.json @@ -1,12 +1,14 @@ { "order": "column-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideX": 1, "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/dtrmv/test/fixtures/column_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_nt_u.json index 5fd88f474523..026735b9badc 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_nt_u.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_nt_u.json @@ -1,12 +1,14 @@ { "order": "column-major", - "trans": "none", + "trans": "no-transpose", "diag": "unit", "uplo": "lower", "strideX": 1, "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/dtrmv/test/fixtures/column_major_l_t_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_t_nu.json index 971b03a57717..f43bed3bcf48 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_t_nu.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_l_t_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_t_u.json index a0002090b4be..8f1400bc40e7 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_l_t_u.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_oa.json new file mode 100644 index 000000000000..8513fc653ed3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_oa.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "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/dtrmv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1_sa2.json new file mode 100644 index 000000000000..f83b9134b59b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1_sa2.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "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/dtrmv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1_sa2n.json new file mode 100644 index 000000000000..b911bab43e9f --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1_sa2n.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "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/dtrmv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1n_sa2.json new file mode 100644 index 000000000000..09ebe2c83fd6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1n_sa2.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "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/dtrmv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1n_sa2n.json new file mode 100644 index 000000000000..c41ec6f24164 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1n_sa2n.json @@ -0,0 +1,15 @@ +{ + "order": "column-major", + "trans": "no-transpose", + "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/dtrmv/test/fixtures/column_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_nt_nu.json index 3376c5fbb377..cbbc1b3e3d8b 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_nt_nu.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_nt_nu.json @@ -1,12 +1,14 @@ { "order": "column-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "upper", "strideX": 1, "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/dtrmv/test/fixtures/column_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_nt_u.json index 4e71ba3df2d3..28367ca0cc0e 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_nt_u.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_nt_u.json @@ -1,12 +1,14 @@ { "order": "column-major", - "trans": "none", + "trans": "no-transpose", "diag": "unit", "uplo": "upper", "strideX": 1, "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/dtrmv/test/fixtures/column_major_u_t_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_t_nu.json index dd31956cbf60..92c5e1acd392 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_t_nu.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_u_t_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_t_u.json index 22f8c21ca2ed..c395300a07ab 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_u_t_u.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_xn.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_xn.json index f90772bf622e..90fd6cefe031 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_xn.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_xt.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_xt.json index 24262a526b03..2a993cbf7c5f 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_xt.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_complex_access_pattern.json new file mode 100644 index 000000000000..54d4b4ec9805 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_complex_access_pattern.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "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/dtrmv/test/fixtures/row_major_l_nt_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_nt_nu.json index 404f5f3237ba..07cb4c70bfb5 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_nt_nu.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_nt_nu.json @@ -1,12 +1,14 @@ { "order": "row-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "lower", "strideX": 1, "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/dtrmv/test/fixtures/row_major_l_nt_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_nt_u.json index 3663451cdc0d..94e7a6c28a02 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_nt_u.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_nt_u.json @@ -1,12 +1,14 @@ { "order": "row-major", - "trans": "none", + "trans": "no-transpose", "diag": "unit", "uplo": "lower", "strideX": 1, "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/dtrmv/test/fixtures/row_major_l_t_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_t_nu.json index b7fba35a2d79..d6429a1ee234 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_t_nu.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_l_t_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_t_u.json index 789cc11add74..2cd0a30d3c88 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_l_t_u.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_oa.json new file mode 100644 index 000000000000..f334c8f70992 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_oa.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "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/dtrmv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1_sa2.json new file mode 100644 index 000000000000..1d64b7029d7e --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1_sa2.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "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/dtrmv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1_sa2n.json new file mode 100644 index 000000000000..ac74875f17ea --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1_sa2n.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "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/dtrmv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1n_sa2.json new file mode 100644 index 000000000000..93f0200157b6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1n_sa2.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "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/dtrmv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1n_sa2n.json new file mode 100644 index 000000000000..9f320ee1adad --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1n_sa2n.json @@ -0,0 +1,15 @@ +{ + "order": "row-major", + "trans": "no-transpose", + "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/dtrmv/test/fixtures/row_major_u_nt_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_nt_nu.json index f66dfdfdac62..9d0ffaf69264 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_nt_nu.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_nt_nu.json @@ -1,12 +1,14 @@ { "order": "row-major", - "trans": "none", + "trans": "no-transpose", "diag": "non-unit", "uplo": "upper", "strideX": 1, "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/dtrmv/test/fixtures/row_major_u_nt_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_nt_u.json index 3ce3c31258a4..0bef3befccd2 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_nt_u.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_nt_u.json @@ -1,12 +1,14 @@ { "order": "row-major", - "trans": "none", + "trans": "no-transpose", "diag": "unit", "uplo": "upper", "strideX": 1, "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/dtrmv/test/fixtures/row_major_u_t_nu.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_t_nu.json index 8f4921208210..350bc599d057 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_t_nu.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_u_t_u.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_t_u.json index aa20e05b248a..3216211b81ae 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_u_t_u.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_xn.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_xn.json index 6f8f9dafab40..6f9608e918a7 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_xn.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_xt.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_xt.json index b0120582e0c7..6e31d5f93c78 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_xt.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/test.dtrmv.js b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.dtrmv.js index 82778875337e..078293205d78 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.dtrmv.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.dtrmv.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() { - dtrmv( value, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, new Float64Array( rutu.x ), rutu.strideX ); + dtrmv( value, data.uplo, data.trans, data.diag, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( 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() { - dtrmv( rutu.order, value, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, new Float64Array( rutu.x ), rutu.strideX ); + dtrmv( data.order, value, data.trans, data.diag, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( 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() { - dtrmv( rutu.order, rutu.uplo, value, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, new Float64Array( rutu.x ), rutu.strideX ); + dtrmv( data.order, data.uplo, value, data.diag, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( 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() { - dtrmv( rutu.order, rutu.uplo, rutu.trans, value, rutu.N, new Float64Array( rutu.A ), rutu.LDA, new Float64Array( rutu.x ), rutu.strideX ); + dtrmv( data.order, data.uplo, data.trans, value, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( 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() { - dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, value, new Float64Array( rutu.A ), rutu.LDA, new Float64Array( rutu.x ), rutu.strideX ); + dtrmv( data.order, data.uplo, data.trans, data.diag, value, new Float64Array( data.A ), data.LDA, new Float64Array( 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() { - dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), value, new Float64Array( rutu.x ), rutu.strideX ); + dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, new Float64Array( data.A ), value, new Float64Array( 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() { - dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, new Float64Array( rutu.x ), value ); + dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, new Float64Array( data.A ), data.LDA, new Float64Array( 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 Float64Array( rlntnu.A ); - x = new Float64Array( rlntnu.x ); + data = rlntnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( rlntnu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( rlntnu.order, rlntnu.uplo, rlntnu.trans, rlntnu.diag, rlntnu.N, a, rlntnu.LDA, x, rlntnu.strideX ); + out = dtrmv( 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 Float64Array( clntnu.A ); - x = new Float64Array( clntnu.x ); + data = clntnu; - expected = new Float64Array( clntnu.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( clntnu.order, clntnu.uplo, clntnu.trans, clntnu.diag, clntnu.N, a, clntnu.LDA, x, clntnu.strideX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( rltnu.A ); - x = new Float64Array( rltnu.x ); + data = rltnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( rltnu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( rltnu.order, rltnu.uplo, rltnu.trans, rltnu.diag, rltnu.N, a, rltnu.LDA, x, rltnu.strideX ); + out = dtrmv( 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 Float64Array( cltnu.A ); - x = new Float64Array( cltnu.x ); + data = cltnu; - expected = new Float64Array( cltnu.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( cltnu.order, cltnu.uplo, cltnu.trans, cltnu.diag, cltnu.N, a, cltnu.LDA, x, cltnu.strideX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( rlntu.A ); - x = new Float64Array( rlntu.x ); + data = rlntu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( rlntu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( rlntu.order, rlntu.uplo, rlntu.trans, rlntu.diag, rlntu.N, a, rlntu.LDA, x, rlntu.strideX ); + out = dtrmv( 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 Float64Array( clntu.A ); - x = new Float64Array( clntu.x ); + data = clntu; - expected = new Float64Array( clntu.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( clntu.order, clntu.uplo, clntu.trans, clntu.diag, clntu.N, a, clntu.LDA, x, clntu.strideX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( rltu.A ); - x = new Float64Array( rltu.x ); + data = rltu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( rltu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( rltu.order, rltu.uplo, rltu.trans, rltu.diag, rltu.N, a, rltu.LDA, x, rltu.strideX ); + out = dtrmv( 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 Float64Array( cltu.A ); - x = new Float64Array( cltu.x ); + data = cltu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( cltu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( cltu.order, cltu.uplo, cltu.trans, cltu.diag, cltu.N, a, cltu.LDA, x, cltu.strideX ); + out = dtrmv( 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 Float64Array( runtnu.A ); - x = new Float64Array( runtnu.x ); + data = runtnu; - expected = new Float64Array( runtnu.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( runtnu.order, runtnu.uplo, runtnu.trans, runtnu.diag, runtnu.N, a, runtnu.LDA, x, runtnu.strideX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( cuntnu.A ); - x = new Float64Array( cuntnu.x ); + data = cuntnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( cuntnu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( cuntnu.order, cuntnu.uplo, cuntnu.trans, cuntnu.diag, cuntnu.N, a, cuntnu.LDA, x, cuntnu.strideX ); + out = dtrmv( 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 Float64Array( runtu.A ); - x = new Float64Array( runtu.x ); + data = runtu; - expected = new Float64Array( runtu.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( runtu.order, runtu.uplo, runtu.trans, runtu.diag, runtu.N, a, runtu.LDA, x, runtu.strideX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( cuntu.A ); - x = new Float64Array( cuntu.x ); + data = cuntu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( cuntu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( cuntu.order, cuntu.uplo, cuntu.trans, cuntu.diag, cuntu.N, a, cuntu.LDA, x, cuntu.strideX ); + out = dtrmv( 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 Float64Array( rutnu.A ); - x = new Float64Array( rutnu.x ); + data = rutnu; - expected = new Float64Array( rutnu.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( rutnu.order, rutnu.uplo, rutnu.trans, rutnu.diag, rutnu.N, a, rutnu.LDA, x, rutnu.strideX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( cutnu.A ); - x = new Float64Array( cutnu.x ); + data = cutnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( cutnu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( cutnu.order, cutnu.uplo, cutnu.trans, cutnu.diag, cutnu.N, a, cutnu.LDA, x, cutnu.strideX ); + out = dtrmv( 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 Float64Array( rutu.A ); - x = new Float64Array( rutu.x ); + data = rutu; - expected = new Float64Array( rutu.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, a, rutu.LDA, x, rutu.strideX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( cutu.A ); - x = new Float64Array( cutu.x ); + data = cutu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( cutu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( cutu.order, cutu.uplo, cutu.trans, cutu.diag, cutu.N, a, cutu.LDA, x, cutu.strideX ); + out = dtrmv( 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 Float64Array( rxt.A ); - x = new Float64Array( rxt.x ); + data = rxt; - expected = new Float64Array( rxt.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( rxt.order, rxt.uplo, rxt.trans, rxt.diag, rxt.N, a, rxt.LDA, x, rxt.strideX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( cxt.A ); - x = new Float64Array( cxt.x ); + data = cxt; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( cxt.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( cxt.order, cxt.uplo, cxt.trans, cxt.diag, cxt.N, a, cxt.LDA, x, cxt.strideX ); + out = dtrmv( 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 Float64Array( rutu.A ); - x = new Float64Array( rutu.x ); + data = rutu; - out = dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, a, rutu.LDA, x, rutu.strideX ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + out = dtrmv( 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 Float64Array( rutu.A ); - x = new Float64Array( rutu.x ); + data = rutu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( rutu.x ); + expected = new Float64Array( data.x ); - out = dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, 0, a, rutu.LDA, x, rutu.strideX ); + out = dtrmv( 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 Float64Array( cutu.A ); - x = new Float64Array( cutu.x ); + data = cutu; - expected = new Float64Array( cutu.x ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( cutu.order, cutu.uplo, cutu.trans, cutu.diag, 0, a, cutu.LDA, x, cutu.strideX ); + expected = new Float64Array( data.x ); + + out = dtrmv( 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 Float64Array( rxn.A ); - x = new Float64Array( rxn.x ); + data = rxn; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( rxn.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( rxn.order, rxn.uplo, rxn.trans, rxn.diag, rxn.N, a, rxn.LDA, x, rxn.strideX ); + out = dtrmv( 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 Float64Array( cxn.A ); - x = new Float64Array( cxn.x ); + data = cxn; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( cxn.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( cxn.order, cxn.uplo, cxn.trans, cxn.diag, cxn.N, a, cxn.LDA, x, cxn.strideX ); + out = dtrmv( 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 ); diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js index 3e19c22c502d..03863f396a06 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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 // @@ -91,15 +103,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( dtrmv.length, 11, 'returns expected value' ); +tape( 'the function has an arity of 12', function test( t ) { + t.strictEqual( dtrmv.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 +129,18 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - dtrmv( value, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float64Array( rutu.x ), rutu.strideX, rutu.offsetX ); + dtrmv( value, data.uplo, data.trans, data.diag, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( 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 +155,18 @@ tape( 'the function throws an error if provided an invalid second argument', fun function badValue( value ) { return function badValue() { - dtrmv( rutu.order, value, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float64Array( rutu.x ), rutu.strideX, rutu.offsetX ); + dtrmv( data.order, value, data.trans, data.diag, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( 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 +181,18 @@ tape( 'the function throws an error if provided an invalid third argument', func function badValue( value ) { return function badValue() { - dtrmv( rutu.order, rutu.uplo, value, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float64Array( rutu.x ), rutu.strideX, rutu.offsetX ); + dtrmv( data.order, data.uplo, value, data.diag, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( 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 +207,19 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun function badValue( value ) { return function badValue() { - dtrmv( rutu.order, rutu.uplo, rutu.trans, value, rutu.N, new Float64Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float64Array( rutu.x ), rutu.strideX, rutu.offsetX ); + dtrmv( data.order, data.uplo, data.trans, value, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( 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() { - dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, value, new Float64Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float64Array( 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 +232,18 @@ tape( 'the function throws an error if provided an invalid seventh argument', fu function badValue( value ) { return function badValue() { - dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), value, new Float64Array( rutu.x ), rutu.strideX ); + dtrmv( data.order, data.uplo, data.trans, data.diag, value, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( 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 +255,26 @@ tape( 'the function throws an error if provided an invalid tenth argument', func function badValue( value ) { return function badValue() { - dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, new Float64Array( rutu.A ), rutu.LDA, rutu.offsetA, new Float64Array( rutu.x ), value, rutu.offsetX ); + dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( 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 Float64Array( rlntnu.A ); - x = new Float64Array( rlntnu.x ); + data = rlntnu; - expected = new Float64Array( rlntnu.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( rlntnu.order, rlntnu.uplo, rlntnu.trans, rlntnu.diag, rlntnu.N, a, rlntnu.LDA, rlntnu.offsetA, x, rlntnu.strideX, rlntnu.offsetX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 +283,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 Float64Array( clntnu.A ); - x = new Float64Array( clntnu.x ); + data = clntnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( clntnu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( clntnu.order, clntnu.uplo, clntnu.trans, clntnu.diag, clntnu.N, a, clntnu.LDA, clntnu.offsetA, x, clntnu.strideX, clntnu.offsetX ); + out = dtrmv( 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 +304,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 Float64Array( rltnu.A ); - x = new Float64Array( rltnu.x ); + data = rltnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( rltnu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( rltnu.order, rltnu.uplo, rltnu.trans, rltnu.diag, rltnu.N, a, rltnu.LDA, rltnu.offsetA, x, rltnu.strideX, rltnu.offsetX ); + out = dtrmv( 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 +325,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 Float64Array( cltnu.A ); - x = new Float64Array( cltnu.x ); + data = cltnu; - expected = new Float64Array( cltnu.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( cltnu.order, cltnu.uplo, cltnu.trans, cltnu.diag, cltnu.N, a, cltnu.LDA, cltnu.offsetA, x, cltnu.strideX, cltnu.offsetX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 +346,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 Float64Array( rlntu.A ); - x = new Float64Array( rlntu.x ); + data = rlntu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( rlntu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( rlntu.order, rlntu.uplo, rlntu.trans, rlntu.diag, rlntu.N, a, rlntu.LDA, rlntu.offsetA, x, rlntu.strideX, rlntu.offsetX ); + out = dtrmv( 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 +367,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 Float64Array( clntu.A ); - x = new Float64Array( clntu.x ); + data = clntu; - expected = new Float64Array( clntu.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( clntu.order, clntu.uplo, clntu.trans, clntu.diag, clntu.N, a, clntu.LDA, clntu.offsetA, x, clntu.strideX, clntu.offsetX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 +388,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 Float64Array( rltu.A ); - x = new Float64Array( rltu.x ); + data = rltu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( rltu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( rltu.order, rltu.uplo, rltu.trans, rltu.diag, rltu.N, a, rltu.LDA, rltu.offsetA, x, rltu.strideX, rltu.offsetX ); + out = dtrmv( 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 +409,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 Float64Array( cltu.A ); - x = new Float64Array( cltu.x ); + data = cltu; - expected = new Float64Array( cltu.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( cltu.order, cltu.uplo, cltu.trans, cltu.diag, cltu.N, a, cltu.LDA, cltu.offsetA, x, cltu.strideX, cltu.offsetX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 +430,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 Float64Array( runtnu.A ); - x = new Float64Array( runtnu.x ); + data = runtnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( runtnu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( runtnu.order, runtnu.uplo, runtnu.trans, runtnu.diag, runtnu.N, a, runtnu.LDA, runtnu.offsetA, x, runtnu.strideX, runtnu.offsetX ); + out = dtrmv( 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 +451,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 Float64Array( cuntnu.A ); - x = new Float64Array( cuntnu.x ); + data = cuntnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( cuntnu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( cuntnu.order, cuntnu.uplo, cuntnu.trans, cuntnu.diag, cuntnu.N, a, cuntnu.LDA, cuntnu.offsetA, x, cuntnu.strideX, cuntnu.offsetX ); + out = dtrmv( 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 +472,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 Float64Array( runtu.A ); - x = new Float64Array( runtu.x ); + data = runtu; - expected = new Float64Array( runtu.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( runtu.order, runtu.uplo, runtu.trans, runtu.diag, runtu.N, a, runtu.LDA, runtu.offsetA, x, runtu.strideX, runtu.offsetX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 +493,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 Float64Array( cuntu.A ); - x = new Float64Array( cuntu.x ); + data = cuntu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( cuntu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( cuntu.order, cuntu.uplo, cuntu.trans, cuntu.diag, cuntu.N, a, cuntu.LDA, cuntu.offsetA, x, cuntu.strideX, cuntu.offsetX ); + out = dtrmv( 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 +514,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 Float64Array( rutnu.A ); - x = new Float64Array( rutnu.x ); + data = rutnu; - expected = new Float64Array( rutnu.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( rutnu.order, rutnu.uplo, rutnu.trans, rutnu.diag, rutnu.N, a, rutnu.LDA, rutnu.offsetA, x, rutnu.strideX, rutnu.offsetX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 +535,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 Float64Array( cutnu.A ); - x = new Float64Array( cutnu.x ); + data = cutnu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( cutnu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( cutnu.order, cutnu.uplo, cutnu.trans, cutnu.diag, cutnu.N, a, cutnu.LDA, cutnu.offsetA, x, cutnu.strideX, cutnu.offsetX ); + out = dtrmv( 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 +556,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 Float64Array( rutu.A ); - x = new Float64Array( rutu.x ); + data = rutu; - expected = new Float64Array( rutu.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, a, rutu.LDA, rutu.offsetA, x, rutu.strideX, rutu.offsetX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 +577,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 Float64Array( cutu.A ); - x = new Float64Array( cutu.x ); + data = cutu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( cutu.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( cutu.order, cutu.uplo, cutu.trans, cutu.diag, cutu.N, a, cutu.LDA, cutu.offsetA, x, cutu.strideX, cutu.offsetX ); + out = dtrmv( 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 +598,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 Float64Array( rxt.A ); - x = new Float64Array( rxt.x ); + data = rxt; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( rxt.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( rxt.order, rxt.uplo, rxt.trans, rxt.diag, rxt.N, a, rxt.LDA, rxt.offsetA, x, rxt.strideX, rxt.offsetX ); + out = dtrmv( 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 +619,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 Float64Array( cxt.A ); - x = new Float64Array( cxt.x ); + data = cxt; - expected = new Float64Array( cxt.x_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( cxt.order, cxt.uplo, cxt.trans, cxt.diag, cxt.N, a, cxt.LDA, cxt.offsetA, x, cxt.strideX, cxt.offsetX ); + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 +639,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 Float64Array( rutu.A ); - x = new Float64Array( rutu.x ); + data = rutu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, rutu.N, a, rutu.LDA, rutu.offsetA, x, rutu.strideX, rutu.offsetX ); + out = dtrmv( 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 +657,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 Float64Array( rutu.A ); - x = new Float64Array( rutu.x ); + data = rutu; - expected = new Float64Array( rutu.x ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - out = dtrmv( rutu.order, rutu.uplo, rutu.trans, rutu.diag, 0, a, rutu.LDA, rutu.offsetA, x, rutu.strideX, rutu.offsetX ); + expected = new Float64Array( data.x ); + + out = dtrmv( 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,34 +678,292 @@ 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 Float64Array( cutu.A ); - x = new Float64Array( cutu.x ); + data = cutu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( cutu.x ); + expected = new Float64Array( data.x ); - out = dtrmv( cutu.order, cutu.uplo, cutu.trans, cutu.diag, 0, a, cutu.LDA, cutu.offsetA, x, cutu.strideX, cutu.offsetX ); + out = dtrmv( 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' ); t.end(); }); +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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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; + var a; + var x; + + data = rxn; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + + data = cxn; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + + expected = new Float64Array( data.x_out ); + + out = dtrmv( 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 (row-major)', function test( t ) { var expected; + var data; var out; var a; var x; - a = new Float64Array( rxn.A ); - x = new Float64Array( rxn.x ); + data = rcap; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( rxn.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( rxn.order, rxn.uplo, rxn.trans, rxn.diag, rxn.N, a, rxn.LDA, rxn.offsetA, x, rxn.strideX, rxn.offsetX ); + out = dtrmv( 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 +972,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 Float64Array( cxn.A ); - x = new Float64Array( cxn.x ); + data = ccap; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); - expected = new Float64Array( cxn.x_out ); + expected = new Float64Array( data.x_out ); - out = dtrmv( cxn.order, cxn.uplo, cxn.trans, cxn.diag, cxn.N, a, cxn.LDA, cxn.offsetA, x, cxn.strideX, cxn.offsetX ); + out = dtrmv( 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 d1fef4bb237509caae9a790a2ed6ebcf7e0a0081 Mon Sep 17 00:00:00 2001 From: aman-095 Date: Tue, 30 Jul 2024 18:00:55 +0530 Subject: [PATCH 06/13] refactor: update parameter for ndarray, and base implementations, update special test cases for ndarray, and update descriptions --- .../@stdlib/blas/base/dtrmv/README.md | 12 +- .../base/dtrmv/benchmark/benchmark.ndarray.js | 2 +- .../@stdlib/blas/base/dtrmv/docs/repl.txt | 13 +- .../blas/base/dtrmv/docs/types/index.d.ts | 13 +- .../blas/base/dtrmv/docs/types/test.ts | 236 ++++++++---------- .../@stdlib/blas/base/dtrmv/lib/base.js | 36 +-- .../@stdlib/blas/base/dtrmv/lib/dtrmv.js | 8 +- .../@stdlib/blas/base/dtrmv/lib/index.js | 4 +- .../@stdlib/blas/base/dtrmv/lib/ndarray.js | 36 ++- .../@stdlib/blas/base/dtrmv/package.json | 2 +- .../column_major_complex_access_pattern.json | 1 - .../dtrmv/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 - .../row_major_complex_access_pattern.json | 1 - .../dtrmv/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/dtrmv/test/test.ndarray.js | 112 ++++----- 23 files changed, 211 insertions(+), 275 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/README.md b/lib/node_modules/@stdlib/blas/base/dtrmv/README.md index 217613d5e22f..368db21497cf 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/README.md @@ -20,7 +20,7 @@ limitations under the License. # dtrmv -> 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 dtrmv = require( '@stdlib/blas/base/dtrmv' ); #### dtrmv( 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 Float64Array = require( '@stdlib/array/float64' ); @@ -86,9 +86,9 @@ dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); // x0 => [ 1.0, 6.0, 3.0, 1.0 ] ``` -#### dtrmv.ndarray( order, uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox ) +#### dtrmv.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 Float64Array = require( '@stdlib/array/float64' ); @@ -96,7 +96,7 @@ var Float64Array = require( '@stdlib/array/float64' ); var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); +dtrmv.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 Float64Array = require( '@stdlib/array/float64' ); var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); +dtrmv.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/dtrmv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.ndarray.js index 201247c3c824..46840080337b 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/benchmark/benchmark.ndarray.js @@ -62,7 +62,7 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - z = dtrmv( 'row-major', 'upper', 'transpose', 'non-unit', N, A, N, 1, 0, x, 1, 0 ); + z = dtrmv( 'upper', 'transpose', 'non-unit', N, A, N, 1, 0, x, 1, 0 ); if ( isnan( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt index 1bd95dece4e9..279f4b1ab425 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt @@ -1,6 +1,6 @@ {{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`, + 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. @@ -54,8 +54,8 @@ [ 3.0, 1.0 ] -{{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`, +{{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 matrix. @@ -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/float64}}( [ 1.0, 1.0 ] ); > var A = new {{alias:@stdlib/array/float64}}( [ 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/dtrmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts index 269131d0cb4b..99b322082ceb 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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,9 +52,8 @@ interface Routine { ( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float64Array, LDA: number, x: Float64Array, strideX: number ): Float64Array; /** - * 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 `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,14 +73,14 @@ interface Routine { * var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * - * dtrmv.ndarray( row-major', 'upper', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); + * dtrmv.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: Float64Array, LDA: number, x: Float64Array, strideX: number, offsetX: number ): Float64Array; + ndarray( uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float64Array, LDA: number, x: Float64Array, strideX: number, offsetX: number ): Float64Array; } /** -* 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 @@ -109,7 +108,7 @@ interface Routine { * var A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ] ); * var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); * -* dtrmv.ndarray( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); +* dtrmv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 1.0, 5.0, 15.0 ] */ declare var dtrmv: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts index 6a15939238e0..4173edd681ae 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts @@ -186,7 +186,7 @@ import dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectType Float64Array + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectType Float64Array } // The compiler throws an error if the function is provided a first argument which is not a string... @@ -194,14 +194,14 @@ import dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 10, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( true, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( false, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( null, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( undefined, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( [], 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( {}, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( ( x: number ): number => x, 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 10, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( true, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( false, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( null, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( undefined, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( [], 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( {}, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.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 dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 10, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', true, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', false, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', null, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', undefined, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', [], 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', {}, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', ( x: number ): number => x, 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 10, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', true, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', false, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', null, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', undefined, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', [], 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', {}, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.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,149 +224,134 @@ import dtrmv = require( './index' ); const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 10, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', true, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', false, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', null, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', undefined, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', [], 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', {}, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', ( x: number ): number => x, 'unit', 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', true, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', false, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', null, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', undefined, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', [], 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', {}, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.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... -{ - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 10, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', true, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', false, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', null, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', undefined, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', [], 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', {}, 10, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.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... +// The compiler throws an error if the function is provided a fourth argument which is not a number... { const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', '10', A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', true, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', false, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', null, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', undefined, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', [], A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', {}, A, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', ( x: number ): number => x, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', '10', A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', true, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', false, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', null, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', undefined, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', [], A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', {}, A, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.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 sixth argument which is not a Float64Array... +// The compiler throws an error if the function is provided a fifth argument which is not a Float64Array... { const x = new Float64Array( 10 ); - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, 10, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, '10', 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, true, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, false, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, null, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, undefined, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, [ '1' ], 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, {}, 10, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, ( x: number ): number => x, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, 10, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, '10', 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, true, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, false, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, null, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, undefined, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, [ '1' ], 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, {}, 10, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.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 seventh argument which is not a number... +// The compiler throws an error if the function is provided a sixth argument which is not a number... { const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, '10', 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, true, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, false, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, null, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, undefined, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, [], 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, {}, 1, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, ( x: number ): number => x, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, '10', 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, true, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, false, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, null, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, undefined, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, [], 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, {}, 1, 0, x, 1, 0 ); // $ExpectError + dtrmv.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 eighth argument which is not a number... +// The compiler throws an error if the function is provided a seventh argument which is not a number... { const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, '10', 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, true, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, false, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, null, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, undefined, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, [], 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, {}, 0, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, ( x: number ): number => x, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, '10', 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, true, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, false, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, null, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, undefined, 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, [], 0, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, {}, 0, x, 1, 0 ); // $ExpectError + dtrmv.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 ninth 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 Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, '10', x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, true, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, false, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, null, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, undefined, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, [], x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, {}, x, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, ( x: number ): number => x, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, '10', x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, true, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, false, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, null, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, undefined, x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, [], x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, {}, x, 1, 0 ); // $ExpectError + dtrmv.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 Float64Array... +// The compiler throws an error if the function is provided a ninth argument which is not a Float64Array... { const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, 10, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, '10', 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, true, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, false, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, null, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, undefined, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, [ '1' ], 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, {}, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, ( x: number ): number => x, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, 10, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, '10', 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, true, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, false, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, null, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, undefined, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, [ '1' ], 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, {}, 1, 0 ); // $ExpectError + dtrmv.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 Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, '10', 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, true, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, false, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, null, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, undefined, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, [], 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, {}, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, ( x: number ): number => x, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, '10', 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, true, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, false, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, null, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, undefined, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, [], 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, {}, 0 ); // $ExpectError + dtrmv.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 an eleventh argument which is not a number... { const x = new Float64Array( 10 ); const A = new Float64Array( 20 ); - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, '10' ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, true ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, false ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, null ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, undefined ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, [] ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, {} ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, ( x: number ): number => x ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, '10' ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, true ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, false ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, null ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, undefined ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, [] ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, {} ); // $ExpectError + dtrmv.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 dtrmv = require( './index' ); const A = new Float64Array( 20 ); dtrmv.ndarray(); // $ExpectError - dtrmv.ndarray( 'row-major' ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper' ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose' ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit' ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1 ); // $ExpectError - dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0, 10 ); // $ExpectError + dtrmv.ndarray( 'upper' ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose' ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit' ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1 ); // $ExpectError + dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 10, A, 10, 1, 0, x, 1, 0, 10 ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js index 39ed9cb6e97e..45646a3998ca 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js @@ -18,12 +18,16 @@ 'use strict'; +// MODULES // + +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); + + // 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 * @param {string} trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed * @param {string} diag - specifies whether `A` has a unit diagonal @@ -43,13 +47,12 @@ * var A = new Float64Array( [ 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 Float64Array( [ 1.0, 2.0, 3.0 ] ); * -* dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); +* dtrmv( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ -function dtrmv( order, uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX, offsetX ) { // eslint-disable-line max-params, max-len - var isRowMajor; - var isColMajor; +function dtrmv( 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; @@ -62,11 +65,10 @@ function dtrmv( 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' ); + isrm = isRowMajor( [ strideA1, strideA2 ] ); nonunit = ( diag === 'non-unit' ); - if ( isRowMajor ) { + 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 @@ -78,8 +80,8 @@ function dtrmv( 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' ) + ( !isrm && trans === 'no-transpose' && uplo === 'upper' ) || + ( isrm && trans !== 'no-transpose' && uplo === 'lower' ) ) { ix1 = ox; for ( i1 = 0; i1 < N; i1++ ) { @@ -100,8 +102,8 @@ function dtrmv( 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' ) + ( !isrm && trans === 'no-transpose' && uplo === 'lower' ) || + ( isrm && trans !== 'no-transpose' && uplo === 'upper' ) ) { ox += ( N - 1 ) * strideX; ix1 = ox; @@ -123,8 +125,8 @@ function dtrmv( 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' ) + ( !isrm && trans !== 'no-transpose' && uplo === 'upper' ) || + ( isrm && trans === 'no-transpose' && uplo === 'lower' ) ) { ix1 = ox + ( ( N - 1 ) * strideX ); for ( i1 = N-1; i1 >= 0; i1-- ) { @@ -144,8 +146,8 @@ function dtrmv( 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' ) + ( !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/dtrmv/lib/dtrmv.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.js index 993abc3ea30b..b16b0048a7bd 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.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' ); @@ -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 @@ -99,7 +99,7 @@ function dtrmv( 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/dtrmv/lib/index.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/index.js index 75dec73d4dc4..e6cc7d7d20d1 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv * @@ -40,7 +40,7 @@ * var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] ); * var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * -* dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); +* dtrmv.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/dtrmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js index 0aec498bba1d..fdb3c6f9d4f3 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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' ); @@ -31,9 +30,8 @@ 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 * @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 {Float64Array} 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 {Float64Array} `x` * * @example @@ -59,32 +56,29 @@ var base = require( './base.js' ); * var A = new Float64Array( [ 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 Float64Array( [ 1.0, 2.0, 3.0 ] ); * -* dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); +* dtrmv( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 ); * // x => [ 14.0, 8.0, 3.0 ] */ -function dtrmv( 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 dtrmv( 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/dtrmv/package.json b/lib/node_modules/@stdlib/blas/base/dtrmv/package.json index a61534fb43fe..1ce52bfa1581 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/package.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/base/dtrmv", "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", diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_complex_access_pattern.json index 27a2e9cc91e8..fbfeb4e86d8f 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_complex_access_pattern.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_oa.json index 8513fc653ed3..d2c2ab29e078 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_oa.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1_sa2.json index f83b9134b59b..3653ba1b270a 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1_sa2n.json index b911bab43e9f..69a3f6b4166a 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1n_sa2.json index 09ebe2c83fd6..5262cb1d4dab 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1n_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1n_sa2n.json index c41ec6f24164..9e26fe112a9c 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/column_major_sa1n_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_complex_access_pattern.json index 54d4b4ec9805..c2aed04ac974 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_complex_access_pattern.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_oa.json index f334c8f70992..fdbc41a79943 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_oa.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1_sa2.json index 1d64b7029d7e..bd2a70b57393 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1_sa2n.json index ac74875f17ea..87d036861387 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1n_sa2.json index 93f0200157b6..954c9c09556a 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1n_sa2.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1n_sa2n.json index 9f320ee1adad..44d83b8a3bf7 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/fixtures/row_major_sa1n_sa2n.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js index 03863f396a06..94230df5fc36 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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( dtrmv.length, 12, 'returns expected value' ); +tape( 'the function has an arity of 11', function test( t ) { + t.strictEqual( dtrmv.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() { - dtrmv( value, data.uplo, data.trans, data.diag, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); + dtrmv( value, data.trans, data.diag, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( 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() { - dtrmv( data.order, value, data.trans, data.diag, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); + dtrmv( data.uplo, value, data.diag, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( 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() { - dtrmv( data.order, data.uplo, value, data.diag, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); + dtrmv( data.uplo, data.trans, value, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( 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() { - dtrmv( data.order, data.uplo, data.trans, value, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( 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() { - dtrmv( data.order, data.uplo, data.trans, data.diag, value, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX ); + dtrmv( data.uplo, data.trans, data.diag, value, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( 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() { - dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), value, data.offsetX ); + dtrmv( data.uplo, data.trans, data.diag, data.N, new Float64Array( data.A ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.A ); x = new Float64Array( data.x ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, 0, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, 0, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 Float64Array( data.x_out ); - out = dtrmv( data.order, data.uplo, data.trans, data.diag, data.N, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX ); + out = dtrmv( 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 1228f69a31f68bb972e3a3f39564d9600591ec60 Mon Sep 17 00:00:00 2001 From: aman-095 Date: Tue, 30 Jul 2024 18:04:30 +0530 Subject: [PATCH 07/13] docs: update descriptions --- lib/node_modules/@stdlib/blas/base/dtrmv/README.md | 2 +- lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt | 2 +- lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/README.md b/lib/node_modules/@stdlib/blas/base/dtrmv/README.md index 368db21497cf..5491910065c3 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/README.md @@ -88,7 +88,7 @@ dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 ); #### dtrmv.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 Float64Array = require( '@stdlib/array/float64' ); diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt index 279f4b1ab425..59965c0e8899 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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/dtrmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts index 99b322082ceb..d0d9a8e0740f 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts @@ -52,7 +52,7 @@ interface Routine { ( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float64Array, LDA: number, x: Float64Array, strideX: number ): Float64Array; /** - * 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 From e6d62f4a21255c253bc494a9b07b6fd70c1249ef Mon Sep 17 00:00:00 2001 From: aman-095 Date: Thu, 1 Aug 2024 13:22:06 +0530 Subject: [PATCH 08/13] chore: apply review changes --- .../@stdlib/blas/base/dtrmv/README.md | 13 ++-- .../@stdlib/blas/base/dtrmv/docs/repl.txt | 4 +- .../blas/base/dtrmv/docs/types/index.d.ts | 2 +- .../@stdlib/blas/base/dtrmv/examples/index.js | 7 ++- .../@stdlib/blas/base/dtrmv/lib/base.js | 37 ++++++------ .../@stdlib/blas/base/dtrmv/lib/dtrmv.js | 4 +- .../@stdlib/blas/base/dtrmv/lib/ndarray.js | 2 +- .../@stdlib/blas/base/dtrmv/package.json | 2 +- .../blas/base/dtrmv/test/test.dtrmv.js | 42 ++++++------- .../blas/base/dtrmv/test/test.ndarray.js | 60 +++++++++---------- 10 files changed, 88 insertions(+), 85 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/README.md b/lib/node_modules/@stdlib/blas/base/dtrmv/README.md index 5491910065c3..5a4f30f9aab1 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/README.md +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/README.md @@ -20,7 +20,7 @@ limitations under the License. # dtrmv -> 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`.
@@ -127,7 +127,7 @@ dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 ); ## Notes -- `dtrmv()` corresponds to the [BLAS][blas] level 2 function [`dtrmv`][dtrmv]. +- `dtrmv()` corresponds to the [BLAS][blas] level 2 function [`dtrmv`][blas-dtrmv].
@@ -147,12 +147,15 @@ var opts = { 'dtype': 'float64' }; -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 ); -dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); +dtrmv( 'column-major', 'upper', 'no-transpose', 'unit', N, A, N, x, 1 ); +console.log( x ); + +dtrmv.ndarray( 'upper', 'no-transpose', 'unit', N, A, 1, N, 0, x, 1, 0 ); console.log( x ); ``` @@ -244,7 +247,7 @@ TODO [blas]: http://www.netlib.org/blas -[dtrmv]: https://www.netlib.org/lapack/explore-html/d6/d1c/group__trmv_ga7b90369d2b2b19f78f168e10dd9eb8ad.html#ga7b90369d2b2b19f78f168e10dd9eb8ad +[blas-dtrmv]: https://www.netlib.org/lapack/explore-html/d6/d1c/group__trmv_ga7b90369d2b2b19f78f168e10dd9eb8ad.html#ga7b90369d2b2b19f78f168e10dd9eb8ad [mdn-float64array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt index 59965c0e8899..64b772a891b6 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt @@ -44,7 +44,7 @@ Returns ------- x: Float64Array - Output vector. + Input vector. Examples -------- @@ -103,7 +103,7 @@ Returns ------- x: Float64Array - Output array. + Input vector. Examples -------- diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts index d0d9a8e0740f..81e994ec3414 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts @@ -76,7 +76,7 @@ interface Routine { * dtrmv.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: Float64Array, LDA: number, x: Float64Array, strideX: number, offsetX: number ): Float64Array; + ndarray( uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number, x: Float64Array, strideX: number, offsetX: number ): Float64Array; } /** diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/examples/index.js b/lib/node_modules/@stdlib/blas/base/dtrmv/examples/index.js index 470aacbfba7c..79ad63ee3232 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/examples/index.js @@ -25,10 +25,13 @@ var opts = { 'dtype': 'float64' }; -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 ); -dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x, 1 ); +dtrmv( 'column-major', 'upper', 'no-transpose', 'unit', N, A, N, x, 1 ); +console.log( x ); + +dtrmv.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/dtrmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js index 45646a3998ca..e4e67c5c38c6 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js @@ -28,6 +28,7 @@ var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); /** * 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 @@ -77,8 +78,8 @@ function dtrmv( 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' ) @@ -145,27 +146,23 @@ function dtrmv( 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 *= A[ oa+(sa0*i1) ]; - } - for ( i0 = i1+1; i0 < N; i0++ ) { - ix0 += strideX; - tmp += ( 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 *= A[ oa+(sa0*i1) ]; } - return x; + for ( i0 = i1+1; i0 < N; i0++ ) { + ix0 += strideX; + tmp += ( x[ ix0 ] * A[ oa+(sa0*i0) ] ); + } + x[ ix1 ] = tmp; + ix1 += strideX; } + return x; } diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.js index b16b0048a7bd..987510e68c17 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/dtrmv.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 {Float64Array} 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 diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js index fdb3c6f9d4f3..9036d43cb702 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/ndarray.js @@ -43,7 +43,7 @@ var base = require( './base.js' ); * @param {Float64Array} 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/dtrmv/package.json b/lib/node_modules/@stdlib/blas/base/dtrmv/package.json index 1ce52bfa1581..ecf9053fd047 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/package.json +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/base/dtrmv", "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", diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.dtrmv.js b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.dtrmv.js index 078293205d78..18bdc4c9e8e8 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.dtrmv.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.dtrmv.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, none, 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, none, 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, none, 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, none, 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, none, 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, none, 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, none, 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, none, 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 speciying 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 speciying 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; diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js index 94230df5fc36..9e4c9ea153f4 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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; @@ -797,7 +797,7 @@ tape( 'the function supports a negative `strideA2` parameter (column-major)', fu t.end(); }); -tape( 'the function supports negative strides for `A` (row-major)', function test( t ) { +tape( 'the function supports negative strides for both dimensions of `A` (row-major)', function test( t ) { var expected; var data; var out; @@ -818,7 +818,7 @@ tape( 'the function supports negative strides for `A` (row-major)', function tes t.end(); }); -tape( 'the function supports negative strides for `A` (column-major)', function test( t ) { +tape( 'the function supports negative strides for both dimensions 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; From 9e899f840e78d2f9493a1789629e3faf38092a10 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Thu, 1 Aug 2024 13:11:11 -0700 Subject: [PATCH 09/13] style: remove extra parentheses --- lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js index e4e67c5c38c6..b137a81fde7f 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/lib/base.js @@ -91,7 +91,7 @@ function dtrmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX oa = offsetA + (sa1*i1); ix0 = ox; for ( i0 = 0; i0 < i1; i0++ ) { - x[ ix0 ] += ( tmp * A[ oa+(sa0*i0) ] ); + x[ ix0 ] += tmp * A[ oa+(sa0*i0) ]; ix0 += strideX; } if ( nonunit ) { @@ -114,7 +114,7 @@ function dtrmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX oa = offsetA + (sa1*i1); ix0 = ox; for ( i0 = N-1; i0 > i1; i0-- ) { - x[ ix0 ] += ( tmp * A[ oa+(sa0*i0) ] ); + x[ ix0 ] += tmp * A[ oa+(sa0*i0) ]; ix0 -= strideX; } if ( nonunit ) { @@ -139,7 +139,7 @@ function dtrmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX } for ( i0 = i1-1; i0 >= 0; i0-- ) { ix0 -= strideX; - tmp += ( x[ ix0 ] * A[ oa+(sa0*i0) ] ); + tmp += x[ ix0 ] * A[ oa+(sa0*i0) ]; } x[ ix1 ] = tmp; ix1 -= strideX; @@ -157,7 +157,7 @@ function dtrmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX } for ( i0 = i1+1; i0 < N; i0++ ) { ix0 += strideX; - tmp += ( x[ ix0 ] * A[ oa+(sa0*i0) ] ); + tmp += x[ ix0 ] * A[ oa+(sa0*i0) ]; } x[ ix1 ] = tmp; ix1 += strideX; From c4107bd0e8cb1fc6516f804ef65ea345d96d270b Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Thu, 1 Aug 2024 13:13:21 -0700 Subject: [PATCH 10/13] test: fix grammar --- lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts index 4173edd681ae..2b1d14fd827d 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/test.ts @@ -134,7 +134,7 @@ import dtrmv = require( './index' ); dtrmv( '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 Float64Array... +// The compiler throws an error if the function is provided an eighth argument which is not a Float64Array... { const A = new Float64Array( 20 ); From 2f9d4adf34f3368a0108508587d12dd155b194d7 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Thu, 1 Aug 2024 13:14:46 -0700 Subject: [PATCH 11/13] style: fix line wrapping --- lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt index 64b772a891b6..b171e52b1849 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt @@ -19,8 +19,8 @@ Specifies whether `A` is an upper or lower triangular matrix. trans: string - Specifies whether `A` should be transposed, conjugate-transposed, or - not transposed. + Specifies whether `A` should be transposed, conjugate-transposed, or not + transposed. diag: string Specifies whether `A` has a unit diagonal. @@ -70,8 +70,8 @@ Specifies whether `A` is an upper or lower triangular matrix. trans: string - Specifies whether `A` should be transposed, conjugate-transposed, or - not transposed. + Specifies whether `A` should be transposed, conjugate-transposed, or not + transposed. diag: string Specifies whether `A` has a unit diagonal. From 7bdd25405db3b632ca49297d59fbd7e32394207c Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Thu, 1 Aug 2024 13:17:44 -0700 Subject: [PATCH 12/13] test: update descriptions --- .../blas/base/dtrmv/test/test.dtrmv.js | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.dtrmv.js b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.dtrmv.js index 18bdc4c9e8e8..7f8351f0f026 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.dtrmv.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.dtrmv.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 operations `x = A*x`, or `x = A^T*x` (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 operations `x = A*x`, or ` t.end(); }); -tape( 'the function performs one of the matrix-vector operations `x = A*x`, or `x = A^T*x` (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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -tape( 'the function performs one of the matrix-vector operations `x = A*x`, or `x = A^T*x` (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 operations `x = A*x`, or ` t.end(); }); -tape( 'the function performs one of the matrix-vector operations `x = A*x`, or `x = A^T*x` (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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -tape( 'the function performs one of the matrix-vector operations `x = A*x`, or `x = A^T*x` (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 operations `x = A*x`, or ` t.end(); }); -tape( 'the function performs one of the matrix-vector operations `x = A*x`, or `x = A^T*x` (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 operations `x = A*x`, or ` t.end(); }); -tape( 'the function performs one of the matrix-vector operations `x = A*x`, or `x = A^T*x` (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 operations `x = A*x`, or ` t.end(); }); -tape( 'the function performs one of the matrix-vector operations `x = A*x`, or `x = A^T*x` (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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -tape( 'the function supports speciying an `x` stride (row-major)', 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 supports speciying an `x` stride (row-major)', function test t.end(); }); -tape( 'the function supports speciying an `x` stride (column-major)', function test( t ) { +tape( 'the function supports specifying an `x` stride (column-major)', function test( t ) { var expected; var data; var out; From f130666262f80120e16ad986d06e06b786c81ff7 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Thu, 1 Aug 2024 13:19:33 -0700 Subject: [PATCH 13/13] test: update descriptions --- .../blas/base/dtrmv/test/test.ndarray.js | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js index 9e4c9ea153f4..34c08cbbb68c 100644 --- a/lib/node_modules/@stdlib/blas/base/dtrmv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dtrmv/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 operations `x = A*x`, or `x = A^T*x` (row-major, lower, no-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, 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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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 operations `x = A*x`, or ` t.end(); }); -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 ) { +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; @@ -671,7 +671,7 @@ tape( 'if `N` is zero, the function returns the input vector unchanged (column-m t.end(); }); -tape( 'the function supports specifying stride of the first and second dimensions of `A` (row-major)', function test( t ) { +tape( 'the function supports specifying the strides 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 second dimension t.end(); }); -tape( 'the function supports specifying stride of the first and second dimensions of `A` (column-major)', function test( t ) { +tape( 'the function supports specifying the strides of the first and second dimensions of `A` (column-major)', function test( t ) { var expected; var data; var out;