Skip to content

Commit

Permalink
refactor: update parameter for ndarray, and base implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-095 committed Jul 30, 2024
1 parent 3737826 commit e10c507
Show file tree
Hide file tree
Showing 23 changed files with 192 additions and 262 deletions.
6 changes: 3 additions & 3 deletions lib/node_modules/@stdlib/blas/base/strmv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ strmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 );
// x0 => <Float32Array>[ 1.0, 6.0, 3.0, 1.0 ]
```

#### strmv.ndarray( order, uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox )
#### strmv.ndarray( uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox )

Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.

Expand All @@ -96,7 +96,7 @@ var Float32Array = require( '@stdlib/array/float32' );
var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] );
var x = new Float32Array( [ 1.0, 2.0, 3.0 ] );

strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 );
strmv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, 1, 0 );
// x => <Float32Array>[ 14.0, 8.0, 3.0 ]
```

Expand All @@ -115,7 +115,7 @@ var Float32Array = require( '@stdlib/array/float32' );
var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] );
var x = new Float32Array( [ 1.0, 2.0, 3.0 ] );

strmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 );
strmv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 );
// x => <Float32Array>[ 1.0, 4.0, 10.0 ]
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function createBenchmark( N ) {

b.tic();
for ( i = 0; i < b.iterations; i++ ) {
z = strmv( 'row-major', 'upper', 'transpose', 'non-unit', N, A, N, 1, 0, x, 1, 0 );
z = strmv( 'upper', 'transpose', 'non-unit', N, A, N, 1, 0, x, 1, 0 );
if ( isnanf( z[ i%z.length ] ) ) {
b.fail( 'should not return NaN' );
}
Expand Down
9 changes: 2 additions & 7 deletions lib/node_modules/@stdlib/blas/base/strmv/docs/repl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<Float32Array>[ 3.0, 1.0 ]


{{alias}}.ndarray( ord, uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox )
{{alias}}.ndarray( uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox )
Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`,
using alternative indexing semantics, where `x` is an `N` element vector
and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular
Expand All @@ -66,10 +66,6 @@

Parameters
----------
ord: string
Row-major (C-style) or column-major (Fortran-style) order. Must be
either 'row-major' or 'column-major'.

uplo: string
Specifies whether `A` is an upper or lower triangular matrix.

Expand Down Expand Up @@ -113,10 +109,9 @@
--------
> var x = new {{alias:@stdlib/array/float32}}( [ 1.0, 1.0 ] );
> var A = new {{alias:@stdlib/array/float32}}( [ 1.0, 2.0, 0.0, 1.0 ] );
> var ord = 'row-major';
> var uplo = 'upper';
> var trans = 'no-transpose';
> {{alias}}.ndarray( ord, uplo, trans, 'unit', 2, A, 2, 1, 0, x, 1, 0 )
> {{alias}}.ndarray( uplo, trans, 'unit', 2, A, 2, 1, 0, x, 1, 0 )
<Float32Array>[ 3.0, 1.0 ]

See Also
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ interface Routine {
/**
* Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, using alternative indexing semantics, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.
*
* @param order - storage layout
* @param uplo - specifies whether `A` is an upper or lower triangular matrix
* @param trans - specifies whether `A` should be transposed, conjugate-transposed, or not transposed
* @param diag - specifies whether `A` has a unit diagonal
Expand All @@ -74,10 +73,10 @@ interface Routine {
* var A = new Float32Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] );
* var x = new Float32Array( [ 1.0, 2.0, 3.0 ] );
*
* strmv.ndarray( row-major', 'upper', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 );
* strmv.ndarray( 'upper', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 );
* // x => <Float32Array>[ 14.0, 8.0, 3.0 ]
*/
ndarray( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number, offsetX: number ): Float32Array;
ndarray( uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float32Array, LDA: number, x: Float32Array, strideX: number, offsetX: number ): Float32Array;
}

/**
Expand Down Expand Up @@ -109,7 +108,7 @@ interface Routine {
* var A = new Float32Array( [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ] );
* var x = new Float32Array( [ 1.0, 1.0, 1.0 ] );
*
* strmv.ndarray( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 );
* strmv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 );
* // x => <Float32Array>[ 1.0, 5.0, 15.0 ]
*/
declare var strmv: Routine;
Expand Down
Loading

0 comments on commit e10c507

Please sign in to comment.