Skip to content

Commit cd7bb25

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: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: missing_dependencies - task: lint_c_examples status: na - 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 22d7083 commit cd7bb25

File tree

5 files changed

+16
-42
lines changed

5 files changed

+16
-42
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ void c_dspr( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N,
215215

216216
#### c_dspr_ndarray( order, uplo, N, alpha, \*X, strideX, \*AP, strideAP, offsetAP )
217217

218-
Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix supplied in packed form using alternative indexing semantics.
218+
Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix supplied in packed form.
219219

220220
```c
221221
#include "stdlib/blas/base/shared.h"

lib/node_modules/@stdlib/blas/base/dspr/benchmark/c/benchmark.length.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,18 @@ static double benchmark1( int iterations, int len ) {
9393
double t;
9494
int i;
9595

96-
stdlib_strided_dfill( len, 0.5, x, 1 );
96+
stdlib_strided_dfill( len, 1.0, x, 1 );
9797
stdlib_strided_dfill( len*(len+1)/2, 1.0, AP, 1 );
9898
t = tic();
9999
for ( i = 0; i < iterations; i++ ) {
100100
c_dspr( CblasRowMajor, CblasUpper, len, 1.0, x, 1, AP );
101-
if ( AP[ 0 ] != AP[ 0 ] ) {
101+
if ( AP[ i%len ] != AP[ i%len ] ) {
102102
printf( "should not return NaN\n" );
103103
break;
104104
}
105105
}
106106
elapsed = tic() - t;
107-
if ( AP[ 0 ] != AP[ 0 ] ) {
107+
if ( AP[ i%len ] != AP[ i%len ] ) {
108108
printf( "should not return NaN\n" );
109109
}
110110
return elapsed;
@@ -124,18 +124,18 @@ static double benchmark2( int iterations, int len ) {
124124
double t;
125125
int i;
126126

127-
stdlib_strided_dfill( len, 0.5, x, 1 );
127+
stdlib_strided_dfill( len, 1.0, x, 1 );
128128
stdlib_strided_dfill( len*(len+1)/2, 1.0, AP, 1 );
129129
t = tic();
130130
for ( i = 0; i < iterations; i++ ) {
131131
c_dspr_ndarray( CblasRowMajor, CblasUpper, len, 1.0, x, 1, 0, AP, 1, 0 );
132-
if ( AP[ 0 ] != AP[ 0 ] ) {
132+
if ( AP[ i%len ] != AP[ i%len ] ) {
133133
printf( "should not return NaN\n" );
134134
break;
135135
}
136136
}
137137
elapsed = tic() - t;
138-
if ( AP[ 0 ] != AP[ 0 ] ) {
138+
if ( AP[ i%len ] != AP[ i%len ] ) {
139139
printf( "should not return NaN\n" );
140140
}
141141
return elapsed;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ extern "C" {
3737
void API_SUFFIX(c_dspr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *AP );
3838

3939
/**
40-
* Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix supplied in packed form using alternative indexing semantics.
40+
* Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix supplied in packed form.
4141
*/
4242
void API_SUFFIX(c_dspr_ndarray)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *AP, const CBLAS_INT strideAP, const CBLAS_INT offsetAP );
4343

lib/node_modules/@stdlib/blas/base/dspr/src/dspr_cblas.c

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -24,48 +24,22 @@
2424
* Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix supplied in packed form.
2525
*
2626
* @param order storage layout
27-
* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced
27+
* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied
2828
* @param N number of elements along each dimension of `A`
2929
* @param alpha scalar
3030
* @param X input vector
3131
* @param strideX `x` stride length
3232
* @param AP packed form of a symmetric matrix `A`
3333
*/
3434
void API_SUFFIX(c_dspr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, double *AP ) {
35-
CBLAS_INT sx = strideX;
36-
if ( sx < 0 ) {
37-
sx = -sx;
38-
}
39-
API_SUFFIX(cblas_dspr)( order, uplo, N, alpha, X, sx, AP );
40-
}
41-
42-
/**
43-
* Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix supplied in packed form using alternative indexing semantics.
44-
*
45-
* @param order storage layout
46-
* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced
47-
* @param N number of elements along each dimension of `A`
48-
* @param alpha scalar
49-
* @param X input vector
50-
* @param strideX `x` stride length
51-
* @param offsetX starting index for `x`
52-
* @param AP packed form of a symmetric matrix `A`
53-
* @param strideAP `AP` stride length
54-
* @param offsetAP starting index for `AP`
55-
*/
56-
void API_SUFFIX(c_dspr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *AP, const CBLAS_INT strideAP, const CBLAS_INT offsetAP ) {
57-
CBLAS_INT sx = strideX;
58-
if ( sx < 0 ) {
59-
sx = -sx;
60-
}
6135
API_SUFFIX(cblas_dspr)( order, uplo, N, alpha, X, sx, AP );
6236
}
6337

6438
/**
65-
* Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix supplied in packed form using alternative indexing semantics.
39+
* Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix supplied in packed form.
6640
*
6741
* @param order storage layout
68-
* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced
42+
* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied
6943
* @param N number of elements along each dimension of `A`
7044
* @param alpha scalar
7145
* @param X input vector

lib/node_modules/@stdlib/blas/base/dspr/src/dspr_ndarray.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
#include "stdlib/blas/base/shared.h"
2121

2222
/**
23-
* Performs the symmetric rank 1 operation `A = α*x*x^T + A` where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix supplied in packed form using alternative indexing semantics.
23+
* Performs the symmetric rank 1 operation `A = α*x*x^T + A`, using alternative indexing semantics and where `α` is a scalar, `x` is an `N` element vector, and `A` is an `N` by `N` symmetric matrix supplied in packed form.
2424
*
25-
* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced
25+
* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied
2626
* @param N number of elements along each dimension of `A`
2727
* @param alpha scalar
2828
* @param X input vector
@@ -42,7 +42,7 @@ void API_SUFFIX(c_dspr_ndarray)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo
4242
CBLAS_INT ox;
4343
double tmp;
4444

45-
if ( N == 0 || alpha == 0.0f ) {
45+
if ( N == 0 || alpha == 0.0 ) {
4646
return;
4747
}
4848
ox = offsetX;
@@ -53,7 +53,7 @@ void API_SUFFIX(c_dspr_ndarray)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo
5353
) {
5454
ix1 = ox;
5555
for ( i1 = 0; i1 < N; i1++ ) {
56-
if ( X[ ix1 ] != 0.0f ) {
56+
if ( X[ ix1 ] != 0.0 ) {
5757
tmp = alpha * X[ ix1 ];
5858
ix0 = ox;
5959
iap = kk;
@@ -71,7 +71,7 @@ void API_SUFFIX(c_dspr_ndarray)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo
7171
// ( order == CblasColMajor && uplo == CblasLower ) || ( order == CblasRowMajor && uplo == CblasUpper )
7272
ix1 = ox;
7373
for ( i1 = 0; i1 < N; i1++ ) {
74-
if ( X[ ix1 ] != 0.0f ) {
74+
if ( X[ ix1 ] != 0.0 ) {
7575
tmp = alpha * X[ ix1 ];
7676
ix0 = ix1;
7777
iap = kk;

0 commit comments

Comments
 (0)