Skip to content

Commit

Permalink
refactor: update parameter for ndarray, and base implementations, upd…
Browse files Browse the repository at this point in the history
…ate special test cases for ndarray, and update descriptions
  • Loading branch information
aman-095 committed Jul 30, 2024
1 parent 81ef001 commit d1fef4b
Show file tree
Hide file tree
Showing 23 changed files with 211 additions and 275 deletions.
12 changes: 6 additions & 6 deletions lib/node_modules/@stdlib/blas/base/dtrmv/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ limitations under the License.

# dtrmv

> Perform one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.
> Perform one of the matrix-vector operations `x = A*x` or `x = A^T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.
<section class = "usage">

Expand All @@ -32,7 +32,7 @@ var dtrmv = require( '@stdlib/blas/base/dtrmv' );

#### dtrmv( order, uplo, trans, diag, N, A, LDA, x, sx )

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

```javascript
var Float64Array = require( '@stdlib/array/float64' );
Expand Down Expand Up @@ -86,17 +86,17 @@ dtrmv( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, x1, 1 );
// x0 => <Float64Array>[ 1.0, 6.0, 3.0, 1.0 ]
```

#### dtrmv.ndarray( order, uplo, trans, diag, N, A, sa1, sa2, oa, x, sx, ox )
#### dtrmv.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.
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.

```javascript
var Float64Array = require( '@stdlib/array/float64' );

var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] );
var x = new Float64Array( [ 1.0, 2.0, 3.0 ] );

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

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

dtrmv.ndarray( 'row-major', 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 );
dtrmv.ndarray( 'upper', 'no-transpose', 'unit', 3, A, 3, 1, 0, x, -1, 2 );
// x => <Float64Array>[ 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 = dtrmv( 'row-major', 'upper', 'transpose', 'non-unit', N, A, N, 1, 0, x, 1, 0 );
z = dtrmv( 'upper', 'transpose', 'non-unit', N, A, N, 1, 0, x, 1, 0 );
if ( isnan( z[ i%z.length ] ) ) {
b.fail( 'should not return NaN' );
}
Expand Down
13 changes: 4 additions & 9 deletions lib/node_modules/@stdlib/blas/base/dtrmv/docs/repl.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

{{alias}}( ord, uplo, trans, diag, N, A, lda, x, sx )
Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`,
Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`,
where `x` is an `N` element vector and `A` is an `N` by `N` unit, or
non-unit, upper or lower triangular matrix.

Expand Down Expand Up @@ -54,8 +54,8 @@
<Float64Array>[ 3.0, 1.0 ]


{{alias}}.ndarray( ord, 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`,
{{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
matrix.
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/float64}}( [ 1.0, 1.0 ] );
> var A = new {{alias:@stdlib/array/float64}}( [ 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 )
<Float64Array>[ 3.0, 1.0 ]

See Also
Expand Down
13 changes: 6 additions & 7 deletions lib/node_modules/@stdlib/blas/base/dtrmv/docs/types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import { Layout, MatrixTriangle, TransposeOperation, DiagonalType } from '@stdli
*/
interface Routine {
/**
* Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.
* Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, 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
Expand All @@ -52,9 +52,8 @@ interface Routine {
( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float64Array, LDA: number, x: Float64Array, strideX: number ): Float64Array;

/**
* 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.
* 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,14 +73,14 @@ interface Routine {
* var A = new Float64Array( [ 1.0, 2.0, 3.0, 0.0, 1.0, 2.0, 0.0, 0.0, 1.0 ] );
* var x = new Float64Array( [ 1.0, 2.0, 3.0 ] );
*
* dtrmv.ndarray( row-major', 'upper', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 );
* dtrmv.ndarray( 'upper', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 );
* // x => <Float64Array>[ 14.0, 8.0, 3.0 ]
*/
ndarray( order: Layout, uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float64Array, LDA: number, x: Float64Array, strideX: number, offsetX: number ): Float64Array;
ndarray( uplo: MatrixTriangle, trans: TransposeOperation, diag: DiagonalType, N: number, A: Float64Array, LDA: number, x: Float64Array, strideX: number, offsetX: number ): Float64Array;
}

/**
* Performs one of the matrix-vector operations `x = A*x` or `x = A**T*x`, where `x` is an `N` element vector and `A` is an `N` by `N` unit, or non-unit, upper or lower triangular matrix.
* Performs one of the matrix-vector operations `x = A*x` or `x = A^T*x`, 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
Expand Down Expand Up @@ -109,7 +108,7 @@ interface Routine {
* var A = new Float64Array( [ 1.0, 0.0, 0.0, 2.0, 3.0, 0.0, 4.0, 5.0, 6.0 ] );
* var x = new Float64Array( [ 1.0, 1.0, 1.0 ] );
*
* dtrmv.ndarray( 'row-major', 'lower', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 );
* dtrmv.ndarray( 'lower', 'no-transpose', 'non-unit', 3, A, 3, 1, 0, x, 1, 0 );
* // x => <Float64Array>[ 1.0, 5.0, 15.0 ]
*/
declare var dtrmv: Routine;
Expand Down
Loading

0 comments on commit d1fef4b

Please sign in to comment.