diff --git a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js index b3d926607656..8feb20cb6ee3 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/lib/ndarray.js @@ -47,6 +47,8 @@ var base = require( './base.js' ); * @throws {TypeError} second argument must be a valid transpose operation * @throws {TypeError} third argument must be a valid diagonal type * @throws {RangeError} fourth argument must be a nonnegative integer +* @throws {RangeError} sixth argument must be non-zero +* @throws {RangeError} seventh argument must be non-zero * @throws {RangeError} tenth argument must be non-zero * @returns {Float32Array} `x` * @@ -72,6 +74,12 @@ function strmv( uplo, trans, diag, N, A, strideA1, strideA2, offsetA, x, strideX if ( N < 0 ) { throw new RangeError( format( 'invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.', N ) ); } + if ( strideA1 === 0 ) { + throw new RangeError( format( 'invalid argument. Sixth argument must be non-zero. Value: `%d`.', strideA1 ) ); + } + if ( strideA2 === 0 ) { + throw new RangeError( format( 'invalid argument. Seventh argument must be non-zero. Value: `%d`.', strideA2 ) ); + } if ( strideX === 0 ) { throw new RangeError( format( 'invalid argument. Tenth argument must be non-zero. Value: `%d`.', strideX ) ); } diff --git a/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js index d1df4fe1952e..208fe74fd3f1 100644 --- a/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/strmv/test/test.ndarray.js @@ -180,6 +180,52 @@ tape( 'the function throws an error if provided an invalid fourth argument', fun } }); +tape( 'the function throws an error if provided an invalid sixth argument', function test( t ) { + var values; + var data; + var i; + + data = rutu; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + strmv( data.uplo, data.trans, data.diag, data.N, new Float32Array( data.A ), value, data.strideA2, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); + }; + } +}); + +tape( 'the function throws an error if provided an invalid seventh argument', function test( t ) { + var values; + var data; + var i; + + data = rutu; + + values = [ + 0 + ]; + + for ( i = 0; i < values.length; i++ ) { + t.throws( badValue( values[ i ] ), RangeError, 'throws an error when provided ' + values[ i ] ); + } + t.end(); + + function badValue( value ) { + return function badValue() { + strmv( data.uplo, data.trans, data.diag, data.N, new Float32Array( data.A ), data.strideA1, value, data.offsetA, new Float32Array( data.x ), data.strideX, data.offsetX ); + }; + } +}); + tape( 'the function throws an error if provided an invalid tenth argument', function test( t ) { var values; var data;