Skip to content

Commit 5c010c5

Browse files
committed
chore: apply review changes
--- 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: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - 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: 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 --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: passed - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: passed - task: run_c_benchmarks status: passed - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: passed ---
1 parent b1b6469 commit 5c010c5

File tree

12 files changed

+66
-74
lines changed

12 files changed

+66
-74
lines changed

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

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
@license Apache-2.0
44
5-
Copyright (c) 2024 The Stdlib Authors.
5+
Copyright (c) 2025 The Stdlib Authors.
66
77
Licensed under the Apache License, Version 2.0 (the "License");
88
you may not use this file except in compliance with the License.
@@ -184,14 +184,15 @@ console.log( AP );
184184

185185
```c
186186
#include "stdlib/blas/base/sspr.h"
187-
#include "stdlib/blas/base/shared.h"
188187
```
189188

190189
#### c_sspr( order, uplo, N, alpha, \*X, strideX, \*AP )
191190

192191
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.
193192

194193
```c
194+
#include "stdlib/blas/base/shared.h"
195+
195196
float AP[] = { 1.0f, 2.0f, 3.0f, 1.0f, 2.0f, 1.0f };
196197
const float x[] = { 1.0f, 2.0f, 3.0f };
197198

@@ -204,7 +205,7 @@ The function accepts the following arguments:
204205
- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced.
205206
- **N**: `[in] CBLAS_INT` number of elements along each dimension of `A`.
206207
- **alpha**: `[in] float` scalar.
207-
- **X**: `[in] float*` first input array.
208+
- **X**: `[in] float*` input array.
208209
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
209210
- **AP**: `[inout] float*` packed form of a symmetric matrix `A`.
210211
@@ -217,6 +218,8 @@ void c_sspr( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N,
217218
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.
218219

219220
```c
221+
#include "stdlib/blas/base/shared.h"
222+
220223
float AP[] = { 1.0f, 2.0f, 3.0f, 1.0f, 2.0f, 1.0f };
221224
const float x[] = { 1.0f, 2.0f, 3.0f };
222225

