Skip to content

Commit 8d5d2e7

Browse files
committed
chore: add checks
--- 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: na - 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: na - 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 f3bbcea commit 8d5d2e7

File tree

3 files changed

+55
-2
lines changed

3 files changed

+55
-2
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"libpath": [],
4545
"dependencies": [
4646
"@stdlib/blas/base/shared",
47+
"@stdlib/blas/base/xerbla",
4748
"@stdlib/strided/base/stride2offset",
4849
"@stdlib/ndarray/base/assert/is-row-major",
4950
"@stdlib/napi/export",
@@ -71,6 +72,7 @@
7172
"libpath": [],
7273
"dependencies": [
7374
"@stdlib/blas/base/shared",
75+
"@stdlib/blas/base/xerbla",
7476
"@stdlib/strided/base/stride2offset",
7577
"@stdlib/ndarray/base/assert/is-row-major",
7678
"@stdlib/blas/ext/base/dfill"
@@ -92,6 +94,7 @@
9294
"libpath": [],
9395
"dependencies": [
9496
"@stdlib/blas/base/shared",
97+
"@stdlib/blas/base/xerbla",
9598
"@stdlib/strided/base/stride2offset",
9699
"@stdlib/ndarray/base/assert/is-row-major"
97100
]
@@ -188,6 +191,7 @@
188191
"libpath": [],
189192
"dependencies": [
190193
"@stdlib/blas/base/shared",
194+
"@stdlib/blas/base/xerbla",
191195
"@stdlib/strided/base/stride2offset",
192196
"@stdlib/ndarray/base/assert/is-row-major",
193197
"@stdlib/napi/export",
@@ -215,6 +219,7 @@
215219
"libpath": [],
216220
"dependencies": [
217221
"@stdlib/blas/base/shared",
222+
"@stdlib/blas/base/xerbla",
218223
"@stdlib/strided/base/stride2offset",
219224
"@stdlib/ndarray/base/assert/is-row-major",
220225
"@stdlib/blas/ext/base/dfill"
@@ -236,6 +241,7 @@
236241
"libpath": [],
237242
"dependencies": [
238243
"@stdlib/blas/base/shared",
244+
"@stdlib/blas/base/xerbla",
239245
"@stdlib/strided/base/stride2offset",
240246
"@stdlib/ndarray/base/assert/is-row-major"
241247
]
@@ -404,6 +410,7 @@
404410
"libpath": [],
405411
"dependencies": [
406412
"@stdlib/blas/base/shared",
413+
"@stdlib/blas/base/xerbla",
407414
"@stdlib/strided/base/stride2offset",
408415
"@stdlib/ndarray/base/assert/is-row-major",
409416
"@stdlib/napi/export",
@@ -431,6 +438,7 @@
431438
"libpath": [],
432439
"dependencies": [
433440
"@stdlib/blas/base/shared",
441+
"@stdlib/blas/base/xerbla",
434442
"@stdlib/strided/base/stride2offset",
435443
"@stdlib/ndarray/base/assert/is-row-major",
436444
"@stdlib/blas/ext/base/dfill"
@@ -452,6 +460,7 @@
452460
"libpath": [],
453461
"dependencies": [
454462
"@stdlib/blas/base/shared",
463+
"@stdlib/blas/base/xerbla",
455464
"@stdlib/strided/base/stride2offset",
456465
"@stdlib/ndarray/base/assert/is-row-major"
457466
]
@@ -473,6 +482,7 @@
473482
"libpath": [],
474483
"dependencies": [
475484
"@stdlib/blas/base/shared",
485+
"@stdlib/blas/base/xerbla",
476486
"@stdlib/strided/base/stride2offset",
477487
"@stdlib/ndarray/base/assert/is-row-major"
478488
]

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

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "stdlib/blas/base/dsyr.h"
2020
#include "stdlib/blas/base/shared.h"
21+
#include "stdlib/blas/base/xerbla.h"
2122
#include "stdlib/strided/base/stride2offset.h"
2223

2324
/**
@@ -37,6 +38,28 @@ void API_SUFFIX(c_dsyr)( const CBLAS_LAYOUT order, const CBLAS_UPLO uplo, const
3738
CBLAS_INT sa2;
3839
CBLAS_INT ox;
3940

41+
// Perform input argument validation...
42+
if ( order != CblasRowMajor && order != CblasColMajor ) {
43+
c_xerbla( 1, "c_dsyr", "Error: invalid argument. First argument must be a valid order. Value: `%d`.", order );
44+
return;
45+
}
46+
if ( uplo != CblasLower && uplo != CblasUpper ) {
47+
c_xerbla( 2, "c_dsyr", "Error: invalid argument. Second argument must specify whether to reference the lower or upper triangular matrixecond argument must specify whether to reference the lower or upper triangular matrix. Value: `%d`.", uplo );
48+
return;
49+
}
50+
if ( N < 0 ) {
51+
c_xerbla( 3, "c_dsyr", "Error: invalid argument. Third argument must be a nonnegative integer. Value: `%d`.", N );
52+
return;
53+
}
54+
if ( strideX == 0 ) {
55+
c_xerbla( 6, "c_dsyr", "Error: invalid argument. Sixth argument must be nonzero. Value: `%d`.", strideX );
56+
return;
57+
}
58+
if ( LDA < N ) {
59+
c_xerbla( 10, "c_dsyr", "Error: invalid argument. Eighth argument must be greater than or equal to max(1,%d). Value: `%d`.", N, LDA );
60+
return;
61+
}
62+
// Check whether we can avoid computation altogether...
4063
if ( N == 0 || alpha == 0.0 ) {
4164
return;
4265
}

lib/node_modules/@stdlib/blas/base/dsyr/src/dsyr_ndarray.c

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
#include "stdlib/blas/base/dsyr.h"
2020
#include "stdlib/blas/base/shared.h"
21+
#include "stdlib/blas/base/xerbla.h"
2122
#include "stdlib/ndarray/base/assert/is_row_major.h"
2223

2324
/**
@@ -35,6 +36,7 @@
3536
* @param offsetA starting index of `A`
3637
*/
3738
void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const double alpha, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA ) {
39+
int64_t sa[ 2 ];
3840
CBLAS_INT isrm;
3941
CBLAS_INT ix0;
4042
CBLAS_INT ix1;
@@ -46,11 +48,29 @@ void API_SUFFIX(c_dsyr_ndarray)( const CBLAS_UPLO uplo, const CBLAS_INT N, const
4648
CBLAS_INT ox;
4749
double tmp;
4850

49-
int64_t strides[] = { strideA1, strideA2 };
51+
// Note on variable naming convention: S#, ix#, iy#, i# where # corresponds to the loop number, with `0` being the innermost loop...
52+
53+
// Perform input argument validation...
54+
if ( uplo != CblasLower && uplo != CblasUpper ) {
55+
c_xerbla( 1, "c_dsyr_ndarray", "Error: invalid argument. First argument must specify whether to reference the lower or upper triangular matrixecond argument must specify whether to reference the lower or upper triangular matrix. Value: `%d`.", uplo );
56+
return;
57+
}
58+
if ( N < 0 ) {
59+
c_xerbla( 2, "c_dsyr_ndarray", "Error: invalid argument. Second argument must be a nonnegative integer. Value: `%d`.", N );
60+
return;
61+
}
62+
if ( strideX == 0 ) {
63+
c_xerbla( 5, "c_dsyr_ndarray", "Error: invalid argument. Fifth argument must be a nonzero. Value: `%d`.", strideX );
64+
return;
65+
}
66+
// Check whether we can avoid computation altogether...
5067
if ( N == 0 || alpha == 0.0 ) {
5168
return;
5269
}
53-
isrm = stdlib_ndarray_is_row_major( 2, strides );
70+
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
71+
sa[ 0 ] = strideA1;
72+
sa[ 1 ] = strideA2;
73+
isrm = stdlib_ndarray_is_row_major( 2, sa );
5474
if ( isrm ) {
5575
// For row-major matrices, the last dimension has the fastest changing index...
5676
sa0 = strideA2; // stride for innermost loop

0 commit comments

Comments
 (0)