Skip to content

Commit 8d10d26

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: passed - 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: na - 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 c5016e8 commit 8d10d26

17 files changed

Lines changed: 407 additions & 90 deletions

File tree

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

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@ The function has the following parameters:
5555
- **N**: number of indexed elements.
5656
- **x**: input [`Float64Array`][@stdlib/array/float64].
5757
- **strideX**: stride length for `x`.
58-
- **N1**: number of elements to `prepend`.
58+
- **N1**: number of indexed elements to `prepend`.
5959
- **prepend**: a [`Float64Array`][@stdlib/array/float64] containing values to prepend after computing differences.
6060
- **strideP**: stride length for `prepend`.
61-
- **N2**: number of elements to `append`.
61+
- **N2**: number of indexed elements to `append`.
6262
- **append**: a [`Float64Array`][@stdlib/array/float64] containing values to append after computing differences..
6363
- **strideA**: strides length for `append`.
6464
- **out**: output [`Float64Array`][@stdlib/array/float64]. Must have `N + N1 + N2 - 1` elements.
@@ -152,7 +152,7 @@ console.log( out );
152152

153153
## Notes
154154

155-
- If the sum of `N`, `N1`, and `N2` is less than or equal to `1`, both functions return the output array unchanged.
155+
- If `N + N1 + N2 <= 1`, both functions return the output array unchanged.
156156

157157
</section>
158158

@@ -187,7 +187,7 @@ console.log( 'Append array: ', a );
187187
var out = new Float64Array( 13 );
188188

