Skip to content

Commit 40e55f5

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 d4574d9 commit 40e55f5

File tree

3 files changed

+64
-3
lines changed

3 files changed

+64
-3
lines changed

lib/node_modules/@stdlib/blas/base/dgemv/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/blas/base/dscal",
4849
"@stdlib/blas/ext/base/dfill",
4950
"@stdlib/strided/base/stride2offset",
@@ -73,6 +74,7 @@
7374
"libpath": [],
7475
"dependencies": [
7576
"@stdlib/blas/base/shared",
77+
"@stdlib/blas/base/xerbla",
7678
"@stdlib/blas/base/dscal",
7779
"@stdlib/blas/ext/base/dfill",
7880
"@stdlib/strided/base/stride2offset",
@@ -96,6 +98,7 @@
9698
"libpath": [],
9799
"dependencies": [
98100
"@stdlib/blas/base/shared",
101+
"@stdlib/blas/base/xerbla",
99102
"@stdlib/blas/base/dscal",
100103
"@stdlib/blas/ext/base/dfill",
101104
"@stdlib/strided/base/stride2offset",
@@ -194,6 +197,7 @@
194197
"libpath": [],
195198
"dependencies": [
196199
"@stdlib/blas/base/shared",
200+
"@stdlib/blas/base/xerbla",
197201
"@stdlib/blas/base/dscal",
198202
"@stdlib/blas/ext/base/dfill",
199203
"@stdlib/strided/base/stride2offset",
@@ -223,6 +227,7 @@
223227
"libpath": [],
224228
"dependencies": [
225229
"@stdlib/blas/base/shared",
230+
"@stdlib/blas/base/xerbla",
226231
"@stdlib/blas/base/dscal",
227232
"@stdlib/blas/ext/base/dfill",
228233
"@stdlib/strided/base/stride2offset",
@@ -246,6 +251,7 @@
246251
"libpath": [],
247252
"dependencies": [
248253
"@stdlib/blas/base/shared",
254+
"@stdlib/blas/base/xerbla",
249255
"@stdlib/blas/base/dscal",
250256
"@stdlib/blas/ext/base/dfill",
251257
"@stdlib/strided/base/stride2offset",
@@ -416,6 +422,7 @@
416422
"libpath": [],
417423
"dependencies": [
418424
"@stdlib/blas/base/shared",
425+
"@stdlib/blas/base/xerbla",
419426
"@stdlib/blas/base/dscal",
420427
"@stdlib/blas/ext/base/dfill",
421428
"@stdlib/strided/base/stride2offset",
@@ -445,6 +452,7 @@
445452
"libpath": [],
446453
"dependencies": [
447454
"@stdlib/blas/base/shared",
455+
"@stdlib/blas/base/xerbla",
448456
"@stdlib/blas/base/dscal",
449457
"@stdlib/blas/ext/base/dfill",
450458
"@stdlib/strided/base/stride2offset",
@@ -468,6 +476,7 @@
468476
"libpath": [],
469477
"dependencies": [
470478
"@stdlib/blas/base/shared",
479+
"@stdlib/blas/base/xerbla",
471480
"@stdlib/blas/base/dscal",
472481
"@stdlib/blas/ext/base/dfill",
473482
"@stdlib/strided/base/stride2offset",
@@ -491,6 +500,7 @@
491500
"libpath": [],
492501
"dependencies": [
493502
"@stdlib/blas/base/shared",
503+
"@stdlib/blas/base/xerbla",
494504
"@stdlib/blas/base/dscal",
495505
"@stdlib/blas/ext/base/dfill",
496506
"@stdlib/strided/base/stride2offset",

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

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

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

2324
/**
@@ -45,6 +46,31 @@ void API_SUFFIX(c_dgemv)( const CBLAS_LAYOUT order, const CBLAS_TRANSPOSE trans,
4546
CBLAS_INT ox;
4647
CBLAS_INT oy;
4748

49+
// Perform input argument validation...
50+
if ( order != CblasRowMajor && order != CblasColMajor ) {
51+
c_xerbla( 1, "c_dsyr2", "Error: invalid argument. First argument must be a valid order. Value: `%d`.", order );
52+
return;
53+
}
54+
if ( trans != CblasTrans && trans != CblasNoTrans ) {
55+
c_xerbla( 2, "c_dgemv_ndarray", "Error: invalid argument. Second argument must be a valid transpose operation. Value: `%d`.", trans );
56+
return;
57+
}
58+
if ( M < 0 ) {
59+
c_xerbla( 3, "c_dgemv_ndarray", "Error: invalid argument. Third argument must be a nonnegative integer. Value: `%d`.", M );
60+
return;
61+
}
62+
if ( N < 0 ) {
63+
c_xerbla( 4, "c_dgemv_ndarray", "Error: invalid argument. Fourth argument must be a nonnegative integer. Value: `%d`.", N );
64+
return;
65+
}
66+
if ( strideX == 0 ) {
67+
c_xerbla( 9, "c_dgemv_ndarray", "Error: invalid argument. Ninth argument must be a nonzero. Value: `%d`.", strideX );
68+
return;
69+
}
70+
if ( strideY == 0 ) {
71+
c_xerbla( 12, "c_dgemv_ndarray", "Error: invalid argument. Twelfth argument must be a nonzero. Value: `%d`.", strideY );
72+
return;
73+
}
4874
if ( trans == CblasNoTrans ) {
4975
xlen = N;
5076
ylen = M;

lib/node_modules/@stdlib/blas/base/dgemv/src/dgemv_ndarray.c

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

1919
#include "stdlib/blas/base/dgemv.h"
2020
#include "stdlib/blas/base/shared.h"
21+
#include "stdlib/blas/base/xerbla.h"
2122
#include "stdlib/blas/base/dscal.h"
2223
#include "stdlib/blas/ext/base/dfill.h"
2324
#include "stdlib/ndarray/base/assert/is_row_major.h"
@@ -43,6 +44,7 @@
4344
* @return output value
4445
*/
4546
void API_SUFFIX(c_dgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M, const CBLAS_INT N, const double alpha, const double *A, const CBLAS_INT strideA1, const CBLAS_INT strideA2, const CBLAS_INT offsetA, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const double beta, double *Y, const CBLAS_INT strideY, const CBLAS_INT offsetY ) {
47+
int64_t sa[ 2 ];
4648
CBLAS_INT isrm;
4749
CBLAS_INT xlen;
4850
CBLAS_INT ylen;
@@ -57,12 +59,35 @@ void API_SUFFIX(c_dgemv_ndarray)( const CBLAS_TRANSPOSE trans, const CBLAS_INT M
5759

5860
// Note on variable naming convention: sa#, ix#, i# where # corresponds to the loop number, with `0` being the innermost loop...
5961

60-
int64_t strides[] = { strideA1, strideA2 };
61-
isrm = stdlib_ndarray_is_row_major( 2, strides );
62-
62+
// Perform input argument validation...
63+
if ( trans != CblasTrans && trans != CblasNoTrans ) {
64+
c_xerbla( 1, "c_dgemv_ndarray", "Error: invalid argument. First argument must be a valid transpose operation. Value: `%d`.", trans );
65+
return;
66+
}
67+
if ( M < 0 ) {
68+
c_xerbla( 2, "c_dgemv_ndarray", "Error: invalid argument. Second argument must be a nonnegative integer. Value: `%d`.", M );
69+
return;
70+
}
71+
if ( N < 0 ) {
72+
c_xerbla( 3, "c_dgemv_ndarray", "Error: invalid argument. Third argument must be a nonnegative integer. Value: `%d`.", N );
73+
return;
74+
}
75+
if ( strideX == 0 ) {
76+
c_xerbla( 10, "c_dgemv_ndarray", "Error: invalid argument. Tenth argument must be a nonzero. Value: `%d`.", strideX );
77+
return;
78+
}
79+
if ( strideY == 0 ) {
80+
c_xerbla( 14, "c_dgemv_ndarray", "Error: invalid argument. Fourteenth argument must be a nonzero. Value: `%d`.", strideY );
81+
return;
82+
}
83+
// Check whether we can avoid computation altogether...
6384
if ( M == 0 || N == 0 || ( alpha == 0.0 && beta == 1.0 ) ) {
6485
return;
6586
}
87+
// Extract loop variables for purposes of loop interchange: dimensions and loop offset (pointer) increments...
88+
sa[ 0 ] = strideA1;
89+
sa[ 1 ] = strideA2;
90+
isrm = stdlib_ndarray_is_row_major( 2, strides );
6691
if ( isrm ) {
6792
sa0 = strideA2;
6893
sa1 = strideA1;

0 commit comments

Comments
 (0)