Skip to content

Commit bf45d08

Browse files
committed
chore: add implementation
1 parent eaddeda commit bf45d08

File tree

5 files changed

+1223
-23
lines changed

5 files changed

+1223
-23
lines changed

lib/node_modules/@stdlib/blas/base/strsm/docs/types/index.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface Routine {
3232
* @param order - storage layout of `A` and `B`
3333
* @param side - specifies whether `op( A )` appears on the left or right of `X`
3434
* @param uplo - specifies whether the upper or lower triangular part of the matrix `A` is supplied
35-
* @param trans - specifies the form of `op( A )` to be used in matrix multiplication
35+
* @param transa - specifies the form of `op( A )` to be used in matrix multiplication
3636
* @param diag - specifies whether or not `A` is unit triangular
3737
* @param m - number of rows in `B`
3838
* @param n - number of columns in `B`
@@ -52,14 +52,14 @@ interface Routine {
5252
* strsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 );
5353
* // B => <Float32Array>[ 30.0, 6.0, 0.0, 12.0 ]
5454
*/
55-
( order: Layout, side: OperationSide, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, m: number, n: number, alpha: number, A: Float32Array, LDA: number, B: Float32Array, LDB: number ): Float32Array;
55+
( order: Layout, side: OperationSide, uplo: MatrixTriangle, transa: TransposeOperation, diag: DiagonalType, m: number, n: number, alpha: number, A: Float32Array, LDA: number, B: Float32Array, LDB: number ): Float32Array;
5656

5757
/**
5858
* Solve matrix equation `op(A) * X = alpha * B` or `X * op(A) = alpha * B` where `alpha` is a scalar, `X` and `B` are `m` by `n` matrices, `A` is a unit, or non-unit, upper or lower triangular matrix and `op(A)` is one of `op(A) = A` or `op(A) = A^T`. The matrix `X` is overwritten on `B`.
5959
*
6060
* @param side - specifies whether `op( A )` appears on the left or right of `X`
6161
* @param uplo - specifies whether the upper or lower triangular part of the matrix `A` is supplied
62-
* @param trans - specifies the form of `op( A )` to be used in matrix multiplication
62+
* @param transa - specifies the form of `op( A )` to be used in matrix multiplication
6363
* @param diag - specifies whether or not `A` is unit triangular
6464
* @param m - number of rows in `B`
6565
* @param n - number of columns in `B`
@@ -83,7 +83,7 @@ interface Routine {
8383
* strsm.ndarray( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 );
8484
* // B => <Float32Array>[ 0.0, 30.0, 6.0, 0.0, 12.0 ]
8585
*/
86-
ndarray( side: OperationSide, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, m: number, n: number, alpha: number, A: Float32Array, strideA1: number, strideA2: number, offsetA: number, B: Float32Array, strideB1: number, strideB2: number, offsetB: number ): Float32Array;
86+
ndarray( side: OperationSide, uplo: MatrixTriangle, transa: TransposeOperation, diag: DiagonalType, m: number, n: number, alpha: number, A: Float32Array, strideA1: number, strideA2: number, offsetA: number, B: Float32Array, strideB1: number, strideB2: number, offsetB: number ): Float32Array;
8787
}
8888

