Skip to content

Commit 7e836ac

Browse files
committed
fix: apply suggestions from code review
--- 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: na - 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: passed - task: lint_typescript_tests status: passed - task: lint_license_headers status: passed ---
1 parent 9e6f7a4 commit 7e836ac

13 files changed

Lines changed: 161 additions & 146 deletions

File tree

lib/node_modules/@stdlib/blas/ext/base/ddiff/README.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ The function has the following parameters:
5757
- **k**: number of times to recursively compute differences.
5858
- **x**: input [`Float64Array`][@stdlib/array/float64].
5959
- **strideX**: stride length for `x`.
60-
- **N1**: number of elements to `prepend`.
60+
- **N1**: number of indexed elements to `prepend`.
6161
- **prepend**: a [`Float64Array`][@stdlib/array/float64] containing values to prepend prior to computing differences.
6262
- **strideP**: stride length for `prepend`.
63-
- **N2**: number of elements to `append`.
63+
- **N2**: number of indexed elements to `append`.
6464
- **append**: a [`Float64Array`][@stdlib/array/float64] containing values to append prior to computing differences.
6565
- **strideA**: stride length for `append`.
6666
- **out**: output [`Float64Array`][@stdlib/array/float64]. Must have `N + N1 + N2 - k` elements.
@@ -136,7 +136,7 @@ The function has the following additional parameters:
136136
- **offsetOut**: starting index for `out`.
137137
- **offsetW**: starting index for `workspace`.
138138

139-
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameter supports indexing semantics based on a starting index. For example, to access only the last three elements:
139+
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying buffer, the offset parameters support indexing semantics based on starting indices. For example, to access only the last three elements:
140140

