diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js index 490056e2b0e9..b45322084a3c 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js @@ -43,6 +43,8 @@ var base = require( './base.js' ); * @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} eighth argument must be non-zero +* @throws {RangeError} ninth argument must be non-zero * @returns {Float64Array} `A` * * @example @@ -64,6 +66,12 @@ function dsyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offse if ( strideX === 0 ) { throw new RangeError( format( 'invalid argument. Fifth argument must be non-zero. Value: `%d`.', strideX ) ); } + if ( strideA1 === 0 ) { + throw new RangeError( format( 'invalid argument. Eighth argument must be non-zero. Value: `%d`.', strideA1 ) ); + } + if ( strideA2 === 0 ) { + throw new RangeError( format( 'invalid argument. Ninth 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/dsyr/test/test.ndarray.js b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.js index 81213d71812b..fb06e5cc56f2 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/test/test.ndarray.js @@ -139,6 +139,52 @@ tape( 'the function throws an error if provided an invalid fifth argument', func } }); +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 + ]; + + 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() { + dsyr( data.uplo, data.N, data.alpha, new Float64Array( data.x ), data.strideX, data.offsetX, new Float64Array( data.A ), value, data.strideA2, data.offsetA ); + }; + } +}); + +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 + ]; + + 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() { + dsyr( data.uplo, data.N, data.alpha, new Float64Array( data.x ), data.strideX, data.offsetX, new Float64Array( data.A ), data.strideA1, value, data.offsetA ); + }; + } +}); + tape( 'the function performs the symmetric rank 1 operation `A = α*x*x^T + A` (row-major, upper)', function test( t ) { var expected; var data;