@@ -229,10 +232,10 @@ The function accepts the following arguments:
229232
- **uplo**: `[in] CBLAS_UPLO` specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced.
230233
- **N**: `[in] CBLAS_INT` number of elements along each dimension of `A`.
231234
- **alpha**: `[in] float` scalar.
232-
- **X**: `[in] float*` first input array.
233-
- **strideX**: `[in] CBLAS_INT` index increment for `X`.
235+
- **X**: `[in] float*` input array.
236+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
234237
- **AP**: `[inout] float*` packed form of a symmetric matrix `A`.
235-
- **strideAP**: `[in] CBLAS_INT` `AP` stride length.
238+
- **strideAP**: `[in] CBLAS_INT` stride length for `AP`.
236239
- **offsetAP**: `[in] CBLAS_INT` starting index for `AP`.
237240
238241
```c
@@ -267,7 +270,7 @@ int main( void ) {
267270
float AP[] = { 1.0f, 2.0f, 3.0f, 1.0f, 2.0f, 1.0f };
268271
const float x[] = { 1.0f, 2.0f, 3.0f };
269272

270-
// Specify the number of elements:
273+
// Specify the number of elements along each dimension of `A`:
271274
const int N = 3;
272275

273276
// Perform the symmetric rank 1 operation `A = α*x*x^T + A`:

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include "stdlib/blas/base/sspr.h"
2020
#include "stdlib/blas/base/shared.h"
2121
#include "stdlib/blas/ext/base/sfill.h"
22-
#include "stdlib/math/base/special/floorf.h"
2322
#include <stdlib.h>
2423
#include <stdio.h>
2524
#include <math.h>
@@ -159,7 +158,7 @@ int main( void ) {
159158
print_version();
160159
count = 0;
161160
for ( i = MIN; i <= MAX; i++ ) {
162-
len = stdlib_base_floorf( pow( pow( 10, i ), 1.0/2.0 ) );
161+
len = floor( pow( pow( 10, i ), 1.0/2.0 ) );
163162
iter = ITERATIONS / pow( 10, i-1 );
164163
for ( j = 0; j < REPEATS; j++ ) {
165164
count += 1;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ int main( void ) {
2525
float AP[] = { 1.0f, 2.0f, 3.0f, 1.0f, 2.0f, 1.0f };
2626
const float x[] = { 1.0f, 2.0f, 3.0f };
2727

28-
// Specify the number of elements:
28+
// Specify the number of elements along each dimension of `A`:
2929
const int N = 3;
3030

3131
// Perform the symmetric rank 1 operation `A = α*x*x^T + A`:

lib/node_modules/@stdlib/blas/base/sspr/lib/base.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var f32 = require( '@stdlib/number/float64/base/to-float32' );
3333
* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied
3434
* @param {NonNegativeInteger} N - number of elements along each dimension of `A`
3535
* @param {number} alpha - scalar
36-
* @param {Float32Array} x - first input array
36+
* @param {Float32Array} x - input vector
3737
* @param {integer} strideX - `x` stride length
3838
* @param {NonNegativeInteger} offsetX - starting index for `x`
3939
* @param {Float32Array} AP - packed form of a symmetric matrix `A`

lib/node_modules/@stdlib/blas/base/sspr/lib/ndarray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ var base = require( './base.js' );
3535
* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied
3636
* @param {NonNegativeInteger} N - number of elements along each dimension of `A`
3737
* @param {number} alpha - scalar
38-
* @param {Float32Array} x - first input array
38+
* @param {Float32Array} x - input vector
3939
* @param {integer} strideX - `x` stride length
4040
* @param {NonNegativeInteger} offsetX - starting index for `x`
4141
* @param {Float32Array} AP - packed form of a symmetric matrix `A`

lib/node_modules/@stdlib/blas/base/sspr/lib/ndarray.native.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,12 @@ var addon = require( './../src/addon.node' );
3131
* @param {string} uplo - specifies whether the upper or lower triangular part of the symmetric matrix `A` is supplied
3232
* @param {NonNegativeInteger} N - number of elements along each dimension of `A`
3333
* @param {number} alpha - scalar
34-
* @param {Float32Array} x - first input array
34+
* @param {Float32Array} x - input vector
3535
* @param {integer} strideX - `x` stride length
3636
* @param {NonNegativeInteger} offsetX - starting index for `x`
3737
* @param {Float32Array} AP - packed form of a symmetric matrix `A`
3838
* @param {integer} strideAP - `AP` stride length
3939
* @param {NonNegativeInteger} offsetAP - starting index for `AP`
40-
* @throws {TypeError} first argument must be a valid order
41-
* @throws {TypeError} second argument must specify whether the lower or upper triangular matrix is supplied
42-
* @throws {RangeError} third argument must be a nonnegative integer
43-
* @throws {RangeError} sixth argument must be non-zero
44-
* @throws {RangeError} ninth argument must be non-zero
4540
* @returns {Float32Array} `AP`
4641
*
4742
* @example

lib/node_modules/@stdlib/blas/base/sspr/lib/sspr.native.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ var addon = require( './../src/addon.node' );
3737
* @param {Float32Array} x - input vector
3838
* @param {integer} strideX - `x` stride length
3939
* @param {Float32Array} AP - packed form of a symmetric matrix `A`
40-
* @throws {TypeError} first argument must be a valid order
41-
* @throws {TypeError} second argument must specify whether the lower or upper triangular matrix is supplied
42-
* @throws {RangeError} third argument must be a nonnegative integer
43-
* @throws {RangeError} sixth argument must be non-zero
4440
* @returns {Float32Array} `AP`
4541
*
4642
* @example

lib/node_modules/@stdlib/blas/base/sspr/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,4 +308,4 @@
308308
]
309309
}
310310
]
311-
}
311+
}

lib/node_modules/@stdlib/blas/base/sspr/src/sspr.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced
2828
* @param N number of elements along each dimension of `A`
2929
* @param alpha scalar
30-
* @param x first input array
31-
* @param strideX `x` stride length
30+
* @param X input vector
31+
* @param strideX `X` stride length
3232
* @param AP packed form of a symmetric matrix `A`
3333
*/
3434
void API_SUFFIX(c_sspr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, float *AP ) {
@@ -48,8 +48,8 @@ void API_SUFFIX(c_sspr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const
4848
* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced
4949
* @param N number of elements along each dimension of `A`
5050
* @param alpha scalar
51-
* @param x first input array
52-
* @param strideX `x` stride length
51+
* @param X input vector
52+
* @param strideX `X` stride length
5353
* @param offsetX starting index of `x`
5454
* @param AP packed form of a symmetric matrix `A`
5555
* @param strideAP stride of the first dimension of `AP`
@@ -65,11 +65,14 @@ void API_SUFFIX(c_sspr_ndarray)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo
6565
CBLAS_INT ox;
6666
float tmp;
6767

68+
if ( N == 0 || alpha == 0.0f ) {
69+
return;
70+
}
6871
ox = offsetX;
6972
kk = offsetAP;
7073
if (
71-
( order == CblasRowMajor && uplo == CblasLower ) ||
72-
( order == CblasColMajor && uplo == CblasUpper )
74+
( order == CblasRowMajor && uplo == CblasLower ) ||
75+
( order == CblasColMajor && uplo == CblasUpper )
7376
) {
7477
ix1 = ox;
7578
for ( i1 = 0; i1 < N; i1++ ) {
@@ -78,7 +81,7 @@ void API_SUFFIX(c_sspr_ndarray)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo
7881
ix0 = ox;
7982
iap = kk;
8083
for ( i0 = 0; i0 <= i1; i0++ ) {
81-
AP[ iap ] += ( X[ ix0 ] * tmp );
84+
AP[ iap ] += X[ ix0 ] * tmp;
8285
ix0 += strideX;
8386
iap += strideAP;
8487
}
@@ -96,7 +99,7 @@ void API_SUFFIX(c_sspr_ndarray)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo
9699
ix0 = ix1;
97100
iap = kk;
98101
for ( i0 = 0; i0 < N - i1; i0++ ) {
99-
AP[ iap ] += ( X[ ix0 ] * tmp );
102+
AP[ iap ] += X[ ix0 ] * tmp;
100103
ix0 += strideX;
101104
iap += strideAP;
102105
}
@@ -105,4 +108,4 @@ void API_SUFFIX(c_sspr_ndarray)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo
105108
kk += ( N - i1 ) * strideAP;
106109
}
107110
return;
108-
}
111+
}

lib/node_modules/@stdlib/blas/base/sspr/src/sspr_cblas.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,10 @@
2727
* @param uplo specifies whether the upper or lower triangular part of the symmetric matrix `A` should be referenced
2828
* @param N number of elements along each dimension of `A`
2929
* @param alpha scalar
30-
* @param x first input array
30+
* @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_sspr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const CBLAS_INT N, const float alpha, const float *X, const CBLAS_INT strideX, float *AP ) {
3535
API_SUFFIX(cblas_sspr)( order, uplo, N, alpha, X, strideX, AP );
36-
}
36+
}

0 commit comments

Comments
 (0)