Skip to content

Commit 20f0901

Browse files
committed
refactor: update implementation
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: passed - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: passed - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent c84db99 commit 20f0901

File tree

10 files changed

+204
-162
lines changed

10 files changed

+204
-162
lines changed

lib/node_modules/@stdlib/lapack/base/dlaset/README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020

2121
# dlaset
2222

23-
> LAPACK routine to initialize an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals.
23+
> Set the off-diagonal elements and the diagonal elements of a double-precision floating-point matrix to specified values.
2424
2525
<section class="usage">
2626

@@ -30,16 +30,16 @@ limitations under the License.
3030
var dlaset = require( '@stdlib/lapack/base/dlaset' );
3131
```
3232

33-
#### dlaset( order, uplo, M, N, A, LDA, alpha, beta )
33+
#### dlaset( order, uplo, M, N, alpha, beta, A, LDA )
3434

35-
Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals.
35+
Sets the off-diagonal elements and the diagonal elements of a double-precision floating-point matrix to specified values.
3636

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

4040
var A = new Float64Array( 4 );
4141

42-
dlaset( 'row-major', 'all', 2, 2, A, 2, 0.0, 1.0 );
42+
dlaset( 'row-major', 'all', 2, 2, 0.0, 1.0, A, 2 );
4343
// A => <Float64Array>[ 1.0, 0.0, 0.0, 1.0 ]
4444
```
4545

@@ -49,10 +49,10 @@ The function has the following parameters:
4949
- **uplo**: specifies whether to set the upper or lower triangular/trapezoidal part of a matrix `A`.
5050
- **M**: number of rows in `A`.
5151
- **N**: number of columns in `A`.
52+
- **alpha**: value assigned to off-diagonal elements.
53+
- **beta**: value assigned to diagonal elements.
5254
- **A**: input [`Float64Array`][mdn-float64array].
5355
- **LDA**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`).
54-
- **alpha**: number to set on the off-diagonal elements.
55-
- **beta**: number to set on the diagonal elements.
5656

5757
Note that indexing is relative to the first index. To introduce an offset, use [`typed array`][mdn-typed-array] views.
5858

@@ -67,43 +67,43 @@ var A0 = new Float64Array( 5 );
6767
// Create offset views...
6868
var A1 = new Float64Array( A0.buffer, A0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
6969

70-
dlaset( 'row-major', 'all', 2, 2, A1, 2, 0.0, 1.0 );
70+
dlaset( 'row-major', 'all', 2, 2, 0.0, 1.0, A1, 2 );
7171
// A0 => <Float64Array>[ 0.0, 1.0, 0.0, 0.0, 1.0 ]
7272
```
7373

74-
#### dlaset.ndarray( uplo, M, N, A, sa1, sa2, oa, alpha, beta )
74+
#### dlaset.ndarray( uplo, M, N, alpha, beta, A, sa1, sa2, oa )
7575

76-
Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals using alternative indexing semantics.
76+
Sets the off-diagonal elements and the diagonal elements of a double-precision floating-point matrix to specified values using alternative indexing semantics.
7777

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

8181
var A = new Float64Array( 4 );
8282

83-
dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 0.0, 1.0 );
83+
dlaset.ndarray( 'all', 2, 2, 0.0, 1.0, A, 2, 1, 0 );
8484
// A => <Float64Array>[ 1.0, 0.0, 0.0, 1.0 ]
8585
```
8686

8787
The function has the following parameters:
8888

89-
- **uplo**: specifies whether to copy the upper or lower triangular/trapezoidal part of a matrix `A`.
89+
- **uplo**: specifies whether to set the upper or lower triangular/trapezoidal part of a matrix `A`.
9090
- **M**: number of rows in `A`.
9191
- **N**: number of columns in `A`.
92+
- **alpha**: value assigned to off-diagonal elements.
93+
- **beta**: value assigned to diagonal elements.
9294
- **A**: input [`Float64Array`][mdn-float64array].
9395
- **sa1**: stride of the first dimension of `A`.
9496
- **sa2**: stride of the second dimension of `A`.
9597
- **oa**: starting index for `A`.
96-
- **alpha**: number to set on the off-diagonal elements.
97-
- **beta**: number to set on the diagonal elements.
9898

99-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example,
99+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example,
100100

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

104104
var A = new Float64Array( 5 );
105105

106-
dlaset.ndarray( 'all', 2, 2, A, 2, 1, 1, 0.0, 1.0 );
106+
dlaset.ndarray( 'all', 2, 2, 0.0, 1.0, A, 2, 1, 1 );
107107
// A => <Float64Array>[ 0.0, 1.0, 0.0, 0.0, 1.0 ]
108108
```
109109