141141
```javascript
142142
var Float64Array = require( '@stdlib/array/float64' );
@@ -232,7 +232,7 @@ console.log( 'Output: ', out );
232232

233233
<!-- lint disable maximum-heading-length -->
234234

235-
#### stdlib_strided_ddiff( N, k, \*X, strideX, N1, \*Prepend, strideP, N2, \*Append, strideA, \*Out, strideOut, \*Workspace, strideW )
235+
#### stdlib_strided_ddiff( N, k, \*X, strideX, N1, \*prepend, strideP, N2, \*append, strideA, \*out, strideOut, \*workspace, strideW )
236236

237237
Calculates the k-th discrete forward differences of a double-precision floating-point strided array.
238238

@@ -252,24 +252,24 @@ The function accepts the following arguments:
252252
- **k**: `[in] CBLAS_INT` number of times to recursively compute differences.
253253
- **X**: `[in] double*` input array.
254254
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
255-
- **N1**: `[in] CBLAS_INT` number of elements in `Prepend`.
256-
- **Prepend**: `[in] double*` array containing values to prepend prior to computing differences.
257-
- **strideP**: `[in] CBLAS_INT` stride length for `Prepend`.
258-
- **N2**: `[in] CBLAS_INT` number of elements in `Append`.
259-
- **Append**: `[in] double*` array containing values to append prior to computing differences.
260-
- **strideA**: `[in] CBLAS_INT` stride length for `Append`.
261-
- **Out**: `[inout] double*` output array. Must have `N + N1 + N2 - k` elements.
262-
- **strideOut**: `[in] CBLAS_INT` stride length for `Out`.
263-
- **Workspace**: `[inout] double*` workspace array. Must have `N + N1 + N2 - 1` elements.
264-
- **strideW**: `[in] CBLAS_INT` stride length for `Workspace`.
255+
- **N1**: `[in] CBLAS_INT` number of indexed elements for `prepend`.
256+
- **prepend**: `[in] double*` array containing values to prepend prior to computing differences.
257+
- **strideP**: `[in] CBLAS_INT` stride length for `prepend`.
258+
- **N2**: `[in] CBLAS_INT` number of indexed elements for `append`.
259+
- **append**: `[in] double*` array containing values to append prior to computing differences.
260+
- **strideA**: `[in] CBLAS_INT` stride length for `append`.
261+
- **out**: `[inout] double*` output array. Must have `N + N1 + N2 - k` elements.
262+
- **strideOut**: `[in] CBLAS_INT` stride length for `out`.
263+
- **workspace**: `[inout] double*` workspace array. Must have `N + N1 + N2 - 1` elements.
264+
- **strideW**: `[in] CBLAS_INT` stride length for `workspace`.
265265
266266
```c
267-
void stdlib_strided_ddiff( const CBLAS_INT N, const CBLAS_INT k, const double *X, const CBLAS_INT strideX, const CBLAS_INT N1, const double *Prepend, const CBLAS_INT strideP, const CBLAS_INT N2, const double *Append, const CBLAS_INT strideA, double *Out, const CBLAS_INT strideOut, double *Workspace, const CBLAS_INT strideW );
267+
void stdlib_strided_ddiff( const CBLAS_INT N, const CBLAS_INT k, const double *X, const CBLAS_INT strideX, const CBLAS_INT N1, const double *prepend, const CBLAS_INT strideP, const CBLAS_INT N2, const double *append, const CBLAS_INT strideA, double *out, const CBLAS_INT strideOut, double *workspace, const CBLAS_INT strideW );
268268
```
269269

270270
<!-- lint disable maximum-heading-length -->
271271

272-
#### stdlib_strided_ddiff_ndarray( N, k, \*X, strideX, offsetX, N1, \*Prepend, strideP, offsetP, N2, \*Append, strideA, offsetA, \*Out, strideOut, offsetOut, \*W, strideW, offsetW )
272+
#### stdlib_strided_ddiff_ndarray( N, k, \*X, strideX, offsetX, N1, \*prepend, strideP, offsetP, N2, \*append, strideA, offsetA, \*out, strideOut, offsetOut, \*workspace, strideW, offsetW )
273273

274274
Calculates the k-th discrete forward differences of a double-precision floating-point strided array using alternative indexing semantics.
275275

@@ -290,23 +290,23 @@ The function accepts the following arguments:
290290
- **X**: `[in] double*` input array.
291291
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
292292
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
293-
- **N1**: `[in] CBLAS_INT` number of elements in `Prepend`.
294-
- **Prepend**: `[in] double*` array containing values to prepend prior to computing differences.
295-
- **strideP**: `[in] CBLAS_INT` stride length for `Prepend`.
296-
- **offsetP**: `[in] CBLAS_INT` starting index for `Prepend`.
297-
- **N2**: `[in] CBLAS_INT` number of elements in `Append`.
298-
- **Append**: `[in] double*` array containing values to append prior to computing differences.
299-
- **strideA**: `[in] CBLAS_INT` stride length for `Append`.
300-
- **offsetA**: `[in] CBLAS_INT` starting index for `Append`.
301-
- **Out**: `[inout] double*` output array. Must have `N + N1 + N2 - k` elements.
302-
- **strideOut**: `[in] CBLAS_INT` stride length for `Out`.
303-
- **offsetOut**: `[in] CBLAS_INT` starting index for `Out`.
304-
- **Workspace**: `[inout] double*` workspace array. Must have `N + N1 + N2 - 1` elements.
305-
- **strideW**: `[in] CBLAS_INT` stride length for `Workspace`.
306-
- **offsetW**: `[in] CBLAS_INT` starting index for `Workspace`.
293+
- **N1**: `[in] CBLAS_INT` number of indexed elements for `prepend`.
294+
- **prepend**: `[in] double*` array containing values to prepend prior to computing differences.
295+
- **strideP**: `[in] CBLAS_INT` stride length for `prepend`.
296+
- **offsetP**: `[in] CBLAS_INT` starting index for `prepend`.
297+
- **N2**: `[in] CBLAS_INT` number of indexed elements for `append`.
298+
- **append**: `[in] double*` array containing values to append prior to computing differences.
299+
- **strideA**: `[in] CBLAS_INT` stride length for `append`.
300+
- **offsetA**: `[in] CBLAS_INT` starting index for `append`.
301+
- **out**: `[inout] double*` output array. Must have `N + N1 + N2 - k` elements.
302+
- **strideOut**: `[in] CBLAS_INT` stride length for `out`.
303+
- **offsetOut**: `[in] CBLAS_INT` starting index for `out`.
304+
- **workspace**: `[inout] double*` workspace array. Must have `N + N1 + N2 - 1` elements.
305+
- **strideW**: `[in] CBLAS_INT` stride length for `workspace`.
306+
- **offsetW**: `[in] CBLAS_INT` starting index for `workspace`.
307307
308308
```c
309-
void stdlib_strided_ddiff_ndarray( const CBLAS_INT N, const CBLAS_INT k, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const CBLAS_INT N1, const double *Prepend, const CBLAS_INT strideP, const CBLAS_INT offsetP, const CBLAS_INT N2, const double *Append, const CBLAS_INT strideA, const CBLAS_INT offsetA, double *Out, const CBLAS_INT strideOut, const CBLAS_INT offsetOut, double *Workspace, const CBLAS_INT strideW, const CBLAS_INT offsetW );
309+
void stdlib_strided_ddiff_ndarray( const CBLAS_INT N, const CBLAS_INT k, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const CBLAS_INT N1, const double *prepend, const CBLAS_INT strideP, const CBLAS_INT offsetP, const CBLAS_INT N2, const double *append, const CBLAS_INT strideA, const CBLAS_INT offsetA, double *out, const CBLAS_INT strideOut, const CBLAS_INT offsetOut, double *workspace, const CBLAS_INT strideW, const CBLAS_INT offsetW );
310310
```
311311

312312
</section>
@@ -335,10 +335,10 @@ int main( void ) {
335335
// Create a strided array:
336336
const double x[] = { 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 };
337337

338-
// Define prepend values:
338+
// Define a list of values to prepend:
339339
const double p[] = { -1.0 };
340340

341-
// Define append values:
341+
// Define a list of values to append:
342342
const double a[] = { 10.0 };
343343

344344
// Define an output array:

lib/node_modules/@stdlib/blas/ext/base/ddiff/benchmark/benchmark.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function createBenchmark( len ) {
6161
N = len;
6262
N1 = 1;
6363
N2 = 1;
64-
k = 1; // worst case: N + N1 + N2 - 1
64+
k = 1;
6565
ol = N + N1 + N2 - k;
6666

6767
x = uniform( N, -100, 100, options );

lib/node_modules/@stdlib/blas/ext/base/ddiff/benchmark/benchmark.native.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function createBenchmark( len ) {
6666
N = len;
6767
N1 = 1;
6868
N2 = 1;
69-
k = 1; // worst case: N + N1 + N2 - 1
69+
k = 1;
7070
ol = N + N1 + N2 - k;
7171

7272
x = uniform( N, -100, 100, options );

lib/node_modules/@stdlib/blas/ext/base/ddiff/benchmark/benchmark.ndarray.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function createBenchmark( len ) {
6161
N = len;
6262
N1 = 1;
6363
N2 = 1;
64-
k = 1; // worst case: N + N1 + N2 - 1
64+
k = 1;
6565
ol = N + N1 + N2 - k;
6666

6767
x = uniform( N, -100, 100, options );

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ function createBenchmark( len ) {
6666
N = len;
6767
N1 = 1;
6868
N2 = 1;
69-
k = 1; // worst case: N + N1 + N2 - 1
69+
k = 1;
7070
ol = N + N1 + N2 - k;
7171

7272
x = uniform( N, -100, 100, options );

lib/node_modules/@stdlib/blas/ext/base/ddiff/benchmark/c/benchmark.length.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ static double benchmark1( int iterations, int len ) {
113113
N = len;
114114
N1 = 1;
115115
N2 = 1;
116-
k = 1; // worst case: N + N1 + N2 - 1
116+
k = 1;
117117
ol = N + N1 + N2 - k;
118118
wl = N + N1 + N2 - 1;
119119

@@ -185,7 +185,7 @@ static double benchmark2( int iterations, int len ) {
185185
N = len;
186186
N1 = 1;
187187
N2 = 1;
188-
k = 1; // worst case: N + N1 + N2 - 1
188+
k = 1;
189189
ol = N + N1 + N2 - k;
190190
wl = N + N1 + N2 - 1;
191191

lib/node_modules/@stdlib/blas/ext/base/ddiff/docs/repl.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@
4343
Stride length for `append`.
4444

4545
out: Float64Array
46-
Output array. Must have `N + N1 + N2 - k` elements.
46+
Output array. Must have `N + N1 + N2 - k` indexed elements.
4747

4848
so: integer
4949
Stride length for `out`.
5050

5151
w: Float64Array
52-
Workspace array. Must have `N + N1 + N2 - 1` elements.
52+
Workspace array. Must have `N + N1 + N2 - 1` indexed elements.
5353

5454
sw: integer
5555
Stride length for `workspace`.
@@ -90,7 +90,7 @@
9090
<Float64Array>[ 3.0, 2.0, 2.0, 2.0, 1.0 ]
9191

9292

93-
{{alias}}.ndarray( N, k, x,sx,ox, N1,p,sp,op, N2,a,sa,oa, out,so,oo, w,sw,ow )
93+
{{alias}}.ndarray( N, k, x,sx,ox, N1, p,sp,op, N2, a,sa,oa, out,so,oo, w,sw,ow )
9494
Calculates the k-th discrete forward differences of a double-precision
9595
floating-point strided array using alternative indexing semantics.
9696

@@ -140,7 +140,7 @@
140140
Starting index for `append`.
141141

142142
out: Float64Array
143-
Output array. Must have `N + N1 + N2 - k` elements.
143+
Output array. Must have `N + N1 + N2 - k` indexed elements.
144144

145145
so: integer
146146
Stride length for `out`.
@@ -149,7 +149,7 @@
149149
Starting index for `out`.
150150

151151
w: Float64Array
152-
Workspace array. Must have `N + N1 + N2 - 1` elements.
152+
Workspace array. Must have `N + N1 + N2 - 1` indexed elements.
153153

154154
sw: integer
155155
Stride length for `workspace`.

lib/node_modules/@stdlib/blas/ext/base/ddiff/docs/types/index.d.ts

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ interface Routine {
2929
* @param k - number of times to recursively compute differences
3030
* @param x - input array
3131
* @param strideX - stride length for `x`
32-
* @param N1 - number of indexed elements of prepend
32+
* @param N1 - number of indexed elements for `prepend`
3333
* @param prepend - prepend array
3434
* @param strideP - stride length for `prepend`
35-
* @param N2 - number of indexed elements of append
35+
* @param N2 - number of indexed elements for `append`
3636
* @param append - append array
3737
* @param strideA - stride length for `append`
3838
* @param out - output array
@@ -41,6 +41,11 @@ interface Routine {
4141
* @param strideW - stride length for `workspace`
4242
* @returns output array
4343
*
44+
* ## Notes
45+
*
46+
* - The `out` array must have `N + N1 + N2 - k` elements.
47+
* - The `workspace` array must have `N + N1 + N2 - 1` elements.
48+
*
4449
* @example
4550
* var Float64Array = require( '@stdlib/array/float64' );
4651
*
@@ -65,11 +70,11 @@ interface Routine {
6570
* @param x - input array
6671
* @param strideX - stride length for `x`
6772
* @param offsetX - starting index for `x`
68-
* @param N1 - number of indexed elements of prepend
73+
* @param N1 - number of indexed elements for `prepend`
6974
* @param prepend - prepend array
7075
* @param strideP - stride length for `prepend`
7176
* @param offsetP - starting index for `prepend`
72-
* @param N2 - number of indexed elements of append
77+
* @param N2 - number of indexed elements for `append`
7378
* @param append - append array
7479
* @param strideA - stride length for `append`
7580
* @param offsetA - starting index for `append`
@@ -81,6 +86,11 @@ interface Routine {
8186
* @param offsetW - starting index for `workspace`
8287
* @returns output array
8388
*
89+
* ## Notes
90+
*
91+
* - The `out` array must have `N + N1 + N2 - k` elements.
92+
* - The `workspace` array must have `N + N1 + N2 - 1` elements.
93+
*
8494
* @example
8595
* var Float64Array = require( '@stdlib/array/float64' );
8696
*
@@ -105,10 +115,10 @@ interface Routine {
105115
* @param k - number of times to recursively compute differences
106116
* @param x - input array
107117
* @param strideX - stride length for `x`
108-
* @param N1 - number of indexed elements of prepend
118+
* @param N1 - number of indexed elements for `prepend`
109119
* @param prepend - prepend array
110120
* @param strideP - stride length for `prepend`
111-
* @param N2 - number of indexed elements of append
121+
* @param N2 - number of indexed elements for `append`
112122
* @param append - append array
113123
* @param strideA - stride length for `append`
114124
* @param out - output array
@@ -117,6 +127,11 @@ interface Routine {
117127
* @param strideW - stride length for `workspace`
118128
* @returns output array
119129
*
130+
* ## Notes
131+
*
132+
* - The `out` array must have `N + N1 + N2 - k` elements.
133+
* - The `workspace` array must have `N + N1 + N2 - 1` elements.
134+
*
120135
* @example
121136
* var Float64Array = require( '@stdlib/array/float64' );
122137
*

lib/node_modules/@stdlib/blas/ext/base/ddiff/examples/c/example.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,16 @@ int main( void ) {
2323
// Create a strided array:
2424
const double x[] = { 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 };
2525

26-
// Define prepend values:
26+
// Define a list of values to prepend:
2727
const double p[] = { -1.0 };
2828

29-
// Define append values:
29+
// Define a list of values to append:
3030
const double a[] = { 10.0 };
3131

32-
// Define an output array:
32+
// Define the output array:
3333
double out[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
3434

35-
// Define a workspace:
35+
// Define the workspace:
3636
double w[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
3737

3838
// Compute forward differences:

lib/node_modules/@stdlib/blas/ext/base/ddiff/include/stdlib/blas/ext/base/ddiff.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ extern "C" {
3131
/**
3232
* Calculates the k-th discrete forward differences of a double-precision floating-point strided array.
3333
*/
34-
void API_SUFFIX(stdlib_strided_ddiff)( const CBLAS_INT N, const CBLAS_INT k, const double *X, const CBLAS_INT strideX, const CBLAS_INT N1, const double *Prepend, const CBLAS_INT strideP, const CBLAS_INT N2, const double *Append, const CBLAS_INT strideA, double *Out, const CBLAS_INT strideOut, double *Workspace, const CBLAS_INT strideW );
34+
void API_SUFFIX(stdlib_strided_ddiff)( const CBLAS_INT N, const CBLAS_INT k, const double *X, const CBLAS_INT strideX, const CBLAS_INT N1, const double *prepend, const CBLAS_INT strideP, const CBLAS_INT N2, const double *append, const CBLAS_INT strideA, double *out, const CBLAS_INT strideOut, double *workspace, const CBLAS_INT strideW );
3535

3636
/**
3737
* Calculates the k-th discrete forward differences of a double-precision floating-point strided array using alternative indexing semantics.
3838
*/
39-
void API_SUFFIX(stdlib_strided_ddiff_ndarray)( const CBLAS_INT N, const CBLAS_INT k, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const CBLAS_INT N1, const double *Prepend, const CBLAS_INT strideP, const CBLAS_INT offsetP, const CBLAS_INT N2, const double *Append, const CBLAS_INT strideA, const CBLAS_INT offsetA, double *Out, const CBLAS_INT strideOut, const CBLAS_INT offsetOut, double *Workspace, const CBLAS_INT strideW, const CBLAS_INT offsetW );
39+
void API_SUFFIX(stdlib_strided_ddiff_ndarray)( const CBLAS_INT N, const CBLAS_INT k, const double *X, const CBLAS_INT strideX, const CBLAS_INT offsetX, const CBLAS_INT N1, const double *prepend, const CBLAS_INT strideP, const CBLAS_INT offsetP, const CBLAS_INT N2, const double *append, const CBLAS_INT strideA, const CBLAS_INT offsetA, double *out, const CBLAS_INT strideOut, const CBLAS_INT offsetOut, double *workspace, const CBLAS_INT strideW, const CBLAS_INT offsetW );
4040

4141

4242
#ifdef __cplusplus

0 commit comments

Comments
 (0)