@ohos-ports/stdlib-complex 0.0.0-stage → 0.4.1-beta.0
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/LICENSE +177 -0
- package/NOTICE +1 -0
- package/README.md +222 -2
- package/SECURITY.md +5 -0
- package/base/README.md +114 -0
- package/base/assert/README.md +108 -0
- package/base/assert/docs/types/index.d.ts +94 -0
- package/base/assert/docs/types/test.ts +29 -0
- package/base/assert/is-almost-equal/README.md +159 -0
- package/base/assert/is-almost-equal/docs/repl.txt +45 -0
- package/base/assert/is-almost-equal/docs/types/index.d.ts +56 -0
- package/base/assert/is-almost-equal/docs/types/test.ts +83 -0
- package/base/assert/is-almost-equal/lib/index.js +48 -0
- package/base/assert/is-almost-equal/lib/main.js +89 -0
- package/base/assert/is-almost-equal/package.json +73 -0
- package/base/assert/is-almost-same-value/README.md +159 -0
- package/base/assert/is-almost-same-value/docs/repl.txt +41 -0
- package/base/assert/is-almost-same-value/docs/types/index.d.ts +55 -0
- package/base/assert/is-almost-same-value/docs/types/test.ts +83 -0
- package/base/assert/is-almost-same-value/lib/index.js +48 -0
- package/base/assert/is-almost-same-value/lib/main.js +91 -0
- package/base/assert/is-almost-same-value/package.json +73 -0
- package/base/assert/lib/index.js +60 -0
- package/base/assert/package.json +62 -0
- package/base/cast-return/README.md +128 -0
- package/base/cast-return/docs/repl.txt +41 -0
- package/base/cast-return/docs/types/index.d.ts +378 -0
- package/base/cast-return/docs/types/test.ts +192 -0
- package/base/cast-return/lib/index.js +46 -0
- package/base/cast-return/lib/main.js +204 -0
- package/base/cast-return/package.json +65 -0
- package/base/docs/types/index.d.ts +130 -0
- package/base/docs/types/test.ts +29 -0
- package/base/lib/index.js +78 -0
- package/base/package.json +61 -0
- package/base/parse/README.md +137 -0
- package/base/parse/docs/repl.txt +21 -0
- package/base/parse/docs/types/index.d.ts +42 -0
- package/base/parse/docs/types/test.ts +34 -0
- package/base/parse/lib/index.js +42 -0
- package/base/parse/lib/main.js +124 -0
- package/base/parse/package.json +71 -0
- package/base/wrap-function/README.md +128 -0
- package/base/wrap-function/docs/repl.txt +43 -0
- package/base/wrap-function/docs/types/index.d.ts +417 -0
- package/base/wrap-function/docs/types/test.ts +629 -0
- package/base/wrap-function/lib/index.js +46 -0
- package/base/wrap-function/lib/main.js +225 -0
- package/base/wrap-function/package.json +63 -0
- package/cmplx/README.md +137 -0
- package/cmplx/docs/repl.txt +35 -0
- package/cmplx/docs/types/index.d.ts +44 -0
- package/cmplx/docs/types/test.ts +66 -0
- package/cmplx/lib/index.js +40 -0
- package/cmplx/lib/main.js +66 -0
- package/cmplx/package.json +63 -0
- package/ctors/README.md +136 -0
- package/ctors/docs/repl.txt +29 -0
- package/ctors/docs/types/index.d.ts +67 -0
- package/ctors/docs/types/test.ts +35 -0
- package/ctors/lib/ctors.js +38 -0
- package/ctors/lib/index.js +43 -0
- package/ctors/lib/main.js +49 -0
- package/ctors/package.json +72 -0
- package/docs/types/index.d.ts +151 -0
- package/dtype/README.md +142 -0
- package/dtype/docs/repl.txt +28 -0
- package/dtype/docs/types/index.d.ts +82 -0
- package/dtype/docs/types/test.ts +36 -0
- package/dtype/lib/ctor2dtype.js +32 -0
- package/dtype/lib/ctors.js +38 -0
- package/dtype/lib/dtypes.js +33 -0
- package/dtype/lib/index.js +49 -0
- package/dtype/lib/main.js +65 -0
- package/dtype/package.json +67 -0
- package/dtypes/README.md +142 -0
- package/dtypes/docs/repl.txt +22 -0
- package/dtypes/docs/types/index.d.ts +39 -0
- package/dtypes/docs/types/test.ts +33 -0
- package/dtypes/lib/dtypes.json +4 -0
- package/dtypes/lib/index.js +40 -0
- package/dtypes/lib/main.js +44 -0
- package/dtypes/package.json +68 -0
- package/float32/README.md +137 -0
- package/float32/base/README.md +140 -0
- package/float32/base/add/README.md +279 -0
- package/float32/base/add/docs/repl.txt +118 -0
- package/float32/base/add/docs/types/index.d.ts +136 -0
- package/float32/base/add/docs/types/test.ts +356 -0
- package/float32/base/add/include/stdlib/complex/float32/base/add.h +40 -0
- package/float32/base/add/lib/assign.js +55 -0
- package/float32/base/add/lib/index.js +54 -0
- package/float32/base/add/lib/main.js +55 -0
- package/float32/base/add/lib/native.js +53 -0
- package/float32/base/add/lib/strided.js +60 -0
- package/float32/base/add/manifest.json +75 -0
- package/float32/base/add/package.json +69 -0
- package/float32/base/add/src/addon.c +22 -0
- package/float32/base/add/src/main.c +60 -0
- package/float32/base/add3/README.md +275 -0
- package/float32/base/add3/docs/repl.txt +133 -0
- package/float32/base/add3/docs/types/index.d.ts +145 -0
- package/float32/base/add3/docs/types/test.ts +465 -0
- package/float32/base/add3/include/stdlib/complex/float32/base/add3.h +40 -0
- package/float32/base/add3/lib/assign.js +57 -0
- package/float32/base/add3/lib/index.js +54 -0
- package/float32/base/add3/lib/main.js +56 -0
- package/float32/base/add3/lib/native.js +54 -0
- package/float32/base/add3/lib/strided.js +64 -0
- package/float32/base/add3/manifest.json +75 -0
- package/float32/base/add3/package.json +69 -0
- package/float32/base/add3/src/addon.c +22 -0
- package/float32/base/add3/src/main.c +64 -0
- package/float32/base/assert/README.md +120 -0
- package/float32/base/assert/docs/types/index.d.ts +181 -0
- package/float32/base/assert/docs/types/test.ts +29 -0
- package/float32/base/assert/is-almost-equal/README.md +158 -0
- package/float32/base/assert/is-almost-equal/docs/repl.txt +45 -0
- package/float32/base/assert/is-almost-equal/docs/types/index.d.ts +56 -0
- package/float32/base/assert/is-almost-equal/docs/types/test.ts +83 -0
- package/float32/base/assert/is-almost-equal/lib/index.js +48 -0
- package/float32/base/assert/is-almost-equal/lib/main.js +67 -0
- package/float32/base/assert/is-almost-equal/package.json +73 -0
- package/float32/base/assert/is-almost-same-value/README.md +158 -0
- package/float32/base/assert/is-almost-same-value/docs/repl.txt +43 -0
- package/float32/base/assert/is-almost-same-value/docs/types/index.d.ts +55 -0
- package/float32/base/assert/is-almost-same-value/docs/types/test.ts +83 -0
- package/float32/base/assert/is-almost-same-value/lib/index.js +48 -0
- package/float32/base/assert/is-almost-same-value/lib/main.js +69 -0
- package/float32/base/assert/is-almost-same-value/package.json +74 -0
- package/float32/base/assert/is-equal/README.md +221 -0
- package/float32/base/assert/is-equal/docs/repl.txt +27 -0
- package/float32/base/assert/is-equal/docs/types/index.d.ts +46 -0
- package/float32/base/assert/is-equal/docs/types/test.ts +67 -0
- package/float32/base/assert/is-equal/include/stdlib/complex/float32/base/assert/is_equal.h +41 -0
- package/float32/base/assert/is-equal/lib/index.js +44 -0
- package/float32/base/assert/is-equal/lib/main.js +56 -0
- package/float32/base/assert/is-equal/manifest.json +59 -0
- package/float32/base/assert/is-equal/package.json +71 -0
- package/float32/base/assert/is-equal/src/main.c +48 -0
- package/float32/base/assert/is-not-equal/README.md +221 -0
- package/float32/base/assert/is-not-equal/docs/repl.txt +28 -0
- package/float32/base/assert/is-not-equal/docs/types/index.d.ts +46 -0
- package/float32/base/assert/is-not-equal/docs/types/test.ts +67 -0
- package/float32/base/assert/is-not-equal/include/stdlib/complex/float32/base/assert/is_not_equal.h +41 -0
- package/float32/base/assert/is-not-equal/lib/index.js +44 -0
- package/float32/base/assert/is-not-equal/lib/main.js +56 -0
- package/float32/base/assert/is-not-equal/manifest.json +59 -0
- package/float32/base/assert/is-not-equal/package.json +72 -0
- package/float32/base/assert/is-not-equal/src/main.c +48 -0
- package/float32/base/assert/is-same-value/README.md +245 -0
- package/float32/base/assert/is-same-value/docs/repl.txt +31 -0
- package/float32/base/assert/is-same-value/docs/types/index.d.ts +53 -0
- package/float32/base/assert/is-same-value/docs/types/test.ts +67 -0
- package/float32/base/assert/is-same-value/include/stdlib/complex/float32/base/assert/is_same_value.h +41 -0
- package/float32/base/assert/is-same-value/lib/index.js +44 -0
- package/float32/base/assert/is-same-value/lib/main.js +64 -0
- package/float32/base/assert/is-same-value/manifest.json +61 -0
- package/float32/base/assert/is-same-value/package.json +74 -0
- package/float32/base/assert/is-same-value/src/main.c +52 -0
- package/float32/base/assert/is-same-value-zero/README.md +247 -0
- package/float32/base/assert/is-same-value-zero/docs/repl.txt +31 -0
- package/float32/base/assert/is-same-value-zero/docs/types/index.d.ts +50 -0
- package/float32/base/assert/is-same-value-zero/docs/types/test.ts +67 -0
- package/float32/base/assert/is-same-value-zero/include/stdlib/complex/float32/base/assert/is_same_value_zero.h +41 -0
- package/float32/base/assert/is-same-value-zero/lib/index.js +44 -0
- package/float32/base/assert/is-same-value-zero/lib/main.js +62 -0
- package/float32/base/assert/is-same-value-zero/manifest.json +61 -0
- package/float32/base/assert/is-same-value-zero/package.json +74 -0
- package/float32/base/assert/is-same-value-zero/src/main.c +52 -0
- package/float32/base/assert/lib/index.js +96 -0
- package/float32/base/assert/package.json +63 -0
- package/float32/base/docs/types/index.d.ts +297 -0
- package/float32/base/docs/types/test.ts +29 -0
- package/float32/base/identity/README.md +233 -0
- package/float32/base/identity/docs/img/equation_identity_function.svg +18 -0
- package/float32/base/identity/docs/repl.txt +27 -0
- package/float32/base/identity/docs/types/index.d.ts +42 -0
- package/float32/base/identity/docs/types/test.ts +45 -0
- package/float32/base/identity/include/stdlib/complex/float32/base/identity.h +40 -0
- package/float32/base/identity/lib/index.js +41 -0
- package/float32/base/identity/lib/main.js +42 -0
- package/float32/base/identity/lib/native.js +50 -0
- package/float32/base/identity/manifest.json +75 -0
- package/float32/base/identity/package.json +68 -0
- package/float32/base/identity/src/addon.c +22 -0
- package/float32/base/identity/src/main.c +44 -0
- package/float32/base/lib/index.js +123 -0
- package/float32/base/mul/README.md +281 -0
- package/float32/base/mul/docs/repl.txt +120 -0
- package/float32/base/mul/docs/types/index.d.ts +138 -0
- package/float32/base/mul/docs/types/test.ts +356 -0
- package/float32/base/mul/include/stdlib/complex/float32/base/mul.h +40 -0
- package/float32/base/mul/lib/assign.js +55 -0
- package/float32/base/mul/lib/index.js +55 -0
- package/float32/base/mul/lib/main.js +60 -0
- package/float32/base/mul/lib/native.js +54 -0
- package/float32/base/mul/lib/strided.js +64 -0
- package/float32/base/mul/manifest.json +95 -0
- package/float32/base/mul/package.json +69 -0
- package/float32/base/mul/src/addon.c +22 -0
- package/float32/base/mul/src/main.c +61 -0
- package/float32/base/mul-add/README.md +286 -0
- package/float32/base/mul-add/docs/repl.txt +141 -0
- package/float32/base/mul-add/docs/types/index.d.ts +151 -0
- package/float32/base/mul-add/docs/types/test.ts +465 -0
- package/float32/base/mul-add/include/stdlib/complex/float32/base/mul_add.h +40 -0
- package/float32/base/mul-add/lib/assign.js +57 -0
- package/float32/base/mul-add/lib/index.js +56 -0
- package/float32/base/mul-add/lib/main.js +64 -0
- package/float32/base/mul-add/lib/native.js +56 -0
- package/float32/base/mul-add/lib/strided.js +70 -0
- package/float32/base/mul-add/manifest.json +75 -0
- package/float32/base/mul-add/package.json +70 -0
- package/float32/base/mul-add/src/addon.c +22 -0
- package/float32/base/mul-add/src/main.c +66 -0
- package/float32/base/neg/README.md +259 -0
- package/float32/base/neg/docs/repl.txt +28 -0
- package/float32/base/neg/docs/types/index.d.ts +60 -0
- package/float32/base/neg/docs/types/test.ts +51 -0
- package/float32/base/neg/include/stdlib/complex/float32/base/neg.h +40 -0
- package/float32/base/neg/lib/index.js +61 -0
- package/float32/base/neg/lib/main.js +67 -0
- package/float32/base/neg/lib/native.js +68 -0
- package/float32/base/neg/manifest.json +75 -0
- package/float32/base/neg/package.json +67 -0
- package/float32/base/neg/src/addon.c +22 -0
- package/float32/base/neg/src/main.c +50 -0
- package/float32/base/package.json +67 -0
- package/float32/base/scale/README.md +263 -0
- package/float32/base/scale/docs/repl.txt +110 -0
- package/float32/base/scale/docs/types/index.d.ts +131 -0
- package/float32/base/scale/docs/types/test.ts +296 -0
- package/float32/base/scale/include/stdlib/complex/float32/base/scale.h +40 -0
- package/float32/base/scale/lib/assign.js +54 -0
- package/float32/base/scale/lib/index.js +54 -0
- package/float32/base/scale/lib/main.js +53 -0
- package/float32/base/scale/lib/native.js +53 -0
- package/float32/base/scale/lib/strided.js +57 -0
- package/float32/base/scale/manifest.json +75 -0
- package/float32/base/scale/package.json +69 -0
- package/float32/base/scale/src/addon.c +22 -0
- package/float32/base/scale/src/main.c +51 -0
- package/float32/base/sub/README.md +225 -0
- package/float32/base/sub/docs/repl.txt +33 -0
- package/float32/base/sub/docs/types/index.d.ts +46 -0
- package/float32/base/sub/docs/types/test.ts +67 -0
- package/float32/base/sub/include/stdlib/complex/float32/base/sub.h +40 -0
- package/float32/base/sub/lib/index.js +44 -0
- package/float32/base/sub/lib/main.js +56 -0
- package/float32/base/sub/lib/native.js +54 -0
- package/float32/base/sub/manifest.json +75 -0
- package/float32/base/sub/package.json +72 -0
- package/float32/base/sub/src/addon.c +22 -0
- package/float32/base/sub/src/main.c +62 -0
- package/float32/conj/README.md +258 -0
- package/float32/conj/docs/repl.txt +27 -0
- package/float32/conj/docs/types/index.d.ts +42 -0
- package/float32/conj/docs/types/test.ts +45 -0
- package/float32/conj/include/stdlib/complex/float32/conj.h +40 -0
- package/float32/conj/lib/index.js +43 -0
- package/float32/conj/lib/main.js +42 -0
- package/float32/conj/manifest.json +75 -0
- package/float32/conj/package.json +64 -0
- package/float32/conj/src/main.c +49 -0
- package/float32/ctor/README.md +547 -0
- package/float32/ctor/docs/repl.txt +93 -0
- package/float32/ctor/docs/types/index.d.ts +120 -0
- package/float32/ctor/docs/types/test.ts +59 -0
- package/float32/ctor/include/stdlib/complex/float32/ctor.h +148 -0
- package/float32/ctor/lib/index.js +40 -0
- package/float32/ctor/lib/main.js +164 -0
- package/float32/ctor/lib/tojson.js +39 -0
- package/float32/ctor/lib/tostring.js +42 -0
- package/float32/ctor/manifest.json +38 -0
- package/float32/ctor/package.json +70 -0
- package/float32/ctor/src/main.c +151 -0
- package/float32/docs/types/index.d.ts +151 -0
- package/float32/docs/types/test.ts +29 -0
- package/float32/imag/README.md +239 -0
- package/float32/imag/docs/repl.txt +24 -0
- package/float32/imag/docs/types/index.d.ts +44 -0
- package/float32/imag/docs/types/test.ts +45 -0
- package/float32/imag/include/stdlib/complex/float32/imag.h +40 -0
- package/float32/imag/lib/index.js +43 -0
- package/float32/imag/lib/main.js +42 -0
- package/float32/imag/manifest.json +40 -0
- package/float32/imag/package.json +67 -0
- package/float32/imag/src/main.c +42 -0
- package/float32/lib/index.js +114 -0
- package/float32/package.json +61 -0
- package/float32/parse/README.md +133 -0
- package/float32/parse/docs/repl.txt +22 -0
- package/float32/parse/docs/types/index.d.ts +46 -0
- package/float32/parse/docs/types/test.ts +44 -0
- package/float32/parse/lib/index.js +42 -0
- package/float32/parse/lib/main.js +90 -0
- package/float32/parse/package.json +67 -0
- package/float32/real/README.md +239 -0
- package/float32/real/docs/repl.txt +24 -0
- package/float32/real/docs/types/index.d.ts +44 -0
- package/float32/real/docs/types/test.ts +45 -0
- package/float32/real/include/stdlib/complex/float32/real.h +40 -0
- package/float32/real/lib/index.js +43 -0
- package/float32/real/lib/main.js +42 -0
- package/float32/real/manifest.json +40 -0
- package/float32/real/package.json +67 -0
- package/float32/real/src/main.c +42 -0
- package/float32/reim/README.md +248 -0
- package/float32/reim/docs/repl.txt +24 -0
- package/float32/reim/docs/types/index.d.ts +44 -0
- package/float32/reim/docs/types/test.ts +45 -0
- package/float32/reim/include/stdlib/complex/float32/reim.h +40 -0
- package/float32/reim/lib/index.js +43 -0
- package/float32/reim/lib/main.js +52 -0
- package/float32/reim/manifest.json +40 -0
- package/float32/reim/package.json +67 -0
- package/float32/reim/src/main.c +46 -0
- package/float32/reviver/README.md +145 -0
- package/float32/reviver/docs/repl.txt +26 -0
- package/float32/reviver/docs/types/index.d.ts +41 -0
- package/float32/reviver/docs/types/test.ts +50 -0
- package/float32/reviver/lib/index.js +43 -0
- package/float32/reviver/lib/main.js +60 -0
- package/float32/reviver/package.json +72 -0
- package/float64/README.md +137 -0
- package/float64/base/README.md +143 -0
- package/float64/base/add/README.md +279 -0
- package/float64/base/add/docs/repl.txt +118 -0
- package/float64/base/add/docs/types/index.d.ts +136 -0
- package/float64/base/add/docs/types/test.ts +357 -0
- package/float64/base/add/include/stdlib/complex/float64/base/add.h +40 -0
- package/float64/base/add/lib/assign.js +50 -0
- package/float64/base/add/lib/index.js +54 -0
- package/float64/base/add/lib/main.js +54 -0
- package/float64/base/add/lib/native.js +53 -0
- package/float64/base/add/lib/strided.js +55 -0
- package/float64/base/add/manifest.json +75 -0
- package/float64/base/add/package.json +68 -0
- package/float64/base/add/src/addon.c +22 -0
- package/float64/base/add/src/main.c +60 -0
- package/float64/base/add3/README.md +275 -0
- package/float64/base/add3/docs/repl.txt +133 -0
- package/float64/base/add3/docs/types/index.d.ts +145 -0
- package/float64/base/add3/docs/types/test.ts +467 -0
- package/float64/base/add3/include/stdlib/complex/float64/base/add3.h +40 -0
- package/float64/base/add3/lib/assign.js +52 -0
- package/float64/base/add3/lib/index.js +54 -0
- package/float64/base/add3/lib/main.js +55 -0
- package/float64/base/add3/lib/native.js +54 -0
- package/float64/base/add3/lib/strided.js +59 -0
- package/float64/base/add3/manifest.json +75 -0
- package/float64/base/add3/package.json +68 -0
- package/float64/base/add3/src/addon.c +22 -0
- package/float64/base/add3/src/main.c +64 -0
- package/float64/base/assert/README.md +120 -0
- package/float64/base/assert/docs/types/index.d.ts +181 -0
- package/float64/base/assert/docs/types/test.ts +29 -0
- package/float64/base/assert/is-almost-equal/README.md +158 -0
- package/float64/base/assert/is-almost-equal/docs/repl.txt +45 -0
- package/float64/base/assert/is-almost-equal/docs/types/index.d.ts +56 -0
- package/float64/base/assert/is-almost-equal/docs/types/test.ts +83 -0
- package/float64/base/assert/is-almost-equal/lib/index.js +48 -0
- package/float64/base/assert/is-almost-equal/lib/main.js +67 -0
- package/float64/base/assert/is-almost-equal/package.json +73 -0
- package/float64/base/assert/is-almost-same-value/README.md +158 -0
- package/float64/base/assert/is-almost-same-value/docs/repl.txt +43 -0
- package/float64/base/assert/is-almost-same-value/docs/types/index.d.ts +55 -0
- package/float64/base/assert/is-almost-same-value/docs/types/test.ts +83 -0
- package/float64/base/assert/is-almost-same-value/lib/index.js +48 -0
- package/float64/base/assert/is-almost-same-value/lib/main.js +69 -0
- package/float64/base/assert/is-almost-same-value/package.json +74 -0
- package/float64/base/assert/is-equal/README.md +221 -0
- package/float64/base/assert/is-equal/docs/repl.txt +27 -0
- package/float64/base/assert/is-equal/docs/types/index.d.ts +46 -0
- package/float64/base/assert/is-equal/docs/types/test.ts +67 -0
- package/float64/base/assert/is-equal/include/stdlib/complex/float64/base/assert/is_equal.h +41 -0
- package/float64/base/assert/is-equal/lib/index.js +44 -0
- package/float64/base/assert/is-equal/lib/main.js +56 -0
- package/float64/base/assert/is-equal/manifest.json +59 -0
- package/float64/base/assert/is-equal/package.json +71 -0
- package/float64/base/assert/is-equal/src/main.c +48 -0
- package/float64/base/assert/is-not-equal/README.md +221 -0
- package/float64/base/assert/is-not-equal/docs/repl.txt +28 -0
- package/float64/base/assert/is-not-equal/docs/types/index.d.ts +46 -0
- package/float64/base/assert/is-not-equal/docs/types/test.ts +67 -0
- package/float64/base/assert/is-not-equal/include/stdlib/complex/float64/base/assert/is_not_equal.h +41 -0
- package/float64/base/assert/is-not-equal/lib/index.js +44 -0
- package/float64/base/assert/is-not-equal/lib/main.js +56 -0
- package/float64/base/assert/is-not-equal/manifest.json +59 -0
- package/float64/base/assert/is-not-equal/package.json +72 -0
- package/float64/base/assert/is-not-equal/src/main.c +48 -0
- package/float64/base/assert/is-same-value/README.md +245 -0
- package/float64/base/assert/is-same-value/docs/repl.txt +31 -0
- package/float64/base/assert/is-same-value/docs/types/index.d.ts +53 -0
- package/float64/base/assert/is-same-value/docs/types/test.ts +67 -0
- package/float64/base/assert/is-same-value/include/stdlib/complex/float64/base/assert/is_same_value.h +41 -0
- package/float64/base/assert/is-same-value/lib/index.js +44 -0
- package/float64/base/assert/is-same-value/lib/main.js +64 -0
- package/float64/base/assert/is-same-value/manifest.json +61 -0
- package/float64/base/assert/is-same-value/package.json +74 -0
- package/float64/base/assert/is-same-value/src/main.c +52 -0
- package/float64/base/assert/is-same-value-zero/README.md +247 -0
- package/float64/base/assert/is-same-value-zero/docs/repl.txt +31 -0
- package/float64/base/assert/is-same-value-zero/docs/types/index.d.ts +50 -0
- package/float64/base/assert/is-same-value-zero/docs/types/test.ts +67 -0
- package/float64/base/assert/is-same-value-zero/include/stdlib/complex/float64/base/assert/is_same_value_zero.h +41 -0
- package/float64/base/assert/is-same-value-zero/lib/index.js +44 -0
- package/float64/base/assert/is-same-value-zero/lib/main.js +62 -0
- package/float64/base/assert/is-same-value-zero/manifest.json +61 -0
- package/float64/base/assert/is-same-value-zero/package.json +74 -0
- package/float64/base/assert/is-same-value-zero/src/main.c +52 -0
- package/float64/base/assert/lib/index.js +96 -0
- package/float64/base/assert/package.json +63 -0
- package/float64/base/div/README.md +304 -0
- package/float64/base/div/docs/repl.txt +119 -0
- package/float64/base/div/docs/types/index.d.ts +119 -0
- package/float64/base/div/docs/types/test.ts +357 -0
- package/float64/base/div/include/stdlib/complex/float64/base/div.h +40 -0
- package/float64/base/div/lib/assign.js +106 -0
- package/float64/base/div/lib/index.js +55 -0
- package/float64/base/div/lib/internal_compreal.js +56 -0
- package/float64/base/div/lib/main.js +76 -0
- package/float64/base/div/lib/native.js +54 -0
- package/float64/base/div/lib/robust_internal.js +61 -0
- package/float64/base/div/lib/strided.js +58 -0
- package/float64/base/div/manifest.json +87 -0
- package/float64/base/div/package.json +68 -0
- package/float64/base/div/src/addon.c +22 -0
- package/float64/base/div/src/main.c +173 -0
- package/float64/base/docs/types/index.d.ts +316 -0
- package/float64/base/docs/types/test.ts +29 -0
- package/float64/base/identity/README.md +235 -0
- package/float64/base/identity/docs/img/equation_identity_function.svg +18 -0
- package/float64/base/identity/docs/repl.txt +27 -0
- package/float64/base/identity/docs/types/index.d.ts +42 -0
- package/float64/base/identity/docs/types/test.ts +45 -0
- package/float64/base/identity/include/stdlib/complex/float64/base/identity.h +40 -0
- package/float64/base/identity/lib/index.js +41 -0
- package/float64/base/identity/lib/main.js +42 -0
- package/float64/base/identity/lib/native.js +50 -0
- package/float64/base/identity/manifest.json +75 -0
- package/float64/base/identity/package.json +68 -0
- package/float64/base/identity/src/addon.c +22 -0
- package/float64/base/identity/src/main.c +44 -0
- package/float64/base/lib/index.js +132 -0
- package/float64/base/mul/README.md +288 -0
- package/float64/base/mul/docs/repl.txt +120 -0
- package/float64/base/mul/docs/types/index.d.ts +138 -0
- package/float64/base/mul/docs/types/test.ts +358 -0
- package/float64/base/mul/include/stdlib/complex/float64/base/mul.h +40 -0
- package/float64/base/mul/lib/assign.js +50 -0
- package/float64/base/mul/lib/index.js +55 -0
- package/float64/base/mul/lib/main.js +59 -0
- package/float64/base/mul/lib/native.js +54 -0
- package/float64/base/mul/lib/strided.js +59 -0
- package/float64/base/mul/manifest.json +95 -0
- package/float64/base/mul/package.json +69 -0
- package/float64/base/mul/src/addon.c +22 -0
- package/float64/base/mul/src/main.c +61 -0
- package/float64/base/mul-add/README.md +286 -0
- package/float64/base/mul-add/docs/repl.txt +142 -0
- package/float64/base/mul-add/docs/types/index.d.ts +151 -0
- package/float64/base/mul-add/docs/types/test.ts +467 -0
- package/float64/base/mul-add/include/stdlib/complex/float64/base/mul_add.h +40 -0
- package/float64/base/mul-add/lib/assign.js +52 -0
- package/float64/base/mul-add/lib/index.js +56 -0
- package/float64/base/mul-add/lib/main.js +63 -0
- package/float64/base/mul-add/lib/native.js +56 -0
- package/float64/base/mul-add/lib/strided.js +65 -0
- package/float64/base/mul-add/manifest.json +75 -0
- package/float64/base/mul-add/package.json +70 -0
- package/float64/base/mul-add/src/addon.c +22 -0
- package/float64/base/mul-add/src/main.c +66 -0
- package/float64/base/neg/README.md +257 -0
- package/float64/base/neg/docs/repl.txt +28 -0
- package/float64/base/neg/docs/types/index.d.ts +60 -0
- package/float64/base/neg/docs/types/test.ts +51 -0
- package/float64/base/neg/include/stdlib/complex/float64/base/neg.h +40 -0
- package/float64/base/neg/lib/index.js +61 -0
- package/float64/base/neg/lib/main.js +67 -0
- package/float64/base/neg/lib/native.js +68 -0
- package/float64/base/neg/manifest.json +75 -0
- package/float64/base/neg/package.json +67 -0
- package/float64/base/neg/src/addon.c +22 -0
- package/float64/base/neg/src/main.c +49 -0
- package/float64/base/package.json +67 -0
- package/float64/base/scale/README.md +263 -0
- package/float64/base/scale/docs/repl.txt +106 -0
- package/float64/base/scale/docs/types/index.d.ts +131 -0
- package/float64/base/scale/docs/types/test.ts +297 -0
- package/float64/base/scale/include/stdlib/complex/float64/base/scale.h +40 -0
- package/float64/base/scale/lib/assign.js +49 -0
- package/float64/base/scale/lib/index.js +54 -0
- package/float64/base/scale/lib/main.js +52 -0
- package/float64/base/scale/lib/native.js +53 -0
- package/float64/base/scale/lib/strided.js +52 -0
- package/float64/base/scale/manifest.json +75 -0
- package/float64/base/scale/package.json +69 -0
- package/float64/base/scale/src/addon.c +22 -0
- package/float64/base/scale/src/main.c +51 -0
- package/float64/base/sub/README.md +226 -0
- package/float64/base/sub/docs/repl.txt +33 -0
- package/float64/base/sub/docs/types/index.d.ts +46 -0
- package/float64/base/sub/docs/types/test.ts +67 -0
- package/float64/base/sub/include/stdlib/complex/float64/base/sub.h +40 -0
- package/float64/base/sub/lib/index.js +44 -0
- package/float64/base/sub/lib/main.js +55 -0
- package/float64/base/sub/lib/native.js +54 -0
- package/float64/base/sub/manifest.json +75 -0
- package/float64/base/sub/package.json +71 -0
- package/float64/base/sub/src/addon.c +22 -0
- package/float64/base/sub/src/main.c +61 -0
- package/float64/conj/README.md +255 -0
- package/float64/conj/docs/repl.txt +27 -0
- package/float64/conj/docs/types/index.d.ts +42 -0
- package/float64/conj/docs/types/test.ts +45 -0
- package/float64/conj/include/stdlib/complex/float64/conj.h +40 -0
- package/float64/conj/lib/index.js +43 -0
- package/float64/conj/lib/main.js +48 -0
- package/float64/conj/lib/native.js +52 -0
- package/float64/conj/manifest.json +76 -0
- package/float64/conj/package.json +65 -0
- package/float64/conj/src/addon.c +22 -0
- package/float64/conj/src/main.c +49 -0
- package/float64/ctor/README.md +617 -0
- package/float64/ctor/docs/repl.txt +84 -0
- package/float64/ctor/docs/types/index.d.ts +120 -0
- package/float64/ctor/docs/types/test.ts +69 -0
- package/float64/ctor/include/stdlib/complex/float64/ctor.h +169 -0
- package/float64/ctor/lib/index.js +40 -0
- package/float64/ctor/lib/main.js +163 -0
- package/float64/ctor/lib/tojson.js +39 -0
- package/float64/ctor/lib/tostring.js +42 -0
- package/float64/ctor/manifest.json +40 -0
- package/float64/ctor/package.json +69 -0
- package/float64/ctor/src/main.c +224 -0
- package/float64/docs/types/index.d.ts +151 -0
- package/float64/docs/types/test.ts +29 -0
- package/float64/imag/README.md +236 -0
- package/float64/imag/docs/repl.txt +24 -0
- package/float64/imag/docs/types/index.d.ts +44 -0
- package/float64/imag/docs/types/test.ts +45 -0
- package/float64/imag/include/stdlib/complex/float64/imag.h +40 -0
- package/float64/imag/lib/index.js +43 -0
- package/float64/imag/lib/main.js +42 -0
- package/float64/imag/manifest.json +40 -0
- package/float64/imag/package.json +67 -0
- package/float64/imag/src/main.c +42 -0
- package/float64/lib/index.js +114 -0
- package/float64/package.json +61 -0
- package/float64/parse/README.md +132 -0
- package/float64/parse/docs/repl.txt +23 -0
- package/float64/parse/docs/types/index.d.ts +46 -0
- package/float64/parse/docs/types/test.ts +44 -0
- package/float64/parse/lib/index.js +42 -0
- package/float64/parse/lib/main.js +90 -0
- package/float64/parse/package.json +67 -0
- package/float64/real/README.md +236 -0
- package/float64/real/docs/repl.txt +24 -0
- package/float64/real/docs/types/index.d.ts +44 -0
- package/float64/real/docs/types/test.ts +45 -0
- package/float64/real/include/stdlib/complex/float64/real.h +40 -0
- package/float64/real/lib/index.js +43 -0
- package/float64/real/lib/main.js +42 -0
- package/float64/real/manifest.json +40 -0
- package/float64/real/package.json +67 -0
- package/float64/real/src/main.c +42 -0
- package/float64/reim/README.md +245 -0
- package/float64/reim/docs/repl.txt +24 -0
- package/float64/reim/docs/types/index.d.ts +44 -0
- package/float64/reim/docs/types/test.ts +45 -0
- package/float64/reim/include/stdlib/complex/float64/reim.h +40 -0
- package/float64/reim/lib/index.js +43 -0
- package/float64/reim/lib/main.js +52 -0
- package/float64/reim/manifest.json +40 -0
- package/float64/reim/package.json +67 -0
- package/float64/reim/src/main.c +46 -0
- package/float64/reviver/README.md +145 -0
- package/float64/reviver/docs/repl.txt +26 -0
- package/float64/reviver/docs/types/index.d.ts +41 -0
- package/float64/reviver/docs/types/test.ts +50 -0
- package/float64/reviver/lib/index.js +43 -0
- package/float64/reviver/lib/main.js +60 -0
- package/float64/reviver/package.json +72 -0
- package/lib/index.js +123 -0
- package/package.json +71 -4
- package/promotion-rules/README.md +164 -0
- package/promotion-rules/docs/repl.txt +33 -0
- package/promotion-rules/docs/types/index.d.ts +102 -0
- package/promotion-rules/docs/types/test.ts +66 -0
- package/promotion-rules/lib/index.js +46 -0
- package/promotion-rules/lib/main.js +102 -0
- package/promotion-rules/lib/promotion_rules.json +64 -0
- package/promotion-rules/package.json +69 -0
- package/reviver/README.md +148 -0
- package/reviver/docs/repl.txt +33 -0
- package/reviver/docs/types/index.d.ts +41 -0
- package/reviver/docs/types/test.ts +45 -0
- package/reviver/lib/ctors.js +37 -0
- package/reviver/lib/index.js +43 -0
- package/reviver/lib/main.js +63 -0
- package/reviver/package.json +73 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
|
|
3
|
+
@license Apache-2.0
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2021 The Stdlib Authors.
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
|
18
|
+
|
|
19
|
+
-->
|
|
20
|
+
|
|
21
|
+
# wrap
|
|
22
|
+
|
|
23
|
+
> Wrap a function accepting complex number arguments to support providing both real and complex numbers.
|
|
24
|
+
|
|
25
|
+
<!-- Section to include introductory text. Make sure to keep an empty line after the intro `section` element and another before the `/section` close. -->
|
|
26
|
+
|
|
27
|
+
<section class="intro">
|
|
28
|
+
|
|
29
|
+
</section>
|
|
30
|
+
|
|
31
|
+
<!-- /.intro -->
|
|
32
|
+
|
|
33
|
+
<!-- Package usage documentation. -->
|
|
34
|
+
|
|
35
|
+
<section class="usage">
|
|
36
|
+
|
|
37
|
+
## Usage
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
var wrap = require( '@stdlib/complex/base/wrap-function' );
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
#### wrap( fcn, nargs, ctor )
|
|
44
|
+
|
|
45
|
+
Returns a function which wraps a function accepting complex number arguments to support providing both real and complex numbers.
|
|
46
|
+
|
|
47
|
+
```javascript
|
|
48
|
+
var Complex64 = require( '@stdlib/complex/float32/ctor' );
|
|
49
|
+
var caddf = require( '@stdlib/complex/float32/base/add' );
|
|
50
|
+
|
|
51
|
+
var f = wrap( caddf, 2, Complex64 );
|
|
52
|
+
// returns <Function>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The function accepts the following arguments:
|
|
56
|
+
|
|
57
|
+
- **fcn**: the function to wrap.
|
|
58
|
+
- **nargs**: the number of arguments to be provided to the wrapped function.
|
|
59
|
+
- **ctor**: complex number constructor for converting real numbers to complex numbers.
|
|
60
|
+
|
|
61
|
+
</section>
|
|
62
|
+
|
|
63
|
+
<!-- /.usage -->
|
|
64
|
+
|
|
65
|
+
<!-- Package usage notes. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
66
|
+
|
|
67
|
+
<section class="notes">
|
|
68
|
+
|
|
69
|
+
## Notes
|
|
70
|
+
|
|
71
|
+
- The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number).
|
|
72
|
+
- The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification.
|
|
73
|
+
|
|
74
|
+
</section>
|
|
75
|
+
|
|
76
|
+
<!-- /.notes -->
|
|
77
|
+
|
|
78
|
+
<!-- Package usage examples. -->
|
|
79
|
+
|
|
80
|
+
<section class="examples">
|
|
81
|
+
|
|
82
|
+
## Examples
|
|
83
|
+
|
|
84
|
+
<!-- eslint no-undef: "error" -->
|
|
85
|
+
|
|
86
|
+
```javascript
|
|
87
|
+
var Complex64 = require( '@stdlib/complex/float32/ctor' );
|
|
88
|
+
var caddf = require( '@stdlib/complex/float32/base/add' );
|
|
89
|
+
var wrap = require( '@stdlib/complex/base/wrap-function' );
|
|
90
|
+
|
|
91
|
+
var f = wrap( caddf, 2, Complex64 );
|
|
92
|
+
|
|
93
|
+
// ...
|
|
94
|
+
|
|
95
|
+
var z = f( 3.0, 4.0 );
|
|
96
|
+
// returns <Complex64>[ 7.0, 0.0 ]
|
|
97
|
+
|
|
98
|
+
console.log( z.toString() );
|
|
99
|
+
// => '7 + 0i'
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
</section>
|
|
103
|
+
|
|
104
|
+
<!-- /.examples -->
|
|
105
|
+
|
|
106
|
+
<!-- Section to include cited references. If references are included, add a horizontal rule *before* the section. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
107
|
+
|
|
108
|
+
<section class="references">
|
|
109
|
+
|
|
110
|
+
</section>
|
|
111
|
+
|
|
112
|
+
<!-- /.references -->
|
|
113
|
+
|
|
114
|
+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
|
|
115
|
+
|
|
116
|
+
<section class="related">
|
|
117
|
+
|
|
118
|
+
</section>
|
|
119
|
+
|
|
120
|
+
<!-- /.related -->
|
|
121
|
+
|
|
122
|
+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
|
|
123
|
+
|
|
124
|
+
<section class="links">
|
|
125
|
+
|
|
126
|
+
</section>
|
|
127
|
+
|
|
128
|
+
<!-- /.links -->
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
{{alias}}( fcn, nargs, ctor )
|
|
3
|
+
Wraps a function accepting complex number arguments to support providing
|
|
4
|
+
both real and complex numbers.
|
|
5
|
+
|
|
6
|
+
The returned function *assumes* that the wrapped function accepts *only*
|
|
7
|
+
complex number input arguments (i.e., every argument must be a complex
|
|
8
|
+
number).
|
|
9
|
+
|
|
10
|
+
The returned function *assumes* that, if an input argument is non-numeric
|
|
11
|
+
(i.e., not of type `number`), then the input argument is a complex number.
|
|
12
|
+
|
|
13
|
+
The returned function does *not* verify that non-numeric input arguments
|
|
14
|
+
are, in fact, complex number objects.
|
|
15
|
+
|
|
16
|
+
The returned function passes non-numeric input arguments to the wrapped
|
|
17
|
+
function without modification.
|
|
18
|
+
|
|
19
|
+
Parameters
|
|
20
|
+
----------
|
|
21
|
+
fcn: Function
|
|
22
|
+
Function to wrap.
|
|
23
|
+
|
|
24
|
+
nargs: integer
|
|
25
|
+
Number of arguments.
|
|
26
|
+
|
|
27
|
+
ctor: Function
|
|
28
|
+
Complex number constructor.
|
|
29
|
+
|
|
30
|
+
Returns
|
|
31
|
+
-------
|
|
32
|
+
f: Function
|
|
33
|
+
Wrapped function.
|
|
34
|
+
|
|
35
|
+
Examples
|
|
36
|
+
--------
|
|
37
|
+
> var f = {{alias}}( {{alias:@stdlib/complex/float32/base/add}}, 2, {{alias:@stdlib/complex/float32/ctor}} );
|
|
38
|
+
> var z = f( 3.0, 4.0 )
|
|
39
|
+
<Complex64>[ 7.0, 0.0 ]
|
|
40
|
+
|
|
41
|
+
See Also
|
|
42
|
+
--------
|
|
43
|
+
|
|
@@ -0,0 +1,417 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @license Apache-2.0
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2021 The Stdlib Authors.
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
// TypeScript Version: 4.1
|
|
20
|
+
|
|
21
|
+
/// <reference types="@stdlib/types"/>
|
|
22
|
+
|
|
23
|
+
import { ComplexLike } from '@stdlib/types/complex';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Real or complex number.
|
|
27
|
+
*/
|
|
28
|
+
type RealOrComplex = number | ComplexLike;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Nullary function.
|
|
32
|
+
*
|
|
33
|
+
* @returns result
|
|
34
|
+
*/
|
|
35
|
+
type Nullary = () => any;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Unary function accepting complex numbers.
|
|
39
|
+
*
|
|
40
|
+
* @param x - input value
|
|
41
|
+
* @returns result
|
|
42
|
+
*/
|
|
43
|
+
type Unary = ( x: ComplexLike ) => any;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Unary function accepting both real and complex numbers.
|
|
47
|
+
*
|
|
48
|
+
* @param x - input value
|
|
49
|
+
* @returns result
|
|
50
|
+
*/
|
|
51
|
+
type WrappedUnary = ( x: RealOrComplex ) => any;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Binary function accepting complex numbers.
|
|
55
|
+
*
|
|
56
|
+
* @param x - input value
|
|
57
|
+
* @param y - input value
|
|
58
|
+
* @returns result
|
|
59
|
+
*/
|
|
60
|
+
type Binary = ( x: ComplexLike, y: ComplexLike ) => any;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Binary function accepting both real and complex numbers.
|
|
64
|
+
*
|
|
65
|
+
* @param x - input value
|
|
66
|
+
* @param y - input value
|
|
67
|
+
* @returns result
|
|
68
|
+
*/
|
|
69
|
+
type WrappedBinary = ( x: RealOrComplex, y: RealOrComplex ) => any;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Ternary function accepting complex numbers.
|
|
73
|
+
*
|
|
74
|
+
* @param x - input value
|
|
75
|
+
* @param y - input value
|
|
76
|
+
* @param z - input value
|
|
77
|
+
* @returns result
|
|
78
|
+
*/
|
|
79
|
+
type Ternary = ( x: ComplexLike, y: ComplexLike, z: ComplexLike ) => any;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Ternary function accepting both real and complex numbers.
|
|
83
|
+
*
|
|
84
|
+
* @param x - input value
|
|
85
|
+
* @param y - input value
|
|
86
|
+
* @param z - input value
|
|
87
|
+
* @returns result
|
|
88
|
+
*/
|
|
89
|
+
type WrappedTernary = ( x: RealOrComplex, y: RealOrComplex, z: RealOrComplex ) => any;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Quaternary function accepting complex numbers.
|
|
93
|
+
*
|
|
94
|
+
* @param x - input value
|
|
95
|
+
* @param y - input value
|
|
96
|
+
* @param z - input value
|
|
97
|
+
* @param w - input value
|
|
98
|
+
* @returns result
|
|
99
|
+
*/
|
|
100
|
+
type Quaternary = ( x: ComplexLike, y: ComplexLike, z: ComplexLike, w: ComplexLike ) => any;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Quaternary function accepting both real and complex numbers.
|
|
104
|
+
*
|
|
105
|
+
* @param x - input value
|
|
106
|
+
* @param y - input value
|
|
107
|
+
* @param z - input value
|
|
108
|
+
* @param w - input value
|
|
109
|
+
* @returns result
|
|
110
|
+
*/
|
|
111
|
+
type WrappedQuaternary = ( x: RealOrComplex, y: RealOrComplex, z: RealOrComplex, w: RealOrComplex ) => any;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Quinary function accepting complex numbers.
|
|
115
|
+
*
|
|
116
|
+
* @param x - input value
|
|
117
|
+
* @param y - input value
|
|
118
|
+
* @param z - input value
|
|
119
|
+
* @param w - input value
|
|
120
|
+
* @param v - input value
|
|
121
|
+
* @returns result
|
|
122
|
+
*/
|
|
123
|
+
type Quinary = ( x: ComplexLike, y: ComplexLike, z: ComplexLike, w: ComplexLike, v: ComplexLike ) => any;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Quinary function accepting both real and complex numbers.
|
|
127
|
+
*
|
|
128
|
+
* @param x - input value
|
|
129
|
+
* @param y - input value
|
|
130
|
+
* @param z - input value
|
|
131
|
+
* @param w - input value
|
|
132
|
+
* @param v - input value
|
|
133
|
+
* @returns result
|
|
134
|
+
*/
|
|
135
|
+
type WrappedQuinary = ( x: RealOrComplex, y: RealOrComplex, z: RealOrComplex, w: RealOrComplex, v: RealOrComplex ) => any;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* An n-ary function accepting complex numbers.
|
|
139
|
+
*
|
|
140
|
+
* @param x - input value
|
|
141
|
+
* @param y - input value
|
|
142
|
+
* @param z - input value
|
|
143
|
+
* @param w - input value
|
|
144
|
+
* @param v - input value
|
|
145
|
+
* @param args - subsequent input values
|
|
146
|
+
* @returns result
|
|
147
|
+
*/
|
|
148
|
+
type Nary = ( x: ComplexLike, y: ComplexLike, z: ComplexLike, w: ComplexLike, v: ComplexLike, ...args: Array<ComplexLike> ) => any;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* An n-ary function accepting both real and complex numbers.
|
|
152
|
+
*
|
|
153
|
+
* @param x - input value
|
|
154
|
+
* @param y - input value
|
|
155
|
+
* @param z - input value
|
|
156
|
+
* @param w - input value
|
|
157
|
+
* @param v - input value
|
|
158
|
+
* @param args - subsequent input values
|
|
159
|
+
* @returns result
|
|
160
|
+
*/
|
|
161
|
+
type WrappedNary = ( x: RealOrComplex, y: RealOrComplex, z: RealOrComplex, w: RealOrComplex, v: RealOrComplex, ...args: Array<RealOrComplex> ) => any;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Complex number constructor.
|
|
165
|
+
*
|
|
166
|
+
* @param re - real component
|
|
167
|
+
* @param im - imaginary component
|
|
168
|
+
* @returns complex number
|
|
169
|
+
*/
|
|
170
|
+
type Constructor = new( re: number, im: number ) => ComplexLike;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Wraps a nullary function accepting complex number arguments to support providing both real and complex numbers.
|
|
174
|
+
*
|
|
175
|
+
* @param fcn - nullary function to wrap
|
|
176
|
+
* @param nargs - number of arguments
|
|
177
|
+
* @param ctor - complex number constructor
|
|
178
|
+
* @throws second argument must be a nonnegative integer
|
|
179
|
+
* @returns wrapped function
|
|
180
|
+
*
|
|
181
|
+
* @example
|
|
182
|
+
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
|
|
183
|
+
* var realf = require( '@stdlib/complex/float32/real' );
|
|
184
|
+
* var imagf = require( '@stdlib/complex/float32/imag' );
|
|
185
|
+
* var randu = require( '@stdlib/random/base/randu' );
|
|
186
|
+
*
|
|
187
|
+
* function randComplex() {
|
|
188
|
+
* return new Complex64( randu(), randu() );
|
|
189
|
+
* }
|
|
190
|
+
*
|
|
191
|
+
* var f = wrap( randComplex, 0, Complex64 );
|
|
192
|
+
*
|
|
193
|
+
* // ...
|
|
194
|
+
*
|
|
195
|
+
* var z = f();
|
|
196
|
+
* // e.g., returns <Complex64>[ <number>, <number> ]
|
|
197
|
+
*/
|
|
198
|
+
declare function wrap( fcn: Nullary, nargs: 0, ctor: Constructor ): Nullary;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Wraps a unary function accepting complex number arguments to support providing both real and complex numbers.
|
|
202
|
+
*
|
|
203
|
+
* ## Notes
|
|
204
|
+
*
|
|
205
|
+
* - The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number).
|
|
206
|
+
* - The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification.
|
|
207
|
+
*
|
|
208
|
+
* @param fcn - function to wrap
|
|
209
|
+
* @param nargs - number of arguments
|
|
210
|
+
* @param ctor - complex number constructor
|
|
211
|
+
* @throws second argument must be a nonnegative integer
|
|
212
|
+
* @returns wrapped function
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
|
|
216
|
+
* var cidentityf = require( '@stdlib/complex/float32/base/identity' );
|
|
217
|
+
*
|
|
218
|
+
* var f = wrap( cidentityf, 1, Complex64 );
|
|
219
|
+
*
|
|
220
|
+
* // ...
|
|
221
|
+
*
|
|
222
|
+
* var z = f( 3.0 );
|
|
223
|
+
* // returns <Complex64>[ 3.0, 0.0 ]
|
|
224
|
+
*/
|
|
225
|
+
declare function wrap( fcn: Unary, nargs: 1, ctor: Constructor ): WrappedUnary;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Wraps a binary function accepting complex number arguments to support providing both real and complex numbers.
|
|
229
|
+
*
|
|
230
|
+
* ## Notes
|
|
231
|
+
*
|
|
232
|
+
* - The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number).
|
|
233
|
+
* - The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification.
|
|
234
|
+
*
|
|
235
|
+
* @param fcn - function to wrap
|
|
236
|
+
* @param nargs - number of arguments
|
|
237
|
+
* @param ctor - complex number constructor
|
|
238
|
+
* @throws second argument must be a nonnegative integer
|
|
239
|
+
* @returns wrapped function
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
|
|
243
|
+
* var caddf = require( '@stdlib/complex/float32/base/add' );
|
|
244
|
+
*
|
|
245
|
+
* var f = wrap( caddf, 2, Complex64 );
|
|
246
|
+
*
|
|
247
|
+
* // ...
|
|
248
|
+
*
|
|
249
|
+
* var z = f( 3.0, 4.0 );
|
|
250
|
+
* // returns <Complex64>[ 7.0, 0.0 ]
|
|
251
|
+
*/
|
|
252
|
+
declare function wrap( fcn: Binary, nargs: 2, ctor: Constructor ): WrappedBinary;
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Wraps a ternary function accepting complex number arguments to support providing both real and complex numbers.
|
|
256
|
+
*
|
|
257
|
+
* ## Notes
|
|
258
|
+
*
|
|
259
|
+
* - The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number).
|
|
260
|
+
* - The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification.
|
|
261
|
+
*
|
|
262
|
+
* @param fcn - function to wrap
|
|
263
|
+
* @param nargs - number of arguments
|
|
264
|
+
* @param ctor - complex number constructor
|
|
265
|
+
* @throws second argument must be a nonnegative integer
|
|
266
|
+
* @returns wrapped function
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
|
|
270
|
+
* var realf = require( '@stdlib/complex/float32/real' );
|
|
271
|
+
* var imagf = require( '@stdlib/complex/float32/imag' );
|
|
272
|
+
*
|
|
273
|
+
* function add( x, y, z ) {
|
|
274
|
+
* var re = realf( x ) + realf( y ) + realf( z );
|
|
275
|
+
* var im = imagf( x ) + imagf( y ) + imagf( z );
|
|
276
|
+
* return new Complex64( re, im );
|
|
277
|
+
* }
|
|
278
|
+
*
|
|
279
|
+
* var f = wrap( add, 3, Complex64 );
|
|
280
|
+
*
|
|
281
|
+
* // ...
|
|
282
|
+
*
|
|
283
|
+
* var z = f( 3.0, 4.0, 5.0 );
|
|
284
|
+
* // returns <Complex64>
|
|
285
|
+
*
|
|
286
|
+
* var re = realf( z );
|
|
287
|
+
* // returns 12.0
|
|
288
|
+
*
|
|
289
|
+
* var im = imagf( z );
|
|
290
|
+
* // returns 0.0
|
|
291
|
+
*/
|
|
292
|
+
declare function wrap( fcn: Ternary, nargs: 3, ctor: Constructor ): WrappedTernary;
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Wraps a quaternary function accepting complex number arguments to support providing both real and complex numbers.
|
|
296
|
+
*
|
|
297
|
+
* ## Notes
|
|
298
|
+
*
|
|
299
|
+
* - The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number).
|
|
300
|
+
* - The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification.
|
|
301
|
+
*
|
|
302
|
+
* @param fcn - function to wrap
|
|
303
|
+
* @param nargs - number of arguments
|
|
304
|
+
* @param ctor - complex number constructor
|
|
305
|
+
* @throws second argument must be a nonnegative integer
|
|
306
|
+
* @returns wrapped function
|
|
307
|
+
*
|
|
308
|
+
* @example
|
|
309
|
+
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
|
|
310
|
+
* var realf = require( '@stdlib/complex/float32/real' );
|
|
311
|
+
* var imagf = require( '@stdlib/complex/float32/imag' );
|
|
312
|
+
*
|
|
313
|
+
* function add( x, y, z, w ) {
|
|
314
|
+
* var re = realf( x ) + realf( y ) + realf( z ) + realf( w );
|
|
315
|
+
* var im = imagf( x ) + imagf( y ) + imagf( z ) + imagf( w );
|
|
316
|
+
* return new Complex64( re, im );
|
|
317
|
+
* }
|
|
318
|
+
*
|
|
319
|
+
* var f = wrap( add, 4, Complex64 );
|
|
320
|
+
*
|
|
321
|
+
* // ...
|
|
322
|
+
*
|
|
323
|
+
* var z = f( 3.0, 4.0, 5.0, 6.0 );
|
|
324
|
+
* // returns <Complex64>
|
|
325
|
+
*
|
|
326
|
+
* var re = realf( z );
|
|
327
|
+
* // returns 18.0
|
|
328
|
+
*
|
|
329
|
+
* var im = imagf( z );
|
|
330
|
+
* // returns 0.0
|
|
331
|
+
*/
|
|
332
|
+
declare function wrap( fcn: Quaternary, nargs: 4, ctor: Constructor ): WrappedQuaternary;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Wraps a quinary function accepting complex number arguments to support providing both real and complex numbers.
|
|
336
|
+
*
|
|
337
|
+
* ## Notes
|
|
338
|
+
*
|
|
339
|
+
* - The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number).
|
|
340
|
+
* - The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification.
|
|
341
|
+
*
|
|
342
|
+
* @param fcn - function to wrap
|
|
343
|
+
* @param nargs - number of arguments
|
|
344
|
+
* @param ctor - complex number constructor
|
|
345
|
+
* @throws second argument must be a nonnegative integer
|
|
346
|
+
* @returns wrapped function
|
|
347
|
+
*
|
|
348
|
+
* @example
|
|
349
|
+
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
|
|
350
|
+
* var realf = require( '@stdlib/complex/float32/real' );
|
|
351
|
+
* var imagf = require( '@stdlib/complex/float32/imag' );
|
|
352
|
+
*
|
|
353
|
+
* function add( x, y, z, w, v ) {
|
|
354
|
+
* var re = realf( x ) + realf( y ) + realf( z ) + realf( w ) + realf( v );
|
|
355
|
+
* var im = imagf( x ) + imagf( y ) + imagf( z ) + imagf( w ) + imagf( v );
|
|
356
|
+
* return new Complex64( re, im );
|
|
357
|
+
* }
|
|
358
|
+
*
|
|
359
|
+
* var f = wrap( add, 5, Complex64 );
|
|
360
|
+
*
|
|
361
|
+
* // ...
|
|
362
|
+
*
|
|
363
|
+
* var z = f( 3.0, 4.0, 5.0, 6.0, 7.0 );
|
|
364
|
+
* // returns <Complex64>
|
|
365
|
+
*
|
|
366
|
+
* var re = realf( z );
|
|
367
|
+
* // returns 25.0
|
|
368
|
+
*
|
|
369
|
+
* var im = imagf( z );
|
|
370
|
+
* // returns 0.0
|
|
371
|
+
*/
|
|
372
|
+
declare function wrap( fcn: Quinary, nargs: 5, ctor: Constructor ): WrappedQuinary;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Wraps an n-ary function accepting complex number arguments to support providing both real and complex numbers.
|
|
376
|
+
*
|
|
377
|
+
* ## Notes
|
|
378
|
+
*
|
|
379
|
+
* - The returned function **assumes** that the wrapped function accepts **only** complex number input arguments (i.e., every argument must be a complex number).
|
|
380
|
+
* - The returned function **assumes** that, if an input argument is non-numeric (i.e., not of type `number`), then the input argument is a complex number. The returned function does **not** verify that non-numeric input arguments are, in fact, complex number objects. The returned function passes non-numeric input arguments to the wrapped function without modification.
|
|
381
|
+
*
|
|
382
|
+
* @param fcn - function to wrap
|
|
383
|
+
* @param nargs - number of arguments
|
|
384
|
+
* @param ctor - complex number constructor
|
|
385
|
+
* @throws second argument must be a nonnegative integer
|
|
386
|
+
* @returns wrapped function
|
|
387
|
+
*
|
|
388
|
+
* @example
|
|
389
|
+
* var Complex64 = require( '@stdlib/complex/float32/ctor' );
|
|
390
|
+
* var realf = require( '@stdlib/complex/float32/real' );
|
|
391
|
+
* var imagf = require( '@stdlib/complex/float32/imag' );
|
|
392
|
+
*
|
|
393
|
+
* function add( x, y, z, w, v, t ) {
|
|
394
|
+
* var re = realf( x ) + realf( y ) + realf( z ) + realf( w ) + realf( v ) + realf( t );
|
|
395
|
+
* var im = imagf( x ) + imagf( y ) + imagf( z ) + imagf( w ) + imagf( v ) + imagf( t );
|
|
396
|
+
* return new Complex64( re, im );
|
|
397
|
+
* }
|
|
398
|
+
*
|
|
399
|
+
* var f = wrap( add, 6, Complex64 );
|
|
400
|
+
*
|
|
401
|
+
* // ...
|
|
402
|
+
*
|
|
403
|
+
* var z = f( 3.0, 4.0, 5.0, 6.0, 7.0, 8.0 );
|
|
404
|
+
* // returns <Complex64>
|
|
405
|
+
*
|
|
406
|
+
* var re = realf( z );
|
|
407
|
+
* // returns 33.0
|
|
408
|
+
*
|
|
409
|
+
* var im = imagf( z );
|
|
410
|
+
* // returns 0.0
|
|
411
|
+
*/
|
|
412
|
+
declare function wrap( fcn: Nary, nargs: number, ctor: Constructor ): WrappedNary;
|
|
413
|
+
|
|
414
|
+
|
|
415
|
+
// EXPORTS //
|
|
416
|
+
|
|
417
|
+
export = wrap;
|