Skip to content

Commit 2d228f6

Browse files
committed
Merge branch 'develop' of https://github.com/stdlib-js/stdlib into develop
2 parents 3642086 + 975697c commit 2d228f6

File tree

5 files changed

+19
-69
lines changed

5 files changed

+19
-69
lines changed

lib/node_modules/@stdlib/stats/range/README.md

Lines changed: 10 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ var array = require( '@stdlib/ndarray/array' );
4848
var x = array( [ -1.0, 2.0, -3.0 ] );
4949

5050
var y = range( x );
51-
// returns <ndarray>
52-
53-
var v = y.get();
54-
// returns 5.0
51+
// returns <ndarray>[ 5.0 ]
5552
```
5653

5754
The function has the following parameters:
@@ -68,81 +65,58 @@ The function accepts the following options:
6865
By default, the function performs a reduction over all elements in a provided input [ndarray][@stdlib/ndarray/ctor]. To perform a reduction over specific dimensions, provide a `dims` option.
6966

7067
```javascript
71-
var ndarray2array = require( '@stdlib/ndarray/to-array' );
7268
var array = require( '@stdlib/ndarray/array' );
7369

7470
var x = array( [ -1.0, 2.0, -3.0, 4.0 ], {
7571
'shape': [ 2, 2 ],
7672
'order': 'row-major'
7773
});
78-
var v = ndarray2array( x );
79-
// returns [ [ -1.0, 2.0 ], [ -3.0, 4.0 ] ]
74+
// returns <ndarray>[ [ -1.0, 2.0 ], [ -3.0, 4.0 ] ]
8075

8176
var y = range( x, {
8277
'dims': [ 0 ]
8378
});
84-
// returns <ndarray>
85-
86-
v = ndarray2array( y );
87-
// returns [ 2.0, 2.0 ]
79+
// returns <ndarray>[ 2.0, 2.0 ]
8880

8981
y = range( x, {
9082
'dims': [ 1 ]
9183
});
92-
// returns <ndarray>
93-
94-
v = ndarray2array( y );
95-
// returns [ 3.0, 7.0 ]
84+
// returns <ndarray>[ 3.0, 7.0 ]
9685

9786
y = range( x, {
9887
'dims': [ 0, 1 ]
9988
});
100-
// returns <ndarray>
101-
102-
v = y.get();
103-
// returns 7.0
89+
// returns <ndarray>[ 7.0 ]
10490
```
10591

10692
By default, the function excludes reduced dimensions from the output [ndarray][@stdlib/ndarray/ctor]. To include the reduced dimensions as singleton dimensions, set the `keepdims` option to `true`.
10793

10894
```javascript
109-
var ndarray2array = require( '@stdlib/ndarray/to-array' );
11095
var array = require( '@stdlib/ndarray/array' );
11196

11297
var x = array( [ -1.0, 2.0, -3.0, 4.0 ], {
11398
'shape': [ 2, 2 ],
11499
'order': 'row-major'
115100
});
116-
117-
var v = ndarray2array( x );
118-
// returns [ [ -1.0, 2.0 ], [ -3.0, 4.0 ] ]
101+
// returns <ndarray>[ [ -1.0, 2.0 ], [ -3.0, 4.0 ] ]
119102

120103
var y = range( x, {
121104
'dims': [ 0 ],
122105
'keepdims': true
123106
});
124-
// returns <ndarray>
125-
126-
v = ndarray2array( y );
127-
// returns [ [ 2.0, 2.0 ] ]
107+
// returns <ndarray>[ [ 2.0, 2.0 ] ]
128108

129109
y = range( x, {
130110
'dims': [ 1 ],
131111
'keepdims': true
132112
});
133-
// returns <ndarray>
134-
135-
v = ndarray2array( y );
136-
// returns [ [ 3.0 ], [ 7.0 ] ]
113+
// returns <ndarray>[ [ 3.0 ], [ 7.0 ] ]
137114

