diff --git a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js index c8c14a02e4ff..0209564e16df 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/dsyr.js @@ -21,7 +21,7 @@ // MODULES // var isLayout = require( '@stdlib/blas/base/assert/is-layout' ); -var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var resolveStr = require( '@stdlib/blas/base/matrix-triangle-resolve-str' ); var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' ); var stride2offset = require( '@stdlib/strided/base/stride2offset' ); var max = require( '@stdlib/math/base/special/fast/max' ); @@ -35,7 +35,7 @@ var base = require( './base.js' ); * Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, 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 {(integer|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} x - input vector @@ -62,11 +62,13 @@ function dsyr( order, uplo, N, alpha, x, strideX, A, LDA ) { var sa1; var sa2; var ox; + var u; if ( !isLayout( order ) ) { throw new TypeError( format( 'invalid argument. First argument must be a valid order. Value: `%s`.', order ) ); } - if ( !isMatrixTriangle( uplo ) ) { + u = resolveStr( uplo ); + if ( u === null ) { 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 ) { @@ -90,7 +92,7 @@ function dsyr( order, uplo, N, alpha, x, strideX, A, LDA ) { sa2 = 1; } ox = stride2offset( N, strideX ); - return base( uplo, N, alpha, x, strideX, ox, A, sa1, sa2, 0 ); + return base( u, N, alpha, x, strideX, ox, A, sa1, sa2, 0 ); } 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 e82b95100197..2da19ed9da37 100644 --- a/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js +++ b/lib/node_modules/@stdlib/blas/base/dsyr/lib/ndarray.js @@ -20,7 +20,7 @@ // MODULES // -var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' ); +var resolveStr = require( '@stdlib/blas/base/matrix-triangle-resolve-str' ); var format = require( '@stdlib/string/format' ); var base = require( './base.js' ); @@ -30,7 +30,7 @@ var base = require( './base.js' ); /** * Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, 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 {(integer|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} x - input vector @@ -57,7 +57,8 @@ var base = require( './base.js' ); * // A => [ 2.0, 4.0, 6.0, 2.0, 5.0, 8.0, 3.0, 2.0, 10.0 ] */ function dsyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ) { // eslint-disable-line max-len - if ( !isMatrixTriangle( uplo ) ) { + var u = resolveStr( uplo ); + if ( u === null ) { 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 ) { @@ -76,7 +77,7 @@ function dsyr( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offse if ( N === 0 || alpha === 0.0 ) { return A; } - return base( uplo, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ); // eslint-disable-line max-len + return base( u, N, alpha, x, strideX, offsetX, A, strideA1, strideA2, offsetA ); // eslint-disable-line max-len }