Skip to content

Commit 4d47e87

Browse files
committed
chore: clean-up
--- 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: missing_dependencies - task: lint_c_examples status: missing_dependencies - task: lint_c_benchmarks status: missing_dependencies - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent ecc6237 commit 4d47e87

File tree

21 files changed

+535
-186
lines changed

21 files changed

+535
-186
lines changed

lib/node_modules/@stdlib/blas/base/dsyr2/README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ The function has the following parameters:
5252
- **N**: number of elements along each dimension of `A`.
5353
- **α**: scalar constant.
5454
- **x**: first input [`Float64Array`][mdn-float64array].
55-
- **sx**: index increment for `x`.
55+
- **sx**: stride length for `x`.
5656
- **y**: second input [`Float64Array`][mdn-float64array].
57-
- **sy**: index increment for `y`.
57+
- **sy**: stride length for `y`.
5858
- **A**: input matrix stored in linear memory as a [`Float64Array`][mdn-float64array].
5959
- **lda**: stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`).
6060

@@ -196,7 +196,7 @@ console.log( A );
196196
#include "stdlib/blas/base/dsyr2.h"
197197
```
198198

199-
#### c_dsyr2( order, uplo, N, alpha, \*X, strideX, \*Y, strideY, \*A, LDA )
199+
#### c_dsyr2( order, uplo, N, alpha, \*X, sx, \*Y, sy, \*A, LDA )
200200

201201
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.
202202

