Skip to content

Commit ed34020

Browse files
committed
refactor: refactor docs and examples
--- 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: passed - 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: na - task: lint_c_examples status: passed - 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: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: passed - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent d2018d0 commit ed34020

File tree

3 files changed

+24
-29
lines changed

3 files changed

+24
-29
lines changed

lib/node_modules/@stdlib/stats/base/dnanmaxabs/docs/repl.txt

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11

2-
{{alias}}( N, x, stride )
2+
{{alias}}( N, x, strideX )
33
Computes the maximum absolute value of a double-precision floating-point
44
strided array, ignoring `NaN` values.
55

6-
The `N` and `stride` parameters determine which elements in `x` are accessed
7-
at runtime.
6+
The `N` and stride parameters determine which elements in the strided array
7+
are accessed at runtime.
88

99
Indexing is relative to the first index. To introduce an offset, use a typed
1010
array view.
@@ -19,8 +19,8 @@
1919
x: Float64Array
2020
Input array.
2121

22-
stride: integer
23-
Index increment.
22+
strideX: integer
23+
Stride Length.
2424

2525
Returns
2626
-------
@@ -34,22 +34,19 @@
3434
> {{alias}}( x.length, x, 1 )
3535
2.0
3636

37-
// Using `N` and `stride` parameters:
37+
// Using `N` and stride parameters:
3838
> x = new {{alias:@stdlib/array/float64}}( [ -2.0, 1.0, 1.0, -5.0, 2.0, -1.0, NaN ] );
39-
> var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
40-
> var stride = 2;
41-
> {{alias}}( N, x, stride )
39+
> {{alias}}( 3, x, 2 )
4240
2.0
4341

4442
// Using view offsets:
4543
> var x0 = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0, NaN ] );
4644
> var x1 = new {{alias:@stdlib/array/float64}}( x0.buffer, x0.BYTES_PER_ELEMENT*1 );
47-
> N = {{alias:@stdlib/math/base/special/floor}}( x0.length / 2 );
48-
> stride = 2;
49-
> {{alias}}( N, x1, stride )
45+
> {{alias}}( 3, x1, 2 )
5046
2.0
5147

52-
{{alias}}.ndarray( N, x, stride, offset )
48+
49+
{{alias}}.ndarray( N, x, strideX, offsetX )
5350
Computes the maximum absolute value of a double-precision floating-point
5451
strided array, ignoring `NaN` values and using alternative indexing
5552
semantics.
@@ -66,10 +63,10 @@
6663
x: Float64Array
6764
Input array.
6865

69-
stride: integer
70-
Index increment.
66+
strideX: integer
67+
Stride Length.
7168

72-
offset: integer
69+
offsetX: integer
7370
Starting index.
7471

7572
Returns
@@ -86,8 +83,7 @@
8683

8784
// Using offset parameter:
8885
> var x = new {{alias:@stdlib/array/float64}}( [ 1.0, -2.0, 3.0, 2.0, 5.0, -1.0, NaN ] );
89-
> var N = {{alias:@stdlib/math/base/special/floor}}( x.length / 2 );
90-
> {{alias}}.ndarray( N, x, 2, 1 )
86+
> {{alias}}.ndarray( 3, x, 2, 1 )
9187
2.0
9288

9389
See Also

lib/node_modules/@stdlib/stats/base/dnanmaxabs/docs/types/index.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface Routine {
2727
*
2828
* @param N - number of indexed elements
2929
* @param x - input array
30-
* @param stride - stride length
30+
* @param strideX - stride length
3131
* @returns maximum absolute value
3232
*
3333
* @example
@@ -38,15 +38,15 @@ interface Routine {
3838
* var v = dnanmaxabs( x.length, x, 1 );
3939
* // returns 2.0
4040
*/
41-
( N: number, x: Float64Array, stride: number ): number;
41+
( N: number, x: Float64Array, strideX: number ): number;
4242

4343
/**
4444
* Computes the maximum absolute value of a double-precision floating-point strided array, ignoring `NaN` values and using alternative indexing semantics.
4545
*
4646
* @param N - number of indexed elements
4747
* @param x - input array
48-
* @param stride - stride length
49-
* @param offset - starting index
48+
* @param strideX - stride length
49+
* @param offsetX - starting index
5050
* @returns maximum absolute value
5151
*
5252
* @example
@@ -57,15 +57,15 @@ interface Routine {
5757
* var v = dnanmaxabs.ndarray( x.length, x, 1, 0 );
5858
* // returns 2.0
5959
*/
60-
ndarray( N: number, x: Float64Array, stride: number, offset: number ): number;
60+
ndarray( N: number, x: Float64Array, strideX: number, offsetX: number ): number;
6161
}
6262

6363
/**
6464
* Computes the maximum absolute value of a double-precision floating-point strided array, ignoring `NaN` values.
6565
*
6666
* @param N - number of indexed elements
6767
* @param x - input array
68-
* @param stride - stride length
68+
* @param strideX - stride length
6969
* @returns maximum absolute value
7070
*
7171
* @example

lib/node_modules/@stdlib/stats/base/dnanmaxabs/examples/c/example.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,20 @@
1717
*/
1818

1919
#include "stdlib/stats/base/dnanmaxabs.h"
20-
#include <stdint.h>
2120
#include <stdio.h>
2221

2322
int main( void ) {
2423
// Create a strided array:
25-
double x[] = { 1.0, -2.0, -3.0, 4.0, -5.0, -6.0, 7.0, 8.0, 0.0/0.0, 0.0/0.0 };
24+
const double x[] = { 1.0, -2.0, -3.0, 4.0, -5.0, -6.0, 7.0, 8.0, 0.0/0.0, 0.0/0.0 };
2625

2726
// Specify the number of elements:
28-
int64_t N = 5;
27+
const int N = 5;
2928

3029
// Specify the stride length:
31-
int64_t stride = 2;
30+
const int strideX = 2;
3231

3332
// Compute the maximum absolute value:
34-
double v = stdlib_strided_dnanmaxabs( N, x, stride );
33+
double v = stdlib_strided_dnanmaxabs( N, x, strideX );
3534

3635
// Print the result:
3736
printf( "maxabs: %lf\n", v );

0 commit comments

Comments
 (0)