Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions lib/node_modules/@stdlib/blas/base/dspr/lib/dspr.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 stride2offset = require( '@stdlib/strided/base/stride2offset' );
var format = require( '@stdlib/string/format' );
var base = require( './base.js' );
Expand All @@ -33,7 +33,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 supplied in packed form.
*
* @param {string} order - storage layout
* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied
* @param {(integer|string)} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied
* @param {NonNegativeInteger} N - number of elements along each dimension of `A`
* @param {number} alpha - scalar constant
* @param {Float64Array} x - input vector
Expand All @@ -56,11 +56,13 @@ var base = require( './base.js' );
*/
function dspr( order, uplo, N, alpha, x, strideX, AP ) {
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 the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) );
}
if ( N < 0 ) {
Expand All @@ -73,7 +75,7 @@ function dspr( order, uplo, N, alpha, x, strideX, AP ) {
return AP;
}
ox = stride2offset( N, strideX );
return base( order, uplo, N, alpha, x, strideX, ox, AP, 1, 0 );
return base( order, u, N, alpha, x, strideX, ox, AP, 1, 0 );
}


Expand Down
10 changes: 6 additions & 4 deletions lib/node_modules/@stdlib/blas/base/dspr/lib/ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 format = require( '@stdlib/string/format' );
var base = require( './base.js' );

Expand All @@ -32,7 +32,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 supplied in packed form.
*
* @param {string} order - storage layout
* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied
* @param {(integer|string)} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied
* @param {NonNegativeInteger} N - number of elements along each dimension of `A`
* @param {number} alpha - scalar constant
* @param {Float64Array} x - input vector
Expand All @@ -58,10 +58,12 @@ var base = require( './base.js' );
* // AP => <Float64Array>[ 2.0, 4.0, 6.0, 5.0, 8.0, 10.0 ]
*/
function dspr( order, uplo, N, alpha, x, strideX, offsetX, AP, strideAP, offsetAP ) { // eslint-disable-line max-len
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 the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) );
}
if ( N < 0 ) {
Expand All @@ -76,7 +78,7 @@ function dspr( order, uplo, N, alpha, x, strideX, offsetX, AP, strideAP, offsetA
if ( N === 0 || alpha === 0.0 ) {
return AP;
}
return base( order, uplo, N, alpha, x, strideX, offsetX, AP, strideAP, offsetAP ); // eslint-disable-line max-len
return base( order, u, N, alpha, x, strideX, offsetX, AP, strideAP, offsetAP ); // eslint-disable-line max-len
}


Expand Down