diff --git a/lib/node_modules/@stdlib/blas/base/ssyr2/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/ssyr2/lib/ndarray.js index 3e1cca554855..80619579390d 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr2/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr2/lib/ndarray.js @@ -47,6 +47,8 @@ var base = require( './base.js' ); * @throws {RangeError} second argument must be a nonnegative integer * @throws {RangeError} fifth argument must be non-zero * @throws {RangeError} eighth argument must be non-zero +* @throws {RangeError} eleventh argument must be non-zero +* @throws {RangeError} twelfth argument must be non-zero * @returns {Float32Array} `A` * * @example @@ -72,6 +74,12 @@ function ssyr2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, str if ( strideY === 0 ) { throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideY ) ); } + if ( strideA1 === 0 ) { + throw new RangeError( format( 'invalid argument. Eleventh argument must be non-zero. Value: `%d`.', strideA1 ) ); + } + if ( strideA2 === 0 ) { + throw new RangeError( format( 'invalid argument. Twelfth argument must be non-zero. Value: `%d`.', strideA2 ) ); + } if ( N === 0 || alpha === 0.0 ) { return A; } diff --git a/lib/node_modules/@stdlib/blas/base/ssyr2/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/ssyr2/test/test.ndarray.js index 5b0f9e8b74a2..5dcafcc16aaf 100644 --- a/lib/node_modules/@stdlib/blas/base/ssyr2/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/ssyr2/test/test.ndarray.js @@ -168,6 +168,52 @@ tape( 'the function throws an error if provided an invalid eighth argument', fun } }); +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 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssyr2( data.uplo, data.N, data.alpha, new Float32Array( data.x ), data.strideX, data.offsetX, new Float32Array( data.y ), data.strideY, data.offsetY, new Float32Array( data.A ), value, data.strideA2, data.offsetA ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid twelfth argument', function test( t ) { + var values; + var data; + var i; + + data = ru; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + ssyr2( data.uplo, data.N, data.alpha, new Float32Array( data.x ), data.strideX, data.offsetX, new Float32Array( data.y ), data.strideY, data.offsetY, new Float32Array( data.A ), data.strideA1, value, data.offsetA ); + }; + } +}); + tape( 'the function performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` (row-major, upper)', function test( t ) { var expected; var data;