Skip to content
Open
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/dsyr2/lib/dsyr2.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

var isColumnMajor = require( '@stdlib/ndarray/base/assert/is-column-major-string' );
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 max = require( '@stdlib/math/base/special/fast/max' );
var format = require( '@stdlib/string/format' );
Expand All @@ -35,7 +35,7 @@ var base = require( './base.js' );
* Performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` where `α` is a scalar, `x` and `y` are `N` element vectors, 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 - first input vector
Expand Down Expand Up @@ -67,11 +67,13 @@ function dsyr2( order, uplo, N, alpha, x, strideX, y, strideY, A, LDA ) {
var sa2;
var ox;
var oy;
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 ) {
Expand Down Expand Up @@ -99,7 +101,7 @@ function dsyr2( order, uplo, N, alpha, x, strideX, y, strideY, A, LDA ) {
}
ox = stride2offset( N, strideX );
oy = stride2offset( N, strideY );
return base( uplo, N, alpha, x, strideX, ox, y, strideY, oy, A, sa1, sa2, 0 ); // eslint-disable-line max-len
return base( u, N, alpha, x, strideX, ox, y, strideY, oy, A, sa1, sa2, 0 );
}


Expand Down
10 changes: 6 additions & 4 deletions lib/node_modules/@stdlib/blas/base/dsyr2/lib/dsyr2.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
// MODULES //

var isLayout = require( '@stdlib/blas/base/assert/is-layout' );
var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' );
var resolveOrder = require( '@stdlib/blas/base/layout-resolve-enum' );
var resolveUplo = require( '@stdlib/blas/base/matrix-triangle-resolve-enum' );
var max = require( '@stdlib/math/base/special/fast/max' );
Expand All @@ -35,7 +34,7 @@ var addon = require( './../src/addon.node' );
* Performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` where `α` is a scalar, `x` and `y` are `N` element vectors, 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 - first input vector
Expand Down Expand Up @@ -63,10 +62,13 @@ var addon = require( './../src/addon.node' );
* // A => <Float64Array>[ 3.0, 6.0, 9.0, 2.0, 9.0, 14.0, 3.0, 2.0, 19.0 ]
*/
function dsyr2( order, uplo, N, alpha, x, strideX, y, strideY, A, LDA ) {
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 = resolveUplo( 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 ) {
Expand All @@ -85,7 +87,7 @@ function dsyr2( order, uplo, N, alpha, x, strideX, y, strideY, A, LDA ) {
if ( N === 0 || alpha === 0.0 ) {
return A;
}
addon( resolveOrder( order ), resolveUplo( uplo ), N, alpha, x, strideX, y, strideY, A, LDA ); // eslint-disable-line max-len
addon( resolveOrder( order ), u, N, alpha, x, strideX, y, strideY, A, LDA );
return A;
}

Expand Down
9 changes: 5 additions & 4 deletions lib/node_modules/@stdlib/blas/base/dsyr2/lib/ndarray.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

Expand All @@ -30,7 +30,7 @@ var base = require( './base.js' );
/**
* Performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` where `α` is a scalar, `x` and `y` are `N` element vectors, 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 - first input vector
Expand Down Expand Up @@ -62,7 +62,8 @@ var base = require( './base.js' );
* // A => <Float64Array>[ 3.0, 6.0, 9.0, 2.0, 9.0, 14.0, 3.0, 2.0, 19.0 ]
*/
function dsyr2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ) { // eslint-disable-line max-len, max-params
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 ) {
Expand All @@ -84,7 +85,7 @@ function dsyr2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, str
if ( N === 0 || alpha === 0.0 ) {
return A;
}
return base( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ); // eslint-disable-line max-len
return base( u, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ); // eslint-disable-line max-len
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@

// MODULES //

var isMatrixTriangle = require( '@stdlib/blas/base/assert/is-matrix-triangle' );
var resolveUplo = require( '@stdlib/blas/base/matrix-triangle-resolve-enum' );
var format = require( '@stdlib/string/format' );
var addon = require( './../src/addon.node' );
Expand All @@ -31,7 +30,7 @@ var addon = require( './../src/addon.node' );
/**
* Performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A` where `α` is a scalar, `x` and `y` are `N` element vectors, 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 - first input vector
Expand Down Expand Up @@ -63,7 +62,8 @@ var addon = require( './../src/addon.node' );
* // A => <Float64Array>[ 3.0, 6.0, 9.0, 2.0, 9.0, 14.0, 3.0, 2.0, 19.0 ]
*/
function dsyr2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ) { // eslint-disable-line max-len, max-params
if ( !isMatrixTriangle( uplo ) ) {
var u = resolveUplo( 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 ) {
Expand All @@ -85,7 +85,7 @@ function dsyr2( uplo, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, str
if ( N === 0 || alpha === 0.0 ) {
return A;
}
addon.ndarray( resolveUplo( uplo ), N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ); // eslint-disable-line max-len
addon.ndarray( u, N, alpha, x, strideX, offsetX, y, strideY, offsetY, A, strideA1, strideA2, offsetA ); // eslint-disable-line max-len
return A;
}

Expand Down
Loading