lib/node_modules/@stdlib/lapack/base/dlaset/benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function createBenchmark( order, N ) {
6767

6868
b.tic();
6969
for ( i = 0; i < b.iterations; i++ ) {
70-
z = dlaset( order, 'all', N, N, A, N, 1.0, 0.0 );
70+
z = dlaset( order, 'all', N, N, 1.0, 0.0, A, N );
7171
if ( isnan( z[ i%z.length ] ) ) {
7272
b.fail( 'should not return NaN' );
7373
}

lib/node_modules/@stdlib/lapack/base/dlaset/benchmark/benchmark.ndarray.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var isnan = require( '@stdlib/math/base/assert/is-nan' );
2727
var pow = require( '@stdlib/math/base/special/pow' );
2828
var floor = require( '@stdlib/math/base/special/floor' );
2929
var pkg = require( './../package.json' ).name;
30-
var dlaswp = require( './../lib/ndarray.js' );
30+
var dlaset = require( './../lib/ndarray.js' );
3131

3232

3333
// VARIABLES //
@@ -77,7 +77,7 @@ function createBenchmark( order, N ) {
7777

7878
b.tic();
7979
for ( i = 0; i < b.iterations; i++ ) {
80-
z = dlaswp( 'all', N, N, A, sa1, sa2, 0, 1.0, 0.0 );
80+
z = dlaset( 'all', N, N, 1.0, 0.0, A, sa1, sa2, 0 );
8181
if ( isnan( z[ i%z.length ] ) ) {
8282
b.fail( 'should not return NaN' );
8383
}

lib/node_modules/@stdlib/lapack/base/dlaset/docs/repl.txt

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

2-
{{alias}}( order, uplo, M, N, A, LDA, alpha, beta )
3-
Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha`
4-
on the off diagonals.
2+
{{alias}}( order, uplo, M, N, alpha, beta, A, LDA )
3+
Sets the off-diagonal elements and the diagonal elements of a
4+
double-precision floating-point matrix to specified values.
55

6-
Indexing is relative to the first index. To introduce an offset, use typed
7-
array views.
6+
Indexing is relative to the first index. To introduce an offset, use
7+
typed array views.
88

99
Parameters
1010
----------
@@ -13,27 +13,27 @@
1313
either 'row-major' or 'column-major'.
1414

1515
uplo: string
16-
Specifies whether to set the upper or lower triangular/trapezoidal part
17-
of a matrix `A`.
16+
Specifies whether to set the upper or lower triangular/trapezoidal
17+
part of a matrix `A`.
1818

1919
M: integer
2020
Number of rows in `A`.
2121

2222
N: integer
2323
Number of columns in `A`.
2424

25+
alpha: number
26+
Value assigned to off-diagonal elements.
27+
28+
beta: number
29+
Value assigned to diagonal elements.
30+
2531
A: Float64Array
2632
Input matrix `A`.
2733

2834
LDA: integer
29-
Stride of the first dimension of `A` (a.k.a., leading dimension of the
30-
matrix `A`).
31-
32-
alpha: number
33-
Number to set on the off-diagonal elements.
34-
35-
beta: number
36-
Number to set on the diagonal elements.
35+
Stride of the first dimension of `A` (a.k.a., leading dimension of
36+
the matrix `A`).
3737

3838
Returns
3939
-------
@@ -43,30 +43,37 @@
4343
Examples
4444
--------
4545
> var A = new {{alias:@stdlib/array/float64}}( 4 );
46-
> {{alias}}( 'row-major', 'all', 2, 2, A, 2, 0.0, 1.0 )
46+
> {{alias}}( 'row-major', 'all', 2, 2, 0.0, 1.0, A, 2 )
4747
<Float64Array>[ 1.0, 0.0, 0.0, 1.0 ]
4848

4949

50-
{{alias}}.ndarray( uplo, M, N, A, sa1, sa2, oa, alpha, beta )
51-
Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha`
52-
on the off diagonals using alternative indexing semantics.
50+
{{alias}}.ndarray( uplo, M, N, alpha, beta, A, sa1, sa2, oa )
51+
Sets the off-diagonal elements and the diagonal elements of a
52+
double-precision floating-point matrix to specified values using
53+
alternative indexing semantics.
5354

5455
While typed array views mandate a view offset based on the underlying
55-
buffer, the offset parameters support indexing semantics based on starting
56-
indices.
56+
buffer, the offset parameter supports indexing semantics based on a
57+
starting index.
5758

5859
Parameters
5960
----------
6061
uplo: string
61-
Specifies whether to set the upper or lower triangular/trapezoidal part
62-
of a matrix `A`.
62+
Specifies whether to set the upper or lower triangular/trapezoidal
63+
part of a matrix `A`.
6364

6465
M: integer
6566
Number of rows in `A`.
6667

6768
N: integer
6869
Number of columns in `A`.
6970

71+
alpha: number
72+
Value assigned to off-diagonal elements.
73+
74+
beta: number
75+
Value assigned to diagonal elements.
76+
7077
A: Float64Array
7178
Input matrix `A`.
7279

@@ -79,12 +86,6 @@
7986
oa: integer
8087
Starting index for `A`.
8188

82-
alpha: number
83-
Number to set on the off-diagonal elements.
84-
85-
beta: number
86-
Number to set on the diagonal elements.
87-
8889
Returns
8990
-------
9091
A: Float64Array
@@ -93,7 +94,7 @@
9394
Examples
9495
--------
9596
> var A = new {{alias:@stdlib/array/float64}}( 4 );
96-
> {{alias}}.ndarray( 'all', 2, 2, A, 2, 1, 0, 0.0, 1.0 )
97+
> {{alias}}.ndarray( 'all', 2, 2, 0.0, 1.0, A, 2, 1, 0 )
9798
<Float64Array>[ 1.0, 0.0, 0.0, 1.0 ]
9899

99100
See Also

lib/node_modules/@stdlib/lapack/base/dlaset/docs/types/index.d.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,80 +27,80 @@ import { Layout } from '@stdlib/types/blas';
2727
*/
2828
interface Routine {
2929
/**
30-
* Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals.
30+
* Sets the off-diagonal elements and the diagonal elements of a double-precision floating-point matrix to specified values.
3131
*
3232
* @param order - storage layout of `A` and `B`
3333
* @param uplo - specifies whether to set the upper or lower triangular/trapezoidal part of matrix `A`
3434
* @param M - number of rows in matrix `A`
3535
* @param N - number of columns in matrix `A`
36+
* @param alpha - value assigned to off-diagonal elements
37+
* @param beta - value assigned to diagonal elements
3638
* @param A - input matrix
3739
* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`)
38-
* @param alpha - number to set on off diagonal elements
39-
* @param beta - number to set on diagonal elements
4040
* @returns `A`
4141
*
4242
* @example
4343
* var Float64Array = require( '@stdlib/array/float64' );
4444
*
4545
* var A = new Float64Array( 4 );
4646
*
47-
* dlaset( 'row-major', 'all', 2, 2, A, 2, 0.0, 1.0 );
47+
* dlaset( 'row-major', 'all', 2, 2, 0.0, 1.0, A, 2 );
4848
* // A => <Float64Array>[ 1.0, 0.0, 0.0, 1.0 ]
4949
*/
50-
( order: Layout, uplo: string, M: number, N: number, A: Float64Array, LDA: number, alpha: number, beta: number ): Float64Array;
50+
( order: Layout, uplo: string, M: number, N: number, alpha: number, beta: number, A: Float64Array, LDA: number ): Float64Array;
5151

5252
/**
53-
* Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals using alternative indexing semantics.
53+
* Sets the off-diagonal elements and the diagonal elements of a double-precision floating-point matrix to specified values using alternative indexing semantics.
5454
*
5555
* @param uplo - specifies whether to set the upper or lower triangular/trapezoidal part of matrix `A`
5656
* @param M - number of rows in matrix `A`
5757
* @param N - number of columns in matrix `A`
58+
* @param alpha - value assigned to off-diagonal elements
59+
* @param beta - value assigned to diagonal elements
5860
* @param A - input matrix
5961
* @param strideA1 - stride of the first dimension of `A`
6062
* @param strideA2 - stride of the second dimension of `A`
6163
* @param offsetA - starting index for `A`
62-
* @param alpha - number to set on off diagonal elements
63-
* @param beta - number to set on diagonal elements
6464
* @returns `A`
6565
*
6666
* @example
6767
* var Float64Array = require( '@stdlib/array/float64' );
6868
*
6969
* var A = new Float64Array( 4 );
7070
*
71-
* dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 0.0, 1.0 );
71+
* dlaset.ndarray( 'all', 2, 2, 0.0, 1.0, A, 2, 1, 0 );
7272
* // A => <Float64Array>[ 1.0, 0.0, 0.0, 1.0 ]
7373
*/
74-
ndarray( uplo: string, M: number, N: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number, alpha: number, beta: number ): Float64Array;
74+
ndarray( uplo: string, M: number, N: number, alpha: number, beta: number, A: Float64Array, strideA1: number, strideA2: number, offsetA: number ): Float64Array;
7575
}
7676

7777
/**
78-
* Initialises an M by N matrix `A` to `beta` on the diagonals and `alpha` on the off diagonals.
78+
* Sets the off-diagonal elements and the diagonal elements of a double-precision floating-point matrix to specified values.
7979
*
8080
* @param order - storage layout of `A` and `B`
8181
* @param uplo - specifies whether to set the upper or lower triangular/trapezoidal part of matrix `A`
8282
* @param M - number of rows in matrix `A`
8383
* @param N - number of columns in matrix `A`
84+
* @param alpha - value assigned to off-diagonal elements
85+
* @param beta - value assigned to diagonal elements
8486
* @param A - input matrix
8587
* @param LDA - stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`)
86-
* @param alpha - number to set on off diagonal elements
87-
* @param beta - number to set on diagonal elements
8888
* @returns `A`
8989
*
9090
* @example
9191
* var Float64Array = require( '@stdlib/array/float64' );
9292
*
9393
* var A = new Float64Array( 4 );
9494
*
95-
* dlaset( 'row-major', 'all', 2, 2, A, 2, 0.0, 1.0 );
95+
* dlaset( 'row-major', 'all', 2, 2, 0.0, 1.0, A, 2 );
9696
* // A => <Float64Array>[ 1.0, 0.0, 0.0, 1.0 ]
9797
*
9898
* @example
9999
* var Float64Array = require( '@stdlib/array/float64' );
100100
*
101101
* var A = new Float64Array( 4 );
102102
*
103-
* dlaset.ndarray( 'all', 2, 2, A, 2, 1, 0, 0.0, 1.0 );
103+
* dlaset.ndarray( 'all', 2, 2, 0.0, 1.0, A, 2, 1, 0 );
104104
* // A => <Float64Array>[ 1.0, 0.0, 0.0, 1.0 ]
105105
*/
106106
declare var dlaset: Routine;

0 commit comments

Comments
 (0)