@stdlib/stats-base-cumaxabs 0.0.2 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +1 -1
- package/README.md +54 -20
- package/package.json +2 -2
- package/CHANGELOG.md +0 -5
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2022 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ limitations under the License.
|
|
|
20
20
|
|
|
21
21
|
# cumaxabs
|
|
22
22
|
|
|
23
|
-
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] [![dependencies][dependencies-image]][dependencies-url]
|
|
23
|
+
[![NPM version][npm-image]][npm-url] [![Build Status][test-image]][test-url] [![Coverage Status][coverage-image]][coverage-url] <!-- [![dependencies][dependencies-image]][dependencies-url] -->
|
|
24
24
|
|
|
25
25
|
> Calculate the cumulative maximum absolute value of a strided array.
|
|
26
26
|
|
|
@@ -71,14 +71,10 @@ The function has the following parameters:
|
|
|
71
71
|
The `N` and `stride` parameters determine which elements in `x` and `y` are accessed at runtime. For example, to compute the cumulative maximum absolute value of every other element in `x`,
|
|
72
72
|
|
|
73
73
|
```javascript
|
|
74
|
-
var floor = require( '@stdlib/math-base-special-floor' );
|
|
75
|
-
|
|
76
74
|
var x = [ 1.0, 2.0, 2.0, -7.0, -2.0, 3.0, 4.0, 2.0 ];
|
|
77
75
|
var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
|
|
78
76
|
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
var v = cumaxabs( N, x, 2, y, 1 );
|
|
77
|
+
var v = cumaxabs( 4, x, 2, y, 1 );
|
|
82
78
|
// y => [ 1.0, 2.0, 2.0, 4.0, 0.0, 0.0, 0.0, 0.0 ]
|
|
83
79
|
```
|
|
84
80
|
|
|
@@ -88,7 +84,6 @@ Note that indexing is relative to the first index. To introduce an offset, use [
|
|
|
88
84
|
|
|
89
85
|
```javascript
|
|
90
86
|
var Float64Array = require( '@stdlib/array-float64' );
|
|
91
|
-
var floor = require( '@stdlib/math-base-special-floor' );
|
|
92
87
|
|
|
93
88
|
// Initial arrays...
|
|
94
89
|
var x0 = new Float64Array( [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ] );
|
|
@@ -98,10 +93,8 @@ var y0 = new Float64Array( x0.length );
|
|
|
98
93
|
var x1 = new Float64Array( x0.buffer, x0.BYTES_PER_ELEMENT*1 ); // start at 2nd element
|
|
99
94
|
var y1 = new Float64Array( y0.buffer, y0.BYTES_PER_ELEMENT*3 ); // start at 4th element
|
|
100
95
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
cumaxabs( N, x1, -2, y1, 1 );
|
|
104
|
-
// y0 => <Float64Array>[ 0.0, 0.0, 0.0, 0.0, 4.0, 4.0, 4.0, 4.0 ]
|
|
96
|
+
cumaxabs( 4, x1, -2, y1, 1 );
|
|
97
|
+
// y0 => <Float64Array>[ 0.0, 0.0, 0.0, 4.0, 4.0, 4.0, 4.0, 0.0 ]
|
|
105
98
|
```
|
|
106
99
|
|
|
107
100
|
#### cumaxabs.ndarray( N, x, strideX, offsetX, y, strideY, offsetY )
|
|
@@ -124,14 +117,10 @@ The function has the following additional parameters:
|
|
|
124
117
|
While [`typed array`][mdn-typed-array] views mandate a view offset based on the underlying `buffer`, `offsetX` and `offsetY` parameters support indexing semantics based on a starting indices. For example, to calculate the cumulative maximum absolute value of every other value in `x` starting from the second value and to store in the last `N` elements of `y` starting from the last element
|
|
125
118
|
|
|
126
119
|
```javascript
|
|
127
|
-
var floor = require( '@stdlib/math-base-special-floor' );
|
|
128
|
-
|
|
129
120
|
var x = [ 2.0, 1.0, 2.0, -2.0, -2.0, 2.0, 3.0, 4.0 ];
|
|
130
121
|
var y = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 ];
|
|
131
122
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
cumaxabs.ndarray( N, x, 2, 1, y, -1, y.length-1 );
|
|
123
|
+
cumaxabs.ndarray( 4, x, 2, 1, y, -1, y.length-1 );
|
|
135
124
|
// y => [ 0.0, 0.0, 0.0, 0.0, 4.0, 2.0, 2.0, 1.0 ]
|
|
136
125
|
```
|
|
137
126
|
|
|
@@ -188,6 +177,25 @@ console.log( y );
|
|
|
188
177
|
|
|
189
178
|
<!-- /.references -->
|
|
190
179
|
|
|
180
|
+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
|
|
181
|
+
|
|
182
|
+
<section class="related">
|
|
183
|
+
|
|
184
|
+
* * *
|
|
185
|
+
|
|
186
|
+
## See Also
|
|
187
|
+
|
|
188
|
+
- <span class="package-name">[`@stdlib/stats/base/cumax`][@stdlib/stats/base/cumax]</span><span class="delimiter">: </span><span class="description">calculate the cumulative maximum of a strided array.</span>
|
|
189
|
+
- <span class="package-name">[`@stdlib/stats/base/cuminabs`][@stdlib/stats/base/cuminabs]</span><span class="delimiter">: </span><span class="description">calculate the cumulative minimum absolute value of a strided array.</span>
|
|
190
|
+
- <span class="package-name">[`@stdlib/stats/base/dcumaxabs`][@stdlib/stats/base/dcumaxabs]</span><span class="delimiter">: </span><span class="description">calculate the cumulative maximum absolute value of double-precision floating-point strided array elements.</span>
|
|
191
|
+
- <span class="package-name">[`@stdlib/stats/base/scumaxabs`][@stdlib/stats/base/scumaxabs]</span><span class="delimiter">: </span><span class="description">calculate the cumulative maximum absolute value of single-precision floating-point strided array elements.</span>
|
|
192
|
+
|
|
193
|
+
</section>
|
|
194
|
+
|
|
195
|
+
<!-- /.related -->
|
|
196
|
+
|
|
197
|
+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
198
|
+
|
|
191
199
|
|
|
192
200
|
<section class="main-repo" >
|
|
193
201
|
|
|
@@ -199,6 +207,10 @@ This package is part of [stdlib][stdlib], a standard library for JavaScript and
|
|
|
199
207
|
|
|
200
208
|
For more information on the project, filing bug reports and feature requests, and guidance on how to develop [stdlib][stdlib], see the main project [repository][stdlib].
|
|
201
209
|
|
|
210
|
+
#### Community
|
|
211
|
+
|
|
212
|
+
[![Chat][chat-image]][chat-url]
|
|
213
|
+
|
|
202
214
|
---
|
|
203
215
|
|
|
204
216
|
## License
|
|
@@ -208,7 +220,7 @@ See [LICENSE][stdlib-license].
|
|
|
208
220
|
|
|
209
221
|
## Copyright
|
|
210
222
|
|
|
211
|
-
Copyright © 2016-
|
|
223
|
+
Copyright © 2016-2022. The Stdlib [Authors][stdlib-authors].
|
|
212
224
|
|
|
213
225
|
</section>
|
|
214
226
|
|
|
@@ -227,9 +239,23 @@ Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors].
|
|
|
227
239
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/stats-base-cumaxabs/main.svg
|
|
228
240
|
[coverage-url]: https://codecov.io/github/stdlib-js/stats-base-cumaxabs?branch=main
|
|
229
241
|
|
|
230
|
-
|
|
242
|
+
<!--
|
|
243
|
+
|
|
244
|
+
[dependencies-image]: https://img.shields.io/david/stdlib-js/stats-base-cumaxabs.svg
|
|
231
245
|
[dependencies-url]: https://david-dm.org/stdlib-js/stats-base-cumaxabs/main
|
|
232
246
|
|
|
247
|
+
-->
|
|
248
|
+
|
|
249
|
+
[umd]: https://github.com/umdjs/umd
|
|
250
|
+
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
251
|
+
|
|
252
|
+
[deno-url]: https://github.com/stdlib-js/stats-base-cumaxabs/tree/deno
|
|
253
|
+
[umd-url]: https://github.com/stdlib-js/stats-base-cumaxabs/tree/umd
|
|
254
|
+
[esm-url]: https://github.com/stdlib-js/stats-base-cumaxabs/tree/esm
|
|
255
|
+
|
|
256
|
+
[chat-image]: https://img.shields.io/gitter/room/stdlib-js/stdlib.svg
|
|
257
|
+
[chat-url]: https://gitter.im/stdlib-js/stdlib/
|
|
258
|
+
|
|
233
259
|
[stdlib]: https://github.com/stdlib-js/stdlib
|
|
234
260
|
|
|
235
261
|
[stdlib-authors]: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
@@ -240,9 +266,17 @@ Copyright © 2016-2021. The Stdlib [Authors][stdlib-authors].
|
|
|
240
266
|
|
|
241
267
|
[mdn-typed-array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
|
|
242
268
|
|
|
243
|
-
|
|
269
|
+
<!-- <related-links> -->
|
|
270
|
+
|
|
271
|
+
[@stdlib/stats/base/cumax]: https://www.npmjs.com/package/@stdlib/stats-base-cumax
|
|
272
|
+
|
|
273
|
+
[@stdlib/stats/base/cuminabs]: https://www.npmjs.com/package/@stdlib/stats-base-cuminabs
|
|
274
|
+
|
|
275
|
+
[@stdlib/stats/base/dcumaxabs]: https://www.npmjs.com/package/@stdlib/stats-base-dcumaxabs
|
|
276
|
+
|
|
277
|
+
[@stdlib/stats/base/scumaxabs]: https://www.npmjs.com/package/@stdlib/stats-base-scumaxabs
|
|
244
278
|
|
|
245
|
-
|
|
279
|
+
<!-- </related-links> -->
|
|
246
280
|
|
|
247
281
|
</section>
|
|
248
282
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/stats-base-cumaxabs",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Calculate the cumulative maximum absolute value of a strided array.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"examples": "make examples",
|
|
29
29
|
"benchmark": "make benchmark"
|
|
30
30
|
},
|
|
31
|
-
"homepage": "https://
|
|
31
|
+
"homepage": "https://stdlib.io",
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
34
34
|
"url": "git://github.com/stdlib-js/stats-base-cumaxabs.git"
|