numpy-ts 0.11.0 → 0.13.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/README.md +29 -25
- package/dist/esm/common/broadcasting.js +1 -0
- package/dist/esm/common/complex.js +1 -0
- package/dist/esm/common/dtype.js +1 -0
- package/dist/esm/common/internal/compute.js +1 -0
- package/dist/esm/common/internal/indexing.js +1 -0
- package/dist/esm/common/ndarray-core.js +1 -0
- package/dist/esm/common/ops/advanced.js +1 -0
- package/dist/esm/common/ops/arithmetic.js +1 -0
- package/dist/esm/common/ops/bitwise.js +1 -0
- package/dist/esm/common/ops/comparison.js +1 -0
- package/dist/esm/common/ops/complex.js +1 -0
- package/dist/esm/common/ops/exponential.js +1 -0
- package/dist/esm/common/ops/fft.js +1 -0
- package/dist/esm/common/ops/formatting.js +2 -0
- package/dist/esm/common/ops/gradient.js +1 -0
- package/dist/esm/common/ops/hyperbolic.js +1 -0
- package/dist/esm/common/ops/linalg.js +2 -0
- package/dist/esm/common/ops/logic.js +1 -0
- package/dist/esm/common/ops/random.js +1 -0
- package/dist/esm/common/ops/reduction.js +1 -0
- package/dist/esm/common/ops/rounding.js +1 -0
- package/dist/esm/common/ops/sets.js +1 -0
- package/dist/esm/common/ops/shape.js +1 -0
- package/dist/esm/common/ops/sorting.js +1 -0
- package/dist/esm/common/ops/statistics.js +1 -0
- package/dist/esm/common/ops/trig.js +1 -0
- package/dist/esm/common/slicing.js +1 -0
- package/dist/esm/common/storage.js +1 -0
- package/dist/esm/core/advanced.js +1 -0
- package/dist/esm/core/arithmetic.js +1 -0
- package/dist/esm/core/bitwise.js +1 -0
- package/dist/esm/core/complex.js +1 -0
- package/dist/esm/core/creation.js +1 -0
- package/dist/esm/core/formatting.js +1 -0
- package/dist/esm/core/gradient.js +1 -0
- package/dist/esm/core/index.js +1 -0
- package/dist/esm/core/linalg.js +1 -0
- package/dist/esm/core/logic.js +1 -0
- package/dist/esm/core/polynomial.js +1 -0
- package/dist/esm/core/reduction.js +1 -0
- package/dist/esm/core/rounding.js +1 -0
- package/dist/esm/core/sets.js +1 -0
- package/dist/esm/core/shape-extra.js +1 -0
- package/dist/esm/core/shape.js +1 -0
- package/dist/esm/core/sorting.js +1 -0
- package/dist/esm/core/statistics.js +1 -0
- package/dist/esm/core/trig.js +1 -0
- package/dist/esm/core/typechecking.js +1 -0
- package/dist/esm/core/types.js +1 -0
- package/dist/esm/core/utility.js +1 -0
- package/dist/esm/core.js +1 -0
- package/dist/esm/full/index.js +1 -0
- package/dist/esm/full/ndarray.js +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/io/index.js +1 -0
- package/dist/esm/io/npy/format.js +1 -0
- package/dist/esm/io/npy/index.js +1 -0
- package/dist/esm/io/npy/parser.js +1 -0
- package/dist/esm/io/npy/serializer.js +2 -0
- package/dist/esm/io/npz/index.js +1 -0
- package/dist/esm/io/npz/parser.js +1 -0
- package/dist/esm/io/npz/serializer.js +1 -0
- package/dist/esm/io/txt/index.js +1 -0
- package/dist/esm/io/txt/parser.js +1 -0
- package/dist/esm/io/txt/serializer.js +2 -0
- package/dist/esm/io/zip/index.js +1 -0
- package/dist/esm/io/zip/reader.js +1 -0
- package/dist/esm/io/zip/types.js +1 -0
- package/dist/esm/io/zip/writer.js +1 -0
- package/dist/esm/node.js +1 -0
- package/dist/numpy-ts.browser.js +5 -2
- package/dist/numpy-ts.node-io.cjs +5 -3
- package/dist/numpy-ts.node-io.cjs.map +4 -4
- package/dist/numpy-ts.node-io.mjs +5 -3
- package/dist/numpy-ts.node-io.mjs.map +4 -4
- package/dist/numpy-ts.node.cjs +5 -2
- package/dist/numpy-ts.node.cjs.map +4 -4
- package/dist/types/common/complex.d.ts +94 -0
- package/dist/types/{internal → common/internal}/compute.d.ts +1 -1
- package/dist/types/{internal → common/internal}/indexing.d.ts +6 -0
- package/dist/types/common/ndarray-core.d.ts +126 -0
- package/dist/types/{ops → common/ops}/advanced.d.ts +67 -2
- package/dist/types/{ops → common/ops}/arithmetic.d.ts +100 -1
- package/dist/types/{ops → common/ops}/bitwise.d.ts +31 -1
- package/dist/types/{ops → common/ops}/comparison.d.ts +1 -1
- package/dist/types/{ops → common/ops}/complex.d.ts +1 -1
- package/dist/types/{ops → common/ops}/exponential.d.ts +1 -1
- package/dist/types/common/ops/fft.d.ts +166 -0
- package/dist/types/common/ops/formatting.d.ts +229 -0
- package/dist/types/{ops → common/ops}/gradient.d.ts +1 -1
- package/dist/types/{ops → common/ops}/hyperbolic.d.ts +1 -1
- package/dist/types/{ops → common/ops}/linalg.d.ts +148 -3
- package/dist/types/{ops → common/ops}/logic.d.ts +2 -2
- package/dist/types/common/ops/random.d.ts +376 -0
- package/dist/types/{ops → common/ops}/reduction.d.ts +10 -2
- package/dist/types/{ops → common/ops}/rounding.d.ts +1 -1
- package/dist/types/common/ops/sets.d.ts +87 -0
- package/dist/types/{ops → common/ops}/shape.d.ts +14 -1
- package/dist/types/{ops → common/ops}/sorting.d.ts +1 -1
- package/dist/types/{ops → common/ops}/statistics.d.ts +23 -1
- package/dist/types/{ops → common/ops}/trig.d.ts +1 -1
- package/dist/types/{core → common}/storage.d.ts +1 -0
- package/dist/types/core/advanced.d.ts +54 -0
- package/dist/types/core/arithmetic.d.ts +110 -0
- package/dist/types/core/bitwise.d.ts +34 -0
- package/dist/types/core/complex.d.ts +15 -90
- package/dist/types/core/creation.d.ts +98 -0
- package/dist/types/core/formatting.d.ts +29 -0
- package/dist/types/core/gradient.d.ts +14 -0
- package/dist/types/core/index.d.ts +40 -0
- package/dist/types/core/linalg.d.ts +141 -0
- package/dist/types/core/logic.d.ts +72 -0
- package/dist/types/core/polynomial.d.ts +50 -0
- package/dist/types/core/reduction.d.ts +82 -0
- package/dist/types/core/rounding.d.ts +24 -0
- package/dist/types/core/sets.d.ts +48 -0
- package/dist/types/core/shape-extra.d.ts +24 -0
- package/dist/types/core/shape.d.ts +77 -0
- package/dist/types/core/sorting.d.ts +34 -0
- package/dist/types/core/statistics.d.ts +32 -0
- package/dist/types/core/trig.d.ts +58 -0
- package/dist/types/core/typechecking.d.ts +50 -0
- package/dist/types/core/types.d.ts +43 -0
- package/dist/types/core/utility.d.ts +30 -0
- package/dist/types/core.d.ts +30 -0
- package/dist/types/full/index.d.ts +603 -0
- package/dist/types/full/ndarray.d.ts +880 -0
- package/dist/types/index.d.ts +140 -26
- package/dist/types/io/npy/format.d.ts +1 -1
- package/dist/types/io/npy/parser.d.ts +3 -3
- package/dist/types/io/npy/serializer.d.ts +2 -2
- package/dist/types/io/npz/parser.d.ts +4 -4
- package/dist/types/io/npz/serializer.d.ts +6 -6
- package/dist/types/io/txt/parser.d.ts +5 -5
- package/dist/types/io/txt/serializer.d.ts +2 -2
- package/dist/types/node.d.ts +12 -8
- package/package.json +31 -30
- package/dist/numpy-ts.esm.js +0 -2
- package/dist/types/core/ndarray.d.ts +0 -3166
- package/dist/types/ops/random.d.ts +0 -136
- package/dist/types/ops/sets.d.ts +0 -38
- /package/dist/types/{core → common}/broadcasting.d.ts +0 -0
- /package/dist/types/{core → common}/dtype.d.ts +0 -0
- /package/dist/types/{core → common}/slicing.d.ts +0 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Arithmetic Functions - Tree-shakeable standalone functions
|
|
3
|
+
*
|
|
4
|
+
* This module provides arithmetic and mathematical functions that can be
|
|
5
|
+
* imported independently for optimal tree-shaking.
|
|
6
|
+
*
|
|
7
|
+
* Import from here for minimal bundle size:
|
|
8
|
+
* import { sqrt, exp, abs } from 'numpy-ts/functions/arithmetic';
|
|
9
|
+
*
|
|
10
|
+
* Or import from main entry point (also tree-shakeable):
|
|
11
|
+
* import { sqrt, exp, abs } from 'numpy-ts';
|
|
12
|
+
*/
|
|
13
|
+
import { NDArrayCore } from './types';
|
|
14
|
+
/** Add arguments element-wise */
|
|
15
|
+
export declare function add(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
16
|
+
/** Subtract arguments element-wise */
|
|
17
|
+
export declare function subtract(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
18
|
+
/** Multiply arguments element-wise */
|
|
19
|
+
export declare function multiply(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
20
|
+
/** Square root of array elements */
|
|
21
|
+
export declare function sqrt(x: NDArrayCore): NDArrayCore;
|
|
22
|
+
/** Element-wise power */
|
|
23
|
+
export declare function power(x: NDArrayCore, exponent: NDArrayCore | number): NDArrayCore;
|
|
24
|
+
/** Alias for power */
|
|
25
|
+
export declare const pow: typeof power;
|
|
26
|
+
/** Exponential (e^x) */
|
|
27
|
+
export declare function exp(x: NDArrayCore): NDArrayCore;
|
|
28
|
+
/** 2^x */
|
|
29
|
+
export declare function exp2(x: NDArrayCore): NDArrayCore;
|
|
30
|
+
/** exp(x) - 1 */
|
|
31
|
+
export declare function expm1(x: NDArrayCore): NDArrayCore;
|
|
32
|
+
/** Natural logarithm */
|
|
33
|
+
export declare function log(x: NDArrayCore): NDArrayCore;
|
|
34
|
+
/** Base-2 logarithm */
|
|
35
|
+
export declare function log2(x: NDArrayCore): NDArrayCore;
|
|
36
|
+
/** Base-10 logarithm */
|
|
37
|
+
export declare function log10(x: NDArrayCore): NDArrayCore;
|
|
38
|
+
/** log(1 + x) */
|
|
39
|
+
export declare function log1p(x: NDArrayCore): NDArrayCore;
|
|
40
|
+
/** log(exp(x1) + exp(x2)) */
|
|
41
|
+
export declare function logaddexp(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
42
|
+
/** log2(2^x1 + 2^x2) */
|
|
43
|
+
export declare function logaddexp2(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
44
|
+
/** Absolute value */
|
|
45
|
+
export declare function absolute(x: NDArrayCore): NDArrayCore;
|
|
46
|
+
/** Alias for absolute */
|
|
47
|
+
export declare const abs: typeof absolute;
|
|
48
|
+
/** Numerical negative */
|
|
49
|
+
export declare function negative(x: NDArrayCore): NDArrayCore;
|
|
50
|
+
/** Element-wise sign */
|
|
51
|
+
export declare function sign(x: NDArrayCore): NDArrayCore;
|
|
52
|
+
/** Element-wise modulo */
|
|
53
|
+
export declare function mod(x: NDArrayCore, divisor: NDArrayCore | number): NDArrayCore;
|
|
54
|
+
/** Element-wise division */
|
|
55
|
+
export declare function divide(x: NDArrayCore, divisor: NDArrayCore | number): NDArrayCore;
|
|
56
|
+
/** Alias for divide */
|
|
57
|
+
export declare const true_divide: typeof divide;
|
|
58
|
+
/** Element-wise floor division */
|
|
59
|
+
export declare function floor_divide(x: NDArrayCore, divisor: NDArrayCore | number): NDArrayCore;
|
|
60
|
+
/** Numerical positive (returns copy) */
|
|
61
|
+
export declare function positive(x: NDArrayCore): NDArrayCore;
|
|
62
|
+
/** Reciprocal (1/x) */
|
|
63
|
+
export declare function reciprocal(x: NDArrayCore): NDArrayCore;
|
|
64
|
+
/** Cube root */
|
|
65
|
+
export declare function cbrt(x: NDArrayCore): NDArrayCore;
|
|
66
|
+
/** Absolute value (float) */
|
|
67
|
+
export declare function fabs(x: NDArrayCore): NDArrayCore;
|
|
68
|
+
/** Element-wise divmod (quotient and remainder) */
|
|
69
|
+
export declare function divmod(x: NDArrayCore, y: NDArrayCore | number): [NDArrayCore, NDArrayCore];
|
|
70
|
+
/** Element-wise square */
|
|
71
|
+
export declare function square(x: NDArrayCore): NDArrayCore;
|
|
72
|
+
/** Element-wise remainder */
|
|
73
|
+
export declare function remainder(x: NDArrayCore, y: NDArrayCore | number): NDArrayCore;
|
|
74
|
+
/** Heaviside step function */
|
|
75
|
+
export declare function heaviside(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
76
|
+
/** Float power (always returns float) */
|
|
77
|
+
export declare function float_power(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
78
|
+
/** C-style fmod */
|
|
79
|
+
export declare function fmod(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
80
|
+
/** Decompose into mantissa and exponent */
|
|
81
|
+
export declare function frexp(x: NDArrayCore): [NDArrayCore, NDArrayCore];
|
|
82
|
+
/** Greatest common divisor */
|
|
83
|
+
export declare function gcd(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
84
|
+
/** Least common multiple */
|
|
85
|
+
export declare function lcm(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
86
|
+
/** Compose from mantissa and exponent */
|
|
87
|
+
export declare function ldexp(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
88
|
+
/** Decompose into fractional and integer parts */
|
|
89
|
+
export declare function modf(x: NDArrayCore): [NDArrayCore, NDArrayCore];
|
|
90
|
+
/** Clip values to a range */
|
|
91
|
+
export declare function clip(a: NDArrayCore, a_min: NDArrayCore | number | null, a_max: NDArrayCore | number | null): NDArrayCore;
|
|
92
|
+
/** Element-wise maximum */
|
|
93
|
+
export declare function maximum(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
94
|
+
/** Element-wise minimum */
|
|
95
|
+
export declare function minimum(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
96
|
+
/** Element-wise maximum (ignores NaN) */
|
|
97
|
+
export declare function fmax(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
98
|
+
/** Element-wise minimum (ignores NaN) */
|
|
99
|
+
export declare function fmin(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
100
|
+
/** Replace NaN/Inf with numbers */
|
|
101
|
+
export declare function nan_to_num(x: NDArrayCore, nan?: number, posinf?: number, neginf?: number): NDArrayCore;
|
|
102
|
+
/** 1D linear interpolation */
|
|
103
|
+
export declare function interp(x: NDArrayCore, xp: NDArrayCore, fp: NDArrayCore, left?: number, right?: number): NDArrayCore;
|
|
104
|
+
/** Unwrap phase angles */
|
|
105
|
+
export declare function unwrap(p: NDArrayCore, discont?: number, axis?: number, period?: number): NDArrayCore;
|
|
106
|
+
/** Sinc function */
|
|
107
|
+
export declare function sinc(x: NDArrayCore): NDArrayCore;
|
|
108
|
+
/** Modified Bessel function of the first kind, order 0 */
|
|
109
|
+
export declare function i0(x: NDArrayCore): NDArrayCore;
|
|
110
|
+
//# sourceMappingURL=arithmetic.d.ts.map
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bitwise Functions - Tree-shakeable standalone functions
|
|
3
|
+
*
|
|
4
|
+
* This module provides bitwise operations that can be
|
|
5
|
+
* imported independently for optimal tree-shaking.
|
|
6
|
+
*/
|
|
7
|
+
import { NDArrayCore } from './types';
|
|
8
|
+
/** Bitwise AND */
|
|
9
|
+
export declare function bitwise_and(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
10
|
+
/** Bitwise OR */
|
|
11
|
+
export declare function bitwise_or(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
12
|
+
/** Bitwise XOR */
|
|
13
|
+
export declare function bitwise_xor(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
14
|
+
/** Bitwise NOT */
|
|
15
|
+
export declare function bitwise_not(x: NDArrayCore): NDArrayCore;
|
|
16
|
+
/** Bitwise inversion (alias for bitwise_not) */
|
|
17
|
+
export declare function invert(x: NDArrayCore): NDArrayCore;
|
|
18
|
+
/** Left shift */
|
|
19
|
+
export declare function left_shift(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
20
|
+
/** Right shift */
|
|
21
|
+
export declare function right_shift(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
22
|
+
/** Pack bits into bytes */
|
|
23
|
+
export declare function packbits(a: NDArrayCore, axis?: number, bitorder?: 'big' | 'little'): NDArrayCore;
|
|
24
|
+
/** Unpack bytes into bits */
|
|
25
|
+
export declare function unpackbits(a: NDArrayCore, axis?: number, count?: number, bitorder?: 'big' | 'little'): NDArrayCore;
|
|
26
|
+
/** Count number of 1 bits */
|
|
27
|
+
export declare function bitwise_count(x: NDArrayCore): NDArrayCore;
|
|
28
|
+
/** Alias for bitwise_not */
|
|
29
|
+
export declare function bitwise_invert(x: NDArrayCore): NDArrayCore;
|
|
30
|
+
/** Alias for left_shift */
|
|
31
|
+
export declare function bitwise_left_shift(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
32
|
+
/** Alias for right_shift */
|
|
33
|
+
export declare function bitwise_right_shift(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
34
|
+
//# sourceMappingURL=bitwise.d.ts.map
|
|
@@ -1,94 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Complex
|
|
2
|
+
* Complex Number Functions - Tree-shakeable standalone functions
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* This module provides complex number operations that can be
|
|
5
|
+
* imported independently for optimal tree-shaking.
|
|
6
6
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*/
|
|
18
|
-
export declare
|
|
19
|
-
/** Real part */
|
|
20
|
-
readonly re: number;
|
|
21
|
-
/** Imaginary part */
|
|
22
|
-
readonly im: number;
|
|
23
|
-
constructor(re: number, im?: number);
|
|
24
|
-
/**
|
|
25
|
-
* Returns the magnitude (absolute value) of the complex number.
|
|
26
|
-
* |z| = sqrt(re² + im²)
|
|
27
|
-
*/
|
|
28
|
-
abs(): number;
|
|
29
|
-
/**
|
|
30
|
-
* Returns the phase angle (argument) of the complex number in radians.
|
|
31
|
-
* arg(z) = atan2(im, re)
|
|
32
|
-
*/
|
|
33
|
-
angle(): number;
|
|
34
|
-
/**
|
|
35
|
-
* Returns the complex conjugate.
|
|
36
|
-
* conj(a + bi) = a - bi
|
|
37
|
-
*/
|
|
38
|
-
conj(): Complex;
|
|
39
|
-
/**
|
|
40
|
-
* Add another complex number or real number.
|
|
41
|
-
*/
|
|
42
|
-
add(other: Complex | number): Complex;
|
|
43
|
-
/**
|
|
44
|
-
* Subtract another complex number or real number.
|
|
45
|
-
*/
|
|
46
|
-
sub(other: Complex | number): Complex;
|
|
47
|
-
/**
|
|
48
|
-
* Multiply by another complex number or real number.
|
|
49
|
-
* (a + bi)(c + di) = (ac - bd) + (ad + bc)i
|
|
50
|
-
*/
|
|
51
|
-
mul(other: Complex | number): Complex;
|
|
52
|
-
/**
|
|
53
|
-
* Divide by another complex number or real number.
|
|
54
|
-
* (a + bi) / (c + di) = ((ac + bd) + (bc - ad)i) / (c² + d²)
|
|
55
|
-
*/
|
|
56
|
-
div(other: Complex | number): Complex;
|
|
57
|
-
/**
|
|
58
|
-
* Returns the negation of this complex number.
|
|
59
|
-
*/
|
|
60
|
-
neg(): Complex;
|
|
61
|
-
/**
|
|
62
|
-
* Check equality with another complex number.
|
|
63
|
-
*/
|
|
64
|
-
equals(other: Complex): boolean;
|
|
65
|
-
/**
|
|
66
|
-
* String representation matching NumPy/Python format: "(a+bj)"
|
|
67
|
-
*/
|
|
68
|
-
toString(): string;
|
|
69
|
-
/**
|
|
70
|
-
* Create a Complex from various input formats.
|
|
71
|
-
* Accepts:
|
|
72
|
-
* - Complex instance
|
|
73
|
-
* - {re, im} object
|
|
74
|
-
* - [re, im] array
|
|
75
|
-
* - number (creates re + 0i)
|
|
76
|
-
*/
|
|
77
|
-
static from(value: ComplexInput): Complex;
|
|
78
|
-
/**
|
|
79
|
-
* Check if a value is a complex number representation.
|
|
80
|
-
*/
|
|
81
|
-
static isComplex(value: unknown): value is ComplexInput;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Input types that can be converted to Complex.
|
|
85
|
-
*/
|
|
86
|
-
export type ComplexInput = Complex | {
|
|
87
|
-
re: number;
|
|
88
|
-
im?: number;
|
|
89
|
-
} | [number, number] | number;
|
|
90
|
-
/**
|
|
91
|
-
* Helper to check if a value looks like a complex number input.
|
|
92
|
-
*/
|
|
93
|
-
export declare function isComplexLike(value: unknown): value is ComplexInput;
|
|
7
|
+
import { NDArrayCore } from './types';
|
|
8
|
+
export { Complex } from '../common/complex';
|
|
9
|
+
/** Extract real part of array */
|
|
10
|
+
export declare function real(x: NDArrayCore): NDArrayCore;
|
|
11
|
+
/** Extract imaginary part of array */
|
|
12
|
+
export declare function imag(x: NDArrayCore): NDArrayCore;
|
|
13
|
+
/** Complex conjugate */
|
|
14
|
+
export declare function conj(x: NDArrayCore): NDArrayCore;
|
|
15
|
+
/** Alias for conj */
|
|
16
|
+
export declare const conjugate: typeof conj;
|
|
17
|
+
/** Phase angle */
|
|
18
|
+
export declare function angle(x: NDArrayCore, deg?: boolean): NDArrayCore;
|
|
94
19
|
//# sourceMappingURL=complex.d.ts.map
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Array Creation Functions - Tree-shakeable standalone module
|
|
3
|
+
*
|
|
4
|
+
* This module provides all array creation functions including:
|
|
5
|
+
* - Basic: zeros, ones, empty, full, array, arange, linspace, etc.
|
|
6
|
+
* - Advanced: diag, tri, meshgrid, vander, etc.
|
|
7
|
+
*
|
|
8
|
+
* All functions return NDArrayCore for optimal tree-shaking.
|
|
9
|
+
*/
|
|
10
|
+
import { NDArrayCore, type DType } from '../common/ndarray-core';
|
|
11
|
+
import { type TypedArray } from '../common/dtype';
|
|
12
|
+
export type { DType, TypedArray } from '../common/dtype';
|
|
13
|
+
/**
|
|
14
|
+
* Create array of zeros
|
|
15
|
+
*/
|
|
16
|
+
export declare function zeros(shape: number[], dtype?: DType): NDArrayCore;
|
|
17
|
+
/**
|
|
18
|
+
* Create array of ones
|
|
19
|
+
*/
|
|
20
|
+
export declare function ones(shape: number[], dtype?: DType): NDArrayCore;
|
|
21
|
+
/**
|
|
22
|
+
* Create an uninitialized array (zeros in JS)
|
|
23
|
+
*/
|
|
24
|
+
export declare function empty(shape: number[], dtype?: DType): NDArrayCore;
|
|
25
|
+
/**
|
|
26
|
+
* Create array filled with a constant value
|
|
27
|
+
*/
|
|
28
|
+
export declare function full(shape: number[], fill_value: number | bigint | boolean, dtype?: DType): NDArrayCore;
|
|
29
|
+
/**
|
|
30
|
+
* Create array from nested JavaScript arrays
|
|
31
|
+
*/
|
|
32
|
+
export declare function array(data: unknown, dtype?: DType): NDArrayCore;
|
|
33
|
+
/**
|
|
34
|
+
* Create array with evenly spaced values within a given interval
|
|
35
|
+
*/
|
|
36
|
+
export declare function arange(start: number, stop?: number, step?: number, dtype?: DType): NDArrayCore;
|
|
37
|
+
/**
|
|
38
|
+
* Create array with evenly spaced values over a specified interval
|
|
39
|
+
*/
|
|
40
|
+
export declare function linspace(start: number, stop: number, num?: number, dtype?: DType): NDArrayCore;
|
|
41
|
+
/**
|
|
42
|
+
* Create array with logarithmically spaced values
|
|
43
|
+
*/
|
|
44
|
+
export declare function logspace(start: number, stop: number, num?: number, base?: number, dtype?: DType): NDArrayCore;
|
|
45
|
+
/**
|
|
46
|
+
* Create array with geometrically spaced values
|
|
47
|
+
*/
|
|
48
|
+
export declare function geomspace(start: number, stop: number, num?: number, dtype?: DType): NDArrayCore;
|
|
49
|
+
/**
|
|
50
|
+
* Create identity matrix
|
|
51
|
+
*/
|
|
52
|
+
export declare function eye(n: number, m?: number, k?: number, dtype?: DType): NDArrayCore;
|
|
53
|
+
/**
|
|
54
|
+
* Create a square identity matrix
|
|
55
|
+
*/
|
|
56
|
+
export declare function identity(n: number, dtype?: DType): NDArrayCore;
|
|
57
|
+
/**
|
|
58
|
+
* Convert input to an ndarray
|
|
59
|
+
*/
|
|
60
|
+
export declare function asarray(a: NDArrayCore | unknown, dtype?: DType): NDArrayCore;
|
|
61
|
+
/**
|
|
62
|
+
* Return array of zeros with the same shape and dtype as input
|
|
63
|
+
*/
|
|
64
|
+
export declare function zeros_like(a: NDArrayCore, dtype?: DType): NDArrayCore;
|
|
65
|
+
/**
|
|
66
|
+
* Return array of ones with the same shape and dtype as input
|
|
67
|
+
*/
|
|
68
|
+
export declare function ones_like(a: NDArrayCore, dtype?: DType): NDArrayCore;
|
|
69
|
+
/**
|
|
70
|
+
* Return empty array with the same shape and dtype as input
|
|
71
|
+
*/
|
|
72
|
+
export declare function empty_like(a: NDArrayCore, dtype?: DType): NDArrayCore;
|
|
73
|
+
/**
|
|
74
|
+
* Return array filled with value, same shape and dtype as input
|
|
75
|
+
*/
|
|
76
|
+
export declare function full_like(a: NDArrayCore, fill_value: number | bigint | boolean, dtype?: DType): NDArrayCore;
|
|
77
|
+
/**
|
|
78
|
+
* Deep copy of array
|
|
79
|
+
*/
|
|
80
|
+
export declare function copy(a: NDArrayCore): NDArrayCore;
|
|
81
|
+
export declare function asanyarray(a: NDArrayCore | unknown, dtype?: DType): NDArrayCore;
|
|
82
|
+
export declare function ascontiguousarray(a: NDArrayCore | unknown, dtype?: DType): NDArrayCore;
|
|
83
|
+
export declare function asfortranarray(a: NDArrayCore | unknown, dtype?: DType): NDArrayCore;
|
|
84
|
+
export declare function asarray_chkfinite(a: NDArrayCore | unknown, dtype?: DType): NDArrayCore;
|
|
85
|
+
export declare function require(a: NDArrayCore, dtype?: DType, _requirements?: string | string[]): NDArrayCore;
|
|
86
|
+
export declare function diag(v: NDArrayCore, k?: number): NDArrayCore;
|
|
87
|
+
export declare function diagflat(v: NDArrayCore, k?: number): NDArrayCore;
|
|
88
|
+
export declare function tri(N: number, M?: number, k?: number, dtype?: DType): NDArrayCore;
|
|
89
|
+
export declare function tril(m: NDArrayCore, k?: number): NDArrayCore;
|
|
90
|
+
export declare function triu(m: NDArrayCore, k?: number): NDArrayCore;
|
|
91
|
+
export declare function vander(x: NDArrayCore, N?: number, increasing?: boolean): NDArrayCore;
|
|
92
|
+
export declare function frombuffer(buffer: ArrayBuffer | TypedArray, dtype?: DType, count?: number, offset?: number): NDArrayCore;
|
|
93
|
+
export declare function fromfunction(func: (...indices: number[]) => number, shape: number[], dtype?: DType): NDArrayCore;
|
|
94
|
+
export declare function fromiter(iter: Iterable<number>, dtype?: DType, count?: number): NDArrayCore;
|
|
95
|
+
export declare function fromstring(string: string, dtype?: DType, count?: number, sep?: string): NDArrayCore;
|
|
96
|
+
export declare function fromfile(_file: string, _dtype?: DType, _count?: number, _sep?: string): NDArrayCore;
|
|
97
|
+
export declare function meshgrid(...arrays: NDArrayCore[]): NDArrayCore[];
|
|
98
|
+
//# sourceMappingURL=creation.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formatting and printing functions
|
|
3
|
+
*
|
|
4
|
+
* Tree-shakeable standalone functions that wrap the underlying ops.
|
|
5
|
+
*/
|
|
6
|
+
import { NDArrayCore } from '../common/ndarray-core';
|
|
7
|
+
import * as formattingOps from '../common/ops/formatting';
|
|
8
|
+
export declare const set_printoptions: typeof formattingOps.set_printoptions;
|
|
9
|
+
export declare const get_printoptions: typeof formattingOps.get_printoptions;
|
|
10
|
+
export declare const printoptions: typeof formattingOps.printoptions;
|
|
11
|
+
export declare const format_float_positional: typeof formattingOps.format_float_positional;
|
|
12
|
+
export declare const format_float_scientific: typeof formattingOps.format_float_scientific;
|
|
13
|
+
export declare const base_repr: typeof formattingOps.base_repr;
|
|
14
|
+
export declare const binary_repr: typeof formattingOps.binary_repr;
|
|
15
|
+
export declare function array2string(a: NDArrayCore, options?: {
|
|
16
|
+
max_line_width?: number;
|
|
17
|
+
precision?: number;
|
|
18
|
+
suppress_small?: boolean;
|
|
19
|
+
separator?: string;
|
|
20
|
+
prefix?: string;
|
|
21
|
+
suffix?: string;
|
|
22
|
+
threshold?: number;
|
|
23
|
+
edgeitems?: number;
|
|
24
|
+
sign?: ' ' | '+' | '-';
|
|
25
|
+
floatmode?: 'fixed' | 'unique' | 'maxprec' | 'maxprec_equal';
|
|
26
|
+
}): string;
|
|
27
|
+
export declare function array_repr(a: NDArrayCore, max_line_width?: number, precision?: number, suppress_small?: boolean): string;
|
|
28
|
+
export declare function array_str(a: NDArrayCore, max_line_width?: number, precision?: number): string;
|
|
29
|
+
//# sourceMappingURL=formatting.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gradient and Differentiation Functions - Tree-shakeable standalone functions
|
|
3
|
+
*
|
|
4
|
+
* This module provides differentiation operations that can be
|
|
5
|
+
* imported independently for optimal tree-shaking.
|
|
6
|
+
*/
|
|
7
|
+
import { NDArrayCore } from './types';
|
|
8
|
+
/** Calculate n-th discrete difference */
|
|
9
|
+
export declare function diff(a: NDArrayCore, n?: number, axis?: number): NDArrayCore;
|
|
10
|
+
/** Difference between consecutive elements in 1D array */
|
|
11
|
+
export declare function ediff1d(a: NDArrayCore, to_end?: number[] | null, to_begin?: number[] | null): NDArrayCore;
|
|
12
|
+
/** Return gradient of N-dimensional array */
|
|
13
|
+
export declare function gradient(f: NDArrayCore, varargs?: number | number[], axis?: number | number[] | null): NDArrayCore | NDArrayCore[];
|
|
14
|
+
//# sourceMappingURL=gradient.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Module - Tree-shakeable standalone functions
|
|
3
|
+
*
|
|
4
|
+
* This module re-exports all standalone functions from the various
|
|
5
|
+
* function modules. All functions return NDArrayCore for optimal tree-shaking.
|
|
6
|
+
*
|
|
7
|
+
* For optimal tree-shaking, you can also import from specific submodules:
|
|
8
|
+
* import { sin, cos } from 'numpy-ts/core/trig';
|
|
9
|
+
* import { dot, inv } from 'numpy-ts/core/linalg';
|
|
10
|
+
*/
|
|
11
|
+
export type { DType, TypedArray } from './types';
|
|
12
|
+
export { NDArrayCore, Complex, ArrayStorage } from './types';
|
|
13
|
+
export { zeros, ones, empty, full, array, arange, linspace, logspace, geomspace, eye, identity, asarray, zeros_like, ones_like, empty_like, full_like, copy, asanyarray, ascontiguousarray, asfortranarray, asarray_chkfinite, require, diag, diagflat, tri, tril, triu, vander, frombuffer, fromfunction, fromiter, fromstring, fromfile, meshgrid, } from './creation';
|
|
14
|
+
export { add, subtract, multiply, sqrt, power, pow, exp, exp2, expm1, log, log2, log10, log1p, logaddexp, logaddexp2, absolute, abs, negative, sign, mod, divide, true_divide, floor_divide, positive, reciprocal, cbrt, fabs, divmod, square, remainder, heaviside, float_power, fmod, frexp, gcd, lcm, ldexp, modf, clip, maximum, minimum, fmax, fmin, nan_to_num, interp, unwrap, sinc, i0, } from './arithmetic';
|
|
15
|
+
export { sin, cos, tan, arcsin, asin, arccos, acos, arctan, atan, arctan2, atan2, hypot, degrees, radians, deg2rad, rad2deg, sinh, cosh, tanh, arcsinh, asinh, arccosh, acosh, arctanh, atanh, } from './trig';
|
|
16
|
+
export { dot, matmul, trace, diagonal, kron, transpose, inner, outer, tensordot, einsum, einsum_path, vdot, vecdot, matrix_transpose, permute_dims, matvec, vecmat, cross, linalg, } from './linalg';
|
|
17
|
+
export { reshape, flatten, ravel, squeeze, expand_dims, swapaxes, moveaxis, rollaxis, concatenate, stack, vstack, hstack, dstack, concat, column_stack, row_stack, block, split, array_split, vsplit, hsplit, dsplit, unstack, tile, repeat, flip, fliplr, flipud, rot90, roll, resize, atleast_1d, atleast_2d, atleast_3d, } from './shape';
|
|
18
|
+
export { sum, mean, prod, max, amax, min, amin, ptp, argmin, argmax, variance, var_, variance as var, std, median, percentile, quantile, average, all, any, cumsum, cumulative_sum, cumprod, cumulative_prod, nansum, nanprod, nanmean, nanvar, nanstd, nanmin, nanmax, nanargmin, nanargmax, nancumsum, nancumprod, nanmedian, nanquantile, nanpercentile, } from './reduction';
|
|
19
|
+
export { logical_and, logical_or, logical_not, logical_xor, isfinite, isinf, isnan, isnat, isneginf, isposinf, iscomplex, iscomplexobj, isreal, isrealobj, real_if_close, isfortran, isscalar, iterable, isdtype, promote_types, copysign, signbit, nextafter, spacing, greater, greater_equal, less, less_equal, equal, not_equal, isclose, allclose, } from './logic';
|
|
20
|
+
export { sort, argsort, lexsort, partition, argpartition, sort_complex, nonzero, argwhere, flatnonzero, where, searchsorted, extract, count_nonzero, } from './sorting';
|
|
21
|
+
export { bitwise_and, bitwise_or, bitwise_xor, bitwise_not, invert, left_shift, right_shift, packbits, unpackbits, bitwise_count, bitwise_invert, bitwise_left_shift, bitwise_right_shift, } from './bitwise';
|
|
22
|
+
export { around, round_, round, ceil, fix, floor, rint, trunc } from './rounding';
|
|
23
|
+
export { unique, in1d, intersect1d, isin, setdiff1d, setxor1d, union1d, trim_zeros, unique_all, unique_counts, unique_inverse, unique_values, } from './sets';
|
|
24
|
+
export { bincount, digitize, histogram, histogram2d, histogramdd, correlate, convolve, cov, corrcoef, histogram_bin_edges, trapezoid, } from './statistics';
|
|
25
|
+
export { diff, ediff1d, gradient } from './gradient';
|
|
26
|
+
export { real, imag, conj, conjugate, angle } from './complex';
|
|
27
|
+
export { broadcast_to, broadcast_arrays, broadcast_shapes, take, put, take_along_axis, put_along_axis, choose, compress, select, place, putmask, copyto, indices, ix_, ravel_multi_index, unravel_index, diag_indices, diag_indices_from, fill_diagonal, tril_indices, tril_indices_from, triu_indices, triu_indices_from, mask_indices, array_equal, array_equiv, apply_along_axis, apply_over_axes, may_share_memory, shares_memory, geterr, seterr, iindex, bindex, } from './advanced';
|
|
28
|
+
export { set_printoptions, get_printoptions, printoptions, format_float_positional, format_float_scientific, base_repr, binary_repr, array2string, array_repr, array_str, } from './formatting';
|
|
29
|
+
export { ndim, shape, size, item, tolist, tobytes, byteswap, view, tofile, fill } from './utility';
|
|
30
|
+
export { append, delete_, delete_ as delete, insert, pad } from './shape-extra';
|
|
31
|
+
export { can_cast, common_type, result_type, min_scalar_type, issubdtype, typename, mintypecode, } from './typechecking';
|
|
32
|
+
export { poly, polyadd, polyder, polydiv, polyfit, polyint, polymul, polysub, polyval, roots, } from './polynomial';
|
|
33
|
+
export { parseNpy, parseNpyHeader, parseNpyData } from '../io/npy/parser';
|
|
34
|
+
export { serializeNpy } from '../io/npy/serializer';
|
|
35
|
+
export { UnsupportedDTypeError, InvalidNpyError, SUPPORTED_DTYPES, DTYPE_TO_DESCR, type NpyHeader, type NpyMetadata, type NpyVersion, } from '../io/npy/format';
|
|
36
|
+
export { parseNpz, parseNpzSync, loadNpz, loadNpzSync, type NpzParseOptions, type NpzParseResult, } from '../io/npz/parser';
|
|
37
|
+
export { serializeNpz, serializeNpzSync, type NpzArraysInput, type NpzSerializeOptions, } from '../io/npz/serializer';
|
|
38
|
+
export { parseTxt, genfromtxt, fromregex, type ParseTxtOptions } from '../io/txt/parser';
|
|
39
|
+
export { serializeTxt, type SerializeTxtOptions } from '../io/txt/serializer';
|
|
40
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linear Algebra Functions - Tree-shakeable standalone functions
|
|
3
|
+
*
|
|
4
|
+
* This module provides linear algebra functions that can be
|
|
5
|
+
* imported independently for optimal tree-shaking.
|
|
6
|
+
*/
|
|
7
|
+
import { NDArrayCore, Complex } from './types';
|
|
8
|
+
/** Dot product of two arrays */
|
|
9
|
+
export declare function dot(a: NDArrayCore, b: NDArrayCore): NDArrayCore | number | bigint | Complex;
|
|
10
|
+
/** Matrix trace (sum of diagonal elements) */
|
|
11
|
+
export declare function trace(a: NDArrayCore): number | bigint | Complex;
|
|
12
|
+
/** Return diagonal or construct diagonal array */
|
|
13
|
+
export declare function diagonal(a: NDArrayCore, offset?: number, axis1?: number, axis2?: number): NDArrayCore;
|
|
14
|
+
/** Kronecker product */
|
|
15
|
+
export declare function kron(a: NDArrayCore, b: NDArrayCore): NDArrayCore;
|
|
16
|
+
/** Transpose array - returns a view */
|
|
17
|
+
export declare function transpose(a: NDArrayCore, axes?: number[]): NDArrayCore;
|
|
18
|
+
/** Inner product of two arrays */
|
|
19
|
+
export declare function inner(a: NDArrayCore, b: NDArrayCore): NDArrayCore | number | bigint | Complex;
|
|
20
|
+
/** Outer product of two arrays */
|
|
21
|
+
export declare function outer(a: NDArrayCore, b: NDArrayCore): NDArrayCore;
|
|
22
|
+
/** Tensor dot product */
|
|
23
|
+
export declare function tensordot(a: NDArrayCore, b: NDArrayCore, axes?: number | [number[], number[]]): NDArrayCore | number | bigint | Complex;
|
|
24
|
+
/** Evaluates Einstein summation convention */
|
|
25
|
+
export declare function einsum(subscripts: string, ...operands: NDArrayCore[]): NDArrayCore | number | bigint | Complex;
|
|
26
|
+
/** Compute the optimal contraction path for einsum */
|
|
27
|
+
export declare function einsum_path(subscripts: string, ...operands: NDArrayCore[]): [([number, number] | number[])[], string];
|
|
28
|
+
/** Vector dot product */
|
|
29
|
+
export declare function vdot(a: NDArrayCore, b: NDArrayCore): number | bigint | Complex;
|
|
30
|
+
/** Vector dot product along specified axis */
|
|
31
|
+
export declare function vecdot(x1: NDArrayCore, x2: NDArrayCore, axis?: number): NDArrayCore | number | bigint | Complex;
|
|
32
|
+
/** Matrix transpose (swap last two axes) */
|
|
33
|
+
/** Matrix transpose - returns a view */
|
|
34
|
+
export declare function matrix_transpose(a: NDArrayCore): NDArrayCore;
|
|
35
|
+
/** Permute array dimensions - returns a view */
|
|
36
|
+
export declare function permute_dims(a: NDArrayCore, axes?: number[]): NDArrayCore;
|
|
37
|
+
/** Matrix-vector product */
|
|
38
|
+
export declare function matvec(x1: NDArrayCore, x2: NDArrayCore): NDArrayCore;
|
|
39
|
+
/** Vector-matrix product */
|
|
40
|
+
export declare function vecmat(x1: NDArrayCore, x2: NDArrayCore): NDArrayCore;
|
|
41
|
+
/** Cross product */
|
|
42
|
+
export declare function cross(a: NDArrayCore, b: NDArrayCore, axisa?: number, axisb?: number, axisc?: number, axis?: number): NDArrayCore | number | Complex;
|
|
43
|
+
/** Matrix multiplication */
|
|
44
|
+
export declare function matmul(a: NDArrayCore, b: NDArrayCore): NDArrayCore;
|
|
45
|
+
export declare const linalg: {
|
|
46
|
+
/** Matrix multiplication */
|
|
47
|
+
matmul: (a: NDArrayCore, b: NDArrayCore) => NDArrayCore;
|
|
48
|
+
/** Dot product */
|
|
49
|
+
dot: (a: NDArrayCore, b: NDArrayCore) => NDArrayCore | number | bigint | Complex;
|
|
50
|
+
/** Matrix determinant */
|
|
51
|
+
det: (a: NDArrayCore) => number;
|
|
52
|
+
/** Matrix inverse */
|
|
53
|
+
inv: (a: NDArrayCore) => NDArrayCore;
|
|
54
|
+
/** Solve linear system Ax = b */
|
|
55
|
+
solve: (a: NDArrayCore, b: NDArrayCore) => NDArrayCore;
|
|
56
|
+
/** Least-squares solution */
|
|
57
|
+
lstsq: (a: NDArrayCore, b: NDArrayCore, rcond?: number | null) => {
|
|
58
|
+
x: NDArrayCore;
|
|
59
|
+
residuals: NDArrayCore;
|
|
60
|
+
rank: number;
|
|
61
|
+
s: NDArrayCore;
|
|
62
|
+
};
|
|
63
|
+
/** Matrix or vector norm */
|
|
64
|
+
norm: (x: NDArrayCore, ord?: number | "fro" | "nuc" | null, axis?: number | [number, number] | null, keepdims?: boolean) => NDArrayCore | number;
|
|
65
|
+
/** Condition number */
|
|
66
|
+
cond: (a: NDArrayCore, p?: number | "fro" | "nuc") => number;
|
|
67
|
+
/** Matrix rank */
|
|
68
|
+
matrix_rank: (a: NDArrayCore, tol?: number) => number;
|
|
69
|
+
/** Raise matrix to a power */
|
|
70
|
+
matrix_power: (a: NDArrayCore, n: number) => NDArrayCore;
|
|
71
|
+
/** Pseudo-inverse */
|
|
72
|
+
pinv: (a: NDArrayCore, rcond?: number) => NDArrayCore;
|
|
73
|
+
/** QR decomposition */
|
|
74
|
+
qr: (a: NDArrayCore, mode?: "reduced" | "complete" | "r" | "raw") => {
|
|
75
|
+
q: NDArrayCore;
|
|
76
|
+
r: NDArrayCore;
|
|
77
|
+
} | NDArrayCore | {
|
|
78
|
+
h: NDArrayCore;
|
|
79
|
+
tau: NDArrayCore;
|
|
80
|
+
};
|
|
81
|
+
/** Cholesky decomposition */
|
|
82
|
+
cholesky: (a: NDArrayCore, upper?: boolean) => NDArrayCore;
|
|
83
|
+
/** Singular value decomposition */
|
|
84
|
+
svd: (a: NDArrayCore, full_matrices?: boolean, compute_uv?: boolean) => {
|
|
85
|
+
u: NDArrayCore;
|
|
86
|
+
s: NDArrayCore;
|
|
87
|
+
vt: NDArrayCore;
|
|
88
|
+
} | NDArrayCore;
|
|
89
|
+
/** Eigenvalues and eigenvectors */
|
|
90
|
+
eig: (a: NDArrayCore) => {
|
|
91
|
+
w: NDArrayCore;
|
|
92
|
+
v: NDArrayCore;
|
|
93
|
+
};
|
|
94
|
+
/** Eigenvalues and eigenvectors of Hermitian matrix */
|
|
95
|
+
eigh: (a: NDArrayCore, UPLO?: "L" | "U") => {
|
|
96
|
+
w: NDArrayCore;
|
|
97
|
+
v: NDArrayCore;
|
|
98
|
+
};
|
|
99
|
+
/** Eigenvalues */
|
|
100
|
+
eigvals: (a: NDArrayCore) => NDArrayCore;
|
|
101
|
+
/** Eigenvalues of Hermitian matrix */
|
|
102
|
+
eigvalsh: (a: NDArrayCore, UPLO?: "L" | "U") => NDArrayCore;
|
|
103
|
+
/** Sign and log of determinant */
|
|
104
|
+
slogdet: (a: NDArrayCore) => {
|
|
105
|
+
sign: number;
|
|
106
|
+
logabsdet: number;
|
|
107
|
+
};
|
|
108
|
+
/** Singular values */
|
|
109
|
+
svdvals: (a: NDArrayCore) => NDArrayCore;
|
|
110
|
+
/** Chained dot product */
|
|
111
|
+
multi_dot: (arrays: NDArrayCore[]) => NDArrayCore;
|
|
112
|
+
/** Inverse of tensorization */
|
|
113
|
+
tensorinv: (a: NDArrayCore, ind?: number) => NDArrayCore;
|
|
114
|
+
/** Tensor equation solution */
|
|
115
|
+
tensorsolve: (a: NDArrayCore, b: NDArrayCore, axes?: number[]) => NDArrayCore;
|
|
116
|
+
/** Vector norm */
|
|
117
|
+
vector_norm: (x: NDArrayCore, ord?: number | "fro" | "nuc", axis?: number | null, keepdims?: boolean) => NDArrayCore | number;
|
|
118
|
+
/** Matrix norm */
|
|
119
|
+
matrix_norm: (x: NDArrayCore, ord?: number | "fro" | "nuc", keepdims?: boolean) => NDArrayCore | number;
|
|
120
|
+
/** Cross product */
|
|
121
|
+
cross: (a: NDArrayCore, b: NDArrayCore, axisa?: number, axisb?: number, axisc?: number, axis?: number) => NDArrayCore | number | Complex;
|
|
122
|
+
/** Matrix transpose (transposes last two axes) - returns a view */
|
|
123
|
+
matrix_transpose: (a: NDArrayCore) => NDArrayCore;
|
|
124
|
+
/** Permute array dimensions - returns a view */
|
|
125
|
+
permute_dims: (a: NDArrayCore, axes?: number[]) => NDArrayCore;
|
|
126
|
+
/** Matrix trace (sum of diagonal elements) */
|
|
127
|
+
trace: (a: NDArrayCore) => number | bigint | Complex;
|
|
128
|
+
/** Extract diagonal */
|
|
129
|
+
diagonal: (a: NDArrayCore, offset?: number, axis1?: number, axis2?: number) => NDArrayCore;
|
|
130
|
+
/** Outer product */
|
|
131
|
+
outer: (a: NDArrayCore, b: NDArrayCore) => NDArrayCore;
|
|
132
|
+
/** Inner product */
|
|
133
|
+
inner: (a: NDArrayCore, b: NDArrayCore) => NDArrayCore | number | bigint | Complex;
|
|
134
|
+
/** Tensor dot product */
|
|
135
|
+
tensordot: (a: NDArrayCore, b: NDArrayCore, axes?: number | [number[], number[]]) => NDArrayCore | number | bigint | Complex;
|
|
136
|
+
/** Vector dot product */
|
|
137
|
+
vecdot: (a: NDArrayCore, b: NDArrayCore, axis?: number) => NDArrayCore | number | bigint | Complex;
|
|
138
|
+
/** Transpose array - returns a view */
|
|
139
|
+
transpose: (a: NDArrayCore, axes?: number[]) => NDArrayCore;
|
|
140
|
+
};
|
|
141
|
+
//# sourceMappingURL=linalg.d.ts.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Logic Functions - Tree-shakeable standalone functions
|
|
3
|
+
*
|
|
4
|
+
* This module provides logical and type-checking functions that can be
|
|
5
|
+
* imported independently for optimal tree-shaking.
|
|
6
|
+
*/
|
|
7
|
+
import { NDArrayCore, type DType } from './types';
|
|
8
|
+
/** Element-wise logical AND */
|
|
9
|
+
export declare function logical_and(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
10
|
+
/** Element-wise logical OR */
|
|
11
|
+
export declare function logical_or(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
12
|
+
/** Element-wise logical NOT */
|
|
13
|
+
export declare function logical_not(x: NDArrayCore): NDArrayCore;
|
|
14
|
+
/** Element-wise logical XOR */
|
|
15
|
+
export declare function logical_xor(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
16
|
+
/** Test for finite values */
|
|
17
|
+
export declare function isfinite(x: NDArrayCore): NDArrayCore;
|
|
18
|
+
/** Test for infinity */
|
|
19
|
+
export declare function isinf(x: NDArrayCore): NDArrayCore;
|
|
20
|
+
/** Test for NaN */
|
|
21
|
+
export declare function isnan(x: NDArrayCore): NDArrayCore;
|
|
22
|
+
/** Test for NaT (not a time) - returns all False for numeric arrays */
|
|
23
|
+
export declare function isnat(x: NDArrayCore): NDArrayCore;
|
|
24
|
+
/** Test for negative infinity */
|
|
25
|
+
export declare function isneginf(x: NDArrayCore): NDArrayCore;
|
|
26
|
+
/** Test for positive infinity */
|
|
27
|
+
export declare function isposinf(x: NDArrayCore): NDArrayCore;
|
|
28
|
+
/** Element-wise test for complex values */
|
|
29
|
+
export declare function iscomplex(x: NDArrayCore): NDArrayCore;
|
|
30
|
+
/** Check if array has complex dtype */
|
|
31
|
+
export declare function iscomplexobj(x: NDArrayCore): boolean;
|
|
32
|
+
/** Element-wise test for real values */
|
|
33
|
+
export declare function isreal(x: NDArrayCore): NDArrayCore;
|
|
34
|
+
/** Check if array has real dtype */
|
|
35
|
+
export declare function isrealobj(x: NDArrayCore): boolean;
|
|
36
|
+
/** Return real array if imaginary part is negligible */
|
|
37
|
+
export declare function real_if_close(x: NDArrayCore, tol?: number): NDArrayCore;
|
|
38
|
+
/** Check if array is Fortran contiguous */
|
|
39
|
+
export declare function isfortran(x: NDArrayCore): boolean;
|
|
40
|
+
/** Check if value is a scalar */
|
|
41
|
+
export declare function isscalar(val: unknown): boolean;
|
|
42
|
+
/** Check if object is iterable */
|
|
43
|
+
export declare function iterable(obj: unknown): boolean;
|
|
44
|
+
/** Check dtype against a kind string */
|
|
45
|
+
export declare function isdtype(dtype: DType, kind: string): boolean;
|
|
46
|
+
/** Promote dtypes to a common type */
|
|
47
|
+
export declare function promote_types(dtype1: DType, dtype2: DType): DType;
|
|
48
|
+
/** Return sign of x1 with magnitude of x2 */
|
|
49
|
+
export declare function copysign(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
50
|
+
/** Test for negative sign bit */
|
|
51
|
+
export declare function signbit(x: NDArrayCore): NDArrayCore;
|
|
52
|
+
/** Next floating-point value toward x2 */
|
|
53
|
+
export declare function nextafter(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
54
|
+
/** Spacing between x and nearest adjacent number */
|
|
55
|
+
export declare function spacing(x: NDArrayCore): NDArrayCore;
|
|
56
|
+
/** Element-wise greater than comparison */
|
|
57
|
+
export declare function greater(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
58
|
+
/** Element-wise greater than or equal comparison */
|
|
59
|
+
export declare function greater_equal(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
60
|
+
/** Element-wise less than comparison */
|
|
61
|
+
export declare function less(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
62
|
+
/** Element-wise less than or equal comparison */
|
|
63
|
+
export declare function less_equal(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
64
|
+
/** Element-wise equality comparison */
|
|
65
|
+
export declare function equal(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
66
|
+
/** Element-wise inequality comparison */
|
|
67
|
+
export declare function not_equal(x1: NDArrayCore, x2: NDArrayCore | number): NDArrayCore;
|
|
68
|
+
/** Element-wise close comparison with tolerance */
|
|
69
|
+
export declare function isclose(a: NDArrayCore, b: NDArrayCore | number, rtol?: number, atol?: number): NDArrayCore;
|
|
70
|
+
/** Check if all elements are close */
|
|
71
|
+
export declare function allclose(a: NDArrayCore, b: NDArrayCore | number, rtol?: number, atol?: number): boolean;
|
|
72
|
+
//# sourceMappingURL=logic.d.ts.map
|