Skip to content

Commit 04a4694

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: 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: 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 dd789d8 commit 04a4694

12 files changed

Lines changed: 289 additions & 268 deletions

File tree

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

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ The function has the following additional parameters:
134134
- **offsetP**: starting index for `prepend`.
135135
- **offsetA**: starting index for `append`.
136136
- **offsetOut**: starting index for `out`.
137-
- **offsetW**: starting index of `workspace`.
137+
- **offsetW**: starting index for `workspace`.
138138

139139
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:
140140

@@ -194,11 +194,10 @@ var a = discreteUniform( 2, -100, 100, {
194194
console.log( 'Append array: ', a );
195195

196196
var out = new Float64Array( 10 );
197-
198197
var w = new Float64Array( 13 );
199198

200199
ddiff( x.length, 4, x, 1, 2, p, 1, 2, a, 1, out, 1, w, 1 );
201-
console.log( 'Output', out );
200+
console.log( 'Output: ', out );
202201
```
203202

204203
</section>
@@ -233,7 +232,7 @@ console.log( 'Output', out );
233232

234233
<!-- lint disable maximum-heading-length -->
235234

236-
#### 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 )
237236

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

@@ -252,25 +251,25 @@ The function accepts the following arguments:
252251
- **N**: `[in] CBLAS_INT` number of indexed elements.
253252
- **k**: `[in] CBLAS_INT` number of times to recursively compute differences.
254253
- **X**: `[in] double*` input array.
255-
- **strideX**: `[in] CBLAS_INT` stride length for `x`.
256-
- **N1**: `[in] CBLAS_INT` number of elements in `prepend`.
257-
- **prepend**: `[in] double*` array containing values to prepend prior to computing differences.
258-
- **strideP**: `[in] CBLAS_INT` stride length for `prepend`.
259-
- **N2**: `[in] CBLAS_INT` number of elements in `append`.
260-
- **append**: `[in] double*` array containing values to append prior to computing differences.
261-
- **strideA**: `[in] CBLAS_INT` stride length for `append`.
254+
- **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`.
262261
- **Out**: `[inout] double*` output array. Must have `N + N1 + N2 - k` elements.
263-
- **strideOut**: `[in] CBLAS_INT` stride length for `out`.
262+
- **strideOut**: `[in] CBLAS_INT` stride length for `Out`.
264263
- **Workspace**: `[inout] double*` workspace array. Must have `N + N1 + N2 - 1` elements.
265-
- **strideW**: `[in] CBLAS_INT` stride length for `workspace`.
264+
- **strideW**: `[in] CBLAS_INT` stride length for `Workspace`.
266265
267266
```c
268-
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 );
269268
```
270269

271270
<!-- lint disable maximum-heading-length -->
272271

273-
#### 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, \*W, strideW, offsetW )
274273

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

@@ -289,25 +288,25 @@ The function accepts the following arguments:
289288
- **N**: `[in] CBLAS_INT` number of indexed elements.
290289
- **k**: `[in] CBLAS_INT` number of times to recursively compute differences.
291290
- **X**: `[in] double*` input array.
292-
- **strideX**: `[in] CBLAS_INT` stride length for `x`.
293-
- **offsetX**: `[in] CBLAS_INT` starting index for `x`.
294-
- **N1**: `[in] CBLAS_INT` number of elements in `prepend`.
295-
- **prepend**: `[in] double*` array containing values to prepend prior to computing differences.
296-
- **strideP**: `[in] CBLAS_INT` stride length for `prepend`.
297-
- **offsetP**: `[in] CBLAS_INT` starting index for `prepend`.
298-
- **N2**: `[in] CBLAS_INT` number of elements in `append`.
299-
- **append**: `[in] double*` array containing values to append prior to computing differences.
300-
- **strideA**: `[in] CBLAS_INT` stride length for `append`.
301-
- **offsetA**: `[in] CBLAS_INT` starting index for `append`.
291+
- **strideX**: `[in] CBLAS_INT` stride length for `X`.
292+
- **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`.
302301
- **Out**: `[inout] double*` output array. Must have `N + N1 + N2 - k` elements.
303-
- **strideOut**: `[in] CBLAS_INT` stride length for `out`.
304-
- **offsetOut**: `[in] CBLAS_INT` starting index for `out`.
302+
- **strideOut**: `[in] CBLAS_INT` stride length for `Out`.
303+
- **offsetOut**: `[in] CBLAS_INT` starting index for `Out`.
305304
- **Workspace**: `[inout] double*` workspace array. Must have `N + N1 + N2 - 1` elements.
306-
- **strideW**: `[in] CBLAS_INT` stride length for `workspace`.
307-
- **offsetW**: `[in] CBLAS_INT` starting index for `workspace`.
305+
- **strideW**: `[in] CBLAS_INT` stride length for `Workspace`.
306+
- **offsetW**: `[in] CBLAS_INT` starting index for `Workspace`.
308307
309308
```c
310-
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 );
311310
```
312311

313312
</section>
@@ -342,10 +341,10 @@ int main( void ) {
342341
// Define append values:
343342
const double a[] = { 10.0 };
344343

345-
// Define output array:
344+
// Define an output array:
346345
double out[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
347346

348-
// Define workspace:
347+
// Define a workspace:
349348
double w[] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
350349

351350
// Compute forward differences:

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
{{alias}}( N, k, x,sx, N1,p,sp, N2,a,sa, out,so, w,sw )
32
Calculates the k-th discrete forward differences of a double-precision
43
floating-point strided array.
@@ -44,13 +43,13 @@
4443
Stride length for `append`.
4544

4645
out: Float64Array
47-
Output array.
46+
Output array. Must have `N + N1 + N2 - k` elements.
4847

4948
so: integer
5049
Stride length for `out`.
5150

5251
w: Float64Array
53-
Workspace array.
52+
Workspace array. Must have `N + N1 + N2 - 1` elements.
5453

5554
sw: integer
5655
Stride length for `workspace`.
@@ -141,7 +140,7 @@
141140
Starting index for `append`.
142141

143142
out: Float64Array
144-
Output array.
143+
Output array. Must have `N + N1 + N2 - k` elements.
145144

146145
so: integer
147146
Stride length for `out`.
@@ -150,7 +149,7 @@
150149
Starting index for `out`.
151150

152151
w: Float64Array
153-
Workspace array.
152+
Workspace array. Must have `N + N1 + N2 - 1` elements.
154153

155154
sw: integer
156155
Stride length for `workspace`.

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ interface Routine {
124124
* var p = new Float64Array( [ 1.0 ] );
125125
* var a = new Float64Array( [ 22.0 ] );
126126
* var out = new Float64Array( 5 );
127-
* var w = new Float64Array( 6 )
127+
* var w = new Float64Array( 6 );
128128
*
129129
* ddiff( x.length, 2, x, 1, 1, p, 1, 1, a, 1, out, 1, w, 1 );
130130
*
@@ -138,7 +138,7 @@ interface Routine {
138138
* var p = new Float64Array( [ 1.0 ] );
139139
* var a = new Float64Array( [ 22.0 ] );
140140
* var out = new Float64Array( 5 );
141-
* var w = new Float64Array( 6 )
141+
* var w = new Float64Array( 6 );
142142
*
143143
* ddiff.ndarray( x.length, 2, x, 1, 0, 1, p, 1, 0, 1, a, 1, 0, out, 1, 0, w, 1, 0 );
144144
*

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

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ import ddiff = require( './index' );
157157
ddiff( x.length, 1, x, 1, 1, p, ( x: number ): number => x, 1, a, 1, out, 1, w, 1 ); // $ExpectError
158158
}
159159

160-
// The compiler throws an error if the function is provided an eigth argument which is not a number...
160+
// The compiler throws an error if the function is provided an eighth argument which is not a number...
161161
{
162162
const x = new Float64Array( 10 );
163163
const p = new Float64Array( 1 );
@@ -210,7 +210,7 @@ import ddiff = require( './index' );
210210
ddiff( x.length, 1, x, 1, 1, p, 1, 1, a, ( x: number ): number => x, out, 1, w, 1 ); // $ExpectError
211211
}
212212

213-
// The compiler throws an error if the function is provided an eleventth argument which is not a Float64Array...
213+
// The compiler throws an error if the function is provided an eleventh argument which is not a Float64Array...
214214
{
215215
const x = new Float64Array( 10 );
216216
const p = new Float64Array( 1 );
@@ -227,7 +227,7 @@ import ddiff = require( './index' );
227227
ddiff( x.length, 1, x, 1, 1, p, 1, 1, a, 1, ( x: number ): number => x, 1, w, 1 ); // $ExpectError
228228
}
229229

230-
// The compiler throws an error if the function is provided a twelveth argument which is not a number...
230+
// The compiler throws an error if the function is provided a twelfth argument which is not a number...
231231
{
232232
const x = new Float64Array( 10 );
233233
const p = new Float64Array( 1 );
@@ -406,7 +406,7 @@ import ddiff = require( './index' );
406406
ddiff.ndarray( x.length, 1, x, 1, ( x: number ): number => x, 1, p, 1, 0, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
407407
}
408408

409-
// The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a Float64Array...
409+
// The compiler throws an error if the `ndarray` method is provided a sixth argument which is not a number...
410410
{
411411
const x = new Float64Array( 10 );
412412
const p = new Float64Array( 1 );
@@ -417,14 +417,14 @@ import ddiff = require( './index' );
417417
ddiff.ndarray( x.length, 1, x, 1, 0, '10', p, 1, 0, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
418418
ddiff.ndarray( x.length, 1, x, 1, 0, true, p, 1, 0, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
419419
ddiff.ndarray( x.length, 1, x, 1, 0, false, p, 1, 0, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
420-
ddiff.ndarray( x.length, 1, x, 1, 1, null, p, 1, 0, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
420+
ddiff.ndarray( x.length, 1, x, 1, 0, null, p, 1, 0, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
421421
ddiff.ndarray( x.length, 1, x, 1, 0, undefined, p, 1, 0, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
422422
ddiff.ndarray( x.length, 1, x, 1, 0, [], p, 1, 0, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
423423
ddiff.ndarray( x.length, 1, x, 1, 0, {}, p, 1, 0, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
424424
ddiff.ndarray( x.length, 1, x, 1, 0, ( x: number ): number => x, p, 1, 0, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
425425
}
426426

427-
// The compiler throws an error if the `ndarray` method is provided a seventh argument which is not a number...
427+
// The compiler throws an error if the `ndarray` method is provided a seventh argument which is not a Float64Array...
428428
{
429429
const x = new Float64Array( 10 );
430430
const a = new Float64Array( 1 );
@@ -441,7 +441,7 @@ import ddiff = require( './index' );
441441
ddiff.ndarray( x.length, 1, x, 1, 0, 1, ( x: number ): number => x, 1, 0, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
442442
}
443443

444-
// The compiler throws an error if the `ndarray` method is provided an eigth argument which is not a number...
444+
// The compiler throws an error if the `ndarray` method is provided an eighth argument which is not a number...
445445
{
446446
const x = new Float64Array( 10 );
447447
const p = new Float64Array( 1 );
@@ -459,22 +459,22 @@ import ddiff = require( './index' );
459459
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, ( x: number ): number => x, 0, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
460460
}
461461

462-
// The compiler throws an error if the `ndarray` method is provided a ninth argument which is not a Float64Array...
462+
// The compiler throws an error if the `ndarray` method is provided a ninth argument which is not a number...
463463
{
464464
const x = new Float64Array( 10 );
465465
const p = new Float64Array( 1 );
466466
const a = new Float64Array( 1 );
467467
const out = new Float64Array( 11 );
468468
const w = new Float64Array( 11 );
469469

470-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, '10', 1, a, 0, 1, out, 1, 0, w, 1, 0 ); // $ExpectError
471-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, true, 1, a, 0, 1, out, 1, 0, w, 1, 0 ); // $ExpectError
472-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, false, 1, a, 0, 1, out, 1, 0, w, 1, 0 ); // $ExpectError
473-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, null, 1, a, 0, 1, out, 1, 0, w, 1, 0 ); // $ExpectError
474-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, undefined, 1, a, 0, 1, out, 1, 0, w, 1, 0 ); // $ExpectError
475-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, [], 1, a, 0, 1, out, 1, 0, w, 1, 0 ); // $ExpectError
476-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, {}, 1, a, 0, 1, out, 1, 0, w, 1, 0 ); // $ExpectError
477-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, ( x: number ): number => x, 1, a, 0, 1, out, 1, 0, w, 1, 0 ); // $ExpectError
470+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, '10', 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
471+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, true, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
472+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, false, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
473+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, null, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
474+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, undefined, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
475+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, [], 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
476+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, {}, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
477+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, ( x: number ): number => x, 1, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
478478
}
479479

480480
// The compiler throws an error if the `ndarray` method is provided a tenth argument which is not a number...
@@ -495,24 +495,24 @@ import ddiff = require( './index' );
495495
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, ( x: number ): number => x, a, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
496496
}
497497

498-
// The compiler throws an error if the `ndarray` method is provided an eleventth argument which is not a Float64Array...
498+
// The compiler throws an error if the `ndarray` method is provided an eleventh argument which is not a Float64Array...
499499
{
500500
const x = new Float64Array( 10 );
501501
const p = new Float64Array( 1 );
502502
const out = new Float64Array( 11 );
503503
const w = new Float64Array( 9 );
504504

505-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, '10', 1, 0, out, 0, 1, w, 1, 0 ); // $ExpectError
506-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, true, 1, 0, out, 0, 1, w, 1, 0 ); // $ExpectError
507-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, false, 1, 0, out, 0, 1, w, 1, 0 ); // $ExpectError
508-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, null, 1, 0, out, 0, 1, w, 1, 0 ); // $ExpectError
509-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, undefined, 1, 0, out, 0, 1, w, 1, 0 ); // $ExpectError
510-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, [], 1, 0, out, 0, 1, w, 1, 0 ); // $ExpectError
511-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, {}, 1, 0, out, 0, 1, w, 1, 0 ); // $ExpectError
512-
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, ( x: number ): number => x, 1, 0, out, 0, 1, w, 1, 0 ); // $ExpectError
505+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, '10', 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
506+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, true, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
507+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, false, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
508+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, null, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
509+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, undefined, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
510+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, [], 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
511+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, {}, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
512+
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, ( x: number ): number => x, 1, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
513513
}
514514

515-
// The compiler throws an error if the `ndarray` method is provided a twelveth argument which is not a number...
515+
// The compiler throws an error if the `ndarray` method is provided a twelfth argument which is not a number...
516516
{
517517
const x = new Float64Array( 10 );
518518
const p = new Float64Array( 1 );
@@ -530,7 +530,7 @@ import ddiff = require( './index' );
530530
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, a, ( x: number ): number => x, 0, out, 1, 0, w, 1, 0 ); // $ExpectError
531531
}
532532

533-
// The compiler throws an error if the `ndarray` method is provided a thirteenth argument which is not a Float64Array...
533+
// The compiler throws an error if the `ndarray` method is provided a thirteenth argument which is not a number...
534534
{
535535
const x = new Float64Array( 10 );
536536
const p = new Float64Array( 1 );
@@ -548,7 +548,7 @@ import ddiff = require( './index' );
548548
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, a, 1, ( x: number ): number => x, out, 1, 0, w, 1, 0 ); // $ExpectError
549549
}
550550

551-
// The compiler throws an error if the `ndarray` method is provided a fourteenth argument which is not a number...
551+
// The compiler throws an error if the `ndarray` method is provided a fourteenth argument which is not a Float64Array...
552552
{
553553
const x = new Float64Array( 10 );
554554
const p = new Float64Array( 1 );
@@ -601,7 +601,7 @@ import ddiff = require( './index' );
601601
ddiff.ndarray( x.length, 1, x, 1, 0, 1, p, 1, 0, 1, a, 1, 0, out, 1, ( x: number ): number => x, w, 1, 0 ); // $ExpectError
602602
}
603603

604-
// The compiler throws an error if the `ndarray` method is provided a seventeenth argument which is not a number...
604+
// The compiler throws an error if the `ndarray` method is provided a seventeenth argument which is not a Float64Array...
605605
{
606606
const x = new Float64Array( 10 );
607607
const p = new Float64Array( 1 );

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ int main( void ) {
2929
// Define append values:
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 };
3434

35-
// Define workspace:
35+
// Define a 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/examples/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ var a = discreteUniform( 2, -100, 100, {
3838
console.log( 'Append array: ', a );
3939

4040
var out = new Float64Array( 10 );
41-
4241
var w = new Float64Array( 13 );
4342

4443
ddiff( x.length, 4, x, 1, 2, p, 1, 2, a, 1, out, 1, w, 1 );
45-
console.log( 'Output', out );
44+
console.log( 'Output: ', out );

0 commit comments

Comments
 (0)