8989
/**
@@ -92,7 +92,7 @@ interface Routine {
9292
* @param order - storage layout of `A` and `B`
9393
* @param side - specifies whether `op( A )` appears on the left or right of `X`
9494
* @param uplo - specifies whether the upper or lower triangular part of the matrix `A` is supplied
95-
* @param trans - specifies the form of `op( A )` to be used in matrix multiplication
95+
* @param transa - specifies the form of `op( A )` to be used in matrix multiplication
9696
* @param diag - specifies whether or not `A` is unit triangular
9797
* @param m - number of rows in `B`
9898
* @param n - number of columns in `B`

lib/node_modules/@stdlib/blas/base/strsm/lib/base.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function zeros( M, N, X, strideX1, strideX2, offsetX ) { // TODO: consider movin
9898
* @private
9999
* @param {string} side - specifies whether `op( A )` appears on the left or right of `X`
100100
* @param {string} uplo - specifies whether the upper or lower triangular part of the matrix `A` is supplied
101-
* @param {string} trans - specifies the form of `op( A )` to be used in matrix multiplication
101+
* @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication
102102
* @param {string} diag - specifies whether or not `A` is unit triangular
103103
* @param {NonNegativeInteger} M - number of rows in `B`
104104
* @param {NonNegativeInteger} N - number of columns in `B`
@@ -122,7 +122,7 @@ function zeros( M, N, X, strideX1, strideX2, offsetX ) { // TODO: consider movin
122122
* strsm( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 0, B, 2, 1, 0 );
123123
* // B => <Float32Array>[ 30.0, 6.0, 0.0, 12.0 ]
124124
*/
125-
function strsm( side, uplo, trans, diag, M, N, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ) { // eslint-disable-line max-params
125+
function strsm( side, uplo, transa, diag, M, N, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ) { // eslint-disable-line max-params
126126
var nonunit;
127127
var isrma;
128128
var isrmb;
@@ -172,7 +172,7 @@ function strsm( side, uplo, trans, diag, M, N, alpha, A, strideA1, strideA2, off
172172
return B;
173173
}
174174
if ( side === 'left' ) {
175-
if ( trans === 'no-transpose' ) {
175+
if ( transa === 'no-transpose' ) {
176176
// B := alpha * inv( A ) * B
177177
if ( uplo === 'upper' ) {
178178
for ( j = 0; j < N; j++ ) {
@@ -258,7 +258,7 @@ function strsm( side, uplo, trans, diag, M, N, alpha, A, strideA1, strideA2, off
258258
return B;
259259
}
260260
// Right
261-
if ( trans === 'no-transpose' ) {
261+
if ( transa === 'no-transpose' ) {
262262
if ( uplo === 'upper' ) {
263263
for ( j = 0; j < N; j++ ) {
264264
for ( i = 0; i < M; i++ ) {

lib/node_modules/@stdlib/blas/base/strsm/lib/ndarray.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var base = require( './base.js' );
3535
*
3636
* @param {string} side - specifies whether `op( A )` appears on the left or right of `X`
3737
* @param {string} uplo - specifies whether the upper or lower triangular part of the matrix `A` is supplied
38-
* @param {string} trans - specifies the form of `op( A )` to be used in matrix multiplication
38+
* @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication
3939
* @param {string} diag - specifies whether or not `A` is unit triangular
4040
* @param {NonNegativeInteger} M - number of rows in `B`
4141
* @param {NonNegativeInteger} N - number of columns in `B`
@@ -52,6 +52,10 @@ var base = require( './base.js' );
5252
* @throws {TypeError} second argument must specify whether the lower or upper triangular matrix is supplied.
5353
* @throws {TypeError} third argument must specify correct transpose operation
5454
* @throws {TypeError} fourth argument must specify whether the matrix is unit triangular or not
55+
* @throws {RangeError} fifth argument must be a nonnegative integer
56+
* @throws {RangeError} sixth argument must be a nonnegative integer
57+
* @throws {RangeError} thirteenth argument must be non-zero
58+
* @throws {RangeError} fourteenth argument must be non-zero
5559
* @returns {Float32Array} `B`
5660
*
5761
* @example
@@ -63,15 +67,15 @@ var base = require( './base.js' );
6367
* strsm( 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, 1, 2, B, 2, 1, 1 );
6468
* // B => <Float32Array>[ 0.0, 30.0, 6.0, 0.0, 12.0 ]
6569
*/
66-
function strsm( side, uplo, trans, diag, M, N, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ) { // eslint-disable-line max-len, max-params
70+
function strsm( side, uplo, transa, diag, M, N, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ) { // eslint-disable-line max-len, max-params
6771
if ( !isOperationSide( side ) ) {
6872
throw new TypeError( format( 'invalid argument. First argument must be a valid side. Value: `%s`.', side ) );
6973
}
7074
if ( !isMatrixTriangle( uplo ) ) {
7175
throw new TypeError( format( 'invalid argument. Second argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) );
7276
}
73-
if ( !isTransposeOperation( trans ) ) {
74-
throw new TypeError( format( 'invalid argument. Third argument must specify correct transpose operation. Value: `%s`.', trans ) );
77+
if ( !isTransposeOperation( transa ) ) {
78+
throw new TypeError( format( 'invalid argument. Third argument must specify correct transpose operation. Value: `%s`.', transa ) );
7579
}
7680
if ( !isDiagonalType( diag ) ) {
7781
throw new TypeError( format( 'invalid argument. Fourth argument must specify whether the matrix is unit triangular or not. Value: `%s`.', diag ) );
@@ -83,12 +87,12 @@ function strsm( side, uplo, trans, diag, M, N, alpha, A, strideA1, strideA2, off
8387
throw new RangeError( format( 'invalid argument. Sixth argument must be a nonnegative integer. Value: `%d`.', N ) );
8488
}
8589
if ( strideB1 === 0 ) {
86-
throw new RangeError( format( 'invalid argument. Seventeenth argument must be non-zero. Value: `%d`.', strideB1 ) );
90+
throw new RangeError( format( 'invalid argument. Thirteenth argument must be non-zero. Value: `%d`.', strideB1 ) );
8791
}
8892
if ( strideB2 === 0 ) {
89-
throw new RangeError( format( 'invalid argument. Eighteenth argument must be non-zero. Value: `%d`.', strideB2 ) );
93+
throw new RangeError( format( 'invalid argument. Fourteenth argument must be non-zero. Value: `%d`.', strideB2 ) );
9094
}
91-
return base( side, uplo, trans, diag, M, N, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ); // eslint-disable-line max-len
95+
return base( side, uplo, transa, diag, M, N, alpha, A, strideA1, strideA2, offsetA, B, strideB1, strideB2, offsetB ); // eslint-disable-line max-len
9296
}
9397

9498

lib/node_modules/@stdlib/blas/base/strsm/lib/strsm.js

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ var base = require( './base.js' );
3939
* @param {string} order - storage layout of `A` and `B`
4040
* @param {string} side - specifies whether `op( A )` appears on the left or right of `X`
4141
* @param {string} uplo - specifies whether the upper or lower triangular part of the matrix `A` is supplied
42-
* @param {string} trans - specifies the form of `op( A )` to be used in matrix multiplication
42+
* @param {string} transa - specifies the form of `op( A )` to be used in matrix multiplication
4343
* @param {string} diag - specifies whether or not `A` is unit triangular
4444
* @param {NonNegativeInteger} M - number of rows in `B`
4545
* @param {NonNegativeInteger} N - number of columns in `B`
@@ -53,6 +53,10 @@ var base = require( './base.js' );
5353
* @throws {TypeError} third argument must specify whether the lower or upper triangular matrix is supplied
5454
* @throws {TypeError} fourth argument must specify correct transpose operation
5555
* @throws {TypeError} fifth argument must specify whether the matrix is unit triangular or not
56+
* @throws {RangeError} sixth argument must be a nonnegative integer
57+
* @throws {RangeError} seventh argument must be a nonnegative integer
58+
* @throws {RangeError} tenth argument must be greater than or equal to max(1,M) when `A` is on left side and max(1,N) otherwise
59+
* @throws {RangeError} twelfth argument must be greater than or equal to max(1,M)
5660
* @returns {Float32Array} `B`
5761
*
5862
* @example
@@ -64,7 +68,7 @@ var base = require( './base.js' );
6468
* strsm( 'row-major', 'left', 'upper', 'no-transpose', 'non-unit', 2, 2, 6.0, A, 2, B, 2 );
6569
* // B => <Float32Array>[ 30.0, 6.0, 0.0, 12.0 ]
6670
*/
67-
function strsm( order, side, uplo, trans, diag, M, N, alpha, A, LDA, B, LDB ) { // eslint-disable-line max-params
71+
function strsm( order, side, uplo, transa, diag, M, N, alpha, A, LDA, B, LDB ) { // eslint-disable-line max-params
6872
var nrowsa;
6973
var isrm;
7074
var sa1;
@@ -80,8 +84,8 @@ function strsm( order, side, uplo, trans, diag, M, N, alpha, A, LDA, B, LDB ) {
8084
if ( !isMatrixTriangle( uplo ) ) {
8185
throw new TypeError( format( 'invalid argument. Thirds argument must specify whether the lower or upper triangular matrix is supplied. Value: `%s`.', uplo ) );
8286
}
83-
if ( !isTransposeOperation( trans ) ) {
84-
throw new TypeError( format( 'invalid argument. Fourth argument must specify correct transpose operation. Value: `%s`.', trans ) );
87+
if ( !isTransposeOperation( transa ) ) {
88+
throw new TypeError( format( 'invalid argument. Fourth argument must specify correct transpose operation. Value: `%s`.', transa ) );
8589
}
8690
if ( !isDiagonalType( diag ) ) {
8791
throw new TypeError( format( 'invalid argument. Fifth argument must specify whether the matrix is unit triangular or not. Value: `%s`.', diag ) );
@@ -98,10 +102,10 @@ function strsm( order, side, uplo, trans, diag, M, N, alpha, A, LDA, B, LDB ) {
98102
nrowsa = N;
99103
}
100104
if ( LDA < max( 1, nrowsa ) ) {
101-
throw new RangeError( format( 'invalid argument. Ninth argument must be greater than or equal to max(1,%d). Value: `%d`.', nrowsa, LDA ) );
105+
throw new RangeError( format( 'invalid argument. Tenth argument must be greater than or equal to max(1,%d). Value: `%d`.', nrowsa, LDA ) );
102106
}
103107
if ( LDB < max( 1, M ) ) {
104-
throw new RangeError( format( 'invalid argument. Eleventh argument must be greater than or equal to max(1,%d). Value: `%d`.', M, LDB ) );
108+
throw new RangeError( format( 'invalid argument. Twelfth argument must be greater than or equal to max(1,%d). Value: `%d`.', M, LDB ) );
105109
}
106110
isrm = isRowMajor( order );
107111
if ( !isrm ) {
@@ -115,7 +119,7 @@ function strsm( order, side, uplo, trans, diag, M, N, alpha, A, LDA, B, LDB ) {
115119
sb1 = LDB;
116120
sb2 = 1;
117121
}
118-
return base( side, uplo, trans, diag, M, N, alpha, A, sa1, sa2, 0, B, sb1, sb2, 0 ); // eslint-disable-line max-len
122+
return base( side, uplo, transa, diag, M, N, alpha, A, sa1, sa2, 0, B, sb1, sb2, 0 ); // eslint-disable-line max-len
119123
}
120124

121125

0 commit comments

Comments
 (0)