You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
---
---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
---
---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
---
---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
---
---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
---
---
type: pre_push_report
description: Results of running various checks prior to pushing changes.
report:
---
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/stats/base/range/README.md
+15-21Lines changed: 15 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ The [**range**][range] is defined as the difference between the maximum and mini
38
38
var range =require( '@stdlib/stats/base/range' );
39
39
```
40
40
41
-
#### range( N, x, stride )
41
+
#### range( N, x, strideX )
42
42
43
43
Computes the [range][range] of a strided array `x`.
44
44
@@ -54,17 +54,15 @@ The function has the following parameters:
54
54
55
55
-**N**: number of indexed elements.
56
56
-**x**: input [`Array`][mdn-array] or [`typed array`][mdn-typed-array].
57
-
-**stride**: index increment for `x`.
57
+
-**strideX**: stride length for `x`.
58
58
59
-
The `N` and `stride` parameters determine which elements in `x` are accessed at runtime. For example, to compute the [range][range] of every other element in `x`,
59
+
The `N` and `stride` parameters determine which elements in the strided array are accessed at runtime. For example, to compute the [range][range] of every other element in `x`,
60
60
61
61
```javascript
62
-
var floor =require( '@stdlib/math/base/special/floor' );
63
62
64
63
var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ];
65
-
varN=floor( x.length/2 );
66
64
67
-
var v =range( N, x, 2 );
65
+
var v =range( 4, x, 2 );
68
66
// returns 6.0
69
67
```
70
68
@@ -74,18 +72,15 @@ Note that indexing is relative to the first index. To introduce an offset, use [
var x1 =newFloat64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
81
78
82
-
varN=floor( x0.length/2 );
83
-
84
-
var v =range( N, x1, 2 );
79
+
var v =range( 4, x1, 2 );
85
80
// returns 6.0
86
81
```
87
82
88
-
#### range.ndarray( N, x, stride, offset )
83
+
#### range.ndarray( N, x, strideX, offsetX )
89
84
90
85
Computes the [range][range] of a strided array using alternative indexing semantics.
91
86
@@ -99,17 +94,15 @@ var v = range.ndarray( N, x, 1, 0 );
99
94
100
95
The function has the following additional parameters:
101
96
102
-
-**offset**: starting index for `x`.
97
+
-**offsetX**: starting index for `x`.
103
98
104
-
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 calculate the [range][range] for every other value in `x` starting from the second value
99
+
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 calculate the [range][range] for every other value in `x` starting from the second value
105
100
106
101
```javascript
107
-
var floor =require( '@stdlib/math/base/special/floor' );
108
102
109
103
var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];
110
-
varN=floor( x.length/2 );
111
104
112
-
var v =range.ndarray( N, x, 2, 1 );
105
+
var v =range.ndarray( 4, x, 2, 1 );
113
106
// returns 6.0
114
107
```
115
108
@@ -123,6 +116,7 @@ var v = range.ndarray( N, x, 2, 1 );
123
116
124
117
- If `N <= 0`, both functions return `NaN`.
125
118
- Depending on the environment, the typed versions ([`drange`][@stdlib/stats/base/drange], [`srange`][@stdlib/stats/base/srange], etc.) are likely to be significantly more performant.
119
+
- Both functions support array-like objects having getter and setter accessors for array element access (e.g., [`@stdlib/array/base/accessor`][@stdlib/array/base/accessor]).
126
120
127
121
</section>
128
122
@@ -137,16 +131,14 @@ var v = range.ndarray( N, x, 2, 1 );
137
131
```javascript
138
132
var randu =require( '@stdlib/random/base/randu' );
139
133
var round =require( '@stdlib/math/base/special/round' );
0 commit comments