@stdlib/math-tools-unary 0.1.0 → 0.2.1
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 +6 -3
- package/SECURITY.md +5 -0
- package/dist/index.js +1 -1
- package/docs/types/index.d.ts +16 -16
- package/package.json +26 -50
- package/CITATION.cff +0 -30
package/NOTICE
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Copyright (c) 2016-
|
|
1
|
+
Copyright (c) 2016-2024 The Stdlib Authors.
|
package/README.md
CHANGED
|
@@ -369,7 +369,7 @@ See [LICENSE][stdlib-license].
|
|
|
369
369
|
|
|
370
370
|
## Copyright
|
|
371
371
|
|
|
372
|
-
Copyright © 2016-
|
|
372
|
+
Copyright © 2016-2024. The Stdlib [Authors][stdlib-authors].
|
|
373
373
|
|
|
374
374
|
</section>
|
|
375
375
|
|
|
@@ -382,8 +382,8 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
382
382
|
[npm-image]: http://img.shields.io/npm/v/@stdlib/math-tools-unary.svg
|
|
383
383
|
[npm-url]: https://npmjs.org/package/@stdlib/math-tools-unary
|
|
384
384
|
|
|
385
|
-
[test-image]: https://github.com/stdlib-js/math-tools-unary/actions/workflows/test.yml/badge.svg?branch=v0.1
|
|
386
|
-
[test-url]: https://github.com/stdlib-js/math-tools-unary/actions/workflows/test.yml?query=branch:v0.1
|
|
385
|
+
[test-image]: https://github.com/stdlib-js/math-tools-unary/actions/workflows/test.yml/badge.svg?branch=v0.2.1
|
|
386
|
+
[test-url]: https://github.com/stdlib-js/math-tools-unary/actions/workflows/test.yml?query=branch:v0.2.1
|
|
387
387
|
|
|
388
388
|
[coverage-image]: https://img.shields.io/codecov/c/github/stdlib-js/math-tools-unary/main.svg
|
|
389
389
|
[coverage-url]: https://codecov.io/github/stdlib-js/math-tools-unary?branch=main
|
|
@@ -406,8 +406,11 @@ Copyright © 2016-2023. The Stdlib [Authors][stdlib-authors].
|
|
|
406
406
|
[es-module]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules
|
|
407
407
|
|
|
408
408
|
[deno-url]: https://github.com/stdlib-js/math-tools-unary/tree/deno
|
|
409
|
+
[deno-readme]: https://github.com/stdlib-js/math-tools-unary/blob/deno/README.md
|
|
409
410
|
[umd-url]: https://github.com/stdlib-js/math-tools-unary/tree/umd
|
|
411
|
+
[umd-readme]: https://github.com/stdlib-js/math-tools-unary/blob/umd/README.md
|
|
410
412
|
[esm-url]: https://github.com/stdlib-js/math-tools-unary/tree/esm
|
|
413
|
+
[esm-readme]: https://github.com/stdlib-js/math-tools-unary/blob/esm/README.md
|
|
411
414
|
[branches-url]: https://github.com/stdlib-js/math-tools-unary/blob/main/branches.md
|
|
412
415
|
|
|
413
416
|
[stdlib-license]: https://raw.githubusercontent.com/stdlib-js/math-tools-unary/main/LICENSE
|
package/SECURITY.md
ADDED
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ var nr=require('@stdlib/assert-is-plain-object/dist'),tr=require('@stdlib/assert
|
|
|
9
9
|
});var L=v(function(zr,S){
|
|
10
10
|
var sr=require('@stdlib/assert-is-plain-object/dist'),C=require('@stdlib/assert-has-own-property/dist'),I=require('@stdlib/assert-contains/dist'),pr=require('@stdlib/ndarray-orders/dist'),vr=require('@stdlib/ndarray-dtypes/dist'),c=require('@stdlib/error-tools-fmtprodmsg/dist'),dr=pr(),fr=vr();function cr(r,e){return sr(e)?C(e,"dtype")&&(r.dtype=e.dtype,!I(fr,r.dtype))?new TypeError(c('0gz4X',"dtype",r.dtype)):C(e,"order")&&(r.order=e.order,!I(dr,r.order))?new TypeError(c('0gz4X',"order",r.order)):null:new TypeError(c('0gz2V',e));}S.exports=cr
|
|
11
11
|
});var Y=v(function(Cr,U){
|
|
12
|
-
var mr=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),D=require('@stdlib/assert-is-number/dist').isPrimitive,M=require('@stdlib/assert-is-complex-like/dist'),m=require('@stdlib/assert-is-ndarray-like/dist'),g=require('@stdlib/assert-is-collection/dist'),y=require('@stdlib/ndarray-base-buffer-dtype/dist'),gr=require('@stdlib/ndarray-base-buffer/dist'),N=require('@stdlib/ndarray-base-broadcast-array/dist'),F=require('@stdlib/error-tools-fmtprodmsg/dist'),yr=b(),K=T(),hr=O(),qr=_(),wr=z(),br=L();function Er(r,e){var u,n,t,i;if(i={number:null,complex:null,array:null,ndarray:null},n=qr(i,r),n||(u={policy:hr.output_dtype_policy},arguments.length>1&&(n=wr(u,e),n)))throw n;return t=d,mr(t,"assign",A),t;function d(a){var o,s,l,p,f;if(D(a)){if(i.number)return i.number(a);throw new TypeError(
|
|
12
|
+
var mr=require('@stdlib/utils-define-nonenumerable-read-only-property/dist'),D=require('@stdlib/assert-is-number/dist').isPrimitive,M=require('@stdlib/assert-is-complex-like/dist'),m=require('@stdlib/assert-is-ndarray-like/dist'),g=require('@stdlib/assert-is-collection/dist'),y=require('@stdlib/ndarray-base-buffer-dtype/dist'),gr=require('@stdlib/ndarray-base-buffer/dist'),N=require('@stdlib/ndarray-base-broadcast-array/dist'),F=require('@stdlib/error-tools-fmtprodmsg/dist'),yr=b(),K=T(),hr=O(),qr=_(),wr=z(),br=L();function Er(r,e){var u,n,t,i;if(i={number:null,complex:null,array:null,ndarray:null},n=qr(i,r),n||(u={policy:hr.output_dtype_policy},arguments.length>1&&(n=wr(u,e),n)))throw n;return t=d,mr(t,"assign",A),t;function d(a){var o,s,l,p,f;if(D(a)){if(i.number)return i.number(a);throw new TypeError(F('0gz0O'))}if(M(a)){if(i.complex)return i.complex(a);throw new TypeError(F('0gz0P'))}if(l={},arguments.length>1&&(p=br(l,arguments[1]),p))throw p;if(m(a)){if(i.ndarray===null)throw new TypeError(F('0gz0Q'));return s=l.dtype||K(a.dtype,u.policy),yr(i.ndarray,a,s,l.order||a.order)}if(g(a)){if(i.array===null)throw new TypeError(F('0gz0R'));return o=y(a)||"generic",s=l.dtype||K(o,u.policy),f=gr(s,a.length),i.array(a.length,o,a,1,s,f,1),f}throw new TypeError(F('0gz4V',a))}function A(a,o){var s,l,p;if(m(a)){if(m(o)){if(s=a.shape,l=o.shape,s.length===l.length){for(p=0;p<s.length;p++)if(s[p]!==l[p]){a=N(a,l);break}}else a=N(a,l);return i.ndarray(a,o),o}throw new TypeError(F('0gz0S'))}if(g(a)){if(g(o)){if(o.length!==a.length)throw new RangeError(F('0gz0T'));return i.array(a.length,y(a)||"generic",a,1,y(o)||"generic",o,1),o}throw new TypeError(F('0gz0U'))}throw D(a)?new TypeError(F('0gz0V')):M(a)?new TypeError(F('0gz0W')):new TypeError(F('0gz4V',a))}}U.exports=Er
|
|
13
13
|
});var Tr=Y();module.exports=Tr;
|
|
14
14
|
/** @license Apache-2.0 */
|
|
15
15
|
//# sourceMappingURL=index.js.map
|
package/docs/types/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ type ScalarFunction = ( x: number ) => number; // FIXME: add complex number supp
|
|
|
41
41
|
* @param strideY - `y` stride length
|
|
42
42
|
* @returns `y` or `undefined`
|
|
43
43
|
*/
|
|
44
|
-
type StridedArrayFunction = ( N: number, x: ArrayLike<number>, strideX: number, y: ArrayLike<number>, strideY: number ) => ArrayLike<number> | void;
|
|
44
|
+
type StridedArrayFunction = ( N: number, x: ArrayLike<number>, strideX: number, y: ArrayLike<number>, strideY: number ) => ArrayLike<number> | void;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* Function which operates on each element in a strided input array `x` and assigns the results to elements in a strided output array `y` using alternative (i.e., ndarray) indexing semantics.
|
|
@@ -55,7 +55,7 @@ type StridedArrayFunction = ( N: number, x: ArrayLike<number>, strideX: number,
|
|
|
55
55
|
* @param offsetY - starting index for `y`
|
|
56
56
|
* @returns `y` or `undefined`
|
|
57
57
|
*/
|
|
58
|
-
type StridedArrayFunctionWithOffsets = ( N: number, x: ArrayLike<number>, strideX: number, offsetX: number, y: ArrayLike<number>, strideY: number, offsetY: number ) => ArrayLike<number> | void;
|
|
58
|
+
type StridedArrayFunctionWithOffsets = ( N: number, x: ArrayLike<number>, strideX: number, offsetX: number, y: ArrayLike<number>, strideY: number, offsetY: number ) => ArrayLike<number> | void;
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Interface describing a resolution table object.
|
|
@@ -112,7 +112,7 @@ interface DispatchFunction {
|
|
|
112
112
|
* @returns return value
|
|
113
113
|
*
|
|
114
114
|
* @example
|
|
115
|
-
* var nabs = require(
|
|
115
|
+
* var nabs = require( '@stdlib/math-base-special-abs' );
|
|
116
116
|
*
|
|
117
117
|
* var table = {
|
|
118
118
|
* 'scalar': [
|
|
@@ -134,10 +134,10 @@ interface DispatchFunction {
|
|
|
134
134
|
* @returns return value
|
|
135
135
|
*
|
|
136
136
|
* @example
|
|
137
|
-
* var dabs = require(
|
|
138
|
-
* var sabs = require(
|
|
139
|
-
* var gabs = require(
|
|
140
|
-
* var array = require(
|
|
137
|
+
* var dabs = require( '@stdlib/math-strided-special-dabs' );
|
|
138
|
+
* var sabs = require( '@stdlib/math-strided-special-sabs' );
|
|
139
|
+
* var gabs = require( '@stdlib/math-strided-special-abs' );
|
|
140
|
+
* var array = require( '@stdlib/ndarray-array' );
|
|
141
141
|
*
|
|
142
142
|
* var table = {
|
|
143
143
|
* 'ndarray': [
|
|
@@ -165,10 +165,10 @@ interface DispatchFunction {
|
|
|
165
165
|
* @returns return value
|
|
166
166
|
*
|
|
167
167
|
* @example
|
|
168
|
-
* var dabs = require(
|
|
169
|
-
* var sabs = require(
|
|
170
|
-
* var gabs = require(
|
|
171
|
-
* var Float64Array = require(
|
|
168
|
+
* var dabs = require( '@stdlib/math-strided-special-dabs' );
|
|
169
|
+
* var sabs = require( '@stdlib/math-strided-special-sabs' );
|
|
170
|
+
* var gabs = require( '@stdlib/math-strided-special-abs' );
|
|
171
|
+
* var Float64Array = require( '@stdlib/array-float64' );
|
|
172
172
|
*
|
|
173
173
|
* var table = {
|
|
174
174
|
* 'array': [
|
|
@@ -197,11 +197,11 @@ interface DispatchFunction {
|
|
|
197
197
|
* @returns dispatch function
|
|
198
198
|
*
|
|
199
199
|
* @example
|
|
200
|
-
* var nabs = require(
|
|
201
|
-
* var dabs = require(
|
|
202
|
-
* var sabs = require(
|
|
203
|
-
* var gabs = require(
|
|
204
|
-
* var Float64Array = require(
|
|
200
|
+
* var nabs = require( '@stdlib/math-base-special-abs' );
|
|
201
|
+
* var dabs = require( '@stdlib/math-strided-special-dabs' );
|
|
202
|
+
* var sabs = require( '@stdlib/math-strided-special-sabs' );
|
|
203
|
+
* var gabs = require( '@stdlib/math-strided-special-abs' );
|
|
204
|
+
* var Float64Array = require( '@stdlib/array-float64' );
|
|
205
205
|
*
|
|
206
206
|
* var table = {
|
|
207
207
|
* 'scalar': [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stdlib/math-tools-unary",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Multiple dispatch for unary mathematical functions.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": {
|
|
@@ -15,19 +15,12 @@
|
|
|
15
15
|
],
|
|
16
16
|
"main": "./lib",
|
|
17
17
|
"directories": {
|
|
18
|
-
"benchmark": "./benchmark",
|
|
19
18
|
"doc": "./docs",
|
|
20
|
-
"example": "./examples",
|
|
21
19
|
"lib": "./lib",
|
|
22
|
-
"
|
|
20
|
+
"dist": "./dist"
|
|
23
21
|
},
|
|
24
22
|
"types": "./docs/types",
|
|
25
|
-
"scripts": {
|
|
26
|
-
"test": "make test",
|
|
27
|
-
"test-cov": "make test-cov",
|
|
28
|
-
"examples": "make examples",
|
|
29
|
-
"benchmark": "make benchmark"
|
|
30
|
-
},
|
|
23
|
+
"scripts": {},
|
|
31
24
|
"homepage": "https://stdlib.io",
|
|
32
25
|
"repository": {
|
|
33
26
|
"type": "git",
|
|
@@ -37,47 +30,30 @@
|
|
|
37
30
|
"url": "https://github.com/stdlib-js/stdlib/issues"
|
|
38
31
|
},
|
|
39
32
|
"dependencies": {
|
|
40
|
-
"@stdlib/array-base-copy-indexed": "^0.1
|
|
41
|
-
"@stdlib/assert-contains": "^0.1
|
|
42
|
-
"@stdlib/assert-has-own-property": "^0.1
|
|
43
|
-
"@stdlib/assert-is-collection": "^0.1
|
|
44
|
-
"@stdlib/assert-is-complex-like": "^0.1
|
|
45
|
-
"@stdlib/assert-is-function": "^0.1
|
|
46
|
-
"@stdlib/assert-is-ndarray-like": "^0.1
|
|
47
|
-
"@stdlib/assert-is-null": "^0.1
|
|
48
|
-
"@stdlib/assert-is-number": "^0.1
|
|
49
|
-
"@stdlib/assert-is-plain-object": "^0.1
|
|
50
|
-
"@stdlib/ndarray-base-broadcast-array": "^0.1
|
|
51
|
-
"@stdlib/ndarray-base-buffer": "^0.1
|
|
52
|
-
"@stdlib/ndarray-base-buffer-dtype": "^0.1
|
|
53
|
-
"@stdlib/ndarray-base-numel": "^0.1
|
|
54
|
-
"@stdlib/ndarray-base-shape2strides": "^0.1
|
|
55
|
-
"@stdlib/ndarray-ctor": "^0.1
|
|
56
|
-
"@stdlib/ndarray-dtypes": "^0.1
|
|
57
|
-
"@stdlib/ndarray-orders": "^0.1
|
|
58
|
-
"@stdlib/string-format": "^0.1
|
|
59
|
-
"@stdlib/
|
|
60
|
-
"@stdlib/utils-
|
|
61
|
-
"@stdlib/
|
|
62
|
-
"@stdlib/error-tools-fmtprodmsg": "^0.1.0"
|
|
63
|
-
},
|
|
64
|
-
"devDependencies": {
|
|
65
|
-
"@stdlib/array-float32": "^0.1.0",
|
|
66
|
-
"@stdlib/array-float64": "^0.1.0",
|
|
67
|
-
"@stdlib/bench": "^0.1.0",
|
|
68
|
-
"@stdlib/math-base-assert-is-nan": "^0.1.0",
|
|
69
|
-
"@stdlib/math-base-special-abs": "^0.1.0",
|
|
70
|
-
"@stdlib/math-base-special-pow": "^0.1.0",
|
|
71
|
-
"@stdlib/math-strided-special-abs": "^0.1.0",
|
|
72
|
-
"@stdlib/ndarray-array": "^0.0.9",
|
|
73
|
-
"@stdlib/ndarray-base-unary": "^0.1.0",
|
|
74
|
-
"@stdlib/ndarray-dispatch": "^0.1.0",
|
|
75
|
-
"@stdlib/ndarray-ind2sub": "^0.1.0",
|
|
76
|
-
"@stdlib/random-base-uniform": "^0.0.6",
|
|
77
|
-
"tape": "git+https://github.com/kgryte/tape.git#fix/globby",
|
|
78
|
-
"istanbul": "^0.4.1",
|
|
79
|
-
"tap-min": "git+https://github.com/Planeshifter/tap-min.git"
|
|
33
|
+
"@stdlib/array-base-copy-indexed": "^0.2.1",
|
|
34
|
+
"@stdlib/assert-contains": "^0.2.1",
|
|
35
|
+
"@stdlib/assert-has-own-property": "^0.2.1",
|
|
36
|
+
"@stdlib/assert-is-collection": "^0.2.1",
|
|
37
|
+
"@stdlib/assert-is-complex-like": "^0.2.1",
|
|
38
|
+
"@stdlib/assert-is-function": "^0.2.1",
|
|
39
|
+
"@stdlib/assert-is-ndarray-like": "^0.2.1",
|
|
40
|
+
"@stdlib/assert-is-null": "^0.2.1",
|
|
41
|
+
"@stdlib/assert-is-number": "^0.2.1",
|
|
42
|
+
"@stdlib/assert-is-plain-object": "^0.2.1",
|
|
43
|
+
"@stdlib/ndarray-base-broadcast-array": "^0.2.1",
|
|
44
|
+
"@stdlib/ndarray-base-buffer": "^0.2.1",
|
|
45
|
+
"@stdlib/ndarray-base-buffer-dtype": "^0.2.1",
|
|
46
|
+
"@stdlib/ndarray-base-numel": "^0.2.1",
|
|
47
|
+
"@stdlib/ndarray-base-shape2strides": "^0.2.1",
|
|
48
|
+
"@stdlib/ndarray-ctor": "^0.2.1",
|
|
49
|
+
"@stdlib/ndarray-dtypes": "^0.2.1",
|
|
50
|
+
"@stdlib/ndarray-orders": "^0.2.1",
|
|
51
|
+
"@stdlib/string-format": "^0.2.1",
|
|
52
|
+
"@stdlib/utils-define-nonenumerable-read-only-property": "^0.2.1",
|
|
53
|
+
"@stdlib/utils-keys": "^0.2.1",
|
|
54
|
+
"@stdlib/error-tools-fmtprodmsg": "^0.2.1"
|
|
80
55
|
},
|
|
56
|
+
"devDependencies": {},
|
|
81
57
|
"engines": {
|
|
82
58
|
"node": ">=0.10.0",
|
|
83
59
|
"npm": ">2.7.0"
|
package/CITATION.cff
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
cff-version: 1.2.0
|
|
2
|
-
title: stdlib
|
|
3
|
-
message: >-
|
|
4
|
-
If you use this software, please cite it using the
|
|
5
|
-
metadata from this file.
|
|
6
|
-
|
|
7
|
-
type: software
|
|
8
|
-
|
|
9
|
-
authors:
|
|
10
|
-
- name: The Stdlib Authors
|
|
11
|
-
url: https://github.com/stdlib-js/stdlib/graphs/contributors
|
|
12
|
-
|
|
13
|
-
repository-code: https://github.com/stdlib-js/stdlib
|
|
14
|
-
url: https://stdlib.io
|
|
15
|
-
|
|
16
|
-
abstract: |
|
|
17
|
-
Standard library for JavaScript and Node.js.
|
|
18
|
-
|
|
19
|
-
keywords:
|
|
20
|
-
- JavaScript
|
|
21
|
-
- Node.js
|
|
22
|
-
- TypeScript
|
|
23
|
-
- standard library
|
|
24
|
-
- scientific computing
|
|
25
|
-
- numerical computing
|
|
26
|
-
- statistical computing
|
|
27
|
-
|
|
28
|
-
license: Apache-2.0 AND BSL-1.0
|
|
29
|
-
|
|
30
|
-
date-released: 2016
|