189189
dediff( x.length, x, 1, 2, p, 1, 2, a, 1, out, 1 );
190-
console.log( 'Output', out );
190+
console.log( 'Output:', out );
191191
```
192192

193193
</section>
@@ -222,7 +222,7 @@ console.log( 'Output', out );
222222

223223
<!-- lint disable maximum-heading-length -->
224224

225-
#### stdlib_strided_dediff( N, \*X, strideX, N1, \*prepend, strideP, N2, \*append, strideA, \*Out, strideOut )
225+
#### stdlib_strided_dediff( N, \*X, strideX, N1, \*Prepend, strideP, N2, \*Append, strideA, \*Out, strideOut )
226226

227227
Calculates the differences between consecutive elements of a double-precision floating-point strided array.
228228

@@ -240,22 +240,22 @@ The function accepts the following arguments:
240240
- **N**: `[in] CBLAS_INT` number of indexed elements.
241241
- **X**: `[in] double` input [`Float64Array`][@stdlib/array/float64].
242242
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
243-
- **N1**: `[in] CBLAS_INT` number of elements in `prepend`.
244-
- **prepend**: `[in] double` a [`Float64Array`][@stdlib/array/float64] containing values to prepend after computing differences.
245-
- **strideP**: `[in] CBLAS_INT` stride length for `prepend`.
246-
- **N2**: `[in] CBLAS_INT` number of elements in `append`.
247-
- **append**: `[in] double` a [`Float64Array`][@stdlib/array/float64] containing values to append after computing differences.
248-
- **strideA**: `[in] CBLAS_INT` strides length for `append`.
243+
- **N1**: `[in] CBLAS_INT` number of indexed elements to `Prepend`.
244+
- **Prepend**: `[in] double` a [`Float64Array`][@stdlib/array/float64] containing values to prepend after computing differences.
245+
- **strideP**: `[in] CBLAS_INT` stride length for `Prepend`.
246+
- **N2**: `[in] CBLAS_INT` number of indexed elements to `Append`.
247+
- **Append**: `[in] double` a [`Float64Array`][@stdlib/array/float64] containing values to append after computing differences.
248+
- **strideA**: `[in] CBLAS_INT` strides length for `Append`.
249249
- **Out**: `[inout] double` output [`Float64Array`][@stdlib/array/float64]. Must have `N + N1 + N2 - 1` elements.
250250
- **strideOut**: `[in] CBLAS_INT` stride length for `Out`.
251251
252252
```c
253-
void stdlib_strided_dediff( const CBLAS_INT N, 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 );
253+
void stdlib_strided_dediff( const CBLAS_INT N, 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 );
254254
```
255255

256256
<!-- lint disable maximum-heading-length -->
257257

258-
#### stdlib_strided_dediff_ndarray( N, \*X, strideX, offsetX, N1, \*prepend, strideP, offsetP, N2, \*append, strideA, offsetA, \*Out, strideOut, offsetOut )
258+
#### stdlib_strided_dediff_ndarray( N, \*X, strideX, offsetX, N1, \*Prepend, strideP, offsetP, N2, \*Append, strideA, offsetA, \*Out, strideOut, offsetOut )
259259

260260
Calculates the differences between consecutive elements of a double-precision floating-point strided array using alternative indexing semantics.
261261

@@ -274,20 +274,20 @@ The function accepts the following arguments:
274274
- **X**: `[in] double` input [`Float64Array`][@stdlib/array/float64].
275275
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
276276
- **offsetX**: `[in] CBLAS_INT` starting index for `X`.
277-
- **N1**: `[in] CBLAS_INT` number of elements in `prepend`.
278-
- **prepend**: `[in] double` a [`Float64Array`][@stdlib/array/float64] containing values to prepend after computing differences.
279-
- **strideP**: `[in] CBLAS_INT` stride length for `prepend`.
280-
- **offsetP**: `[in] CBLAS_INT` starting index for `prepend`.
281-
- **N2**: `[in] CBLAS_INT` number of elements in `append`.
282-
- **append**: `[in] double` a [`Float64Array`][@stdlib/array/float64] containing values to append after computing differences.
283-
- **strideA**: `[in] CBLAS_INT` strides length for `append`.
284-
- **offsetA**: `[in] CBLAS_INT` starting index for `append`.
277+
- **N1**: `[in] CBLAS_INT` number of indexed elements to `Prepend`.
278+
- **Prepend**: `[in] double` a [`Float64Array`][@stdlib/array/float64] containing values to prepend after computing differences.
279+
- **strideP**: `[in] CBLAS_INT` stride length for `Prepend`.
280+
- **offsetP**: `[in] CBLAS_INT` starting index for `Prepend`.
281+
- **N2**: `[in] CBLAS_INT` number of indexed elements to `Append`.
282+
- **Append**: `[in] double` a [`Float64Array`][@stdlib/array/float64] containing values to append after computing differences.
283+
- **strideA**: `[in] CBLAS_INT` strides length for `Append`.
284+
- **offsetA**: `[in] CBLAS_INT` starting index for `Append`.
285285
- **Out**: `[inout] double` output [`Float64Array`][@stdlib/array/float64]. Must have `N + N1 + N2 - 1` elements.
286286
- **strideOut**: `[in] CBLAS_INT` stride length for `Out`.
287287
- **offsetOut**: `[in] CBLAS_INT` starting index for `Out`.
288288
289289
```c
290-
void stdlib_strided_dediff_ndarray( const CBLAS_INT N, 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 );
290+
void stdlib_strided_dediff_ndarray( const CBLAS_INT N, 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 );
291291
```
292292

293293
</section>
@@ -316,13 +316,13 @@ int main( void ) {
316316
// Create a strided array:
317317
const double x[] = { 1.0, -2.0, 3.0, -4.0, 5.0, -6.0, 7.0, -8.0 };
318318

319-
// Define prepend values:
319+
// Define a list of values to prepend:
320320
const double p[] = { -1.0 };
321321

322-
// Define append values:
322+
// Define a list of values to append:
323323
const double a[] = { 10.0 };
324324

325-
// Define output array:
325+
// Define an output array:
326326
double out[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
327327

328328
// Compute forward differences:

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
Indexing is relative to the first index. To introduce an offset, use a typed
1010
array view.
1111

12-
If the sum of `N`, `N1`, and `N2` is less than or equal to `1`, both
13-
functions return the output array unchanged.
12+
If `N + N1 + N2 <= 1`, the function returns the output array unchanged.
1413

1514
Parameters
1615
----------
@@ -24,22 +23,22 @@
2423
Stride length for `x`.
2524

2625
N1: integer
27-
Number of elements to `prepend`.
26+
Number of indexed elements to prepend.
2827

2928
p: Float64Array
3029
Array containing values to prepend after computing differences.
3130

3231
sp: integer
33-
Stride length for `prepend`.
32+
Stride length for `p`.
3433

3534
N2: integer
36-
Number of elements to `append`.
35+
Number of indexed elements to append.
3736

3837
a: Float64Array
3938
Array containing values to append after computing differences.
4039

4140
sa: integer
42-
Stride length for `append`.
41+
Stride length for `a`.
4342

4443
out: Float64Array
4544
Output array.
@@ -104,28 +103,28 @@
104103
Starting index for `x`.
105104

106105
N1: integer
107-
Number of elements to `prepend`.
106+
Number of indexed elements to prepend.
108107

109108
p: Float64Array
110109
Array containing values to prepend after computing differences.
111110

112111
sp: integer
113-
Stride length for `prepend`.
112+
Stride length for `p`.
114113

115114
op: integer
116-
Starting index for `prepend`.
115+
Starting index for `p`.
117116

118117
N2: integer
119-
Number of elements to `append`.
118+
Number of indexed elements to append.
120119

121120
a: Float64Array
122121
Array containing values to append after computing differences.
123122

124123
sa: integer
125-
Stride length for `append`.
124+
Stride length for `a`.
126125

127126
oa: integer
128-
Starting index for `append`.
127+
Starting index for `a`.
129128

130129
out: Float64Array
131130
Output array.

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ interface Routine {
2828
* @param N - number of indexed elements
2929
* @param x - input array
3030
* @param strideX - stride length for `x`
31-
* @param N1 - number of indexed elements of prepend
31+
* @param N1 - number of indexed elements to `prepend`
3232
* @param prepend - prepend array
3333
* @param strideP - stride length for `prepend`
34-
* @param N2 - number of indexed elements of append
34+
* @param N2 - number of indexed elements to `append`
3535
* @param append - append array
3636
* @param strideA - stride length for `append`
3737
* @param out - output array
@@ -60,11 +60,11 @@ interface Routine {
6060
* @param x - input array
6161
* @param strideX - stride length for `x`
6262
* @param offsetX - starting index for `x`
63-
* @param N1 - number of indexed elements of prepend
63+
* @param N1 - number of indexed elements to `prepend`
6464
* @param prepend - prepend array
6565
* @param strideP - stride length for `prepend`
6666
* @param offsetP - starting index for `prepend`
67-
* @param N2 - number of indexed elements of append
67+
* @param N2 - number of indexed elements to `append`
6868
* @param append - append array
6969
* @param strideA - stride length for `append`
7070
* @param offsetA - starting index for `append`
@@ -95,10 +95,10 @@ interface Routine {
9595
* @param N - number of indexed elements
9696
* @param x - input array
9797
* @param strideX - stride length for `x`
98-
* @param N1 - number of indexed elements of prepend
98+
* @param N1 - number of indexed elements to `prepend`
9999
* @param prepend - prepend array
100100
* @param strideP - stride length for `prepend`
101-
* @param N2 - number of indexed elements of append
101+
* @param N2 - number of indexed elements to `append`
102102
* @param append - append array
103103
* @param strideA - stride length for `append`
104104
* @param out - output array

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ 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 output array:
32+
// Define an output array:
3333
double out[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
3434

3535
// Compute forward differences:

lib/node_modules/@stdlib/blas/ext/base/dediff/examples/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ console.log( 'Append array: ', a );
4040
var out = new Float64Array( 13 );
4141

4242
dediff( x.length, x, 1, 2, p, 1, 2, a, 1, out, 1 );
43-
console.log( 'Output', out );
43+
console.log( 'Output:', out );

lib/node_modules/@stdlib/blas/ext/base/dediff/include/stdlib/blas/ext/base/dediff.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 differences between consecutive elements of a double-precision floating-point strided array.
3333
*/
34-
void API_SUFFIX(stdlib_strided_dediff)( const CBLAS_INT N, 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 );
34+
void API_SUFFIX(stdlib_strided_dediff)( const CBLAS_INT N, 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 );
3535

3636
/**
3737
* Calculates the differences between consecutive elements of a double-precision floating-point strided array using alternative indexing semantics.
3838
*/
39-
void API_SUFFIX(stdlib_strided_dediff_ndarray)( const CBLAS_INT N, 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 );
39+
void API_SUFFIX(stdlib_strided_dediff_ndarray)( const CBLAS_INT N, 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 );
4040

4141

4242
#ifdef __cplusplus

lib/node_modules/@stdlib/blas/ext/base/dediff/lib/dediff.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ var ndarray = require( './ndarray.js' );
3434
* @param {PositiveInteger} N - number of indexed elements
3535
* @param {Float64Array} x - input array
3636
* @param {integer} strideX - stride length for `x`
37-
* @param {PositiveInteger} N1 - number of indexed elements of prepend
37+
* @param {PositiveInteger} N1 - number of indexed elements to `prepend`
3838
* @param {Float64Array} prepend - prepend array
3939
* @param {integer} strideP - stride length for `prepend`
40-
* @param {PositiveInteger} N2 - number of indexed elements of append
40+
* @param {PositiveInteger} N2 - number of indexed elements to `append`
4141
* @param {Float64Array} append - append array
4242
* @param {integer} strideA - stride length for `append`
4343
* @param {Float64Array} out - output array

lib/node_modules/@stdlib/blas/ext/base/dediff/lib/dediff.native.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ var addon = require( './../src/addon.node' );
3333
* @param {PositiveInteger} N - number of indexed elements
3434
* @param {Float64Array} x - input array
3535
* @param {integer} strideX - stride length for `x`
36-
* @param {PositiveInteger} N1 - number of indexed elements of prepend
36+
* @param {PositiveInteger} N1 - number of indexed elements to `prepend`
3737
* @param {Float64Array} prepend - prepend array
3838
* @param {integer} strideP - stride length for `prepend`
39-
* @param {PositiveInteger} N2 - number of indexed elements of append
39+
* @param {PositiveInteger} N2 - number of indexed elements to `append`
4040
* @param {Float64Array} append - append array
4141
* @param {integer} strideA - stride length for `append`
4242
* @param {Float64Array} out - output array

lib/node_modules/@stdlib/blas/ext/base/dediff/lib/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,20 @@
3636
*
3737
* console.log( out );
3838
* // out => <Float64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 22.0 ]
39+
*
40+
* @example
41+
* var Float64Array = require( '@stdlib/array/float64' );
42+
* var dediff = require( '@stdlib/blas/ext/base/dediff' );
43+
*
44+
* var x = new Float64Array( [ 2.0, 4.0, 7.0, 11.0, 16.0 ] );
45+
* var p = new Float64Array( [ 1.0 ] );
46+
* var a = new Float64Array( [ 22.0 ] );
47+
* var out = new Float64Array( 6 );
48+
*
49+
* dediff.ndarray( x.length, x, 1, 0, 1, p, 1, 0, 1, a, 1, 0, out, 1, 0 );
50+
*
51+
* console.log( out );
52+
* // out => <Float64Array>[ 1.0, 2.0, 3.0, 4.0, 5.0, 22.0 ]
3953
*/
4054

4155
// MODULES //

lib/node_modules/@stdlib/blas/ext/base/dediff/lib/ndarray.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ var dcopy = require( '@stdlib/blas/base/dcopy' );
3434
* @param {Float64Array} x - input array
3535
* @param {integer} strideX - stride length for `x`
3636
* @param {PositiveInteger} offsetX - starting index for `x`
37-
* @param {PositiveInteger} N1 - number of indexed elements of prepend
37+
* @param {PositiveInteger} N1 - number of indexed elements to `prepend`
3838
* @param {Float64Array} prepend - prepend array
3939
* @param {integer} strideP - stride length for `prepend`
4040
* @param {PositiveInteger} offsetP - starting index for `prepend`
41-
* @param {PositiveInteger} N2 - number of indexed elements of append
41+
* @param {PositiveInteger} N2 - number of indexed elements to `append`
4242
* @param {Float64Array} append - append array
4343
* @param {integer} strideA - stride length for `append`
4444
* @param {PositiveInteger} offsetA - starting index for `append`

0 commit comments

Comments
 (0)