diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/README.md b/lib/node_modules/@stdlib/blas/base/ssymv/README.md index b2bc397b90d1..408dd6d45227 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/README.md +++ b/lib/node_modules/@stdlib/blas/base/ssymv/README.md @@ -20,7 +20,7 @@ limitations under the License. # ssymv -> Perform the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. +> Perform the matrix-vector operation `y = α*A*x + β*y`.
@@ -37,12 +37,12 @@ Performs the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are ```javascript var Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +var A = new Float32Array( [ 1.0, 4.0, 5.0, 4.0, 2.0, 6.0, 5.0, 6.0, 3.0 ] ); var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); ssymv( 'row-major', 'lower', 3, 1.0, A, 3, x, 1, 0.0, y, 1 ); -// y => [ 1.0, 2.0, 3.0 ] +// y => [ 10.0, 12.0, 14.0 ] ``` The function has the following parameters: @@ -54,22 +54,22 @@ The function has the following parameters: - **A**: input matrix stored in linear memory as a [`Float32Array`][mdn-float32array]. - **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`). - **x**: input [`Float32Array`][mdn-float32array]. -- **sx**: index increment for `x`. +- **sx**: stride length for `x`. - **β**: scalar constant. - **y**: output [`Float32Array`][mdn-float32array]. -- **sy**: index increment for `y`. +- **sy**: stride length for `y`. The stride parameters determine how elements in the input arrays are accessed at runtime. For example, to iterate over the elements of `x` in reverse order, ```javascript var Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +var A = new Float32Array( [ 1.0, 4.0, 5.0, 4.0, 2.0, 6.0, 5.0, 6.0, 3.0 ] ); +var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); -ssymv( 'row-major', 'upper', 3, 2.0, A, 3, x, -1, 1.0, y, 1 ); -// y => [ 7.0, 10.0, 9.0 ] +ssymv( 'row-major', 'upper', 3, 1.0, A, 3, x, -1, 1.0, y, 1 ); +// y => [ 10.0, 12.0, 14.0 ] ``` Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views. @@ -80,35 +80,38 @@ Note that indexing is relative to the first index. To introduce an offset, use [ var Float32Array = require( '@stdlib/array/float32' ); // Initial arrays... -var x0 = new Float32Array( [ 1.0, 1.0, 1.0, 1.0 ] ); -var y0 = new Float32Array( [ 1.0, 1.0, 1.0, 1.0 ] ); -var A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +var x0 = new Float32Array( [ 0.0, 1.0, 1.0, 1.0 ] ); +var y0 = new Float32Array( [ 0.0, 0.0, 0.0, 0.0 ] ); +var A = new Float32Array( [ 1.0, 4.0, 5.0, 4.0, 2.0, 6.0, 5.0, 6.0, 3.0 ] ); // Create offset views... var x1 = new Float32Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element var y1 = new Float32Array( y0.buffer, y0.BYTES_PER_ELEMENT*1 ); // start at 2nd element ssymv( 'row-major', 'upper', 3, 1.0, A, 3, x1, -1, 1.0, y1, -1 ); -// y0 => [ 1.0, 4.0, 3.0, 2.0 ] +// y0 => [ 0.0, 14.0, 12.0, 10.0 ] ``` -#### ssymv.ndarray( order, uplo, N, α, A, LDA, x, sx, ox, β, y, sy, oy ) +#### ssymv.ndarray( uplo, N, α, A, sa1, sa2, oa, x, sx, ox, β, y, sy, oy ) Performs the matrix-vector operation `y = α*A*x + β*y` using alternative indexing semantics and where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. ```javascript var Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); -var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); -var y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); +var A = new Float32Array( [ 1.0, 4.0, 5.0, 4.0, 2.0, 6.0, 5.0, 6.0, 3.0 ] ); +var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); -ssymv.ndarray( 'row-major', 'upper', 3, 2.0, A, 3, x, -1, 2, 1.0, y, 1, 0 ); -// y => [ 7.0, 10.0, 9.0 ] +ssymv.ndarray( 'upper', 3, 1.0, A, 3, 1, 0, x, -1, 2, 1.0, y, 1, 0 ); +// y => [ 10.0, 12.0, 14.0 ] ``` The function has the following additional parameters: +- **sa1**: stride for the first dimension of `A`. +- **sa2**: stride for the second dimension of `A`. +- **oa**: starting index for `A`. - **ox**: starting index for `x`. - **oy**: starting index for `y`. @@ -117,12 +120,12 @@ While [`typed array`][mdn-typed-array] views mandate a view offset based on the ```javascript var Float32Array = require( '@stdlib/array/float32' ); -var A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +var A = new Float32Array( [ 1.0, 4.0, 5.0, 4.0, 2.0, 6.0, 5.0, 6.0, 3.0 ] ); var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); -var y = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); -ssymv.ndarray( 'row-major', 'lower', 3, 1.0, A, 3, x, -1, 2, 1.0, y, -1, 2 ); -// y => [ 4.0, 3.0, 2.0 ] +ssymv.ndarray( 'lower', 3, 1.0, A, 3, 1, 0, x, -1, 2, 1.0, y, -1, 2 ); +// y => [ 14.0, 12.0, 10.0 ] ```
@@ -154,13 +157,16 @@ var opts = { 'dtype': 'float32' }; -var N = 3; +var N = 5; var A = ones( N*N, opts.dtype ); var x = discreteUniform( N, 0, 255, opts ); var y = discreteUniform( N, 0, 255, opts ); -ssymv.ndarray( 'row-major', 'upper', N, 1.0, A, N, x, 1, 0, 1.0, y, 1, 0 ); +ssymv( 'row-major', 'upper', N, 1.0, A, N, x, 1, 1.0, y, 1 ); +console.log( y ); + +ssymv.ndarray( 'upper', N, 1.0, A, N, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); console.log( y ); ``` @@ -252,7 +258,7 @@ TODO [blas]: http://www.netlib.org/blas -[ssymv]: https://netlib.org/lapack/explore-html/d2/d94/ssymv_8f.html +[ssymv]: https://www.netlib.org/lapack/explore-html/db/d17/group__hemv_ga8990fe737209f3401522103c85016d27.html#ga8990fe737209f3401522103c85016d27 [mdn-float32array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/ssymv/benchmark/benchmark.ndarray.js index e1c4c3bf6332..11b6a2f72b38 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ssymv/benchmark/benchmark.ndarray.js @@ -64,7 +64,7 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - z = ssymv( 'row-major', 'upper', N, 1.0, A, N, x, 1, 0, 1.0, y, 1, 0 ); + z = ssymv( 'upper', N, 1.0, A, N, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); if ( isnanf( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/ssymv/docs/repl.txt index cba8d7ca8e50..27a8fd1648bf 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/ssymv/docs/repl.txt @@ -28,7 +28,7 @@ Scalar constant. A: Float32Array - Matrix. + Input matrix. lda: integer Stride of the first dimension of `A` (a.k.a., leading dimension of the @@ -63,7 +63,7 @@ [ 4.0, 4.0 ] -{{alias}}.ndarray( order, uplo, N, α, A, lda, x, sx, ox, β, y, sy, oy ) +{{alias}}.ndarray( uplo, N, α, A, sa1, sa2, oa, x, sx, ox, β, y, sy, oy ) Performs the matrix-vector operation `y = α*A*x + β*y` using alternative indexing semantics and where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. @@ -74,10 +74,6 @@ Parameters ---------- - order: 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`. Must be either 'upper' or 'lower'. @@ -89,11 +85,16 @@ Scalar constant. A: Float32Array - Matrix. + Input matrix. - lda: integer - Stride of the first dimension of `A` (a.k.a., leading dimension of the - matrix `A`). + sa1: integer + Stride for the first dimension of `A`. + + sa2: integer + Stride for the second dimension of `A`. + + oa: integer + Starting index for `A`. x: Float32Array Input vector. @@ -126,8 +127,7 @@ > var x = new {{alias:@stdlib/array/float32}}( [ 1.0, 1.0 ] ); > var y = new {{alias:@stdlib/array/float32}}( [ 1.0, 1.0 ] ); > var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 2.0, 1.0 ] ); - > var ord = 'row-major'; - > {{alias}}.ndarray( ord, 'upper', 2, 1.0, A, 2, x, 1, 0, 1.0, y, 1, 0 ) + > {{alias}}.ndarray( 'upper', 2, 1.0, A, 2, 1, 0, x, 1, 0, 1.0, y, 1, 0 ) [ 4.0, 4.0 ] See Also diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/ssymv/docs/types/index.d.ts index 2904b29e9e46..8af73d1f76fb 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/ssymv/docs/types/index.d.ts @@ -27,13 +27,13 @@ import { Layout, MatrixTriangle } from '@stdlib/types/blas'; */ interface Routine { /** - * Performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. + * Performs the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. * * @param order - storage layout - * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced + * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param N - number of elements along each dimension in the matrix `A` * @param alpha - scalar constant - * @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 strideX - `x` stride length @@ -55,21 +55,23 @@ interface Routine { ( order: Layout, uplo: MatrixTriangle, N: number, alpha: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number, beta: number, y: Float32Array, strideY: number ): Float32Array; /** - * Performs the matrix-vector operation `y = alpha*A*x + beta*y` using alternative indexing semantics and where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. + * Performs the matrix-vector operation `y = α*A*x + β*y`, using alternative indexing semantics and where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. * * @param order - storage layout * @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param N - number of elements along each dimension in the matrix `A` * @param alpha - scalar constant - * @param A - matrix - * @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) + * @param A - input + * @param strideA1 - stride for the first dimension of `A` + * @param strideA2 - stride for the second dimension of `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` * @param beta - scalar constant * @param y - second input array * @param strideY - `y` stride length - * @param offsetY - starting `y` index + * @param offsetY - starting index for `y` * @returns `y` * * @example @@ -79,20 +81,20 @@ interface Routine { * var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); * - * ssymv.ndarray( 'row-major', 'lower', 3, 1.0, A, 3, x, 1, 0, 0.0, y, 1, 0 ); + * ssymv.ndarray( 'lower', 3, 1.0, A, 3, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); * // y => [ 1.0, 2.0, 3.0 ] */ - ndarray( order: Layout, uplo: MatrixTriangle, N: number, alpha: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number, offsetX: number, beta: number, y: Float32Array, strideY: number, offsetY: number ): Float32Array; + ndarray( uplo: MatrixTriangle, N: number, alpha: number, A: Float32Array, strideA1: number, strideA2: number, offsetA: number, x: Float32Array, strideX: number, offsetX: number, beta: number, y: Float32Array, strideY: number, offsetY: number ): Float32Array; } /** -* Performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. +* Performs the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. * * @param order - storage layout -* @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is to be referenced +* @param uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param N - number of elements along each dimension in the matrix `A` * @param alpha - scalar constant -* @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 strideX - `x` stride length @@ -118,7 +120,7 @@ interface Routine { * var x = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * var y = new Float32Array( [ 1.0, 2.0, 3.0 ] ); * -* ssymv.ndarray( 'row-major', 'upper', 3, 2.0, A, 3, x, 1, 0, 1.0, y, 2, 0 ); +* ssymv.ndarray( 'upper', 3, 2.0, A, 3, 1, 0, x, 1, 0, 1.0, y, 2, 0 ); * // y => [ 3.0, 2.0, 11.0 ] */ declare var ssymv: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/ssymv/docs/types/test.ts index 226e81ebcf35..47a6a9aa79fd 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/ssymv/docs/types/test.ts @@ -23,34 +23,34 @@ import ssymv = require( './index' ); // The function returns a Float32Array... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectType Float32Array + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectType Float32Array } // The compiler throws an error if the function is provided a first argument which is not a string... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv( 10, 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( true, 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( false, 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( null, 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( undefined, 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( [], 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( {}, 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( ( x: number ): number => x, 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv( 10, 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( true, 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( false, 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( null, 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( undefined, 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( [], 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( {}, 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( ( x: number ): number => x, 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a second argument which is not a string... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); ssymv( 'row-major', 10, 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError ssymv( 'row-major', true, 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError @@ -64,9 +64,9 @@ import ssymv = require( './index' ); // The compiler throws an error if the function is provided a third argument which is not a number... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); ssymv( 'row-major', 'upper', '10', 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError ssymv( 'row-major', 'upper', true, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError @@ -80,387 +80,404 @@ import ssymv = require( './index' ); // The compiler throws an error if the function is provided a fourth argument which is not a number... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv( 'row-major', 'upper', 10, '10', A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, true, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, false, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, null, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, undefined, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, [], A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, {}, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, ( x: number ): number => x, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv( 'row-major', 'upper', 5, '10', A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, true, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, false, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, null, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, undefined, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, [], A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, {}, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, ( x: number ): number => x, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a fifth argument which is not a Float32Array... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - - ssymv( 'row-major', 'upper', 10, 1.0, 10, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, '10', 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, true, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, false, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, null, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, undefined, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, [ '1' ], 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, {}, 10, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, ( x: number ): number => x, 10, x, 1, 1.0, y, 1 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + + ssymv( 'row-major', 'upper', 5, 1.0, 10, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, '10', 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, true, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, false, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, null, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, undefined, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, [ '1' ], 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, {}, 10, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, ( x: number ): number => x, 10, x, 1, 1.0, y, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a sixth argument which is not a number... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv( 'row-major', 'upper', 10, 1.0, A, '10', x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, true, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, false, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, null, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, undefined, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, [], x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, {}, x, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, ( x: number ): number => x, x, 1, 1.0, y, 1 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv( 'row-major', 'upper', 5, 1.0, A, '10', x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, true, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, false, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, null, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, undefined, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, [], x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, {}, x, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, ( x: number ): number => x, x, 1, 1.0, y, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a seventh argument which is not a Float32Array... { - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, 10, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, '10', 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, true, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, false, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, null, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, undefined, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, [ '1' ], 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, {}, 1, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, ( x: number ): number => x, 1, 1.0, y, 1 ); // $ExpectError + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, 10, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, '10', 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, true, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, false, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, null, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, undefined, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, [ '1' ], 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, {}, 1, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, ( x: number ): number => x, 1, 1.0, y, 1 ); // $ExpectError } // The compiler throws an error if the function is provided an eighth argument which is not a number... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, '10', 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, true, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, false, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, null, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, undefined, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, [], 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, {}, 1.0, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, ( x: number ): number => x, 1.0, y, 1 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, '10', 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, true, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, false, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, null, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, undefined, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, [], 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, {}, 1.0, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, ( x: number ): number => x, 1.0, y, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a ninth argument which is not a number... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, '10', y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, true, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, false, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, null, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, undefined, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, [], y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, {}, y, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, ( x: number ): number => x, y, 1 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, '10', y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, true, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, false, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, null, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, undefined, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, [], y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, {}, y, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, ( x: number ): number => x, y, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a tenth argument which is not a Float32Array... { - const x = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, 10, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, '10', 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, true, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, false, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, null, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, undefined, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, [ '1' ], 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, {}, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, ( x: number ): number => x, 1 ); // $ExpectError + const x = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, 10, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, '10', 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, true, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, false, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, null, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, undefined, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, [ '1' ], 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, {}, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, ( x: number ): number => x, 1 ); // $ExpectError } // The compiler throws an error if the function is provided an eleventh argument which is not a number... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, '10' ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, true ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, false ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, null ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, undefined ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, [] ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, {} ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, ( x: number ): number => x ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, '10' ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, true ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, false ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, null ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, undefined ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, [] ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, {} ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the function is provided an unsupported number of arguments... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); ssymv(); // $ExpectError ssymv( 'row-major' ); // $ExpectError ssymv( 'row-major', 'upper' ); // $ExpectError - ssymv( 'row-major', 'upper', 10 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0 ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y ); // $ExpectError - ssymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1, 10 ); // $ExpectError + ssymv( 'row-major', 'upper', 5 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0 ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y ); // $ExpectError + ssymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1, 10 ); // $ExpectError } // Attached to main export is an `ndarray` method which returns a Float32Array... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectType Float32Array + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectType Float32Array } // The compiler throws an error if the function is provided a first argument which is not a string... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv.ndarray( 10, 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( true, 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( false, 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( null, 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( undefined, 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( [], 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( {}, 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( ( x: number ): number => x, 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv.ndarray( 10, 10, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( true, 10, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( false, 10, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( null, 10, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( undefined, 10, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( [ '1' ], 10, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( {}, 10, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( ( x: number ): number => x, 10, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a second argument which is not a string... +// The compiler throws an error if the function is provided a second argument which is not a number... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv.ndarray( 'row-major', 10, 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', true, 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', false, 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', null, 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', undefined, 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', [ '1' ], 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', {}, 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', ( x: number ): number => x, 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv.ndarray( 'upper', '10', 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', true, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', false, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', null, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', undefined, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', [], 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', {}, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', ( x: number ): number => x, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a third argument which is not a number... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv.ndarray( 'row-major', 'upper', '10', 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', true, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', false, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', null, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', undefined, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', [], 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', {}, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', ( x: number ): number => x, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv.ndarray( 'upper', 5, '10', A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, true, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, false, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, null, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, undefined, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, [], A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, {}, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, ( x: number ): number => x, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a fourth argument which is not a number... +// The compiler throws an error if the function is provided a fourth argument which is not a Float32Array... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv.ndarray( 'row-major', 'upper', 10, '10', A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, true, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, false, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, null, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, undefined, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, [], A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, {}, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, ( x: number ): number => x, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + + ssymv.ndarray( 'upper', 5, 1.0, 10, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, '10', 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, true, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, false, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, null, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, undefined, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, [ '1' ], 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, {}, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, ( x: number ): number => x, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a fifth argument which is not a Float32Array... +// The compiler throws an error if the function is provided a fifth argument which is not a number... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, 10, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, '10', 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, true, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, false, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, null, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, undefined, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, [ '1' ], 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, {}, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, ( x: number ): number => x, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv.ndarray( 'upper', 5, 1.0, A, '10', 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, true, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, false, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, null, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, undefined, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, [], 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, {}, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, ( x: number ): number => x, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a sixth argument which is not a number... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, '10', x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, true, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, false, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, null, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, undefined, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, [], x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, {}, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, ( x: number ): number => x, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv.ndarray( 'upper', 5, 1.0, A, 5, '10', 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, true, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, false, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, null, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, undefined, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, [], 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, {}, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, ( x: number ): number => x, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a seventh argument which is not a Float32Array... +// The compiler throws an error if the function is provided a seventh argument which is not a number... { - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, 10, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, '10', 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, true, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, false, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, null, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, undefined, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, [ '1' ], 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, {}, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, ( x: number ): number => x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, '10', x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, true, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, false, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, null, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, undefined, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, [], x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, {}, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, ( x: number ): number => x, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided an eighth argument which is not a number... +// The compiler throws an error if the function is provided an eighth argument which is not a Float32Array... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, '10', 0, 1.0, y, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, true, 0, 1.0, y, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, false, 0, 1.0, y, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, null, 0, 1.0, y, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, undefined, 0, 1.0, y, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, [], 0, 1.0, y, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, {}, 0, 1.0, y, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, ( x: number ): number => x, 0, 1.0, y, 1 ); // $ExpectError + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, 10, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, '10', 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, true, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, false, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, null, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, undefined, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, [ '1' ], 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, {}, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, ( x: number ): number => x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a ninth argument which is not a number... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, '10', 1.0, y, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, true, 1.0, y, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, false, 1.0, y, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, null, 1.0, y, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, undefined, 1.0, y, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, [], 1.0, y, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, {}, 1.0, y, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, ( x: number ): number => x, 1.0, y, 1 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, '10', 0, 1.0, y, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, true, 0, 1.0, y, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, false, 0, 1.0, y, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, null, 0, 1.0, y, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, undefined, 0, 1.0, y, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, [], 0, 1.0, y, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, {}, 0, 1.0, y, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, ( x: number ): number => x, 0, 1.0, y, 1 ); // $ExpectError } // The compiler throws an error if the function is provided a tenth argument which is not a number... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, '10', y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, true, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, false, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, null, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, undefined, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, [], y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, {}, y, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, ( x: number ): number => x, y, 1, 0 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, '10', 1.0, y, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, true, 1.0, y, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, false, 1.0, y, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, null, 1.0, y, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, undefined, 1.0, y, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, [], 1.0, y, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, {}, 1.0, y, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, ( x: number ): number => x, 1.0, y, 1 ); // $ExpectError } -// The compiler throws an error if the function is provided an eleventh argument which is not a Float32Array... +// The compiler throws an error if the function is provided an eleventh argument which is not a number... { - const x = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, 10, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, '10', 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, true, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, false, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, null, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, undefined, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, [ '1' ], 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, {}, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, ( x: number ): number => x, 1, 0 ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, '10', y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, true, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, false, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, null, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, undefined, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, [], y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, {}, y, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, ( x: number ): number => x, y, 1, 0 ); // $ExpectError } -// The compiler throws an error if the function is provided a twelfth argument which is not a number... +// The compiler throws an error if the function is provided a twelfth argument which is not a Float32Array... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, '10', 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, true, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, false, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, null, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, undefined, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, [], 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, {}, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, ( x: number ): number => x, 0 ); // $ExpectError + const x = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, 10, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, '10', 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, true, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, false, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, null, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, undefined, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, [ '1' ], 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, {}, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, ( x: number ): number => x, 1, 0 ); // $ExpectError } // The compiler throws an error if the function is provided a thirteenth argument which is not a number... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); - - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, '10' ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, true ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, false ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, null ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, undefined ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, [] ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, {} ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, ( x: number ): number => x ); // $ExpectError + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, '10', 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, true, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, false, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, null, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, undefined, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, [], 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, {}, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, ( x: number ): number => x, 0 ); // $ExpectError +} + +// The compiler throws an error if the function is provided a fourteenth argument which is not a number... +{ + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); + + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, '10' ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, true ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, false ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, null ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, undefined ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, [] ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, {} ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, ( x: number ): number => x ); // $ExpectError } // The compiler throws an error if the `ndarray` method is provided an unsupported number of arguments... { - const x = new Float32Array( 10 ); - const y = new Float32Array( 10 ); - const A = new Float32Array( 20 ); + const x = new Float32Array( 5 ); + const y = new Float32Array( 5 ); + const A = new Float32Array( 25 ); ssymv.ndarray(); // $ExpectError - ssymv.ndarray( 'row-major' ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper' ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1 ); // $ExpectError - ssymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0, 10 ); // $ExpectError + ssymv.ndarray( 'upper' ); // $ExpectError + ssymv.ndarray( 'upper', 5 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1 ); // $ExpectError + ssymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0, 10 ); // $ExpectError } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/examples/index.js b/lib/node_modules/@stdlib/blas/base/ssymv/examples/index.js index 354e22194863..2b17fe27b42b 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/ssymv/examples/index.js @@ -26,11 +26,14 @@ var opts = { 'dtype': 'float32' }; -var N = 3; +var N = 5; var A = ones( N*N, opts.dtype ); var x = discreteUniform( N, 0, 255, opts ); var y = discreteUniform( N, 0, 255, opts ); -ssymv.ndarray( 'row-major', 'upper', N, 1.0, A, N, x, 1, 0, 1.0, y, 1, 0 ); +ssymv( 'row-major', 'upper', N, 1.0, A, N, x, 1, 1.0, y, 1 ); +console.log( y ); + +ssymv.ndarray( 'upper', N, 1.0, A, N, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); console.log( y ); diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/lib/base.js b/lib/node_modules/@stdlib/blas/base/ssymv/lib/base.js new file mode 100644 index 000000000000..25987dddf433 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/lib/base.js @@ -0,0 +1,150 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2025 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major' ); +var sfill = require( '@stdlib/blas/ext/base/sfill' ).ndarray; +var sscal = require( '@stdlib/blas/base/sscal' ).ndarray; +var f32 = require( '@stdlib/number/float64/base/to-float32' ); + + +// MAIN // + +/** +* Performs the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. +* +* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced +* @param {NonNegativeInteger} N - number of elements along each dimension of `A` +* @param {number} alpha - scalar constant +* @param {Float32Array} A - input matrix +* @param {PositiveInteger} strideA1 - stride of the first dimension of `A` +* @param {PositiveInteger} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` +* @param {Float32Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @param {number} beta - scalar constant +* @param {Float32Array} y - second input array +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting index for `y` +* @returns {Float32Array} `y` +* +* @example +* var Float32Array = require( '@stdlib/array/float32' ); +* +* var A = new Float32Array( [ 1.0, 4.0, 5.0, 4.0, 2.0, 6.0, 5.0, 6.0, 3.0 ] ); +* var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); +* var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); +* +* ssymv( 'lower', 3, 1.0, A, 3, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); +* // y => [ 10.0, 12.0, 14.0 ] +*/ +function ssymv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len + var isrm; + var tmp1; + var tmp2; + var ix0; + var iy0; + var ix1; + var iy1; + var sa0; + var sa1; + var i1; + var i0; + var ia; + + // Note on variable naming convention: sa#, ix#, i# where # corresponds to the loop number, with `0` being the innermost loop... + + // y = beta*y + if ( beta !== 1.0 ) { + if ( beta === 0.0 ) { + sfill( N, 0.0, y, strideY, offsetY ); + } else { + sscal( N, beta, y, strideY, offsetY ); + } + } + if ( alpha === 0.0 ) { + return y; + } + isrm = isRowMajor( [ strideA1, strideA2 ] ); + if ( isrm ) { + // For row-major matrices, the last dimension has the fastest changing index... + sa0 = strideA2; // stride for innermost loop + sa1 = strideA1; // stride for outermost loop + } else { // isColMajor + // For column-major matrices, the first dimension has the fastest changing index... + sa0 = strideA1; // stride for innermost loop + sa1 = strideA2; // stride for outermost loop + } + // Form: y = α*A*x + y + if ( + ( !isrm && uplo === 'upper' ) || + ( isrm && uplo === 'lower' ) + ) { + ix1 = offsetX; + iy1 = offsetY; + for ( i1 = 0; i1 < N; i1++ ) { + tmp1 = f32( alpha * x[ ix1 ] ); + tmp2 = f32( 0.0 ); + ix0 = offsetX; + iy0 = offsetY; + ia = offsetA + ( sa1*i1 ); + for ( i0 = 0; i0 < i1; i0++ ) { + y[ iy0 ] += f32( tmp1 * A[ ia ] ); + tmp2 = f32( tmp2 + f32( A[ ia ] * x[ ix0 ] ) ); + ix0 += strideX; + iy0 += strideY; + ia += sa0; + } + y[ iy1 ] += f32( f32( tmp1*A[ ia ] ) + f32( alpha*tmp2 ) ); + ix1 += strideX; + iy1 += strideY; + } + return y; + } + // ( !isrm && uplo === 'lower' ) || ( isrm && uplo === 'upper' ) + ix1 = offsetX; + iy1 = offsetY; + for ( i1 = 0; i1 < N; i1++ ) { + tmp1 = f32( alpha * x[ ix1 ] ); + tmp2 = f32( 0.0 ); + ia = offsetA + ( sa1*i1 ) + ( sa0*i1 ); + y[ iy1 ] += f32( tmp1 * A[ ia ] ); + ix0 = ix1; + iy0 = iy1; + for ( i0 = i1+1; i0 < N; i0++ ) { + ix0 += strideX; + iy0 += strideY; + ia += sa0; + y[ iy0 ] += f32( tmp1 * A[ ia ] ); + tmp2 = f32( tmp2 + f32( A[ ia ] * x[ ix0 ] ) ); + } + y[ iy1 ] += f32( alpha*tmp2 ); + ix1 += strideX; + iy1 += strideY; + } + return y; +} + + +// EXPORTS // + +module.exports = ssymv; diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/lib/index.js b/lib/node_modules/@stdlib/blas/base/ssymv/lib/index.js index 6cc9f778db3e..ae115bafbfe3 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/ssymv/lib/index.js @@ -19,7 +19,7 @@ 'use strict'; /** -* BLAS level 2 routine to perform the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. +* BLAS level 2 routine to perform the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. * * @module @stdlib/blas/base/ssymv * @@ -27,23 +27,23 @@ * var Float32Array = require( '@stdlib/array/float32' ); * var ssymv = require( '@stdlib/blas/base/ssymv' ); * -* var A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +* var A = new Float32Array( [ 1.0, 4.0, 5.0, 4.0, 2.0, 6.0, 5.0, 6.0, 3.0 ] ); * var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); * * ssymv( 'row-major', 'lower', 3, 1.0, A, 3, x, 1, 0.0, y, 1 ); -* // y => [ 1.0, 2.0, 3.0 ] +* // y => [ 10.0, 12.0, 14.0 ] * * @example * var Float32Array = require( '@stdlib/array/float32' ); * var ssymv = require( '@stdlib/blas/base/ssymv' ); * -* var A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +* var A = new Float32Array( [ 1.0, 4.0, 5.0, 4.0, 2.0, 6.0, 5.0, 6.0, 3.0 ] ); * var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); * -* ssymv.ndarray( 'row-major', 'lower', 3, 1.0, A, 3, x, 1, 0, 0.0, y, 1, 0 ); -* // y => [ 1.0, 2.0, 3.0 ] +* ssymv.ndarray( 'lower', 3, 1.0, A, 3, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); +* // y => [ 10.0, 12.0, 14.0 ] */ // MODULES // diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/ssymv/lib/ndarray.js index da9b090fc62b..ff55bce5210a 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ssymv/lib/ndarray.js @@ -20,153 +20,71 @@ // MODULES // -var sfill = require( '@stdlib/blas/ext/base/sfill' ).ndarray; -var sscal = require( '@stdlib/blas/base/sscal' ).ndarray; -var max = require( '@stdlib/math/base/special/max' ); -var f32 = require( '@stdlib/number/float64/base/to-float32' ); -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); -var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); -var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); // MAIN // /** -* Performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. +* Performs the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. * -* @param {string} order - storage layout * @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {number} alpha - scalar constant -* @param {Float32Array} A - matrix -* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Float32Array} A - input matrix +* @param {PositiveInteger} strideA1 - stride of the first dimension of `A` +* @param {PositiveInteger} strideA2 - stride of the second dimension of `A` +* @param {NonNegativeInteger} offsetA - starting index for `A` * @param {Float32Array} x - first input array * @param {integer} strideX - `x` stride length -* @param {NonNegativeInteger} offsetX - starting `x` index +* @param {NonNegativeInteger} offsetX - starting index for `x` * @param {number} beta - scalar constant * @param {Float32Array} y - second input array * @param {integer} strideY - `y` stride length -* @param {NonNegativeInteger} offsetY - starting `y` index -* @throws {TypeError} first argument must be a valid order -* @throws {TypeError} second argument must specify whether to reference the lower or upper triangular matrix -* @throws {RangeError} third argument must be a nonnegative integer -* @throws {RangeError} sixth argument must be greater than or equal to max(1,N) -* @throws {RangeError} eighth argument must be non-zero -* @throws {RangeError} twelfth argument must be non-zero +* @param {NonNegativeInteger} offsetY - starting index for `y` +* @throws {TypeError} first argument must specify whether to reference the lower or upper triangular matrix +* @throws {RangeError} second argument must be a nonnegative integer +* @throws {RangeError} fifth argument must be non-zero +* @throws {RangeError} sixth argument must be non-zero +* @throws {RangeError} ninth argument must be non-zero +* @throws {RangeError} thirteenth argument must be non-zero * @returns {Float32Array} `y` * * @example * var Float32Array = require( '@stdlib/array/float32' ); * -* var A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +* var A = new Float32Array( [ 1.0, 4.0, 5.0, 4.0, 2.0, 6.0, 5.0, 6.0, 3.0 ] ); * var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); * -* ssymv( 'row-major', 'lower', 3, 1.0, A, 3, x, 1, 0, 0.0, y, 1, 0 ); -* // y => [ 1.0, 2.0, 3.0 ] +* ssymv( 'lower', 3, 1.0, A, 3, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); +* // y => [ 10.0, 12.0, 14.0 ] */ -function ssymv( order, uplo, N, alpha, A, LDA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len - var temp1; - var temp2; - var jmin; - var jmax; - var ix; - var iy; - var jx; - var jy; - var ox; - var oy; - var i; - var j; - var k; - - if ( !isLayout( order ) ) { - throw new TypeError( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ); - } +function ssymv( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ) { // eslint-disable-line max-params, max-len if ( !isMatrixTriangle( uplo ) ) { - throw new TypeError( 'invalid argument. Second argument must specify whether to reference the lower or upper triangular matrix. Value: `%s`.', uplo ); + throw new TypeError( format( 'invalid argument. First argument must specify whether to reference the lower or upper triangular matrix. Value: `%s`.', uplo ) ); } if ( N < 0 ) { - throw new RangeError( 'invalid argument. Third argument must be a nonnegative integer. Value: `%d`.', N ); + throw new RangeError( format( 'invalid argument. Second argument must be a nonnegative integer. Value: `%d`.', N ) ); + } + if ( strideA1 === 0 ) { + throw new RangeError( format( 'invalid argument. Fifth argument must be non-zero. Value: `%d`.', strideA1 ) ); } - if ( LDA < max( 1, N ) ) { - throw new RangeError( 'invalid argument. Sixth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ); + if ( strideA2 === 0 ) { + throw new RangeError( format( 'invalid argument. Sixth argument must be non-zero. Value: `%d`.', strideA2 ) ); } if ( strideX === 0 ) { - throw new RangeError( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideX ); + throw new RangeError( format( 'invalid argument. Ninth argument must be non-zero. Value: `%d`.', strideX ) ); } if ( strideY === 0 ) { - throw new RangeError( 'invalid argument. Twelfth argument must be non-zero. Value: `%d`.', strideY ); + throw new RangeError( format( 'invalid argument. Thirteenth argument must be non-zero. Value: `%d`.', strideY ) ); } if ( N === 0 || ( alpha === 0.0 && beta === 1.0 ) ) { return y; } - // Form: y = beta*y - if ( beta !== 1.0 ) { - if ( beta === 0.0 ) { - sfill( N, 0.0, y, strideY, offsetY ); - } else { - sscal( N, beta, y, strideY, offsetY ); - } - } - if ( alpha === 0.0 ) { - return y; - } - ox = offsetX; - oy = offsetY; - - // Form: y = alpha*A*x + y - if ( - ( isRowMajor( order ) && uplo === 'upper' ) || - ( isColumnMajor( order ) && uplo === 'lower' ) - ) { - ix = ox; - iy = oy; - for ( i = 0; i < N; i++ ) { - temp1 = f32( alpha * x[ ix ] ); - temp2 = 0.0; - jmin = i + 1; - jmax = N; - jx = ox + ( jmin*strideX ); - jy = oy + ( jmin*strideY ); - y[ iy ] += f32( temp1 * A[(LDA*i)+i] ); - for ( j = jmin; j < jmax; j++ ) { - k = ( LDA*i ) + j; - y[ jy ] += f32( temp1 * A[k] ); - temp2 = f32( temp2 + f32( x[jx] * A[k] ) ); - jx += strideX; - jy += strideY; - } - y[ iy ] += f32( alpha * temp2 ); - ix += strideX; - iy += strideY; - } - return y; - } - // ( order === 'row-major' && uplo === 'lower') || ( order === 'column-major' && uplo === 'upper' ) - ix = ox + ( (N-1)*strideX ); - iy = oy + ( (N-1)*strideY ); - for ( i = N-1; i >= 0; i-- ) { - temp1 = f32( alpha * x[ ix ] ); - temp2 = 0.0; - jmin = 0; - jmax = i; - jx = ox + ( jmin*strideX ); - jy = oy + ( jmin*strideY ); - y[ iy ] += f32( temp1 * A[(LDA*i)+i] ); - for ( j = jmin; j < jmax; j++ ) { - k = ( LDA*i ) + j; - y[ jy ] += f32( temp1 * A[k] ); - temp2 = f32( temp2 + f32( x[jx] * A[k] ) ); - jx += strideX; - jy += strideY; - } - y[ iy ] += f32( alpha * temp2 ); - ix -= strideX; - iy -= strideY; - } - return y; + return base( uplo, N, alpha, A, strideA1, strideA2, offsetA, x, strideX, offsetX, beta, y, strideY, offsetY ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/lib/ssymv.js b/lib/node_modules/@stdlib/blas/base/ssymv/lib/ssymv.js index 29716fea7e1c..e1e3d39938c4 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/lib/ssymv.js +++ b/lib/node_modules/@stdlib/blas/base/ssymv/lib/ssymv.js @@ -20,26 +20,24 @@ // MODULES // -var sfill = require( '@stdlib/blas/ext/base/sfill' ); -var sscal = require( '@stdlib/blas/base/sscal' ); var max = require( '@stdlib/math/base/special/max' ); -var f32 = require( '@stdlib/number/float64/base/to-float32' ); +var stride2offset = require( '@stdlib/strided/base/stride2offset' ); var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); -var isRowMajor = require( '@stdlib/ndarray/base/assert/is-row-major-string' ); -var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); +var format = require( '@stdlib/string/format' ); +var base = require( './base.js' ); // MAIN // /** -* Performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. +* Performs the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix. * * @param {string} order - storage layout * @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced * @param {NonNegativeInteger} N - number of elements along each dimension of `A` * @param {number} alpha - scalar constant -* @param {Float32Array} A - matrix +* @param {Float32Array} A - input matrix * @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) * @param {Float32Array} x - first input array * @param {integer} strideX - `x` stride length @@ -57,124 +55,50 @@ var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string * @example * var Float32Array = require( '@stdlib/array/float32' ); * -* var A = new Float32Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +* var A = new Float32Array( [ 1.0, 4.0, 5.0, 4.0, 2.0, 6.0, 5.0, 6.0, 3.0 ] ); * var x = new Float32Array( [ 1.0, 1.0, 1.0 ] ); * var y = new Float32Array( [ 0.0, 0.0, 0.0 ] ); * * ssymv( 'row-major', 'lower', 3, 1.0, A, 3, x, 1, 0.0, y, 1 ); -* // y => [ 1.0, 2.0, 3.0 ] +* // y => [ 10.0, 12.0, 14.0 ] */ function ssymv( order, uplo, N, alpha, A, LDA, x, strideX, beta, y, strideY ) { // eslint-disable-line max-params - var temp1; - var temp2; - var jmin; - var jmax; - var ix; - var iy; - var jx; - var jy; + var sa1; + var sa2; var ox; var oy; - var i; - var j; - var k; 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 to reference the lower or upper triangular matrix. Value: `%s`.', uplo ); + throw new TypeError( format( 'invalid argument. Second argument must specify whether to reference the lower or upper triangular matrix. Value: `%s`.', uplo ) ); } if ( N < 0 ) { - throw new RangeError( 'invalid argument. Third argument must be a nonnegative integer. Value: `%d`.', N ); + throw new RangeError( format( 'invalid argument. Third 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 max(1,%d). Value: `%d`.', N, LDA ); + throw new RangeError( format( 'invalid argument. Sixth argument must be greater than or equal to max(1,%d). Value: `%d`.', N, LDA ) ); } if ( strideX === 0 ) { - throw new RangeError( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideX ); + throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideX ) ); } if ( strideY === 0 ) { - throw new RangeError( 'invalid argument. Eleventh argument must be non-zero. Value: `%d`.', strideY ); + throw new RangeError( format( 'invalid argument. Eleventh argument must be non-zero. Value: `%d`.', strideY ) ); } if ( N === 0 || ( alpha === 0.0 && beta === 1.0 ) ) { return y; } - // Form: y = beta*y - if ( beta !== 1.0 ) { - if ( beta === 0.0 ) { - sfill( N, 0.0, y, strideY ); - } else { - if ( strideY < 0 ) { - strideY = -strideY; - } - sscal( N, beta, y, strideY ); - } + ox = stride2offset( N, strideX ); + oy = stride2offset( N, strideY ); + if ( order === 'column-major' ) { + sa1 = 1; + sa2 = LDA; + } else { // order === 'row-major' + sa1 = LDA; + sa2 = 1; } - if ( alpha === 0.0 ) { - return y; - } - if ( strideX > 0 ) { - ox = 0; - } else { - ox = ( 1 - N ) * strideX; - } - if ( strideY > 0 ) { - oy = 0; - } else { - oy = ( 1 - N ) * strideY; - } - // Form: y = alpha*A*x + y - if ( - ( isRowMajor( order ) && uplo === 'upper' ) || - ( isColumnMajor( order ) && uplo === 'lower' ) - ) { - ix = ox; - iy = oy; - for ( i = 0; i < N; i++ ) { - temp1 = f32( alpha * x[ ix ] ); - temp2 = 0.0; - jmin = i + 1; - jmax = N; - jx = ox + ( jmin*strideX ); - jy = oy + ( jmin*strideY ); - y[ iy ] += f32( temp1 * A[(LDA*i)+i] ); - for ( j = jmin; j < jmax; j++ ) { - k = ( LDA*i ) + j; - y[ jy ] += f32( temp1 * A[k] ); - temp2 = f32( temp2 + f32( x[jx] * A[k] ) ); - jx += strideX; - jy += strideY; - } - y[ iy ] += f32( alpha * temp2 ); - ix += strideX; - iy += strideY; - } - return y; - } - // ( order === 'row-major' && uplo === 'lower') || ( order === 'column-major' && uplo === 'upper' ) - ix = ox + ( (N-1)*strideX ); - iy = oy + ( (N-1)*strideY ); - for ( i = N-1; i >= 0; i-- ) { - temp1 = f32( alpha * x[ ix ] ); - temp2 = 0.0; - jmin = 0; - jmax = i; - jx = ox + ( jmin*strideX ); - jy = oy + ( jmin*strideY ); - y[ iy ] += f32( temp1 * A[(LDA*i)+i] ); - for ( j = jmin; j < jmax; j++ ) { - k = ( LDA*i ) + j; - y[ jy ] += f32( temp1 * A[k] ); - temp2 = f32( temp2 + f32( x[jx] * A[k] ) ); - jx += strideX; - jy += strideY; - } - y[ iy ] += f32( alpha * temp2 ); - ix -= strideX; - iy -= strideY; - } - return y; + return base( uplo, N, alpha, A, sa1, sa2, 0, x, strideX, ox, beta, y, strideY, oy ); // eslint-disable-line max-len } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/package.json b/lib/node_modules/@stdlib/blas/base/ssymv/package.json index 7f5d309e891e..2c35f5608171 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/package.json +++ b/lib/node_modules/@stdlib/blas/base/ssymv/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/base/ssymv", "version": "0.0.0", - "description": "Perform the matrix-vector operation `y = α*A*x + β*y` where `α` and `β` are scalars, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix.", + "description": "Perform the matrix-vector operation `y = α*A*x + β*y`.", "license": "Apache-2.0", "author": { "name": "The Stdlib Authors", diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_complex_access_pattern.json new file mode 100644 index 000000000000..08ec07cb1528 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_complex_access_pattern.json @@ -0,0 +1,24 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 6.0, 999.0, 5.0, 999.0, 3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 999.0, 4.0, 999.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 999.0, 2.0, 999.0, 1.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 2.0, 4.0, 5.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "lda": 12, + "strideA1": -2, + "strideA2": -12, + "offsetA": 34, + "x": [ 0.0, 1.0, 0.0, 1.0, 0.0, 1.0 ], + "strideX": -2, + "offsetX": 5, + "beta": 1.0, + "y": [ 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 1, + "y_out": [ 0.0, 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_lower.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_lower.json new file mode 100644 index 000000000000..c4bd6e663c94 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_lower.json @@ -0,0 +1,24 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 1.0, 2.0, 3.0, 2.0, 4.0, 5.0, 3.0, 5.0, 6.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 2.0, 4.0, 5.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 0, + "beta": 1.0, + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 0, + "y_out": [ 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_oa.json new file mode 100644 index 000000000000..26694ee124a0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_oa.json @@ -0,0 +1,24 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 0.0, 0.0, 1.0, 2.0, 3.0, 2.0, 4.0, 5.0, 3.0, 5.0, 6.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 2.0, 4.0, 5.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 2, + "x": [ 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 0, + "beta": 1.0, + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 0, + "y_out": [ 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_ox.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_ox.json new file mode 100644 index 000000000000..a3f2611c3fbe --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_ox.json @@ -0,0 +1,24 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 1.0, 2.0, 3.0, 2.0, 4.0, 5.0, 3.0, 5.0, 6.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 2.0, 4.0, 5.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 0.0, 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 1, + "beta": 1.0, + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 0, + "y_out": [ 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_oy.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_oy.json new file mode 100644 index 000000000000..7b337de2dbd7 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_oy.json @@ -0,0 +1,24 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 1.0, 2.0, 3.0, 2.0, 4.0, 5.0, 3.0, 5.0, 6.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 2.0, 4.0, 5.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 0, + "beta": 1.0, + "y": [ 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 1, + "y_out": [ 0.0, 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_sa1_sa2.json new file mode 100644 index 000000000000..f48c3a04d562 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_sa1_sa2.json @@ -0,0 +1,24 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 999.0, 2.0, 999.0, 3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, 999.0, 4.0, 999.0, 5.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 999.0, 5.0, 999.0, 6.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 2.0, 4.0, 5.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "lda": 12, + "strideA1": 2, + "strideA2": 12, + "offsetA": 6, + "x": [ 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 0, + "beta": 1.0, + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 0, + "y_out": [ 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_sa1_sa2n.json new file mode 100644 index 000000000000..a37caf26f6b6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_sa1_sa2n.json @@ -0,0 +1,24 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 999.0, 5.0, 999.0, 6.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, 999.0, 4.0, 999.0, 5.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 999.0, 2.0, 999.0, 3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 2.0, 4.0, 5.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "lda": 12, + "strideA1": 2, + "strideA2": -12, + "offsetA": 30, + "x": [ 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 0, + "beta": 1.0, + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 0, + "y_out": [ 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_sa1n_sa2.json new file mode 100644 index 000000000000..7231dbe88037 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_sa1n_sa2.json @@ -0,0 +1,24 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 999.0, 2.0, 999.0, 1.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 999.0, 4.0, 999.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 6.0, 999.0, 5.0, 999.0, 3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 2.0, 4.0, 5.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "lda": 12, + "strideA1": -2, + "strideA2": 12, + "offsetA": 10, + "x": [ 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 0, + "beta": 1.0, + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 0, + "y_out": [ 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_sa1n_sa2n.json new file mode 100644 index 000000000000..ae021ec0e215 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_sa1n_sa2n.json @@ -0,0 +1,24 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 6.0, 999.0, 5.0, 999.0, 3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 999.0, 4.0, 999.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 999.0, 2.0, 999.0, 1.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 2.0, 4.0, 5.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "lda": 12, + "strideA1": -2, + "strideA2": -12, + "offsetA": 34, + "x": [ 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 0, + "beta": 1.0, + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 0, + "y_out": [ 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xoyt.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_upper.json similarity index 71% rename from lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xoyt.json rename to lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_upper.json index 52fb03d1f33a..93381afde702 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xoyt.json +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_upper.json @@ -1,16 +1,24 @@ { - "uplo": "upper", "order": "column-major", + "uplo": "upper", "N": 3, "alpha": 2.0, - "beta": 1.0, + "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 0.0, 2.0, 0.0 ], + [ 0.0, 0.0, 3.0 ] + ], "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 2.0, 3.0 ], "strideX": 1, "offsetX": 0, + "beta": 1.0, + "y": [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ], "strideY": 2, "offsetY": 0, - "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], - "x": [ 1.0, 2.0, 3.0 ], - "y": [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ], "y_out": [ 3.0, 0.0, 10.0, 0.0, 21.0, 0.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xnyn.json index 2fd5e82f07e3..845e19937483 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xnyn.json +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xnyn.json @@ -1,16 +1,24 @@ { - "uplo": "lower", "order": "column-major", + "uplo": "lower", "N": 3, "alpha": 1.0, - "beta": 1.0, + "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 0.0, 2.0, 0.0 ], + [ 0.0, 0.0, 3.0 ] + ], "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 1.0 ], "strideX": -1, "offsetX": 2, + "beta": 1.0, + "y": [ 1.0, 1.0, 1.0 ], "strideY": -1, "offsetY": 2, - "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], - "x": [ 1.0, 1.0, 1.0 ], - "y": [ 1.0, 1.0, 1.0 ], "y_out": [ 4.0, 3.0, 2.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xnyp.json index ad0199f70d9b..1ff4b932c742 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xnyp.json +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xnyp.json @@ -1,16 +1,24 @@ { - "uplo": "upper", "order": "column-major", + "uplo": "upper", "N": 3, "alpha": 2.0, - "beta": 1.0, + "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 0.0, 2.0, 0.0 ], + [ 0.0, 0.0, 3.0 ] + ], "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 2.0, 3.0 ], "strideX": -1, "offsetX": 2, + "beta": 1.0, + "y": [ 1.0, 2.0, 3.0 ], "strideY": 1, "offsetY": 0, - "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], - "x": [ 1.0, 2.0, 3.0 ], - "y": [ 1.0, 2.0, 3.0 ], "y_out": [ 7.0, 10.0, 9.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xpyn.json index 0fba9d62725a..5693f0bf255a 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xpyn.json +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xpyn.json @@ -1,16 +1,24 @@ { - "uplo": "upper", "order": "column-major", + "uplo": "upper", "N": 3, "alpha": 2.0, - "beta": 1.0, + "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 0.0, 2.0, 0.0 ], + [ 0.0, 0.0, 3.0 ] + ], "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 2.0, 3.0 ], "strideX": 1, "offsetX": 0, + "beta": 1.0, + "y": [ 1.0, 2.0, 3.0 ], "strideY": -1, "offsetY": 2, - "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], - "x": [ 1.0, 2.0, 3.0 ], - "y": [ 1.0, 2.0, 3.0 ], "y_out": [ 19.0, 10.0, 5.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xpyp.json index 11c4b7ffdcbc..3dc512324829 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xpyp.json +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/column_major_xpyp.json @@ -1,16 +1,24 @@ { - "uplo": "lower", "order": "column-major", + "uplo": "lower", "N": 3, "alpha": 1.0, - "beta": 0.0, + "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 0.0, 2.0, 0.0 ], + [ 0.0, 0.0, 3.0 ] + ], "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 1.0 ], "strideX": 1, "offsetX": 0, + "beta": 0.0, + "y": [ 0.0, 0.0, 0.0 ], "strideY": 1, "offsetY": 0, - "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], - "x": [ 1.0, 1.0, 1.0 ], - "y": [ 0.0, 0.0, 0.0 ], "y_out": [ 1.0, 2.0, 3.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_complex_access_pattern.json new file mode 100644 index 000000000000..76cff77eec0b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_complex_access_pattern.json @@ -0,0 +1,24 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 999.0, 6.0, 999.0, 5.0, 999.0, 3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 999.0, 4.0, 999.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 999.0, 2.0, 999.0, 1.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 2.0, 4.0, 5.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "lda": 14, + "strideA1": -14, + "strideA2": -2, + "offsetA": 33, + "x": [ 1.0, 1.0, 1.0 ], + "strideX": -1, + "offsetX": 2, + "beta": 2.0, + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": -2, + "offsetY": 4, + "y_out": [ 16.0, 0.0, 13.0, 0.0, 8.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_lower.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_lower.json new file mode 100644 index 000000000000..93bd2dc6a3d8 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_lower.json @@ -0,0 +1,24 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 1.0, 2.0, 4.0, 2.0, 3.0, 5.0, 4.0, 5.0, 6.0 ], + "A_mat": [ + [ 1.0, 2.0, 4.0 ], + [ 2.0, 3.0, 5.0 ], + [ 4.0, 5.0, 6.0 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 0, + "beta": 2.0, + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 0, + "y_out": [ 9.0, 0.0, 12.0, 0.0, 17.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_oa.json new file mode 100644 index 000000000000..ca7cd90f646c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_oa.json @@ -0,0 +1,24 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 0.0, 0.0, 1.0, 2.0, 4.0, 2.0, 3.0, 5.0, 4.0, 5.0, 6.0 ], + "A_mat": [ + [ 1.0, 2.0, 4.0 ], + [ 2.0, 3.0, 5.0 ], + [ 4.0, 5.0, 6.0 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 2, + "x": [ 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 0, + "beta": 2.0, + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 0, + "y_out": [ 9.0, 0.0, 12.0, 0.0, 17.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_ox.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_ox.json new file mode 100644 index 000000000000..a92a8570247d --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_ox.json @@ -0,0 +1,24 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 1.0, 2.0, 4.0, 2.0, 3.0, 5.0, 4.0, 5.0, 6.0 ], + "A_mat": [ + [ 1.0, 2.0, 4.0 ], + [ 2.0, 3.0, 5.0 ], + [ 4.0, 5.0, 6.0 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 0.0, 0.0, 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 2, + "beta": 2.0, + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 0, + "y_out": [ 9.0, 0.0, 12.0, 0.0, 17.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_oy.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_oy.json new file mode 100644 index 000000000000..502d0b0c4eab --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_oy.json @@ -0,0 +1,24 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 1.0, 2.0, 4.0, 2.0, 3.0, 5.0, 4.0, 5.0, 6.0 ], + "A_mat": [ + [ 1.0, 2.0, 4.0 ], + [ 2.0, 3.0, 5.0 ], + [ 4.0, 5.0, 6.0 ] + ], + "lda": 3, + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 0, + "beta": 2.0, + "y": [ 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 2, + "y_out": [ 0.0, 0.0, 9.0, 0.0, 12.0, 0.0, 17.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_sa1_sa2.json new file mode 100644 index 000000000000..cd1ed6ffa4bb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_sa1_sa2.json @@ -0,0 +1,24 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 999.0, 1.0, 999.0, 2.0, 999.0, 3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, 999.0, 4.0, 999.0, 5.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 999.0, 5.0, 999.0, 6.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 2.0, 4.0, 5.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "lda": 14, + "strideA1": 14, + "strideA2": 2, + "offsetA": 1, + "x": [ 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 0, + "beta": 2.0, + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 0, + "y_out": [ 8.0, 0.0, 13.0, 0.0, 16.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_sa1_sa2n.json new file mode 100644 index 000000000000..247595cf1cf3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_sa1_sa2n.json @@ -0,0 +1,24 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 999.0, 3.0, 999.0, 2.0, 999.0, 1.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 999.0, 4.0, 999.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 6.0, 999.0, 5.0, 999.0, 3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 2.0, 4.0, 5.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "lda": 14, + "strideA1": 14, + "strideA2": -2, + "offsetA": 5, + "x": [ 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 0, + "beta": 2.0, + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 0, + "y_out": [ 8.0, 0.0, 13.0, 0.0, 16.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_sa1n_sa2.json new file mode 100644 index 000000000000..d775444de08b --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_sa1n_sa2.json @@ -0,0 +1,24 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 999.0, 3.0, 999.0, 5.0, 999.0, 6.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 2.0, 999.0, 4.0, 999.0, 5.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 1.0, 999.0, 2.0, 999.0, 3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 2.0, 4.0, 5.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "lda": 14, + "strideA1": -14, + "strideA2": 2, + "offsetA": 29, + "x": [ 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 0, + "beta": 2.0, + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 0, + "y_out": [ 8.0, 0.0, 13.0, 0.0, 16.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_sa1n_sa2n.json new file mode 100644 index 000000000000..431e43eaf7e3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_sa1n_sa2n.json @@ -0,0 +1,24 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "A": [ 999.0, 6.0, 999.0, 5.0, 999.0, 3.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 5.0, 999.0, 4.0, 999.0, 2.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 3.0, 999.0, 2.0, 999.0, 1.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0 ], + "A_mat": [ + [ 1.0, 2.0, 3.0 ], + [ 2.0, 4.0, 5.0 ], + [ 3.0, 5.0, 6.0 ] + ], + "lda": 14, + "strideA1": -14, + "strideA2": -2, + "offsetA": 33, + "x": [ 1.0, 1.0, 1.0 ], + "strideX": 1, + "offsetX": 0, + "beta": 2.0, + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "strideY": 2, + "offsetY": 0, + "y_out": [ 8.0, 0.0, 13.0, 0.0, 16.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xoyt.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_upper.json similarity index 71% rename from lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xoyt.json rename to lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_upper.json index 3d64ae652939..f2a84a70ab21 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xoyt.json +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_upper.json @@ -1,16 +1,24 @@ { - "uplo": "upper", "order": "row-major", + "uplo": "upper", "N": 3, "alpha": 2.0, - "beta": 1.0, + "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 0.0, 2.0, 0.0 ], + [ 0.0, 0.0, 3.0 ] + ], "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 2.0, 3.0 ], "strideX": 1, "offsetX": 0, + "beta": 1.0, + "y": [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ], "strideY": 2, "offsetY": 0, - "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], - "x": [ 1.0, 2.0, 3.0 ], - "y": [ 1.0, 0.0, 2.0, 0.0, 3.0, 0.0 ], "y_out": [ 3.0, 0.0, 10.0, 0.0, 21.0, 0.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xnyn.json index 9f92e653157a..b87bc116649a 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xnyn.json +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xnyn.json @@ -1,16 +1,24 @@ { - "uplo": "lower", "order": "row-major", + "uplo": "lower", "N": 3, "alpha": 1.0, - "beta": 1.0, + "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 0.0, 2.0, 0.0 ], + [ 0.0, 0.0, 3.0 ] + ], "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 1.0 ], "strideX": -1, "offsetX": 2, + "beta": 1.0, + "y": [ 1.0, 1.0, 1.0 ], "strideY": -1, "offsetY": 2, - "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], - "x": [ 1.0, 1.0, 1.0 ], - "y": [ 1.0, 1.0, 1.0 ], "y_out": [ 4.0, 3.0, 2.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xnyp.json index eb8d8c183858..594b5937e70d 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xnyp.json +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xnyp.json @@ -1,16 +1,24 @@ { - "uplo": "upper", "order": "row-major", + "uplo": "upper", "N": 3, "alpha": 2.0, - "beta": 1.0, + "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 0.0, 2.0, 0.0 ], + [ 0.0, 0.0, 3.0 ] + ], "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 2.0, 3.0 ], "strideX": -1, "offsetX": 2, + "beta": 1.0, + "y": [ 1.0, 2.0, 3.0 ], "strideY": 1, "offsetY": 0, - "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], - "x": [ 1.0, 2.0, 3.0 ], - "y": [ 1.0, 2.0, 3.0 ], "y_out": [ 7.0, 10.0, 9.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xpyn.json index 7db3af0f446d..1e21d0e880bc 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xpyn.json +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xpyn.json @@ -1,16 +1,24 @@ { - "uplo": "upper", "order": "row-major", + "uplo": "upper", "N": 3, "alpha": 2.0, - "beta": 1.0, + "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 0.0, 2.0, 0.0 ], + [ 0.0, 0.0, 3.0 ] + ], "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 2.0, 3.0 ], "strideX": 1, "offsetX": 0, + "beta": 1.0, + "y": [ 1.0, 2.0, 3.0 ], "strideY": -1, "offsetY": 2, - "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], - "x": [ 1.0, 2.0, 3.0 ], - "y": [ 1.0, 2.0, 3.0 ], "y_out": [ 19.0, 10.0, 5.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xpyp.json index 8dabdefd5af6..1e14e4fbca46 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xpyp.json +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/fixtures/row_major_xpyp.json @@ -1,16 +1,24 @@ { - "uplo": "lower", "order": "row-major", + "uplo": "lower", "N": 3, "alpha": 1.0, - "beta": 0.0, + "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "A_mat": [ + [ 1.0, 0.0, 0.0 ], + [ 0.0, 2.0, 0.0 ], + [ 0.0, 0.0, 3.0 ] + ], "lda": 3, + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 1.0 ], "strideX": 1, "offsetX": 0, + "beta": 0.0, + "y": [ 0.0, 0.0, 0.0 ], "strideY": 1, "offsetY": 0, - "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], - "x": [ 1.0, 1.0, 1.0 ], - "y": [ 0.0, 0.0, 0.0 ], "y_out": [ 1.0, 2.0, 3.0 ] } diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/ssymv/test/test.ndarray.js index 33e8c96e7a38..8643c9acda04 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/test.ndarray.js @@ -24,54 +24,41 @@ var tape = require( 'tape' ); var Float32Array = require( '@stdlib/array/float32' ); -var EPS = require( '@stdlib/constants/float32/eps' ); -var abs = require( '@stdlib/math/base/special/abs' ); var ones = require( '@stdlib/array/ones' ); var ssymv = require( './../lib/ndarray.js' ); // FIXTURES // -var rxoyt = require( './fixtures/row_major_xoyt.json' ); +var ru = require( './fixtures/row_major_upper.json' ); +var rl = require( './fixtures/row_major_lower.json' ); var rxpyp = require( './fixtures/row_major_xpyp.json' ); var rxnyp = require( './fixtures/row_major_xnyp.json' ); var rxpyn = require( './fixtures/row_major_xpyn.json' ); var rxnyn = require( './fixtures/row_major_xnyn.json' ); - -var cxoyt = require( './fixtures/column_major_xoyt.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 roa = require( './fixtures/row_major_oa.json' ); +var rox = require( './fixtures/row_major_ox.json' ); +var roy = require( './fixtures/row_major_oy.json' ); +var rcap = require( './fixtures/row_major_complex_access_pattern.json' ); + +var cu = require( './fixtures/column_major_upper.json' ); +var cl = require( './fixtures/column_major_lower.json' ); var cxpyp = require( './fixtures/column_major_xpyp.json' ); var cxnyp = require( './fixtures/column_major_xnyp.json' ); var cxpyn = require( './fixtures/column_major_xpyn.json' ); var cxnyn = require( './fixtures/column_major_xnyn.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+'.' ); - } - } -} +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_sa1n_sa2n.json' ); +var coa = require( './fixtures/column_major_oa.json' ); +var cox = require( './fixtures/column_major_ox.json' ); +var coy = require( './fixtures/column_major_oy.json' ); +var ccap = require( './fixtures/column_major_complex_access_pattern.json' ); // TESTS // @@ -82,15 +69,18 @@ tape( 'main export is a function', function test( t ) { t.end(); }); -tape( 'the function has an arity of 13', function test( t ) { - t.strictEqual( ssymv.length, 13, 'returns expected value' ); +tape( 'the function has an arity of 14', function test( t ) { + t.strictEqual( ssymv.length, 14, '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 = ru; + values = [ 'foo', 'bar', @@ -105,42 +95,45 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - ssymv( value, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float32Array( rxpyp.a ), rxpyp.lda, new Float32Array( rxpyp.x ), rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, new Float32Array( rxpyp.y ), rxpyp.strideY, rxpyp.offsetY ); + ssymv( value, data.N, data.alpha, new Float32Array( data.a ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX, data.beta, new Float32Array( data.y ), data.strideY, data.offsetY ); }; } }); tape( 'the function throws an error if provided an invalid second argument', function test( t ) { var values; + var data; var i; + data = ru; + values = [ - 'foo', - 'bar', - 'beep', - 'boop' + -1, + -2, + -3 ]; for ( i = 0; i < values.length; i++ ) { - t.throws( badValue( values[ i ] ), TypeError, 'throws an error when provided ' + values[ i ] ); + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); } t.end(); function badValue( value ) { return function badValue() { - ssymv( rxpyp.order, value, rxpyp.N, rxpyp.alpha, new Float32Array( rxpyp.a ), rxpyp.lda, new Float32Array( rxpyp.x ), rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, new Float32Array( rxpyp.y ), rxpyp.strideY, rxpyp.offsetY ); + ssymv( data.uplo, value, data.alpha, new Float32Array( data.a ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX, data.beta, new Float32Array( data.y ), data.strideY, data.offsetY ); }; } }); -tape( 'the function throws an error if provided an invalid third argument', function test( t ) { +tape( 'the function throws an error if provided an invalid fifth argument', function test( t ) { var values; + var data; var i; + data = ru; + values = [ - -1, - -2, - -3 + 0 ]; for ( i = 0; i < values.length; i++ ) { @@ -150,22 +143,20 @@ tape( 'the function throws an error if provided an invalid third argument', func function badValue( value ) { return function badValue() { - ssymv( rxpyp.order, rxpyp.uplo, value, rxpyp.alpha, new Float32Array( rxpyp.a ), rxpyp.lda, new Float32Array( rxpyp.x ), rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, new Float32Array( rxpyp.y ), rxpyp.strideY, rxpyp.offsetY ); + ssymv( data.uplo, data.N, data.alpha, new Float32Array( data.a ), value, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX, data.beta, new Float32Array( data.y ), data.strideY, data.offsetY ); }; } }); tape( 'the function throws an error if provided an invalid sixth argument', function test( t ) { var values; + var data; var i; + data = ru; + values = [ - 2, - 1, - 0, - -1, - -2, - -3 + 0 ]; for ( i = 0; i < values.length; i++ ) { @@ -175,15 +166,18 @@ tape( 'the function throws an error if provided an invalid sixth argument', func function badValue( value ) { return function badValue() { - ssymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float32Array( rxpyp.a ), value, new Float32Array( rxpyp.x ), rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, new Float32Array( rxpyp.y ), rxpyp.strideY, rxpyp.offsetY ); + ssymv( data.uplo, data.N, data.alpha, new Float32Array( data.a ), data.strideA1, value, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX, data.beta, new Float32Array( data.y ), data.strideY, data.offsetY ); }; } }); -tape( 'the function throws an error if provided an invalid eighth argument', function test( t ) { +tape( 'the function throws an error if provided an invalid ninth argument', function test( t ) { var values; + var data; var i; + data = ru; + values = [ 0 ]; @@ -195,15 +189,18 @@ tape( 'the function throws an error if provided an invalid eighth argument', fun function badValue( value ) { return function badValue() { - ssymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float32Array( rxpyp.a ), rxpyp.lda, new Float32Array( rxpyp.x ), value, rxpyp.offsetX, rxpyp.beta, new Float32Array( rxpyp.y ), rxpyp.strideY, rxpyp.offsetY ); + ssymv( data.uplo, data.N, data.alpha, new Float32Array( data.a ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), value, data.offsetX, data.beta, new Float32Array( data.y ), data.strideY, data.offsetY ); }; } }); -tape( 'the function throws an error if provided an invalid twelfth argument', function test( t ) { +tape( 'the function throws an error if provided an invalid thirteenth argument', function test( t ) { var values; + var data; var i; + data = ru; + values = [ 0 ]; @@ -215,375 +212,828 @@ tape( 'the function throws an error if provided an invalid twelfth argument', fu function badValue( value ) { return function badValue() { - ssymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float32Array( rxpyp.a ), rxpyp.lda, new Float32Array( rxpyp.x ), rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, new Float32Array( rxpyp.y ), value, rxpyp.offsetY ); + ssymv( data.uplo, data.N, data.alpha, new Float32Array( data.a ), data.strideA1, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX, data.beta, new Float32Array( data.y ), value, data.offsetY ); }; } }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (row-major, sx=1, sy=1)', function test( t ) { +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (row-major, upper)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( rxpyp.A ); - x = new Float32Array( rxpyp.x ); - y = new Float32Array( rxpyp.y ); + data = ru; - expected = new Float32Array( rxpyp.y_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - out = ssymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, a, rxpyp.lda, x, rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, y, rxpyp.strideY, rxpyp.offsetY ); + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (column-major, sx=1, sy=1)', function test( t ) { +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, upper)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( cxpyp.A ); - x = new Float32Array( cxpyp.x ); - y = new Float32Array( cxpyp.y ); + data = cu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - expected = new Float32Array( cxpyp.y_out ); + expected = new Float32Array( data.y_out ); - out = ssymv( cxpyp.order, cxpyp.uplo, cxpyp.N, cxpyp.alpha, a, cxpyp.lda, x, cxpyp.strideX, cxpyp.offsetX, cxpyp.beta, y, cxpyp.strideY, cxpyp.offsetY ); + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (row-major, sx=1, sy=2)', function test( t ) { +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (row-major, lower)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( rxoyt.A ); - x = new Float32Array( rxoyt.x ); - y = new Float32Array( rxoyt.y ); + data = rl; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - expected = new Float32Array( rxoyt.y_out ); + expected = new Float32Array( data.y_out ); - out = ssymv( rxoyt.order, rxoyt.uplo, rxoyt.N, rxoyt.alpha, a, rxoyt.lda, x, rxoyt.strideX, rxoyt.offsetX, rxoyt.beta, y, rxoyt.strideY, rxoyt.offsetY ); + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (column-major, sx=1, sy=2)', function test( t ) { +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, lower)', function test( t ) { var expected; + var data; + var out; + var a; + var x; + var y; + + data = cl; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function returns a reference to the second input vector', function test( t ) { + var data; var out; var a; var x; var y; - a = new Float32Array( cxoyt.A ); - x = new Float32Array( cxoyt.x ); - y = new Float32Array( cxoyt.y ); + data = rxpyp; - expected = new Float32Array( cxoyt.y_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - out = ssymv( cxoyt.order, cxoyt.uplo, cxoyt.N, cxoyt.alpha, a, cxoyt.lda, x, cxoyt.strideX, cxoyt.offsetX, cxoyt.beta, y, cxoyt.strideY, cxoyt.offsetY ); + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (row-major, sx=1, sy=-1)', function test( t ) { +tape( 'if `N` is zero or the scalar constants are zero and unity, respectively, the function returns the second input vector unchanged (row-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( rxpyn.A ); - x = new Float32Array( rxpyn.x ); - y = new Float32Array( rxpyn.y ); + data = rl; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - expected = new Float32Array( rxpyn.y_out ); + expected = new Float32Array( data.y ); - out = ssymv( rxpyn.order, rxpyn.uplo, rxpyn.N, rxpyn.alpha, a, rxpyn.lda, x, rxpyn.strideX, rxpyn.offsetX, rxpyn.beta, y, rxpyn.strideY, rxpyn.offsetY ); + out = ssymv( data.uplo, 0, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + out = ssymv( data.uplo, data.N, 0.0, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, 1.0, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (column-major, sx=1, sy=-1)', function test( t ) { +tape( 'if `N` is zero or the scalar constants are zero and unity, respectively, the function returns the second input vector unchanged (column-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( cxpyn.A ); - x = new Float32Array( cxpyn.x ); - y = new Float32Array( cxpyn.y ); + data = cl; - expected = new Float32Array( cxpyn.y_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - out = ssymv( cxpyn.order, cxpyn.uplo, cxpyn.N, cxpyn.alpha, a, cxpyn.lda, x, cxpyn.strideX, cxpyn.offsetX, cxpyn.beta, y, cxpyn.strideY, cxpyn.offsetY ); + expected = new Float32Array( data.y ); + + out = ssymv( data.uplo, 0, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + out = ssymv( data.uplo, data.N, 0.0, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, 1.0, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (row-major, sx=-1, sy=1)', function test( t ) { +tape( 'when `α` is zero, the function scales the second input vector (row-major, upper)', function test( t ) { var expected; var out; var a; var x; var y; - a = new Float32Array( rxnyp.A ); - x = new Float32Array( rxnyp.x ); - y = new Float32Array( rxnyp.y ); + a = ones( 9, 'float32' ); + x = ones( 3, 'float32' ); + y = ones( 3, 'float32' ); + + expected = new Float32Array( [ 5.0, 5.0, 5.0 ] ); + + out = ssymv( 'upper', 3, 0.0, a, 3, 1, 0, x, 1, 0, 5.0, y, 1, 0 ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); - expected = new Float32Array( rxnyp.y_out ); + expected = new Float32Array( [ 0.0, 0.0, 0.0 ] ); - out = ssymv( rxnyp.order, rxnyp.uplo, rxnyp.N, rxnyp.alpha, a, rxnyp.lda, x, rxnyp.strideX, rxnyp.offsetX, rxnyp.beta, y, rxnyp.strideY, rxnyp.offsetY ); + out = ssymv( 'upper', 3, 0.0, a, 3, 1, 0, x, 1, 0, 0.0, y, -1, 2 ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (column-major, sx=-1, sy=1)', function test( t ) { +tape( 'when `α` is zero, the function scales the second input vector (row-major, lower)', function test( t ) { var expected; var out; var a; var x; var y; - a = new Float32Array( cxnyp.A ); - x = new Float32Array( cxnyp.x ); - y = new Float32Array( cxnyp.y ); + a = ones( 9, 'float32' ); + x = ones( 3, 'float32' ); + y = ones( 3, 'float32' ); - expected = new Float32Array( cxnyp.y_out ); + expected = new Float32Array( [ 5.0, 5.0, 5.0 ] ); - out = ssymv( cxnyp.order, cxnyp.uplo, cxnyp.N, cxnyp.alpha, a, cxnyp.lda, x, cxnyp.strideX, cxnyp.offsetX, cxnyp.beta, y, cxnyp.strideY, cxnyp.offsetY ); + out = ssymv( 'lower', 3, 0.0, a, 3, 1, 0, x, 1, 0, 5.0, y, -1, 2 ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); + + expected = new Float32Array( [ 0.0, 0.0, 0.0 ] ); + + out = ssymv( 'lower', 3, 0.0, a, 3, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'the function returns a reference to the second input vector', function test( t ) { +tape( 'when `α` is zero, the function scales the second input vector (column-major, upper)', function test( t ) { + var expected; var out; var a; var x; var y; - a = new Float32Array( rxpyp.A ); - x = new Float32Array( rxpyp.x ); - y = new Float32Array( rxpyp.y ); + a = ones( 9, 'float32' ); + x = ones( 3, 'float32' ); + y = ones( 3, 'float32' ); + + expected = new Float32Array( [ 5.0, 5.0, 5.0 ] ); + + out = ssymv( 'upper', 3, 0.0, a, 1, 3, 0, x, 1, 0, 5.0, y, 1, 0 ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + expected = new Float32Array( [ 0.0, 0.0, 0.0 ] ); - out = ssymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, a, rxpyp.lda, x, rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, y, rxpyp.strideY, rxpyp.offsetY ); + out = ssymv( 'upper', 3, 0.0, a, 1, 3, 0, x, 1, 0, 0.0, y, -1, 2 ); t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'if `N` is zero or the scalar constants are zero and unity, respectively, the function returns the second input vector unchanged (row-major)', function test( t ) { +tape( 'when `α` is zero, the function scales the second input vector (column-major, lower)', function test( t ) { var expected; var out; var a; var x; var y; - a = new Float32Array( rxpyp.A ); - x = new Float32Array( rxpyp.x ); - y = new Float32Array( rxpyp.y ); + a = ones( 9, 'float32' ); + x = ones( 3, 'float32' ); + y = ones( 3, 'float32' ); - expected = new Float32Array( rxpyp.y ); + expected = new Float32Array( [ 5.0, 5.0, 5.0 ] ); - out = ssymv( rxpyp.order, rxpyp.uplo, 0, rxpyp.alpha, a, rxpyp.lda, x, rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, y, rxpyp.strideY, rxpyp.offsetY ); + out = ssymv( 'lower', 3, 0.0, a, 1, 3, 0, x, 1, 0, 5.0, y, -1, 2 ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); - out = ssymv( rxpyp.order, rxpyp.uplo, rxpyp.N, 0.0, a, rxpyp.lda, x, rxpyp.strideX, rxpyp.offsetX, 1.0, y, rxpyp.strideY, rxpyp.offsetY ); + expected = new Float32Array( [ 0.0, 0.0, 0.0 ] ); + + out = ssymv( 'lower', 3, 0.0, a, 1, 3, 0, x, 1, 0, 0.0, y, 1, 0 ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'if `N` is zero or the scalar constants are zero and unity, respectively, the function returns the second input vector unchanged (column-major)', function test( t ) { +tape( 'the function supports specifying the strides of the first and second dimension of `A` (row-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( cxpyp.A ); - x = new Float32Array( cxpyp.x ); - y = new Float32Array( cxpyp.y ); + data = rsa1sa2; - expected = new Float32Array( cxpyp.y ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - out = ssymv( cxpyp.order, cxpyp.uplo, 0, cxpyp.alpha, a, cxpyp.lda, x, cxpyp.strideX, cxpyp.offsetX, cxpyp.beta, y, cxpyp.strideY, cxpyp.offsetY ); + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying the strides of the first and second dimension of `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = csa1sa2; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); - out = ssymv( cxpyp.order, cxpyp.uplo, cxpyp.N, 0.0, a, cxpyp.lda, x, cxpyp.strideX, cxpyp.offsetX, 1.0, y, cxpyp.strideY, cxpyp.offsetY ); + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'when `α` is zero, the function scales the second input vector (row-major, upper)', 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; var a; var x; var y; - a = ones( 9, 'float32' ); - x = ones( 3, 'float32' ); - y = ones( 3, 'float32' ); + data = rsa1nsa2; - expected = new Float32Array( [ 5.0, 5.0, 5.0 ] ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); - out = ssymv( 'row-major', 'upper', 3, 0.0, a, 3, x, 1, 0, 5.0, y, 1, 0 ); + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); - expected = new Float32Array( [ 0.0, 0.0, 0.0 ] ); + t.end(); +}); + +tape( 'the function supports a negative stride for the first dimension of `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = csa1nsa2; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - out = ssymv( 'row-major', 'upper', 3, 0.0, a, 3, x, 1, 0, 0.0, y, -1, 2 ); + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'when `α` is zero, the function scales the second input vector (row-major, lower)', 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; var a; var x; var y; - a = ones( 9, 'float32' ); - x = ones( 3, 'float32' ); - y = ones( 3, 'float32' ); + data = rsa1sa2n; - expected = new Float32Array( [ 5.0, 5.0, 5.0 ] ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); - out = ssymv( 'row-major', 'lower', 3, 0.0, a, 3, x, 1, 0, 5.0, y, -1, 2 ); + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); - expected = new Float32Array( [ 0.0, 0.0, 0.0 ] ); + t.end(); +}); + +tape( 'the function supports a negative stride for the second dimension of `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; - out = ssymv( 'row-major', 'lower', 3, 0.0, a, 3, x, 1, 0, 0.0, y, 1, 0 ); + data = csa1sa2n; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'when `α` is zero, the function scales the second input vector (column-major, upper)', function test( t ) { +tape( 'the function supports negative strides for `A` (row-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = ones( 9, 'float32' ); - x = ones( 3, 'float32' ); - y = ones( 3, 'float32' ); + data = rsa1nsa2n; - expected = new Float32Array( [ 5.0, 5.0, 5.0 ] ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); - out = ssymv( 'column-major', 'upper', 3, 0.0, a, 3, x, 1, 0, 5.0, y, 1, 0 ); + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); - expected = new Float32Array( [ 0.0, 0.0, 0.0 ] ); + t.end(); +}); - out = ssymv( 'column-major', 'upper', 3, 0.0, a, 3, x, 1, 0, 0.0, y, -1, 2 ); +tape( 'the function supports negative strides for `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = csa1nsa2n; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'when `α` is zero, the function scales the second input vector (column-major, lower)', function test( t ) { +tape( 'the function supports specifying an offset parameter for `A` (row-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = ones( 9, 'float32' ); - x = ones( 3, 'float32' ); - y = ones( 3, 'float32' ); + data = roa; - expected = new Float32Array( [ 5.0, 5.0, 5.0 ] ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); - out = ssymv( 'column-major', 'lower', 3, 0.0, a, 3, x, 1, 0, 5.0, y, -1, 2 ); + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); - expected = new Float32Array( [ 0.0, 0.0, 0.0 ] ); + t.end(); +}); + +tape( 'the function supports specifying an offset parameter for `A` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = coa; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = rxpyp; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying `x` and `y` strides (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = cxpyp; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = rxnyp; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `x` stride (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = cxnyp; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = rxpyn; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying a negative `y` stride (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = cxpyn; - out = ssymv( 'column-major', 'lower', 3, 0.0, a, 3, x, 1, 0, 0.0, y, 1, 0 ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying negative strides for `x` and `y` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = rxnyn; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying negative strides for `x` and `y` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = cxnyn; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset parameter for `x` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = rox; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset parameter for `x` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = cox; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset parameter for `y` (row-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = roy; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function supports specifying an offset parameter for `y` (column-major)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = coy; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports complex access patterns (row-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( rxnyn.A ); - x = new Float32Array( rxnyn.x ); - y = new Float32Array( rxnyn.y ); + data = rcap; - expected = new Float32Array( rxnyn.y_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - out = ssymv( rxnyn.order, rxnyn.uplo, rxnyn.N, rxnyn.alpha, a, rxnyn.lda, x, rxnyn.strideX, rxnyn.offsetX, rxnyn.beta, y, rxnyn.strideY, rxnyn.offsetY ); + expected = new Float32Array( data.y_out ); + + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports complex access patterns (column-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( cxnyn.A ); - x = new Float32Array( cxnyn.x ); - y = new Float32Array( cxnyn.y ); + data = ccap; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - expected = new Float32Array( cxnyn.y_out ); + expected = new Float32Array( data.y_out ); - out = ssymv( cxnyn.order, cxnyn.uplo, cxnyn.N, cxnyn.alpha, a, cxnyn.lda, x, cxnyn.strideX, cxnyn.offsetX, cxnyn.beta, y, cxnyn.strideY, cxnyn.offsetY ); + out = ssymv( data.uplo, data.N, data.alpha, a, data.strideA1, data.strideA2, data.offsetA, x, data.strideX, data.offsetX, data.beta, y, data.strideY, data.offsetY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); diff --git a/lib/node_modules/@stdlib/blas/base/ssymv/test/test.ssymv.js b/lib/node_modules/@stdlib/blas/base/ssymv/test/test.ssymv.js index e743e4ae0290..c70b88ed6323 100644 --- a/lib/node_modules/@stdlib/blas/base/ssymv/test/test.ssymv.js +++ b/lib/node_modules/@stdlib/blas/base/ssymv/test/test.ssymv.js @@ -24,56 +24,27 @@ var tape = require( 'tape' ); var Float32Array = require( '@stdlib/array/float32' ); -var EPS = require( '@stdlib/constants/float32/eps' ); -var abs = require( '@stdlib/math/base/special/abs' ); var ones = require( '@stdlib/array/ones' ); var ssymv = require( './../lib/ssymv.js' ); // FIXTURES // -var rxoyt = require( './fixtures/row_major_xoyt.json' ); +var ru = require( './fixtures/row_major_upper.json' ); +var rl = require( './fixtures/row_major_lower.json' ); var rxpyp = require( './fixtures/row_major_xpyp.json' ); var rxnyp = require( './fixtures/row_major_xnyp.json' ); var rxpyn = require( './fixtures/row_major_xpyn.json' ); var rxnyn = require( './fixtures/row_major_xnyn.json' ); -var cxoyt = require( './fixtures/column_major_xoyt.json' ); +var cu = require( './fixtures/column_major_upper.json' ); +var cl = require( './fixtures/column_major_lower.json' ); var cxpyp = require( './fixtures/column_major_xpyp.json' ); var cxnyp = require( './fixtures/column_major_xnyp.json' ); var cxpyn = require( './fixtures/column_major_xpyn.json' ); var cxnyn = require( './fixtures/column_major_xnyn.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 ) { @@ -89,8 +60,11 @@ tape( 'the function has an arity of 11', 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 = ru; + values = [ 'foo', 'bar', @@ -105,15 +79,18 @@ tape( 'the function throws an error if provided an invalid first argument', func function badValue( value ) { return function badValue() { - ssymv( value, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float32Array( rxpyp.a ), rxpyp.lda, new Float32Array( rxpyp.x ), rxpyp.strideX, rxpyp.beta, new Float32Array( rxpyp.y ), rxpyp.strideY ); + ssymv( value, data.uplo, data.N, data.alpha, new Float32Array( data.a ), data.lda, new Float32Array( data.x ), data.strideX, data.beta, new Float32Array( data.y ), data.strideY ); }; } }); tape( 'the function throws an error if provided an invalid second argument', function test( t ) { var values; + var data; var i; + data = ru; + values = [ 'foo', 'bar', @@ -128,15 +105,18 @@ tape( 'the function throws an error if provided an invalid second argument', fun function badValue( value ) { return function badValue() { - ssymv( rxpyp.order, value, rxpyp.N, rxpyp.alpha, new Float32Array( rxpyp.a ), rxpyp.lda, new Float32Array( rxpyp.x ), rxpyp.strideX, rxpyp.beta, new Float32Array( rxpyp.y ), rxpyp.strideY ); + ssymv( data.order, value, data.N, data.alpha, new Float32Array( data.a ), data.lda, new Float32Array( data.x ), data.strideX, data.beta, new Float32Array( data.y ), data.strideY ); }; } }); tape( 'the function throws an error if provided an invalid third argument', function test( t ) { var values; + var data; var i; + data = ru; + values = [ -1, -2, @@ -150,15 +130,18 @@ tape( 'the function throws an error if provided an invalid third argument', func function badValue( value ) { return function badValue() { - ssymv( rxpyp.order, rxpyp.uplo, value, rxpyp.alpha, new Float32Array( rxpyp.a ), rxpyp.lda, new Float32Array( rxpyp.x ), rxpyp.strideX, rxpyp.beta, new Float32Array( rxpyp.y ), rxpyp.strideY ); + ssymv( data.order, data.uplo, value, data.alpha, new Float32Array( data.a ), data.lda, new Float32Array( data.x ), data.strideX, data.beta, new Float32Array( data.y ), data.strideY ); }; } }); tape( 'the function throws an error if provided an invalid sixth argument', function test( t ) { var values; + var data; var i; + data = ru; + values = [ 2, 1, @@ -175,15 +158,18 @@ tape( 'the function throws an error if provided an invalid sixth argument', func function badValue( value ) { return function badValue() { - ssymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float32Array( rxpyp.a ), value, new Float32Array( rxpyp.x ), rxpyp.strideX, rxpyp.beta, new Float32Array( rxpyp.y ), rxpyp.strideY ); + ssymv( data.order, data.uplo, data.N, data.alpha, new Float32Array( data.a ), value, new Float32Array( data.x ), data.strideX, data.beta, new Float32Array( data.y ), data.strideY ); }; } }); tape( 'the function throws an error if provided an invalid eighth argument', function test( t ) { var values; + var data; var i; + data = ru; + values = [ 0 ]; @@ -195,15 +181,18 @@ tape( 'the function throws an error if provided an invalid eighth argument', fun function badValue( value ) { return function badValue() { - ssymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float32Array( rxpyp.a ), rxpyp.lda, new Float32Array( rxpyp.x ), value, rxpyp.beta, new Float32Array( rxpyp.y ), rxpyp.strideY ); + ssymv( data.order, data.uplo, data.N, data.alpha, new Float32Array( data.a ), data.lda, new Float32Array( data.x ), value, data.beta, new Float32Array( data.y ), data.strideY ); }; } }); tape( 'the function throws an error if provided an invalid eleventh argument', function test( t ) { var values; + var data; var i; + data = ru; + values = [ 0 ]; @@ -215,182 +204,255 @@ tape( 'the function throws an error if provided an invalid eleventh argument', f function badValue( value ) { return function badValue() { - ssymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float32Array( rxpyp.a ), rxpyp.lda, new Float32Array( rxpyp.x ), rxpyp.strideX, rxpyp.beta, new Float32Array( rxpyp.y ), value ); + ssymv( data.order, data.uplo, data.N, data.alpha, new Float32Array( data.a ), data.lda, new Float32Array( data.x ), data.strideX, data.beta, new Float32Array( data.y ), value ); }; } }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (row-major, sx=1, sy=1)', function test( t ) { +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (row-major, upper)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = ru; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.order, data.uplo, data.N, data.alpha, a, data.lda, x, data.strideX, data.beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, upper)', function test( t ) { + var expected; + var data; + var out; + var a; + var x; + var y; + + data = cu; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + expected = new Float32Array( data.y_out ); + + out = ssymv( data.order, data.uplo, data.N, data.alpha, a, data.lda, x, data.strideX, data.beta, y, data.strideY ); + t.strictEqual( out, y, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); + + t.end(); +}); + +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (row-major, lower)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( rxpyp.A ); - x = new Float32Array( rxpyp.x ); - y = new Float32Array( rxpyp.y ); + data = rl; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - expected = new Float32Array( rxpyp.y_out ); + expected = new Float32Array( data.y_out ); - out = ssymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, a, rxpyp.lda, x, rxpyp.strideX, rxpyp.beta, y, rxpyp.strideY ); + out = ssymv( data.order, data.uplo, data.N, data.alpha, a, data.lda, x, data.strideX, data.beta, y, data.strideY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (column-major, sx=1, sy=1)', function test( t ) { +tape( 'the function performs the matrix-vector operation `y = α*A*x + β*y` (column-major, lower)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( cxpyp.A ); - x = new Float32Array( cxpyp.x ); - y = new Float32Array( cxpyp.y ); + data = cl; - expected = new Float32Array( cxpyp.y_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - out = ssymv( cxpyp.order, cxpyp.uplo, cxpyp.N, cxpyp.alpha, a, cxpyp.lda, x, cxpyp.strideX, cxpyp.beta, y, cxpyp.strideY ); + expected = new Float32Array( data.y_out ); + + out = ssymv( data.order, data.uplo, data.N, data.alpha, a, data.lda, x, data.strideX, data.beta, y, data.strideY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (row-major, sx=1, sy=2)', function test( t ) { +tape( 'the function supports specifying `x` and `y` strides (row-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( rxoyt.A ); - x = new Float32Array( rxoyt.x ); - y = new Float32Array( rxoyt.y ); + data = rxpyp; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - expected = new Float32Array( rxoyt.y_out ); + expected = new Float32Array( data.y_out ); - out = ssymv( rxoyt.order, rxoyt.uplo, rxoyt.N, rxoyt.alpha, a, rxoyt.lda, x, rxoyt.strideX, rxoyt.beta, y, rxoyt.strideY ); + out = ssymv( data.order, data.uplo, data.N, data.alpha, a, data.lda, x, data.strideX, data.beta, y, data.strideY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (column-major, sx=1, sy=2)', function test( t ) { +tape( 'the function supports specifying `x` and `y` strides (column-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( cxoyt.A ); - x = new Float32Array( cxoyt.x ); - y = new Float32Array( cxoyt.y ); + data = cxpyp; - expected = new Float32Array( cxoyt.y_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - out = ssymv( cxoyt.order, cxoyt.uplo, cxoyt.N, cxoyt.alpha, a, cxoyt.lda, x, cxoyt.strideX, cxoyt.beta, y, cxoyt.strideY ); + expected = new Float32Array( data.y_out ); + + out = ssymv( data.order, data.uplo, data.N, data.alpha, a, data.lda, x, data.strideX, data.beta, y, data.strideY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (row-major, sx=1, sy=-1)', function test( t ) { +tape( 'the function supports specifying a negative `x` stride (row-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( rxpyn.A ); - x = new Float32Array( rxpyn.x ); - y = new Float32Array( rxpyn.y ); + data = rxnyp; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - expected = new Float32Array( rxpyn.y_out ); + expected = new Float32Array( data.y_out ); - out = ssymv( rxpyn.order, rxpyn.uplo, rxpyn.N, rxpyn.alpha, a, rxpyn.lda, x, rxpyn.strideX, rxpyn.beta, y, rxpyn.strideY ); + out = ssymv( data.order, data.uplo, data.N, data.alpha, a, data.lda, x, data.strideX, data.beta, y, data.strideY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (column-major, sx=1, sy=-1)', function test( t ) { +tape( 'the function supports specifying a negative `x` stride (column-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( cxpyn.A ); - x = new Float32Array( cxpyn.x ); - y = new Float32Array( cxpyn.y ); + data = cxnyp; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - expected = new Float32Array( cxpyn.y_out ); + expected = new Float32Array( data.y_out ); - out = ssymv( cxpyn.order, cxpyn.uplo, cxpyn.N, cxpyn.alpha, a, cxpyn.lda, x, cxpyn.strideX, cxpyn.beta, y, cxpyn.strideY ); + out = ssymv( data.order, data.uplo, data.N, data.alpha, a, data.lda, x, data.strideX, data.beta, y, data.strideY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (row-major, sx=-1, sy=1)', function test( t ) { +tape( 'the function supports specifying a negative `y` stride (row-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( rxnyp.A ); - x = new Float32Array( rxnyp.x ); - y = new Float32Array( rxnyp.y ); + data = rxpyn; - expected = new Float32Array( rxnyp.y_out ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - out = ssymv( rxnyp.order, rxnyp.uplo, rxnyp.N, rxnyp.alpha, a, rxnyp.lda, x, rxnyp.strideX, rxnyp.beta, y, rxnyp.strideY ); + expected = new Float32Array( data.y_out ); + + out = ssymv( data.order, data.uplo, data.N, data.alpha, a, data.lda, x, data.strideX, data.beta, y, data.strideY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); -tape( 'the function performs the matrix-vector operation `y = alpha*A*x + beta*y` where `alpha` and `beta` are scalars, `x` and `y` are `n` element vectors, and `A` is an `n` by `n` symmetric matrix (column-major, sx=-1, sy=1)', function test( t ) { +tape( 'the function supports specifying a negative `y` stride (column-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( cxnyp.A ); - x = new Float32Array( cxnyp.x ); - y = new Float32Array( cxnyp.y ); + data = cxpyn; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - expected = new Float32Array( cxnyp.y_out ); + expected = new Float32Array( data.y_out ); - out = ssymv( cxnyp.order, cxnyp.uplo, cxnyp.N, cxnyp.alpha, a, cxnyp.lda, x, cxnyp.strideX, cxnyp.beta, y, cxnyp.strideY ); + out = ssymv( data.order, data.uplo, data.N, data.alpha, a, data.lda, x, data.strideX, data.beta, y, data.strideY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); tape( 'the function returns a reference to the second input vector', function test( t ) { + var data; var out; var a; var x; var y; - a = new Float32Array( rxpyp.A ); - x = new Float32Array( rxpyp.x ); - y = new Float32Array( rxpyp.y ); + data = rxpyp; - out = ssymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, a, rxpyp.lda, x, rxpyp.strideX, rxpyp.beta, y, rxpyp.strideY ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); + + out = ssymv( data.order, data.uplo, data.N, data.alpha, a, data.lda, x, data.strideX, data.beta, y, data.strideY ); t.strictEqual( out, y, 'returns expected value' ); t.end(); @@ -398,48 +460,54 @@ tape( 'the function returns a reference to the second input vector', function te tape( 'if `N` is zero or the scalar constants are zero and unity, respectively, the function returns the second input vector unchanged (row-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( rxpyp.A ); - x = new Float32Array( rxpyp.x ); - y = new Float32Array( rxpyp.y ); + data = rl; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - expected = new Float32Array( rxpyp.y ); + expected = new Float32Array( data.y ); - out = ssymv( rxpyp.order, rxpyp.uplo, 0, rxpyp.alpha, a, rxpyp.lda, x, rxpyp.strideX, rxpyp.beta, y, rxpyp.strideY ); + out = ssymv( data.order, data.uplo, 0, data.alpha, a, data.lda, x, data.strideX, data.beta, y, data.strideY ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); - out = ssymv( rxpyp.order, rxpyp.uplo, rxpyp.N, 0.0, a, rxpyp.lda, x, rxpyp.strideX, 1.0, y, rxpyp.strideY ); + out = ssymv( data.order, data.uplo, data.N, 0.0, a, data.lda, x, data.strideX, 1.0, y, data.strideY ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); tape( 'if `N` is zero or the scalar constants are zero and unity, respectively, the function returns the second input vector unchanged (column-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( cxpyp.A ); - x = new Float32Array( cxpyp.x ); - y = new Float32Array( cxpyp.y ); + data = cl; - expected = new Float32Array( cxpyp.y ); + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - out = ssymv( cxpyp.order, cxpyp.uplo, 0, cxpyp.alpha, a, cxpyp.lda, x, cxpyp.strideX, cxpyp.beta, y, cxpyp.strideY ); + expected = new Float32Array( data.y ); + + out = ssymv( data.order, data.uplo, 0, data.alpha, a, data.lda, x, data.strideX, data.beta, y, data.strideY ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); - out = ssymv( cxpyp.order, cxpyp.uplo, cxpyp.N, 0.0, a, cxpyp.lda, x, cxpyp.strideX, 1.0, y, cxpyp.strideY ); + out = ssymv( data.order, data.uplo, data.N, 0.0, a, data.lda, x, data.strideX, 1.0, y, data.strideY ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); @@ -459,13 +527,13 @@ tape( 'when `α` is zero, the function scales the second input vector (row-major out = ssymv( 'row-major', 'upper', 3, 0.0, a, 3, x, 1, 5.0, y, 1 ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); expected = new Float32Array( [ 0.0, 0.0, 0.0 ] ); out = ssymv( 'row-major', 'upper', 3, 0.0, a, 3, x, 1, 0.0, y, -1 ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); @@ -485,13 +553,13 @@ tape( 'when `α` is zero, the function scales the second input vector (row-major out = ssymv( 'row-major', 'lower', 3, 0.0, a, 3, x, 1, 5.0, y, -1 ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); expected = new Float32Array( [ 0.0, 0.0, 0.0 ] ); out = ssymv( 'row-major', 'lower', 3, 0.0, a, 3, x, 1, 0.0, y, 1 ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); @@ -511,13 +579,13 @@ tape( 'when `α` is zero, the function scales the second input vector (column-ma out = ssymv( 'column-major', 'upper', 3, 0.0, a, 3, x, 1, 5.0, y, 1 ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); expected = new Float32Array( [ 0.0, 0.0, 0.0 ] ); out = ssymv( 'column-major', 'upper', 3, 0.0, a, 3, x, 1, 0.0, y, -1 ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); @@ -537,53 +605,59 @@ tape( 'when `α` is zero, the function scales the second input vector (column-ma out = ssymv( 'column-major', 'lower', 3, 0.0, a, 3, x, 1, 5.0, y, -1 ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); expected = new Float32Array( [ 0.0, 0.0, 0.0 ] ); out = ssymv( 'column-major', 'lower', 3, 0.0, a, 3, x, 1, 0.0, y, 1 ); t.strictEqual( out, y, 'returns expected value' ); - t.deepEqual( y, expected, 'returns expected value' ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports complex access patterns (row-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( rxnyn.A ); - x = new Float32Array( rxnyn.x ); - y = new Float32Array( rxnyn.y ); + data = rxnyn; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - expected = new Float32Array( rxnyn.y_out ); + expected = new Float32Array( data.y_out ); - out = ssymv( rxnyn.order, rxnyn.uplo, rxnyn.N, rxnyn.alpha, a, rxnyn.lda, x, rxnyn.strideX, rxnyn.beta, y, rxnyn.strideY ); + out = ssymv( data.order, data.uplo, data.N, data.alpha, a, data.lda, x, data.strideX, data.beta, y, data.strideY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); }); tape( 'the function supports complex access patterns (column-major)', function test( t ) { var expected; + var data; var out; var a; var x; var y; - a = new Float32Array( cxnyn.A ); - x = new Float32Array( cxnyn.x ); - y = new Float32Array( cxnyn.y ); + data = cxnyn; + + a = new Float32Array( data.A ); + x = new Float32Array( data.x ); + y = new Float32Array( data.y ); - expected = new Float32Array( cxnyn.y_out ); + expected = new Float32Array( data.y_out ); - out = ssymv( cxnyn.order, cxnyn.uplo, cxnyn.N, cxnyn.alpha, a, cxnyn.lda, x, cxnyn.strideX, cxnyn.beta, y, cxnyn.strideY ); + out = ssymv( data.order, data.uplo, data.N, data.alpha, a, data.lda, x, data.strideX, data.beta, y, data.strideY ); t.strictEqual( out, y, 'returns expected value' ); - isApprox( t, y, expected, 2.0 ); + t.deepEqual( out, expected, 'returns expected value' ); t.end(); });