diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/README.md b/lib/node_modules/@stdlib/blas/base/dsymv/README.md index 4168a81bd98..98d35a4569b 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/README.md +++ b/lib/node_modules/@stdlib/blas/base/dsymv/README.md @@ -20,7 +20,7 @@ limitations under the License. # dsymv -> 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`.
@@ -92,7 +92,7 @@ dsymv( 'row-major', 'upper', 3, 1.0, A, 3, x1, -1, 1.0, y1, -1 ); // y0 => [ 1.0, 4.0, 3.0, 2.0 ] ``` -#### dsymv.ndarray( order, uplo, N, α, A, LDA, x, sx, ox, β, y, sy, oy ) +#### dsymv.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. @@ -103,12 +103,15 @@ var A = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); var x = new Float64Array( [ 1.0, 2.0, 3.0 ] ); var y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); -dsymv.ndarray( 'row-major', 'upper', 3, 2.0, A, 3, x, -1, 2, 1.0, y, 1, 0 ); +dsymv.ndarray( 'upper', 3, 2.0, A, 3, 1, 0, x, -1, 2, 1.0, y, 1, 0 ); // y => [ 7.0, 10.0, 9.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`. @@ -121,7 +124,7 @@ var A = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); var y = new Float64Array( [ 1.0, 1.0, 1.0 ] ); -dsymv.ndarray( 'row-major', 'lower', 3, 1.0, A, 3, x, -1, 2, 1.0, y, -1, 2 ); +dsymv.ndarray( 'lower', 3, 1.0, A, 3, 1, 0, x, -1, 2, 1.0, y, -1, 2 ); // y => [ 4.0, 3.0, 2.0 ] ``` @@ -154,13 +157,16 @@ var opts = { 'dtype': 'float64' }; -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 ); -dsymv.ndarray( 'row-major', 'upper', N, 1.0, A, N, x, 1, 0, 1.0, y, 1, 0 ); +dsymv( 'row-major', 'upper', N, 1.0, A, N, x, 1, 1.0, y, 1 ); +console.log( y ); + +dsymv.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/dsymv/benchmark/benchmark.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsymv/benchmark/benchmark.ndarray.js index b612f6e7c38..5138deb33ef 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/benchmark/benchmark.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsymv/benchmark/benchmark.ndarray.js @@ -64,7 +64,7 @@ function createBenchmark( N ) { b.tic(); for ( i = 0; i < b.iterations; i++ ) { - z = dsymv( 'row-major', 'upper', N, 1.0, A, N, x, 1, 0, 1.0, y, 1, 0 ); + z = dsymv( 'upper', N, 1.0, A, N, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); if ( isnan( z[ i%z.length ] ) ) { b.fail( 'should not return NaN' ); } diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/docs/repl.txt b/lib/node_modules/@stdlib/blas/base/dsymv/docs/repl.txt index c7fc6bf494f..99d0d12925c 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/docs/repl.txt +++ b/lib/node_modules/@stdlib/blas/base/dsymv/docs/repl.txt @@ -28,7 +28,7 @@ Scalar constant. A: Float64Array - 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: Float64Array - 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: Float64Array Input vector. @@ -126,8 +127,7 @@ > var x = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); > var y = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] ); > var A = new {{alias:@stdlib/array/float64}}( [ 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/dsymv/docs/types/index.d.ts b/lib/node_modules/@stdlib/blas/base/dsymv/docs/types/index.d.ts index 47e632ca052..0ef381b67b5 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/blas/base/dsymv/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 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: Float64Array, LDA: number, x: Float64Array, strideX: number, beta: number, y: Float64Array, strideY: number ): Float64Array; /** - * 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 matrix + * @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 Float64Array( [ 1.0, 1.0, 1.0 ] ); * var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); * - * dsymv.ndarray( 'row-major', 'lower', 3, 1.0, A, 3, x, 1, 0, 0.0, y, 1, 0 ); + * dsymv.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: Float64Array, LDA: number, x: Float64Array, strideX: number, offsetX: number, beta: number, y: Float64Array, strideY: number, offsetY: number ): Float64Array; + ndarray( uplo: MatrixTriangle, N: number, alpha: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number, x: Float64Array, strideX: number, offsetX: number, beta: number, y: Float64Array, strideY: number, offsetY: number ): Float64Array; } /** -* 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 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 Float64Array( [ 1.0, 2.0, 3.0 ] ); * var y = new Float64Array( [ 1.0, 2.0, 3.0 ] ); * -* dsymv.ndarray( 'row-major', 'upper', 3, 2.0, A, 3, x, 1, 0, 1.0, y, 2, 0 ); +* dsymv.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 dsymv: Routine; diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/docs/types/test.ts b/lib/node_modules/@stdlib/blas/base/dsymv/docs/types/test.ts index 12c0c5590cb..ee001fe012e 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/docs/types/test.ts +++ b/lib/node_modules/@stdlib/blas/base/dsymv/docs/types/test.ts @@ -23,34 +23,34 @@ import dsymv = require( './index' ); // The function returns a Float64Array... { - const x = new Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectType Float64Array + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectType Float64Array } // The compiler throws an error if the function is provided a first argument which is not a string... { - const x = new Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv( 10, 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( true, 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( false, 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( null, 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( undefined, 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( [], 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( {}, 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( ( x: number ): number => x, 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv( 10, 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( true, 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( false, 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( null, 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( undefined, 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( [], 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( {}, 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( ( 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 Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); dsymv( 'row-major', 10, 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError dsymv( 'row-major', true, 10, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError @@ -64,9 +64,9 @@ import dsymv = require( './index' ); // The compiler throws an error if the function is provided a third argument which is not a number... { - const x = new Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); dsymv( 'row-major', 'upper', '10', 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError dsymv( 'row-major', 'upper', true, 1.0, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError @@ -80,387 +80,404 @@ import dsymv = require( './index' ); // The compiler throws an error if the function is provided a fourth argument which is not a number... { - const x = new Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv( 'row-major', 'upper', 10, '10', A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, true, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, false, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, null, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, undefined, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, [], A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, {}, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, ( x: number ): number => x, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv( 'row-major', 'upper', 5, '10', A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, true, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, false, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, null, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, undefined, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, [], A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, {}, A, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( '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 Float64Array... { - const x = new Float64Array( 10 ); - const y = new Float64Array( 10 ); - - dsymv( 'row-major', 'upper', 10, 1.0, 10, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, '10', 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, true, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, false, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, null, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, undefined, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, [ '1' ], 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, {}, 10, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, ( x: number ): number => x, 10, x, 1, 1.0, y, 1 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + + dsymv( 'row-major', 'upper', 5, 1.0, 10, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, '10', 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, true, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, false, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, null, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, undefined, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, [ '1' ], 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, {}, 10, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( '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 Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv( 'row-major', 'upper', 10, 1.0, A, '10', x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, true, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, false, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, null, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, undefined, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, [], x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, {}, x, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, ( x: number ): number => x, x, 1, 1.0, y, 1 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv( 'row-major', 'upper', 5, 1.0, A, '10', x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, true, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, false, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, null, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, undefined, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, [], x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, {}, x, 1, 1.0, y, 1 ); // $ExpectError + dsymv( '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 Float64Array... { - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, 10, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, '10', 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, true, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, false, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, null, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, undefined, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, [ '1' ], 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, {}, 1, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, ( x: number ): number => x, 1, 1.0, y, 1 ); // $ExpectError + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, 10, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, '10', 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, true, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, false, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, null, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, undefined, 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, [ '1' ], 1, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, {}, 1, 1.0, y, 1 ); // $ExpectError + dsymv( '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 Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, '10', 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, true, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, false, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, null, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, undefined, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, [], 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, {}, 1.0, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, ( x: number ): number => x, 1.0, y, 1 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, '10', 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, true, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, false, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, null, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, undefined, 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, [], 1.0, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, {}, 1.0, y, 1 ); // $ExpectError + dsymv( '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 Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, '10', y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, true, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, false, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, null, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, undefined, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, [], y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, {}, y, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, ( x: number ): number => x, y, 1 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, '10', y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, true, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, false, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, null, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, undefined, y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, [], y, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, {}, y, 1 ); // $ExpectError + dsymv( '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 Float64Array... { - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, 10, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, '10', 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, true, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, false, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, null, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, undefined, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, [ '1' ], 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, {}, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, ( x: number ): number => x, 1 ); // $ExpectError + const x = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, 10, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, '10', 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, true, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, false, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, null, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, undefined, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, [ '1' ], 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, {}, 1 ); // $ExpectError + dsymv( '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 Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, '10' ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, true ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, false ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, null ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, undefined ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, [] ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, {} ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, ( x: number ): number => x ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, '10' ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, true ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, false ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, null ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, undefined ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, [] ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y, {} ); // $ExpectError + dsymv( '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 Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); dsymv(); // $ExpectError dsymv( 'row-major' ); // $ExpectError dsymv( 'row-major', 'upper' ); // $ExpectError - dsymv( 'row-major', 'upper', 10 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0 ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y ); // $ExpectError - dsymv( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 1.0, y, 1, 10 ); // $ExpectError + dsymv( 'row-major', 'upper', 5 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0 ); // $ExpectError + dsymv( 'row-major', 'upper', 5, 1.0, A, 10, x, 1, 1.0, y ); // $ExpectError + dsymv( '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 Float64Array... { - const x = new Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectType Float64Array + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectType Float64Array } // The compiler throws an error if the function is provided a first argument which is not a string... { - const x = new Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv.ndarray( 10, 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( true, 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( false, 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( null, 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( undefined, 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( [], 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( {}, 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( ( x: number ): number => x, 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv.ndarray( 10, 10, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( true, 10, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( false, 10, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( null, 10, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( undefined, 10, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( [ '1' ], 10, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( {}, 10, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.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 Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv.ndarray( 'row-major', 10, 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', true, 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', false, 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', null, 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', undefined, 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', [ '1' ], 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', {}, 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', ( x: number ): number => x, 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv.ndarray( 'upper', '10', 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', true, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', false, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', null, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', undefined, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', [], 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', {}, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.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 Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv.ndarray( 'row-major', 'upper', '10', 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', true, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', false, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', null, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', undefined, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', [], 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', {}, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', ( x: number ): number => x, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv.ndarray( 'upper', 5, '10', A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, true, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, false, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, null, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, undefined, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, [], A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, {}, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.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 Float64Array... { - const x = new Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv.ndarray( 'row-major', 'upper', 10, '10', A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, true, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, false, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, null, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, undefined, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, [], A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, {}, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, ( x: number ): number => x, A, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + + dsymv.ndarray( 'upper', 5, 1.0, 10, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, '10', 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, true, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, false, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, null, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, undefined, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, [ '1' ], 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, {}, 5, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.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 Float64Array... +// The compiler throws an error if the function is provided a fifth argument which is not a number... { - const x = new Float64Array( 10 ); - const y = new Float64Array( 10 ); - - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, 10, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, '10', 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, true, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, false, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, null, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, undefined, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, [ '1' ], 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, {}, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, ( x: number ): number => x, 10, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv.ndarray( 'upper', 5, 1.0, A, '10', 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, true, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, false, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, null, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, undefined, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, [], 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, {}, 1, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.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 Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, '10', x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, true, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, false, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, null, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, undefined, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, [], x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, {}, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, ( x: number ): number => x, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv.ndarray( 'upper', 5, 1.0, A, 5, '10', 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, true, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, false, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, null, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, undefined, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, [], 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, {}, 0, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.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 Float64Array... +// The compiler throws an error if the function is provided a seventh argument which is not a number... { - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, 10, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, '10', 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, true, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, false, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, null, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, undefined, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, [ '1' ], 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, {}, 1, 0, 1.0, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, ( x: number ): number => x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, '10', x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, true, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, false, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, null, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, undefined, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, [], x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, {}, x, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.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 Float64Array... { - const x = new Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, '10', 0, 1.0, y, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, true, 0, 1.0, y, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, false, 0, 1.0, y, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, null, 0, 1.0, y, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, undefined, 0, 1.0, y, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, [], 0, 1.0, y, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, {}, 0, 1.0, y, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, ( x: number ): number => x, 0, 1.0, y, 1 ); // $ExpectError + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, 10, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, '10', 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, true, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, false, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, null, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, undefined, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, [ '1' ], 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, {}, 1, 0, 1.0, y, 1, 0 ); // $ExpectError + dsymv.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 Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, '10', 1.0, y, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, true, 1.0, y, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, false, 1.0, y, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, null, 1.0, y, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, undefined, 1.0, y, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, [], 1.0, y, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, {}, 1.0, y, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, ( x: number ): number => x, 1.0, y, 1 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, '10', 0, 1.0, y, 1 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, true, 0, 1.0, y, 1 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, false, 0, 1.0, y, 1 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, null, 0, 1.0, y, 1 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, undefined, 0, 1.0, y, 1 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, [], 0, 1.0, y, 1 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, {}, 0, 1.0, y, 1 ); // $ExpectError + dsymv.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 Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, '10', y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, true, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, false, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, null, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, undefined, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, [], y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, {}, y, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, ( x: number ): number => x, y, 1, 0 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, '10', 1.0, y, 1 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, true, 1.0, y, 1 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, false, 1.0, y, 1 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, null, 1.0, y, 1 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, undefined, 1.0, y, 1 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, [], 1.0, y, 1 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, {}, 1.0, y, 1 ); // $ExpectError + dsymv.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 Float64Array... +// The compiler throws an error if the function is provided an eleventh argument which is not a number... { - const x = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, 10, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, '10', 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, true, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, false, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, null, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, undefined, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, [ '1' ], 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, {}, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, ( x: number ): number => x, 1, 0 ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, '10', y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, true, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, false, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, null, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, undefined, y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, [], y, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, {}, y, 1, 0 ); // $ExpectError + dsymv.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 Float64Array... { - const x = new Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, '10', 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, true, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, false, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, null, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, undefined, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, [], 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, {}, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, ( x: number ): number => x, 0 ); // $ExpectError + const x = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, 10, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, '10', 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, true, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, false, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, null, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, undefined, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, [ '1' ], 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, {}, 1, 0 ); // $ExpectError + dsymv.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 Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); - - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, '10' ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, true ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, false ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, null ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, undefined ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, [] ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, {} ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, ( x: number ): number => x ); // $ExpectError + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, '10', 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, true, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, false, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, null, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, undefined, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, [], 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, {}, 0 ); // $ExpectError + dsymv.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 Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); + + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, '10' ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, true ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, false ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, null ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, undefined ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, [] ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1, {} ); // $ExpectError + dsymv.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 Float64Array( 10 ); - const y = new Float64Array( 10 ); - const A = new Float64Array( 20 ); + const x = new Float64Array( 5 ); + const y = new Float64Array( 5 ); + const A = new Float64Array( 25 ); dsymv.ndarray(); // $ExpectError - dsymv.ndarray( 'row-major' ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper' ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1 ); // $ExpectError - dsymv.ndarray( 'row-major', 'upper', 10, 1.0, A, 10, x, 1, 0, 1.0, y, 1, 0, 10 ); // $ExpectError + dsymv.ndarray( 'upper' ); // $ExpectError + dsymv.ndarray( 'upper', 5 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0 ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y ); // $ExpectError + dsymv.ndarray( 'upper', 5, 1.0, A, 5, 1, 0, x, 1, 0, 1.0, y, 1 ); // $ExpectError + dsymv.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/dsymv/examples/index.js b/lib/node_modules/@stdlib/blas/base/dsymv/examples/index.js index 26ee7647750..d355549f071 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/examples/index.js +++ b/lib/node_modules/@stdlib/blas/base/dsymv/examples/index.js @@ -26,11 +26,14 @@ var opts = { 'dtype': 'float64' }; -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 ); -dsymv.ndarray( 'row-major', 'upper', N, 1.0, A, N, x, 1, 0, 1.0, y, 1, 0 ); +dsymv( 'row-major', 'upper', N, 1.0, A, N, x, 1, 1.0, y, 1 ); +console.log( y ); + +dsymv.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/dsymv/lib/base.js b/lib/node_modules/@stdlib/blas/base/dsymv/lib/base.js new file mode 100644 index 00000000000..6a9b7f4cdb9 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/lib/base.js @@ -0,0 +1,147 @@ +/** +* @license Apache-2.0 +* +* Copyright (c) 2024 The Stdlib Authors. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +'use strict'; + +// MODULES // + +var 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; + + +// 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 {Float64Array} 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 {Float64Array} x - first input array +* @param {integer} strideX - `x` stride length +* @param {NonNegativeInteger} offsetX - starting index for `x` +* @param {number} beta - scalar constant +* @param {Float64Array} y - second input array +* @param {integer} strideY - `y` stride length +* @param {NonNegativeInteger} offsetY - starting index for `y` +* @returns {Float64Array} `y` +* +* @example +* var Float64Array = require( '@stdlib/array/float64' ); +* +* var A = new Float64Array( [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ] ); +* var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); +* var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); +* +* dsymv( 'lower', 3, 1.0, A, 3, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); +* // y => [ 1.0, 2.0, 3.0 ] +*/ +function dsymv( 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 oa; + + // Note on variable naming convention: sa#, ix#, i# where # corresponds to the loop number, with `0` being the innermost loop... + + 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 + } + // 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; + } + // Form: y = α*A*x + y + if ( + ( !isrm && uplo === 'upper' ) || + ( isrm && uplo === 'lower' ) + ) { + ix1 = offsetX; + iy1 = offsetY; + for ( i1 = 0; i1 < N; i1++ ) { + tmp1 = alpha * x[ ix1 ]; + tmp2 = 0.0; + ix0 = offsetX; + iy0 = offsetY; + oa = offsetA + (sa1*i1); + for ( i0 = 0; i0 < i1; i0++ ) { + y[ iy0 ] += tmp1 * A[ oa+(sa0*i0) ]; + tmp2 += A[ oa+(sa0*i0) ] * x[ ix0 ]; + ix0 += strideX; + iy0 += strideY; + } + y[ iy1 ] += ( tmp1 * A[ oa+(sa0*i1) ] ) + ( 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 = alpha * x[ ix1 ]; + tmp2 = 0.0; + oa = offsetA + (sa1*i1); + y[ iy1 ] += tmp1 * A[ oa+(sa0*i1) ]; + ix0 = ix1; + iy0 = iy1; + for ( i0 = i1+1; i0 < N; i0++ ) { + ix0 += strideX; + iy0 += strideY; + y[ iy0 ] += tmp1 * A[ oa+(sa0*i0) ]; + tmp2 += A[ oa+(sa0*i0) ] * x[ ix0 ]; + } + y[ iy1 ] += alpha * tmp2; + ix1 += strideX; + iy1 += strideY; + } + return y; +} + + +// EXPORTS // + +module.exports = dsymv; diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/lib/dsymv.js b/lib/node_modules/@stdlib/blas/base/dsymv/lib/dsymv.js index b34af44bc49..e2ee2a701a3 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/lib/dsymv.js +++ b/lib/node_modules/@stdlib/blas/base/dsymv/lib/dsymv.js @@ -20,23 +20,24 @@ // MODULES // -var dfill = require( '@stdlib/blas/ext/base/dfill' ); -var dscal = require( '@stdlib/blas/base/dscal' ); var max = require( '@stdlib/math/base/special/max' ); +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 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 {Float64Array} A - matrix +* @param {Float64Array} A - input matrix * @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) * @param {Float64Array} x - first input array * @param {integer} strideX - `x` stride length @@ -62,119 +63,42 @@ var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); * // y => [ 1.0, 2.0, 3.0 ] */ function dsymv( 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 sy; - 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 - sy = strideY; - if ( beta !== 1.0 ) { - if ( beta === 0.0 ) { - dfill( N, 0.0, y, strideY ); - } else { - if ( sy < 0 ) { - sy = -sy; - } - dscal( N, beta, y, sy ); - } - } - 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 ( - ( order === 'row-major' && uplo === 'upper' ) || - ( order === 'column-major' && uplo === 'lower' ) - ) { - ix = ox; - iy = oy; - for ( i = 0; i < N; i++ ) { - temp1 = alpha * x[ ix ]; - temp2 = 0.0; - jmin = i + 1; - jmax = N; - jx = ox + ( jmin*strideX ); - jy = oy + ( jmin*strideY ); - y[ iy ] += temp1 * A[ ( LDA * i ) + i ]; - for ( j = jmin; j < jmax; j++ ) { - k = ( LDA * i ) + j; - y[ jy ] += temp1 * A[ k ]; - temp2 += x[ jx ] * A[ k ]; - jx += strideX; - jy += strideY; - } - y[ iy ] += 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 = alpha * x[ ix ]; - temp2 = 0.0; - jmin = 0; - jmax = i; - jx = ox + ( jmin * strideX ); - jy = oy + ( jmin * strideY ); - y[ iy ] += temp1 * A[ ( LDA * i ) + i ]; - for ( j = jmin; j < jmax; j++ ) { - k = ( LDA * i ) + j; - y[ jy ] += temp1 * A[ k ]; - temp2 += x[ jx ] * A[ k ]; - jx += strideX; - jy += strideY; - } - y[ iy ] += alpha * temp2; - ix -= strideX; - iy -= 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; } - 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/dsymv/lib/index.js b/lib/node_modules/@stdlib/blas/base/dsymv/lib/index.js index e5cf53d01ee..d7b8aa97fed 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/lib/index.js +++ b/lib/node_modules/@stdlib/blas/base/dsymv/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/dsymv * @@ -42,7 +42,7 @@ * var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); * var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); * -* dsymv.ndarray( 'row-major', 'lower', 3, 1.0, A, 3, x, 1, 0, 0.0, y, 1, 0 ); +* dsymv.ndarray( 'lower', 3, 1.0, A, 3, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); * // y => [ 1.0, 2.0, 3.0 ] */ diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dsymv/lib/ndarray.js index f44649171e3..ccb1259472c 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsymv/lib/ndarray.js @@ -20,37 +20,36 @@ // MODULES // -var dfill = require( '@stdlib/blas/ext/base/dfill' ).ndarray; -var dscal = require( '@stdlib/blas/base/dscal' ).ndarray; -var max = require( '@stdlib/math/base/special/max' ); -var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var 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 {Float64Array} A - matrix -* @param {PositiveInteger} LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`) +* @param {Float64Array} 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 {Float64Array} 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 {Float64Array} 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 {Float64Array} `y` * * @example @@ -60,110 +59,32 @@ var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); * var x = new Float64Array( [ 1.0, 1.0, 1.0 ] ); * var y = new Float64Array( [ 0.0, 0.0, 0.0 ] ); * -* dsymv( 'row-major', 'lower', 3, 1.0, A, 3, x, 1, 0, 0.0, y, 1, 0 ); +* dsymv( 'lower', 3, 1.0, A, 3, 1, 0, x, 1, 0, 0.0, y, 1, 0 ); * // y => [ 1.0, 2.0, 3.0 ] */ -function dsymv( 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 dsymv( 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 ) { - dfill( N, 0.0, y, strideY, offsetY ); - } else { - dscal( N, beta, y, strideY, offsetY ); - } - } - if ( alpha === 0.0 ) { - return y; - } - ox = offsetX; - oy = offsetY; - - // Form: y = alpha*A*x + y - if ( - ( order === 'row-major' && uplo === 'upper' ) || - ( order === 'column-major' && uplo === 'lower' ) - ) { - ix = ox; - iy = oy; - for ( i = 0; i < N; i++ ) { - temp1 = alpha * x[ ix ]; - temp2 = 0.0; - jmin = i + 1; - jmax = N; - jx = ox + ( jmin * strideX ); - jy = oy + ( jmin * strideY ); - y[ iy ] += temp1 * A[ ( LDA * i ) + i ]; - for ( j = jmin; j < jmax; j++ ) { - k = ( LDA * i ) + j; - y[ jy ] += temp1 * A[ k ]; - temp2 += x[ jx ] * A[ k ]; - jx += strideX; - jy += strideY; - } - y[ iy ] += 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 = alpha * x[ ix ]; - temp2 = 0.0; - jmin = 0; - jmax = i; - jx = ox + ( jmin * strideX ); - jy = oy + ( jmin * strideY ); - y[ iy ] += temp1 * A[ ( LDA * i ) + i ]; - for ( j = jmin; j < jmax; j++ ) { - k = ( LDA * i ) + j; - y[ jy ] += temp1 * A[ k ]; - temp2 += x[ jx ] * A[ k ]; - jx += strideX; - jy += strideY; - } - y[ iy ] += 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/dsymv/package.json b/lib/node_modules/@stdlib/blas/base/dsymv/package.json index fe7e7ba5fec..05ea4c3d358 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/package.json +++ b/lib/node_modules/@stdlib/blas/base/dsymv/package.json @@ -1,7 +1,7 @@ { "name": "@stdlib/blas/base/dsymv", "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/dsymv/test/fixtures/column_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_complex_access_pattern.json new file mode 100644 index 00000000000..12e876432f6 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_complex_access_pattern.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 1.0, + "strideX": -2, + "offsetX": 5, + "strideY": 2, + "offsetY": 1, + "A": [ 999, 999, 999, 999, 999, 999, 6.0, 999, 5.0, 999, 3.0, 999, 999, 999, 999, 999, 999, 999, 5.0, 999, 4.0, 999, 2.0, 999, 999, 999, 999, 999, 999, 999, 3.0, 999, 2.0, 999, 1.0, 999, 999, 999, 999, 999, 999, 999 ], + "strideA1": -2, + "strideA2": -12, + "offsetA": 34, + "x": [ 0.0, 1.0, 0.0, 1.0, 0.0, 1.0 ], + "y": [ 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "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/dsymv/test/fixtures/column_major_lower.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_lower.json new file mode 100644 index 00000000000..3d3fc97f9e3 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_lower.json @@ -0,0 +1,19 @@ +{ + "order": "column-major", + "uplo": "lower", + "N": 3, + "lda": 3, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 2, + "offsetY": 0, + "A": [ 1.0, 2.0, 3.0, 2.0, 4.0, 5.0, 3.0, 5.0, 6.0 ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "y_out": [ 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_oa.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_oa.json new file mode 100644 index 00000000000..dfc4f8c6ae4 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_oa.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 2, + "offsetY": 0, + "A": [ 0.0, 0.0, 1.0, 2.0, 3.0, 2.0, 4.0, 5.0, 3.0, 5.0, 6.0 ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 2, + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "y_out": [ 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_ox.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_ox.json new file mode 100644 index 00000000000..4f303d09bf1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_ox.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 1, + "strideY": 2, + "offsetY": 0, + "A": [ 1.0, 2.0, 3.0, 2.0, 4.0, 5.0, 3.0, 5.0, 6.0 ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 0.0, 1.0, 1.0, 1.0 ], + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "y_out": [ 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_oy.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_oy.json new file mode 100644 index 00000000000..df5ccff87c0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_oy.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 2, + "offsetY": 1, + "A": [ 1.0, 2.0, 3.0, 2.0, 4.0, 5.0, 3.0, 5.0, 6.0 ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 0, + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "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/dsymv/test/fixtures/column_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_sa1_sa2.json new file mode 100644 index 00000000000..7e26e313c11 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_sa1_sa2.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 2, + "offsetY": 0, + "A": [ 999, 999, 999, 999, 999, 999, 1.0, 999, 2.0, 999, 3.0, 999, 999, 999, 999, 999, 999, 999, 2.0, 999, 4.0, 999, 5.0, 999, 999, 999, 999, 999, 999, 999, 3.0, 999, 5.0, 999, 6.0, 999, 999, 999, 999, 999, 999, 999 ], + "strideA1": 2, + "strideA2": 12, + "offsetA": 6, + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "y_out": [ 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_sa1_sa2n.json new file mode 100644 index 00000000000..2d4352798eb --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_sa1_sa2n.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 2, + "offsetY": 0, + "A": [ 999, 999, 999, 999, 999, 999, 3.0, 999, 5.0, 999, 6.0, 999, 999, 999, 999, 999, 999, 999, 2.0, 999, 4.0, 999, 5.0, 999, 999, 999, 999, 999, 999, 999, 1.0, 999, 2.0, 999, 3.0, 999, 999, 999, 999, 999, 999, 999 ], + "strideA1": 2, + "strideA2": -12, + "offsetA": 30, + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "y_out": [ 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_sa1n_sa2.json new file mode 100644 index 00000000000..8203c9c3d4c --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_sa1n_sa2.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 2, + "offsetY": 0, + "A": [ 999, 999, 999, 999, 999, 999, 3.0, 999, 2.0, 999, 1.0, 999, 999, 999, 999, 999, 999, 999, 5.0, 999, 4.0, 999, 2.0, 999, 999, 999, 999, 999, 999, 999, 6.0, 999, 5.0, 999, 3.0, 999, 999, 999, 999, 999, 999, 999 ], + "strideA1": -2, + "strideA2": 12, + "offsetA": 10, + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "y_out": [ 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_sa1n_sa2n.json new file mode 100644 index 00000000000..1d6a3c7d2d5 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_sa1n_sa2n.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 1.0, + "strideX": 1, + "offsetX": 0, + "strideY": 2, + "offsetY": 0, + "A": [ 999, 999, 999, 999, 999, 999, 6.0, 999, 5.0, 999, 3.0, 999, 999, 999, 999, 999, 999, 999, 5.0, 999, 4.0, 999, 2.0, 999, 999, 999, 999, 999, 999, 999, 3.0, 999, 2.0, 999, 1.0, 999, 999, 999, 999, 999, 999, 999 ], + "strideA1": -2, + "strideA2": -12, + "offsetA": 34, + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "y_out": [ 7.0, 0.0, 12.0, 0.0, 15.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_xoyt.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_upper.json similarity index 87% rename from lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_xoyt.json rename to lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_upper.json index 52fb03d1f33..1de0d2e16f1 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_xoyt.json +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_upper.json @@ -10,6 +10,9 @@ "strideY": 2, "offsetY": 0, "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 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/dsymv/test/fixtures/column_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_xnyn.json index 2fd5e82f07e..5554ec9cd80 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_xnyn.json +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_xnyn.json @@ -10,6 +10,9 @@ "strideY": -1, "offsetY": 2, "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 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/dsymv/test/fixtures/column_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_xnyp.json index ad0199f70d9..09acc9063d6 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_xnyp.json +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_xnyp.json @@ -10,6 +10,9 @@ "strideY": 1, "offsetY": 0, "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 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/dsymv/test/fixtures/column_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_xpyn.json index 0fba9d62725..cdf18f296e0 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_xpyn.json +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_xpyn.json @@ -10,6 +10,9 @@ "strideY": -1, "offsetY": 2, "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 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/dsymv/test/fixtures/column_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_xpyp.json index 11c4b7ffdcb..b2ab89cf8ac 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_xpyp.json +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/column_major_xpyp.json @@ -10,6 +10,9 @@ "strideY": 1, "offsetY": 0, "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 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/dsymv/test/fixtures/row_major_complex_access_pattern.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_complex_access_pattern.json new file mode 100644 index 00000000000..86c4544cef0 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_complex_access_pattern.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 2.0, + "strideX": -1, + "offsetX": 2, + "strideY": -2, + "offsetY": 4, + "A": [ 999, 6, 999, 5, 999, 3, 999, 999, 999, 999, 999, 999, 999, 999, 999, 5, 999, 4, 999, 2, 999, 999, 999, 999, 999, 999, 999, 999, 999, 3, 999, 2, 999, 1, 999, 999, 999, 999, 999, 999, 999, 999 ], + "strideA1": -14, + "strideA2": -2, + "offsetA": 33, + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "y_out": [ 16.0, 0.0, 13.0, 0.0, 8.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_lower.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_lower.json new file mode 100644 index 00000000000..e0271942a07 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_lower.json @@ -0,0 +1,19 @@ +{ + "order": "row-major", + "uplo": "lower", + "N": 3, + "lda": 3, + "alpha": 1.0, + "beta": 2.0, + "strideX": 1, + "offsetX": 0, + "strideY": 2, + "offsetY": 0, + "A": [ 1.0, 2.0, 4.0, 2.0, 3.0, 5.0, 4.0, 5.0, 6.0 ], + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "y_out": [ 9.0, 0.0, 12.0, 0.0, 17.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_oa.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_oa.json new file mode 100644 index 00000000000..8afe1a1c588 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_oa.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 2.0, + "strideX": 1, + "offsetX": 0, + "strideY": 2, + "offsetY": 0, + "A": [ 0.0, 0.0, 1.0, 2.0, 4.0, 2.0, 3.0, 5.0, 4.0, 5.0, 6.0 ], + "strideA1": 3, + "strideA2": 1, + "offsetA": 2, + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "y_out": [ 9.0, 0.0, 12.0, 0.0, 17.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_ox.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_ox.json new file mode 100644 index 00000000000..353106aed4a --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_ox.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 2.0, + "strideX": 1, + "offsetX": 2, + "strideY": 2, + "offsetY": 0, + "A": [ 1.0, 2.0, 4.0, 2.0, 3.0, 5.0, 4.0, 5.0, 6.0 ], + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 0.0, 0.0, 1.0, 1.0, 1.0 ], + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "y_out": [ 9.0, 0.0, 12.0, 0.0, 17.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_oy.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_oy.json new file mode 100644 index 00000000000..1e563eae157 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_oy.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 2.0, + "strideX": 1, + "offsetX": 0, + "strideY": 2, + "offsetY": 2, + "A": [ 1.0, 2.0, 4.0, 2.0, 3.0, 5.0, 4.0, 5.0, 6.0 ], + "strideA1": 3, + "strideA2": 1, + "offsetA": 0, + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "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/dsymv/test/fixtures/row_major_sa1_sa2.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_sa1_sa2.json new file mode 100644 index 00000000000..1584afa99d2 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_sa1_sa2.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 2.0, + "strideX": 1, + "offsetX": 0, + "strideY": 2, + "offsetY": 0, + "A": [ 999, 1, 999, 2, 999, 3, 999, 999, 999, 999, 999, 999, 999, 999, 999, 2, 999, 4, 999, 5, 999, 999, 999, 999, 999, 999, 999, 999, 999, 3, 999, 5, 999, 6, 999, 999, 999, 999, 999, 999, 999, 999 ], + "strideA1": 14, + "strideA2": 2, + "offsetA": 1, + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "y_out": [ 8.0, 0.0, 13.0, 0.0, 16.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_sa1_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_sa1_sa2n.json new file mode 100644 index 00000000000..864af5399d1 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_sa1_sa2n.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 2.0, + "strideX": 1, + "offsetX": 0, + "strideY": 2, + "offsetY": 0, + "A": [ 999, 3, 999, 2, 999, 1, 999, 999, 999, 999, 999, 999, 999, 999, 999, 5, 999, 4, 999, 2, 999, 999, 999, 999, 999, 999, 999, 999, 999, 6, 999, 5, 999, 3, 999, 999, 999, 999, 999, 999, 999, 999 ], + "strideA1": 14, + "strideA2": -2, + "offsetA": 5, + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "y_out": [ 8.0, 0.0, 13.0, 0.0, 16.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_sa1n_sa2.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_sa1n_sa2.json new file mode 100644 index 00000000000..2749f2f2613 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_sa1n_sa2.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 2.0, + "strideX": 1, + "offsetX": 0, + "strideY": 2, + "offsetY": 0, + "A": [ 999, 3, 999, 5, 999, 6, 999, 999, 999, 999, 999, 999, 999, 999, 999, 2, 999, 4, 999, 5, 999, 999, 999, 999, 999, 999, 999, 999, 999, 1, 999, 2, 999, 3, 999, 999, 999, 999, 999, 999, 999, 999 ], + "strideA1": -14, + "strideA2": 2, + "offsetA": 29, + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "y_out": [ 8.0, 0.0, 13.0, 0.0, 16.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_sa1n_sa2n.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_sa1n_sa2n.json new file mode 100644 index 00000000000..3013d983545 --- /dev/null +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_sa1n_sa2n.json @@ -0,0 +1,17 @@ +{ + "uplo": "lower", + "N": 3, + "alpha": 1.0, + "beta": 2.0, + "strideX": 1, + "offsetX": 0, + "strideY": 2, + "offsetY": 0, + "A": [ 999, 6, 999, 5, 999, 3, 999, 999, 999, 999, 999, 999, 999, 999, 999, 5, 999, 4, 999, 2, 999, 999, 999, 999, 999, 999, 999, 999, 999, 3, 999, 2, 999, 1, 999, 999, 999, 999, 999, 999, 999, 999 ], + "strideA1": -14, + "strideA2": -2, + "offsetA": 33, + "x": [ 1.0, 1.0, 1.0 ], + "y": [ 1.0, 0.0, 1.0, 0.0, 1.0, 0.0 ], + "y_out": [ 8.0, 0.0, 13.0, 0.0, 16.0, 0.0 ] +} diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_xoyt.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_upper.json similarity index 86% rename from lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_xoyt.json rename to lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_upper.json index 3d64ae65293..07b4d48d6e4 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_xoyt.json +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_upper.json @@ -10,6 +10,9 @@ "strideY": 2, "offsetY": 0, "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 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/dsymv/test/fixtures/row_major_xnyn.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_xnyn.json index 9f92e653157..7c03ccd8c5d 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_xnyn.json +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_xnyn.json @@ -10,6 +10,9 @@ "strideY": -1, "offsetY": 2, "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 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/dsymv/test/fixtures/row_major_xnyp.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_xnyp.json index eb8d8c18385..74ffa06e53a 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_xnyp.json +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_xnyp.json @@ -10,6 +10,9 @@ "strideY": 1, "offsetY": 0, "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 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/dsymv/test/fixtures/row_major_xpyn.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_xpyn.json index 7db3af0f446..ed0a8199c54 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_xpyn.json +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_xpyn.json @@ -10,6 +10,9 @@ "strideY": -1, "offsetY": 2, "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 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/dsymv/test/fixtures/row_major_xpyp.json b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_xpyp.json index 8dabdefd5af..7132bc46b73 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_xpyp.json +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/fixtures/row_major_xpyp.json @@ -10,6 +10,9 @@ "strideY": 1, "offsetY": 0, "A": [ 1.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 3.0 ], + "strideA1": 1, + "strideA2": 3, + "offsetA": 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/dsymv/test/test.dsymv.js b/lib/node_modules/@stdlib/blas/base/dsymv/test/test.dsymv.js index c0118a154b5..e2f99a8b6f3 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/test/test.dsymv.js +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/test.dsymv.js @@ -24,56 +24,27 @@ var tape = require( 'tape' ); var Float64Array = require( '@stdlib/array/float64' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var abs = require( '@stdlib/math/base/special/abs' ); var ones = require( '@stdlib/array/ones' ); var dsymv = require( './../lib/dsymv.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() { - dsymv( value, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float64Array( rxpyp.a ), rxpyp.lda, new Float64Array( rxpyp.x ), rxpyp.strideX, rxpyp.beta, new Float64Array( rxpyp.y ), rxpyp.strideY ); + dsymv( value, data.uplo, data.N, data.alpha, new Float64Array( data.a ), data.lda, new Float64Array( data.x ), data.strideX, data.beta, new Float64Array( 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() { - dsymv( rxpyp.order, value, rxpyp.N, rxpyp.alpha, new Float64Array( rxpyp.a ), rxpyp.lda, new Float64Array( rxpyp.x ), rxpyp.strideX, rxpyp.beta, new Float64Array( rxpyp.y ), rxpyp.strideY ); + dsymv( data.order, value, data.N, data.alpha, new Float64Array( data.a ), data.lda, new Float64Array( data.x ), data.strideX, data.beta, new Float64Array( 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() { - dsymv( rxpyp.order, rxpyp.uplo, value, rxpyp.alpha, new Float64Array( rxpyp.a ), rxpyp.lda, new Float64Array( rxpyp.x ), rxpyp.strideX, rxpyp.beta, new Float64Array( rxpyp.y ), rxpyp.strideY ); + dsymv( data.order, data.uplo, value, data.alpha, new Float64Array( data.a ), data.lda, new Float64Array( data.x ), data.strideX, data.beta, new Float64Array( 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() { - dsymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float64Array( rxpyp.a ), value, new Float64Array( rxpyp.x ), rxpyp.strideX, rxpyp.beta, new Float64Array( rxpyp.y ), rxpyp.strideY ); + dsymv( data.order, data.uplo, data.N, data.alpha, new Float64Array( data.a ), value, new Float64Array( data.x ), data.strideX, data.beta, new Float64Array( 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() { - dsymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float64Array( rxpyp.a ), rxpyp.lda, new Float64Array( rxpyp.x ), value, rxpyp.beta, new Float64Array( rxpyp.y ), rxpyp.strideY ); + dsymv( data.order, data.uplo, data.N, data.alpha, new Float64Array( data.a ), data.lda, new Float64Array( data.x ), value, data.beta, new Float64Array( 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() { - dsymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float64Array( rxpyp.a ), rxpyp.lda, new Float64Array( rxpyp.x ), rxpyp.strideX, rxpyp.beta, new Float64Array( rxpyp.y ), value ); + dsymv( data.order, data.uplo, data.N, data.alpha, new Float64Array( data.a ), data.lda, new Float64Array( data.x ), data.strideX, data.beta, new Float64Array( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( rxpyp.A ); - x = new Float64Array( rxpyp.x ); - y = new Float64Array( rxpyp.y ); + data = rl; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - expected = new Float64Array( rxpyp.y_out ); + expected = new Float64Array( data.y_out ); - out = dsymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, a, rxpyp.lda, x, rxpyp.strideX, rxpyp.beta, y, rxpyp.strideY ); + out = dsymv( 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 Float64Array( cxpyp.A ); - x = new Float64Array( cxpyp.x ); - y = new Float64Array( cxpyp.y ); + data = cl; - expected = new Float64Array( cxpyp.y_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - out = dsymv( cxpyp.order, cxpyp.uplo, cxpyp.N, cxpyp.alpha, a, cxpyp.lda, x, cxpyp.strideX, cxpyp.beta, y, cxpyp.strideY ); + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( rxoyt.A ); - x = new Float64Array( rxoyt.x ); - y = new Float64Array( rxoyt.y ); + data = rxpyp; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - expected = new Float64Array( rxoyt.y_out ); + expected = new Float64Array( data.y_out ); - out = dsymv( rxoyt.order, rxoyt.uplo, rxoyt.N, rxoyt.alpha, a, rxoyt.lda, x, rxoyt.strideX, rxoyt.beta, y, rxoyt.strideY ); + out = dsymv( 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 Float64Array( cxoyt.A ); - x = new Float64Array( cxoyt.x ); - y = new Float64Array( cxoyt.y ); + data = cxpyp; - expected = new Float64Array( cxoyt.y_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - out = dsymv( cxoyt.order, cxoyt.uplo, cxoyt.N, cxoyt.alpha, a, cxoyt.lda, x, cxoyt.strideX, cxoyt.beta, y, cxoyt.strideY ); + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( rxpyn.A ); - x = new Float64Array( rxpyn.x ); - y = new Float64Array( rxpyn.y ); + data = rxnyp; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - expected = new Float64Array( rxpyn.y_out ); + expected = new Float64Array( data.y_out ); - out = dsymv( rxpyn.order, rxpyn.uplo, rxpyn.N, rxpyn.alpha, a, rxpyn.lda, x, rxpyn.strideX, rxpyn.beta, y, rxpyn.strideY ); + out = dsymv( 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 Float64Array( cxpyn.A ); - x = new Float64Array( cxpyn.x ); - y = new Float64Array( cxpyn.y ); + data = cxnyp; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - expected = new Float64Array( cxpyn.y_out ); + expected = new Float64Array( data.y_out ); - out = dsymv( cxpyn.order, cxpyn.uplo, cxpyn.N, cxpyn.alpha, a, cxpyn.lda, x, cxpyn.strideX, cxpyn.beta, y, cxpyn.strideY ); + out = dsymv( 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 Float64Array( rxnyp.A ); - x = new Float64Array( rxnyp.x ); - y = new Float64Array( rxnyp.y ); + data = rxpyn; - expected = new Float64Array( rxnyp.y_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - out = dsymv( rxnyp.order, rxnyp.uplo, rxnyp.N, rxnyp.alpha, a, rxnyp.lda, x, rxnyp.strideX, rxnyp.beta, y, rxnyp.strideY ); + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( cxnyp.A ); - x = new Float64Array( cxnyp.x ); - y = new Float64Array( cxnyp.y ); + data = cxpyn; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - expected = new Float64Array( cxnyp.y_out ); + expected = new Float64Array( data.y_out ); - out = dsymv( cxnyp.order, cxnyp.uplo, cxnyp.N, cxnyp.alpha, a, cxnyp.lda, x, cxnyp.strideX, cxnyp.beta, y, cxnyp.strideY ); + out = dsymv( 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 Float64Array( rxpyp.A ); - x = new Float64Array( rxpyp.x ); - y = new Float64Array( rxpyp.y ); + data = rxpyp; - out = dsymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, a, rxpyp.lda, x, rxpyp.strideX, rxpyp.beta, y, rxpyp.strideY ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + out = dsymv( 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 Float64Array( rxpyp.A ); - x = new Float64Array( rxpyp.x ); - y = new Float64Array( rxpyp.y ); + data = rl; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - expected = new Float64Array( rxpyp.y ); + expected = new Float64Array( data.y ); - out = dsymv( rxpyp.order, rxpyp.uplo, 0, rxpyp.alpha, a, rxpyp.lda, x, rxpyp.strideX, rxpyp.beta, y, rxpyp.strideY ); + out = dsymv( 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 = dsymv( rxpyp.order, rxpyp.uplo, rxpyp.N, 0.0, a, rxpyp.lda, x, rxpyp.strideX, 1.0, y, rxpyp.strideY ); + out = dsymv( 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 Float64Array( cxpyp.A ); - x = new Float64Array( cxpyp.x ); - y = new Float64Array( cxpyp.y ); + data = cl; - expected = new Float64Array( cxpyp.y ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - out = dsymv( cxpyp.order, cxpyp.uplo, 0, cxpyp.alpha, a, cxpyp.lda, x, cxpyp.strideX, cxpyp.beta, y, cxpyp.strideY ); + expected = new Float64Array( data.y ); + + out = dsymv( 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 = dsymv( cxpyp.order, cxpyp.uplo, cxpyp.N, 0.0, a, cxpyp.lda, x, cxpyp.strideX, 1.0, y, cxpyp.strideY ); + out = dsymv( 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 = dsymv( '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 Float64Array( [ 0.0, 0.0, 0.0 ] ); out = dsymv( '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 = dsymv( '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 Float64Array( [ 0.0, 0.0, 0.0 ] ); out = dsymv( '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 = dsymv( '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 Float64Array( [ 0.0, 0.0, 0.0 ] ); out = dsymv( '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 = dsymv( '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 Float64Array( [ 0.0, 0.0, 0.0 ] ); out = dsymv( '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 Float64Array( rxnyn.A ); - x = new Float64Array( rxnyn.x ); - y = new Float64Array( rxnyn.y ); + data = rxnyn; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - expected = new Float64Array( rxnyn.y_out ); + expected = new Float64Array( data.y_out ); - out = dsymv( rxnyn.order, rxnyn.uplo, rxnyn.N, rxnyn.alpha, a, rxnyn.lda, x, rxnyn.strideX, rxnyn.beta, y, rxnyn.strideY ); + out = dsymv( 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 Float64Array( cxnyn.A ); - x = new Float64Array( cxnyn.x ); - y = new Float64Array( cxnyn.y ); + data = cxnyn; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - expected = new Float64Array( cxnyn.y_out ); + expected = new Float64Array( data.y_out ); - out = dsymv( cxnyn.order, cxnyn.uplo, cxnyn.N, cxnyn.alpha, a, cxnyn.lda, x, cxnyn.strideX, cxnyn.beta, y, cxnyn.strideY ); + out = dsymv( 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(); }); diff --git a/lib/node_modules/@stdlib/blas/base/dsymv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsymv/test/test.ndarray.js index c6c7028ad0f..b5f3653141c 100644 --- a/lib/node_modules/@stdlib/blas/base/dsymv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsymv/test/test.ndarray.js @@ -24,54 +24,41 @@ var tape = require( 'tape' ); var Float64Array = require( '@stdlib/array/float64' ); -var EPS = require( '@stdlib/constants/float64/eps' ); -var abs = require( '@stdlib/math/base/special/abs' ); var ones = require( '@stdlib/array/ones' ); var dsymv = 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( dsymv.length, 13, 'returns expected value' ); +tape( 'the function has an arity of 14', function test( t ) { + t.strictEqual( dsymv.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() { - dsymv( value, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float64Array( rxpyp.a ), rxpyp.lda, new Float64Array( rxpyp.x ), rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, new Float64Array( rxpyp.y ), rxpyp.strideY, rxpyp.offsetY ); + dsymv( value, data.N, data.alpha, new Float64Array( data.a ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, data.beta, new Float64Array( 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() { - dsymv( rxpyp.order, value, rxpyp.N, rxpyp.alpha, new Float64Array( rxpyp.a ), rxpyp.lda, new Float64Array( rxpyp.x ), rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, new Float64Array( rxpyp.y ), rxpyp.strideY, rxpyp.offsetY ); + dsymv( data.uplo, value, data.alpha, new Float64Array( data.a ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, data.beta, new Float64Array( 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() { - dsymv( rxpyp.order, rxpyp.uplo, value, rxpyp.alpha, new Float64Array( rxpyp.a ), rxpyp.lda, new Float64Array( rxpyp.x ), rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, new Float64Array( rxpyp.y ), rxpyp.strideY, rxpyp.offsetY ); + dsymv( data.uplo, data.N, data.alpha, new Float64Array( data.a ), value, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, data.beta, new Float64Array( 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() { - dsymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float64Array( rxpyp.a ), value, new Float64Array( rxpyp.x ), rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, new Float64Array( rxpyp.y ), rxpyp.strideY, rxpyp.offsetY ); + dsymv( data.uplo, data.N, data.alpha, new Float64Array( data.a ), data.strideA1, value, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, data.beta, new Float64Array( 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() { - dsymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float64Array( rxpyp.a ), rxpyp.lda, new Float64Array( rxpyp.x ), value, rxpyp.offsetX, rxpyp.beta, new Float64Array( rxpyp.y ), rxpyp.strideY, rxpyp.offsetY ); + dsymv( data.uplo, data.N, data.alpha, new Float64Array( data.a ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), value, data.offsetX, data.beta, new Float64Array( 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() { - dsymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, new Float64Array( rxpyp.a ), rxpyp.lda, new Float64Array( rxpyp.x ), rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, new Float64Array( rxpyp.y ), value, rxpyp.offsetY ); + dsymv( data.uplo, data.N, data.alpha, new Float64Array( data.a ), data.strideA1, data.strideA2, data.offsetA, new Float64Array( data.x ), data.strideX, data.offsetX, data.beta, new Float64Array( 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 Float64Array( rxpyp.A ); - x = new Float64Array( rxpyp.x ); - y = new Float64Array( rxpyp.y ); + data = ru; - expected = new Float64Array( rxpyp.y_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - out = dsymv( 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 Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( cxpyp.A ); - x = new Float64Array( cxpyp.x ); - y = new Float64Array( cxpyp.y ); + data = cu; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - expected = new Float64Array( cxpyp.y_out ); + expected = new Float64Array( data.y_out ); - out = dsymv( cxpyp.order, cxpyp.uplo, cxpyp.N, cxpyp.alpha, a, cxpyp.lda, x, cxpyp.strideX, cxpyp.offsetX, cxpyp.beta, y, cxpyp.strideY, cxpyp.offsetY ); + out = dsymv( 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 Float64Array( rxoyt.A ); - x = new Float64Array( rxoyt.x ); - y = new Float64Array( rxoyt.y ); + data = rl; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - expected = new Float64Array( rxoyt.y_out ); + expected = new Float64Array( data.y_out ); - out = dsymv( rxoyt.order, rxoyt.uplo, rxoyt.N, rxoyt.alpha, a, rxoyt.lda, x, rxoyt.strideX, rxoyt.offsetX, rxoyt.beta, y, rxoyt.strideY, rxoyt.offsetY ); + out = dsymv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( cxoyt.A ); - x = new Float64Array( cxoyt.x ); - y = new Float64Array( cxoyt.y ); + data = rxpyp; - expected = new Float64Array( cxoyt.y_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - out = dsymv( cxoyt.order, cxoyt.uplo, cxoyt.N, cxoyt.alpha, a, cxoyt.lda, x, cxoyt.strideX, cxoyt.offsetX, cxoyt.beta, y, cxoyt.strideY, cxoyt.offsetY ); + out = dsymv( 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 Float64Array( rxpyn.A ); - x = new Float64Array( rxpyn.x ); - y = new Float64Array( rxpyn.y ); + data = rl; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - expected = new Float64Array( rxpyn.y_out ); + expected = new Float64Array( data.y ); - out = dsymv( rxpyn.order, rxpyn.uplo, rxpyn.N, rxpyn.alpha, a, rxpyn.lda, x, rxpyn.strideX, rxpyn.offsetX, rxpyn.beta, y, rxpyn.strideY, rxpyn.offsetY ); + out = dsymv( 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 = dsymv( 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 Float64Array( cxpyn.A ); - x = new Float64Array( cxpyn.x ); - y = new Float64Array( cxpyn.y ); + data = cl; - expected = new Float64Array( cxpyn.y_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - out = dsymv( 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 Float64Array( data.y ); + + out = dsymv( 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 = dsymv( 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 Float64Array( rxnyp.A ); - x = new Float64Array( rxnyp.x ); - y = new Float64Array( rxnyp.y ); + a = ones( 9, 'float64' ); + x = ones( 3, 'float64' ); + y = ones( 3, 'float64' ); + + expected = new Float64Array( [ 5.0, 5.0, 5.0 ] ); + + out = dsymv( '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 Float64Array( rxnyp.y_out ); + expected = new Float64Array( [ 0.0, 0.0, 0.0 ] ); - out = dsymv( rxnyp.order, rxnyp.uplo, rxnyp.N, rxnyp.alpha, a, rxnyp.lda, x, rxnyp.strideX, rxnyp.offsetX, rxnyp.beta, y, rxnyp.strideY, rxnyp.offsetY ); + out = dsymv( '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 Float64Array( cxnyp.A ); - x = new Float64Array( cxnyp.x ); - y = new Float64Array( cxnyp.y ); + a = ones( 9, 'float64' ); + x = ones( 3, 'float64' ); + y = ones( 3, 'float64' ); - expected = new Float64Array( cxnyp.y_out ); + expected = new Float64Array( [ 5.0, 5.0, 5.0 ] ); - out = dsymv( cxnyp.order, cxnyp.uplo, cxnyp.N, cxnyp.alpha, a, cxnyp.lda, x, cxnyp.strideX, cxnyp.offsetX, cxnyp.beta, y, cxnyp.strideY, cxnyp.offsetY ); + out = dsymv( '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 Float64Array( [ 0.0, 0.0, 0.0 ] ); + + out = dsymv( '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 Float64Array( rxpyp.A ); - x = new Float64Array( rxpyp.x ); - y = new Float64Array( rxpyp.y ); + a = ones( 9, 'float64' ); + x = ones( 3, 'float64' ); + y = ones( 3, 'float64' ); + + expected = new Float64Array( [ 5.0, 5.0, 5.0 ] ); + + out = dsymv( '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 Float64Array( [ 0.0, 0.0, 0.0 ] ); - out = dsymv( rxpyp.order, rxpyp.uplo, rxpyp.N, rxpyp.alpha, a, rxpyp.lda, x, rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, y, rxpyp.strideY, rxpyp.offsetY ); + out = dsymv( '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 Float64Array( rxpyp.A ); - x = new Float64Array( rxpyp.x ); - y = new Float64Array( rxpyp.y ); + a = ones( 9, 'float64' ); + x = ones( 3, 'float64' ); + y = ones( 3, 'float64' ); - expected = new Float64Array( rxpyp.y ); + expected = new Float64Array( [ 5.0, 5.0, 5.0 ] ); - out = dsymv( rxpyp.order, rxpyp.uplo, 0, rxpyp.alpha, a, rxpyp.lda, x, rxpyp.strideX, rxpyp.offsetX, rxpyp.beta, y, rxpyp.strideY, rxpyp.offsetY ); + out = dsymv( '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 = dsymv( 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 Float64Array( [ 0.0, 0.0, 0.0 ] ); + + out = dsymv( '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 Float64Array( cxpyp.A ); - x = new Float64Array( cxpyp.x ); - y = new Float64Array( cxpyp.y ); + data = rsa1sa2; - expected = new Float64Array( cxpyp.y ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - out = dsymv( cxpyp.order, cxpyp.uplo, 0, cxpyp.alpha, a, cxpyp.lda, x, cxpyp.strideX, cxpyp.offsetX, cxpyp.beta, y, cxpyp.strideY, cxpyp.offsetY ); + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); - out = dsymv( cxpyp.order, cxpyp.uplo, cxpyp.N, 0.0, a, cxpyp.lda, x, cxpyp.strideX, cxpyp.offsetX, 1.0, y, cxpyp.strideY, cxpyp.offsetY ); + out = dsymv( 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, 'float64' ); - x = ones( 3, 'float64' ); - y = ones( 3, 'float64' ); + data = rsa1nsa2; - expected = new Float64Array( [ 5.0, 5.0, 5.0 ] ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); - out = dsymv( 'row-major', 'upper', 3, 0.0, a, 3, x, 1, 0, 5.0, y, 1, 0 ); + out = dsymv( 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 Float64Array( [ 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - out = dsymv( 'row-major', 'upper', 3, 0.0, a, 3, x, 1, 0, 0.0, y, -1, 2 ); + expected = new Float64Array( data.y_out ); + + out = dsymv( 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, 'float64' ); - x = ones( 3, 'float64' ); - y = ones( 3, 'float64' ); + data = rsa1sa2n; - expected = new Float64Array( [ 5.0, 5.0, 5.0 ] ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); - out = dsymv( 'row-major', 'lower', 3, 0.0, a, 3, x, 1, 0, 5.0, y, -1, 2 ); + out = dsymv( 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 Float64Array( [ 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 = dsymv( 'row-major', 'lower', 3, 0.0, a, 3, x, 1, 0, 0.0, y, 1, 0 ); + data = csa1sa2n; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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, 'float64' ); - x = ones( 3, 'float64' ); - y = ones( 3, 'float64' ); + data = rsa1nsa2n; - expected = new Float64Array( [ 5.0, 5.0, 5.0 ] ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); - out = dsymv( 'column-major', 'upper', 3, 0.0, a, 3, x, 1, 0, 5.0, y, 1, 0 ); + out = dsymv( 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 Float64Array( [ 0.0, 0.0, 0.0 ] ); + t.end(); +}); - out = dsymv( '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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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, 'float64' ); - x = ones( 3, 'float64' ); - y = ones( 3, 'float64' ); + data = roa; - expected = new Float64Array( [ 5.0, 5.0, 5.0 ] ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); - out = dsymv( 'column-major', 'lower', 3, 0.0, a, 3, x, 1, 0, 5.0, y, -1, 2 ); + out = dsymv( 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 Float64Array( [ 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 = rsa1sa2; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 = dsymv( 'column-major', 'lower', 3, 0.0, a, 3, x, 1, 0, 0.0, y, 1, 0 ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); + + expected = new Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( rxnyn.A ); - x = new Float64Array( rxnyn.x ); - y = new Float64Array( rxnyn.y ); + data = rcap; - expected = new Float64Array( rxnyn.y_out ); + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - out = dsymv( 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 Float64Array( data.y_out ); + + out = dsymv( 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 Float64Array( cxnyn.A ); - x = new Float64Array( cxnyn.x ); - y = new Float64Array( cxnyn.y ); + data = ccap; + + a = new Float64Array( data.A ); + x = new Float64Array( data.x ); + y = new Float64Array( data.y ); - expected = new Float64Array( cxnyn.y_out ); + expected = new Float64Array( data.y_out ); - out = dsymv( cxnyn.order, cxnyn.uplo, cxnyn.N, cxnyn.alpha, a, cxnyn.lda, x, cxnyn.strideX, cxnyn.offsetX, cxnyn.beta, y, cxnyn.strideY, cxnyn.offsetY ); + out = dsymv( 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(); });