@@ -215,11 +215,11 @@ The function accepts the following arguments:
215215
- **order**: `[in] CBLAS_LAYOUT` storage layout.
216216
- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied.
217217
- **N**: `[in] CBLAS_INT` number of elements along each dimension of `A`.
218-
- **alpha**: `[in] double` scalar.
218+
- **alpha**: `[in] double` scalar constant.
219219
- **X**: `[in] double*` first input array.
220-
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
220+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
221221
- **Y**: `[in] double*` second input array.
222-
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.
222+
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
223223
- **A**: `[inout] double*` input matrix.
224224
- **LDA**: `[in] CBLAS_INT` stride of the first dimension of `A` (a.k.a., leading dimension of the matrix `A`).
225225
@@ -229,7 +229,7 @@ void c_dsyr2( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N
229229

230230
<!-- lint disable maximum-heading-length -->
231231

232-
#### c_dsyr2_ndarray( uplo, N, alpha, \*X, strideX, offsetX, \*Y, strideY, offsetY, \*A, sa1, sa2, oa )
232+
#### c_dsyr2_ndarray( uplo, N, alpha, \*X, sx, ox, \*Y, sy, oy, \*A, sa1, sa2, oa )
233233

234234
Performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix.
235235

@@ -247,20 +247,20 @@ The function accepts the following arguments:
247247
248248
- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied.
249249
- **N**: `[in] CBLAS_INT` number of elements along each dimension of `A`.
250-
- **alpha**: `[in] double` scalar.
250+
- **alpha**: `[in] double` scalar constant.
251251
- **X**: `[in] double*` first input array.
252-
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
252+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
253253
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
254254
- **Y**: `[in] double` second input array.
255-
- **strideY**: `[in] CBLAS_INT` index increment for `Y`.
255+
- **strideY**: `[in] CBLAS_INT` stride length for `Y`.
256256
- **offsetY**: `[in] CBLAS_INT` starting index for `Y`.
257257
- **A**: `[inout] double*` input matrix.
258258
- **sa1**: `[in] CBLAS_INT` stride of the first dimension of `A`.
259259
- **sa2**: `[in] CBLAS_INT` stride of the second dimension of `A`.
260260
- **oa**: `[in] CBLAS_INT` starting index for `A`.
261261
262262
```c
263-
void c_dsyr2_ndarray( const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double *Y, CBLAS_INT strideY, const CBLAS_INT offsetY, double *A, const CBLAS_INT sa1, const CBLAS_INT sa2, const CBLAS_INT oa )
263+
void c_dsyr2_ndarray( const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *x, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double *y, CBLAS_INT strideY, const CBLAS_INT offsetY, double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA )
264264
```
265265

266266
</section>
@@ -294,7 +294,7 @@ int main( void ) {
294294
3.0, 2.0, 1.0
295295
};
296296

297-
// Create strided arrays:
297+
// Define `x` and `y` vectors:
298298
const double x[] = { 1.0, 2.0, 3.0 };
299299
const double y[] = { 1.0, 2.0, 3.0 };
300300

lib/node_modules/@stdlib/blas/base/dsyr2/benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var options = {
4242
* Creates a benchmark function.
4343
*
4444
* @private
45-
* @param {PositiveInteger} N - number of elements along each dimension
45+
* @param {PositiveInteger} N - array length
4646
* @returns {Function} benchmark function
4747
*/
4848
function createBenchmark( N ) {

lib/node_modules/@stdlib/blas/base/dsyr2/benchmark/benchmark.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var options = {
4747
* Creates a benchmark function.
4848
*
4949
* @private
50-
* @param {PositiveInteger} N - number of elements along each dimension
50+
* @param {PositiveInteger} N - array length
5151
* @returns {Function} benchmark function
5252
*/
5353
function createBenchmark( N ) {

lib/node_modules/@stdlib/blas/base/dsyr2/benchmark/benchmark.ndarray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var options = {
4242
* Creates a benchmark function.
4343
*
4444
* @private
45-
* @param {PositiveInteger} N - number of elements along each dimension
45+
* @param {PositiveInteger} N - array length
4646
* @returns {Function} benchmark function
4747
*/
4848
function createBenchmark( N ) {

lib/node_modules/@stdlib/blas/base/dsyr2/benchmark/benchmark.ndarray.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ var options = {
4747
* Creates a benchmark function.
4848
*
4949
* @private
50-
* @param {PositiveInteger} N - number of elements along each dimension
50+
* @param {PositiveInteger} N - array length
5151
* @returns {Function} benchmark function
5252
*/
5353
function createBenchmark( N ) {

lib/node_modules/@stdlib/blas/base/dsyr2/benchmark/c/benchmark.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -83,30 +83,30 @@ static double tic( void ) {
8383
* Runs a benchmark.
8484
*
8585
* @param iterations number of iterations
86-
* @param len number of elements along each dimension
86+
* @param N array dimension size
8787
* @return elapsed time in seconds
8888
*/
89-
static double benchmark1( int iterations, int len ) {
89+
static double benchmark1( int iterations, int N ) {
9090
double elapsed;
91-
double A[ len*len ];
92-
double x[ len ];
93-
double y[ len ];
91+
double A[ N*N ];
92+
double x[ N ];
93+
double y[ N ];
9494
double t;
9595
int i;
9696

97-
stdlib_strided_dfill( len, 1.0, x, 1 );
98-
stdlib_strided_dfill( len, 1.0, y, 1 );
99-
stdlib_strided_dfill( len*len, 1.0, A, 1 );
97+
stdlib_strided_dfill( N, 1.0, x, 1 );
98+
stdlib_strided_dfill( N, 1.0, y, 1 );
99+
stdlib_strided_dfill( N*N, 1.0, A, 1 );
100100
t = tic();
101101
for ( i = 0; i < iterations; i++ ) {
102-
c_dsyr2( CblasRowMajor, CblasUpper, len, 1.0, x, 1, y, 1, A, len );
103-
if ( A[ i%len ] != A[ i%len ] ) {
102+
c_dsyr2( CblasRowMajor, CblasUpper, N, 1.0, x, 1, y, 1, A, N );
103+
if ( A[ i%N ] != A[ i%N ] ) {
104104
printf( "should not return NaN\n" );
105105
break;
106106
}
107107
}
108108
elapsed = tic() - t;
109-
if ( A[ i%len ] != A[ i%len ] ) {
109+
if ( A[ i%N ] != A[ i%N ] ) {
110110
printf( "should not return NaN\n" );
111111
}
112112
return elapsed;
@@ -116,30 +116,30 @@ static double benchmark1( int iterations, int len ) {
116116
* Runs a benchmark.
117117
*
118118
* @param iterations number of iterations
119-
* @param len number of elements along each dimension
119+
* @param N array dimension size
120120
* @return elapsed time in seconds
121121
*/
122-
static double benchmark2( int iterations, int len ) {
122+
static double benchmark2( int iterations, int N ) {
123123
double elapsed;
124-
double A[ len*len ];
125-
double x[ len ];
126-
double y[ len ];
124+
double A[ N*N ];
125+
double x[ N ];
126+
double y[ N ];
127127
double t;
128128
int i;
129129

130-
stdlib_strided_dfill( len, 1.0, x, 1 );
131-
stdlib_strided_dfill( len, 1.0, y, 1 );
132-
stdlib_strided_dfill( len*len, 1.0, A, 1 );
130+
stdlib_strided_dfill( N, 1.0, x, 1 );
131+
stdlib_strided_dfill( N, 1.0, y, 1 );
132+
stdlib_strided_dfill( N*N, 1.0, A, 1 );
133133
t = tic();
134134
for ( i = 0; i < iterations; i++ ) {
135-
c_dsyr2_ndarray( CblasUpper, len, 1.0, x, 1, 0, y, 1, 0, A, len, 1, 0 );
136-
if ( A[ i%len ] != A[ i%len ] ) {
135+
c_dsyr2_ndarray( CblasUpper, N, 1.0, x, 1, 0, y, 1, 0, A, N, 1, 0 );
136+
if ( A[ i%N ] != A[ i%N ] ) {
137137
printf( "should not return NaN\n" );
138138
break;
139139
}
140140
}
141141
elapsed = tic() - t;
142-
if ( A[ i%len ] != A[ i%len ] ) {
142+
if ( A[ i%N ] != A[ i%N ] ) {
143143
printf( "should not return NaN\n" );
144144
}
145145
return elapsed;
@@ -154,27 +154,27 @@ int main( void ) {
154154
int iter;
155155
int i;
156156
int j;
157-
int len;
157+
int N;
158158

159159
// Use the current time to seed the random number generator:
160160
srand( time( NULL ) );
161161

162162
print_version();
163163
count = 0;
164164
for ( i = MIN; i <= MAX; i++ ) {
165-
len = floor( pow( pow( 10, i ), 1.0/2.0 ) );
165+
N = floor( pow( pow( 10, i ), 1.0/2.0 ) );
166166
iter = ITERATIONS / pow( 10, i-1 );
167167
for ( j = 0; j < REPEATS; j++ ) {
168168
count += 1;
169-
printf( "# c::%s:size=%d\n", NAME, len*len );
170-
elapsed = benchmark1( iter, len );
169+
printf( "# c::%s:size=%d\n", NAME, N*N );
170+
elapsed = benchmark1( iter, N );
171171
print_results( iter, elapsed );
172172
printf( "ok %d benchmark finished\n", count );
173173
}
174174
for ( j = 0; j < REPEATS; j++ ) {
175175
count += 1;
176-
printf( "# c::%s:ndarray:size=%d\n", NAME, len*len );
177-
elapsed = benchmark2( iter, len );
176+
printf( "# c::%s:ndarray:size=%d\n", NAME, N*N );
177+
elapsed = benchmark2( iter, N );
178178
print_results( iter, elapsed );
179179
printf( "ok %d benchmark finished\n", count );
180180
}

lib/node_modules/@stdlib/blas/base/dsyr2/docs/repl.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,29 @@
5252

5353
Examples
5454
--------
55+
// Standard usage:
5556
> var x = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] );
5657
> var y = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] );
5758
> var A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 0.0, 2.0 ] );
5859
> {{alias}}( 'row-major', 'upper', 2, 1.0, x, 1, y, 1, A, 2 )
5960
<Float64Array>[ 3.0, 4.0, 0.0, 4.0 ]
6061

62+
// Advanced indexing:
63+
> x = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] );
64+
> y = new {{alias:@stdlib/array/float64}}( [ 1.0, 1.0 ] );
65+
> A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 0.0, 2.0 ] );
66+
> {{alias}}( 'row-major', 'upper', 2, 1.0, x, -1, y, -1, A, 2 )
67+
<Float64Array>[ 3.0, 4.0, 0.0, 4.0 ]
68+
69+
// Using typed array views:
70+
> var x0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 1.0, 1.0 ] );
71+
> var y0 = new {{alias:@stdlib/array/float64}}( [ 0.0, 1.0, 1.0 ] );
72+
> A = new {{alias:@stdlib/array/float64}}( [ 1.0, 2.0, 0.0, 2.0 ] );
73+
> var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
74+
> var y1 = new {{alias:@stdlib/array/float64}}( y0.buffer, y0.BYTES_PER_ELEMENT*1 );
75+
> {{alias}}( 'row-major', 'upper', 2, 1.0, x, 1, y, 1, A, 2 )
76+
<Float64Array>[ 3.0, 4.0, 0.0, 4.0 ]
77+
6178

6279
{{alias}}.ndarray( uplo, N, α, x, sx, ox, y, sy, oy, A, sa1, sa2, oa )
6380
Performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A`, using

lib/node_modules/@stdlib/blas/base/dsyr2/examples/c/example.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222

2323
int main( void ) {
2424
// Define a 3x3 symmetric matrix stored in row-major order:
25-
double A[] = {
25+
double A[ 3*3 ] = {
2626
1.0, 0.0, 0.0,
2727
2.0, 1.0, 0.0,
2828
3.0, 2.0, 1.0
2929
};
3030

31-
// Create strided arrays:
32-
const double x[] = { 1.0, 2.0, 3.0 };
33-
const double y[] = { 1.0, 2.0, 3.0 };
31+
// Define `x` and `y` vectors:
32+
const double x[ 3 ] = { 1.0, 2.0, 3.0 };
33+
const double y[ 3 ] = { 1.0, 2.0, 3.0 };
3434

3535
// Specify the number of elements along each dimension of `A`:
3636
const int N = 3;

lib/node_modules/@stdlib/blas/base/dsyr2/include/stdlib/blas/base/dsyr2.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extern "C" {
3434
/**
3535
* 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.
3636
*/
37-
void API_SUFFIX(c_dsyr2)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY, double *A, const CBLAS_INT LDA );
37+
void API_SUFFIX(c_dsyr2)( const CBLAS_LAYOUT layout, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY, double *A, const CBLAS_INT LDA );
3838

3939
/**
4040
* Performs the symmetric rank 2 operation `A = α*x*y^T + α*y*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` and `y` are `N` element vectors, and `A` is an `N` by `N` symmetric matrix.

lib/node_modules/@stdlib/blas/base/dsyr2/include/stdlib/blas/base/dsyr2_cblas.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ extern "C" {
3434
/**
3535
* 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.
3636
*/
37-
void API_SUFFIX(cblas_dsyr2)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY, double *A, const CBLAS_INT LDA );
37+
void API_SUFFIX(cblas_dsyr2)( const CBLAS_LAYOUT layout, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const double *Y, const CBLAS_INT strideY, double *A, const CBLAS_INT LDA );
3838

3939
#ifdef __cplusplus
4040
}

0 commit comments

Comments
 (0)