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
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/blas/ext/cusum/README.md
+7-32Lines changed: 7 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,16 +35,12 @@ var cusum = require( '@stdlib/blas/ext/cusum' );
35
35
Computes the cumulative sum along one or more [ndarray][@stdlib/ndarray/ctor] dimensions.
36
36
37
37
```javascript
38
-
var ndarray2array =require( '@stdlib/ndarray/to-array' );
39
38
var array =require( '@stdlib/ndarray/array' );
40
39
41
40
var x =array( [ -1.0, 2.0, -3.0 ] );
42
41
43
42
var y =cusum( x );
44
-
// returns <ndarray>
45
-
46
-
var arr =ndarray2array( y );
47
-
// returns [ -1.0, 1.0, -2.0 ]
43
+
// returns <ndarray>[ -1.0, 1.0, -2.0 ]
48
44
```
49
45
50
46
The function has the following parameters:
@@ -61,61 +57,44 @@ The function accepts the following options:
61
57
By default, the function uses the additive identity when computing the cumulative sum. To begin summing from a different value, provide an `initial` argument.
62
58
63
59
```javascript
64
-
var ndarray2array =require( '@stdlib/ndarray/to-array' );
65
60
var array =require( '@stdlib/ndarray/array' );
66
61
67
62
var x =array( [ -1.0, 2.0, -3.0 ] );
68
63
69
64
var y =cusum( x, 10.0 );
70
-
// returns <ndarray>
71
-
72
-
var arr =ndarray2array( y );
73
-
// returns [ 9.0, 11.0, 8.0 ]
65
+
// returns <ndarray>[ 9.0, 11.0, 8.0 ]
74
66
```
75
67
76
68
By default, the function performs the operation over all elements in a provided input [ndarray][@stdlib/ndarray/ctor]. To perform the operation over specific dimensions, provide a `dims` option.
77
69
78
70
```javascript
79
-
var ndarray2array =require( '@stdlib/ndarray/to-array' );
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.
116
96
117
97
```javascript
118
-
var ndarray2array =require( '@stdlib/ndarray/to-array' );
119
98
var dtype =require( '@stdlib/ndarray/dtype' );
120
99
var array =require( '@stdlib/ndarray/array' );
121
100
@@ -137,18 +116,14 @@ var dt = dtype( y );
137
116
Computes the cumulative sum along one or more [ndarray][@stdlib/ndarray/ctor] dimensions and assigns results to a provided output [ndarray][@stdlib/ndarray/ctor].
138
117
139
118
```javascript
140
-
var ndarray2array =require( '@stdlib/ndarray/to-array' );
141
119
var array =require( '@stdlib/ndarray/array' );
142
120
var zerosLike =require( '@stdlib/ndarray/zeros-like' );
Copy file name to clipboardExpand all lines: lib/node_modules/@stdlib/blas/ext/cusum/docs/types/index.d.ts
+6-30Lines changed: 6 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -70,16 +70,12 @@ interface Unary {
70
70
* @returns output ndarray
71
71
*
72
72
* @example
73
-
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
74
73
* var array = require( '@stdlib/ndarray/array' );
75
74
*
76
75
* var x = array( [ -1.0, 2.0, -3.0 ] );
77
76
*
78
77
* var y = cusum( x );
79
-
* // returns <ndarray>
80
-
*
81
-
* var arr = ndarray2array( y );
82
-
* // returns [ -1.0, 1.0, -2.0 ]
78
+
* // returns <ndarray>[ -1.0, 1.0, -2.0 ]
83
79
*/
84
80
<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`.
85
81
@@ -92,16 +88,12 @@ interface Unary {
92
88
* @returns output ndarray
93
89
*
94
90
* @example
95
-
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
96
91
* var array = require( '@stdlib/ndarray/array' );
97
92
*
98
93
* var x = array( [ -1.0, 2.0, -3.0 ] );
99
94
*
100
95
* var y = cusum( x, 10.0 );
101
-
* // returns <ndarray>
102
-
*
103
-
* var arr = ndarray2array( y );
104
-
* // returns [ 9.0, 11.0, 8.0 ]
96
+
* // returns <ndarray>[ 9.0, 11.0, 8.0 ]
105
97
*/
106
98
<T=unknown,U=unknown>(x: InputArray<T>,initial: InitialValue<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`. In principle, as well, based on the policy, it is possible to know more exactly which `InputArray` types are actually allowed.
107
99
@@ -114,21 +106,17 @@ interface Unary {
114
106
* @returns output ndarray
115
107
*
116
108
* @example
117
-
* var ndarray2array = require( '@stdlib/ndarray/to-array' );
118
109
* var zerosLike = require( '@stdlib/ndarray/zeros-like' );
0 commit comments