138115
y = range( x, {
139116
'dims': [ 0, 1 ],
140117
'keepdims': true
141118
});
142-
// returns <ndarray>
143-
144-
v = ndarray2array( y );
145-
// returns [ [ 7.0 ] ]
119+
// returns <ndarray>[ [ 7.0 ] ]
146120
```
147121

148122
By default, the function returns an [ndarray][@stdlib/ndarray/ctor] having a [data type][@stdlib/ndarray/dtypes] determined by the function's output data type [policy][@stdlib/ndarray/output-dtype-policies]. To override the default behavior, set the `dtype` option.
@@ -176,10 +150,7 @@ var x = array( [ -1.0, 2.0, -3.0 ] );
176150
var y = zeros( [] );
177151

178152
var out = range.assign( x, y );
179-
// returns <ndarray>
180-
181-
var v = out.get();
182-
// returns 5.0
153+
// returns <ndarray>[ 5.0 ]
183154

184155
var bool = ( out === y );
185156
// returns true

lib/node_modules/@stdlib/stats/range/docs/repl.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@
3030
Examples
3131
--------
3232
> var x = {{alias:@stdlib/ndarray/array}}( [ -1.0, 2.0, -3.0, -4.0 ] );
33-
> var y = {{alias}}( x );
34-
> var v = y.get()
35-
6.0
33+
> var y = {{alias}}( x )
34+
<ndarray>[ 6.0 ]
3635

3736

3837
{{alias}}.assign( x, out[, options] )
@@ -65,11 +64,9 @@
6564
> var x = {{alias:@stdlib/ndarray/array}}( [ -1.0, 2.0, -3.0, -4.0 ] );
6665
> var out = {{alias:@stdlib/ndarray/zeros}}( [] );
6766
> var y = {{alias}}.assign( x, out )
68-
<ndarray>
67+
<ndarray>[ 6.0 ]
6968
> var bool = ( out === y )
7069
true
71-
> var v = out.get()
72-
6.0
7370

7471
See Also
7572
--------

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

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ interface Unary {
7575
* var x = array( [ -1.0, 2.0, -3.0 ] );
7676
*
7777
* var y = range( x );
78-
* // returns <ndarray>
79-
*
80-
* var v = y.get();
81-
* // returns 5.0
78+
* // returns <ndarray>[ 5.0 ]
8279
*/
8380
<T = unknown, U = unknown>( x: InputArray<T>, options?: Options ): OutputArray<U>; // NOTE: we lose type specificity here, but retaining specificity would likely be difficult and/or tedious to completely enumerate, as the output ndarray data type is dependent on how `x` interacts with output data type policy and whether that policy has been overridden by `options.dtype`.
8481

@@ -98,10 +95,7 @@ interface Unary {
9895
* var y = zeros( [] );
9996
*
10097
* var out = range.assign( x, y );
101-
* // returns <ndarray>
102-
*
103-
* var v = out.get();
104-
* // returns 5.0
98+
* // returns <ndarray>[ 5.0 ]
10599
*
106100
* var bool = ( out === y );
107101
* // returns true
@@ -122,10 +116,7 @@ interface Unary {
122116
* var x = array( [ -1.0, 2.0, -3.0 ] );
123117
*
124118
* var y = range( x );
125-
* // returns <ndarray>
126-
*
127-
* var v = y.get();
128-
* // returns 5.0
119+
* // returns <ndarray>[ 5.0 ]
129120
*
130121
* @example
131122
* var array = require( '@stdlib/ndarray/array' );
@@ -135,10 +126,7 @@ interface Unary {
135126
* var y = zeros( [] );
136127
*
137128
* var out = range.assign( x, y );
138-
* // returns <ndarray>
139-
*
140-
* var v = out.get();
141-
* // returns 5.0
129+
* // returns <ndarray>[ 5.0 ]
142130
*
143131
* var bool = ( out === y );
144132
* // returns true

lib/node_modules/@stdlib/stats/range/lib/index.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,7 @@
4545
*
4646
* // Perform reduction:
4747
* var out = range( x );
48-
* // returns <ndarray>
49-
*
50-
* var v = out.get();
51-
* // returns 9.0
48+
* // returns <ndarray>[ 9.0 ]
5249
*/
5350

5451
// MODULES //

lib/node_modules/@stdlib/stats/range/lib/main.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@ var table = {
8888
*
8989
* // Perform reduction:
9090
* var out = range( x );
91-
* // returns <ndarray>
92-
*
93-
* var v = out.get();
94-
* // returns 9.0
91+
* // returns <ndarray>[ 9.0 ]
9592
*/
9693
var range = factory( table, [ idtypes ], odtypes, policies );
9794

0 commit comments

Comments
 (0)