@iyulab/u-numflow 0.5.0 → 0.6.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 +2 -2
- package/node/u_numflow.cjs +107 -6
- package/node/u_numflow.d.cts +19 -4
- package/node/u_numflow_bg.wasm +0 -0
- package/package.json +1 -1
- package/u_numflow.d.ts +19 -4
- package/u_numflow.js +1 -1
- package/u_numflow_bg.js +106 -6
- package/u_numflow_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ u-numflow provides foundational mathematical, statistical, and probabilistic bui
|
|
|
17
17
|
|--------|-------------|
|
|
18
18
|
| `stats` | Descriptive statistics (mean, variance, skewness, kurtosis) with Welford's online algorithm and Neumaier summation |
|
|
19
19
|
| `distributions` | Probability distributions: Uniform, Triangular, PERT, Normal, LogNormal |
|
|
20
|
-
| `special` | Special functions: normal
|
|
20
|
+
| `special` | Special functions: normal CDF and tail-precise survival function (and their inverses), t/F/chi² CDF, regularized incomplete beta/gamma, erf |
|
|
21
21
|
| `transforms` | Data transformations: Box-Cox (λ via MLE golden-section search), inverse Box-Cox |
|
|
22
22
|
| `fourier` | Discrete Fourier transform of any length (radix-2 for powers of two, Bluestein otherwise): `fft`, `ifft`, `rfft`, `Complex` |
|
|
23
23
|
| `matrix` | Dense matrix operations: determinant, inverse, Cholesky decomposition, Jacobi eigenvalue decomposition |
|
|
@@ -100,7 +100,7 @@ The package resolves per environment via a conditional `exports` map:
|
|
|
100
100
|
| Bundlers (webpack, Vite, …) | ESM + WebAssembly ESM-integration (`default` condition) |
|
|
101
101
|
| Node.js — `require()`, ESM `import`, CJS TS runners (`tsx`, `ts-node`) | CJS glue loading the wasm from the filesystem (`node` condition) — no loader hooks or flags |
|
|
102
102
|
|
|
103
|
-
Exported functions: `mean`, `std_dev`, `variance`, `normal_cdf`, `box_cox`, `estimate_lambda
|
|
103
|
+
Exported functions: `mean`, `std_dev`, `variance`, `normal_cdf`, `normal_sf` (upper tail `P(Z > x)`, computed directly so tail probabilities keep ~15 significant digits), `box_cox`, `estimate_lambda` (returns `{ lambda, at_bound }` — `at_bound` is `true` when the likelihood was still rising at an end of the search range, so `lambda` is that limit), and
|
|
104
104
|
`rfft(data) -> Float64Array` — the DFT of a real sequence of any length, interleaved as
|
|
105
105
|
`[re0, im0, re1, im1, …]` (bins `k` and `n − k` are conjugates, so `0..=n/2` describes the spectrum).
|
|
106
106
|
|
package/node/u_numflow.cjs
CHANGED
|
@@ -28,15 +28,20 @@ exports.box_cox = box_cox;
|
|
|
28
28
|
/**
|
|
29
29
|
* Estimate the optimal Box-Cox lambda via profile maximum likelihood.
|
|
30
30
|
*
|
|
31
|
-
* Searches in the range `[lambda_min, lambda_max]` using golden-section search
|
|
31
|
+
* Searches in the range `[lambda_min, lambda_max]` using golden-section search
|
|
32
|
+
* and returns `{ lambda: number, at_bound: boolean }`. `at_bound` is `true`
|
|
33
|
+
* when the maximum lies on an end of the range — the likelihood was still
|
|
34
|
+
* rising there, so `lambda` is that range limit (reported exactly), not an
|
|
35
|
+
* interior estimate; widen the range to find the unconstrained optimum.
|
|
32
36
|
*
|
|
33
37
|
* # Errors
|
|
34
38
|
* Returns a `JsValue` error string if data contains non-positive values,
|
|
35
|
-
* has fewer than 2 elements, or
|
|
39
|
+
* has fewer than 2 elements, or the range is not finite with
|
|
40
|
+
* `lambda_min < lambda_max`.
|
|
36
41
|
* @param {Float64Array} data
|
|
37
42
|
* @param {number} lambda_min
|
|
38
43
|
* @param {number} lambda_max
|
|
39
|
-
* @returns {
|
|
44
|
+
* @returns {any}
|
|
40
45
|
*/
|
|
41
46
|
function estimate_lambda(data, lambda_min, lambda_max) {
|
|
42
47
|
const ptr0 = passArrayF64ToWasm0(data, wasm.__wbindgen_malloc);
|
|
@@ -45,7 +50,7 @@ function estimate_lambda(data, lambda_min, lambda_max) {
|
|
|
45
50
|
if (ret[2]) {
|
|
46
51
|
throw takeFromExternrefTable0(ret[1]);
|
|
47
52
|
}
|
|
48
|
-
return ret[0];
|
|
53
|
+
return takeFromExternrefTable0(ret[0]);
|
|
49
54
|
}
|
|
50
55
|
exports.estimate_lambda = estimate_lambda;
|
|
51
56
|
|
|
@@ -69,7 +74,8 @@ exports.mean = mean;
|
|
|
69
74
|
*
|
|
70
75
|
* To evaluate a general normal N(μ, σ), pass `(x - μ) / σ`.
|
|
71
76
|
*
|
|
72
|
-
*
|
|
77
|
+
* Computed as `erfc(−x/√2)/2` with a direct `erfc`, so the lower tail keeps
|
|
78
|
+
* relative precision. For the upper tail use [`normal_sf`].
|
|
73
79
|
* @param {number} x
|
|
74
80
|
* @returns {number}
|
|
75
81
|
*/
|
|
@@ -79,6 +85,21 @@ function normal_cdf(x) {
|
|
|
79
85
|
}
|
|
80
86
|
exports.normal_cdf = normal_cdf;
|
|
81
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Standard normal survival function P(Z > x) = 1 − Φ(x) for Z ~ N(0, 1).
|
|
90
|
+
*
|
|
91
|
+
* Computed directly (not as `1 − normal_cdf(x)`), so upper-tail
|
|
92
|
+
* probabilities such as PPM defect rates keep their significant digits:
|
|
93
|
+
* `normal_sf(6)` is `9.865876450376948e-10` to about 15 digits.
|
|
94
|
+
* @param {number} x
|
|
95
|
+
* @returns {number}
|
|
96
|
+
*/
|
|
97
|
+
function normal_sf(x) {
|
|
98
|
+
const ret = wasm.normal_sf(x);
|
|
99
|
+
return ret;
|
|
100
|
+
}
|
|
101
|
+
exports.normal_sf = normal_sf;
|
|
102
|
+
|
|
82
103
|
/**
|
|
83
104
|
* Forward DFT of a real sequence of any length.
|
|
84
105
|
*
|
|
@@ -130,7 +151,29 @@ exports.variance = variance;
|
|
|
130
151
|
function __wbg_get_imports() {
|
|
131
152
|
const import0 = {
|
|
132
153
|
__proto__: null,
|
|
133
|
-
|
|
154
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
155
|
+
const ret = String(arg1);
|
|
156
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
157
|
+
const len1 = WASM_VECTOR_LEN;
|
|
158
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
159
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
160
|
+
},
|
|
161
|
+
__wbg___wbindgen_throw_5d9e815e6fdf150f: function(arg0, arg1) {
|
|
162
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
163
|
+
},
|
|
164
|
+
__wbg_new_bebc3f4757acf305: function() {
|
|
165
|
+
const ret = new Object();
|
|
166
|
+
return ret;
|
|
167
|
+
},
|
|
168
|
+
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
169
|
+
arg0[arg1] = arg2;
|
|
170
|
+
},
|
|
171
|
+
__wbindgen_generic_0000000000000001: function(arg0) {
|
|
172
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
173
|
+
const ret = arg0;
|
|
174
|
+
return ret;
|
|
175
|
+
},
|
|
176
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
134
177
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
135
178
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
136
179
|
return ret;
|
|
@@ -156,6 +199,14 @@ function getArrayF64FromWasm0(ptr, len) {
|
|
|
156
199
|
return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
157
200
|
}
|
|
158
201
|
|
|
202
|
+
let cachedDataViewMemory0 = null;
|
|
203
|
+
function getDataViewMemory0() {
|
|
204
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
205
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
206
|
+
}
|
|
207
|
+
return cachedDataViewMemory0;
|
|
208
|
+
}
|
|
209
|
+
|
|
159
210
|
let cachedFloat64ArrayMemory0 = null;
|
|
160
211
|
function getFloat64ArrayMemory0() {
|
|
161
212
|
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
|
|
@@ -183,6 +234,43 @@ function passArrayF64ToWasm0(arg, malloc) {
|
|
|
183
234
|
return ptr;
|
|
184
235
|
}
|
|
185
236
|
|
|
237
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
238
|
+
if (realloc === undefined) {
|
|
239
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
240
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
241
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
242
|
+
WASM_VECTOR_LEN = buf.length;
|
|
243
|
+
return ptr;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
let len = arg.length;
|
|
247
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
248
|
+
|
|
249
|
+
const mem = getUint8ArrayMemory0();
|
|
250
|
+
|
|
251
|
+
let offset = 0;
|
|
252
|
+
|
|
253
|
+
for (; offset < len; offset++) {
|
|
254
|
+
const code = arg.charCodeAt(offset);
|
|
255
|
+
if (code > 0x7F) break;
|
|
256
|
+
mem[ptr + offset] = code;
|
|
257
|
+
}
|
|
258
|
+
if (offset !== len) {
|
|
259
|
+
if (offset !== 0) {
|
|
260
|
+
arg = arg.slice(offset);
|
|
261
|
+
}
|
|
262
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
263
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
264
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
265
|
+
|
|
266
|
+
offset += ret.written;
|
|
267
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
WASM_VECTOR_LEN = offset;
|
|
271
|
+
return ptr;
|
|
272
|
+
}
|
|
273
|
+
|
|
186
274
|
function takeFromExternrefTable0(idx) {
|
|
187
275
|
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
188
276
|
wasm.__externref_table_dealloc(idx);
|
|
@@ -195,6 +283,19 @@ function decodeText(ptr, len) {
|
|
|
195
283
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
196
284
|
}
|
|
197
285
|
|
|
286
|
+
const cachedTextEncoder = new TextEncoder();
|
|
287
|
+
|
|
288
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
289
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
290
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
291
|
+
view.set(buf);
|
|
292
|
+
return {
|
|
293
|
+
read: arg.length,
|
|
294
|
+
written: buf.length
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
}
|
|
298
|
+
|
|
198
299
|
let WASM_VECTOR_LEN = 0;
|
|
199
300
|
|
|
200
301
|
const wasmPath = `${__dirname}/u_numflow_bg.wasm`;
|
package/node/u_numflow.d.cts
CHANGED
|
@@ -15,13 +15,18 @@ export function box_cox(data: Float64Array, lambda: number): Float64Array;
|
|
|
15
15
|
/**
|
|
16
16
|
* Estimate the optimal Box-Cox lambda via profile maximum likelihood.
|
|
17
17
|
*
|
|
18
|
-
* Searches in the range `[lambda_min, lambda_max]` using golden-section search
|
|
18
|
+
* Searches in the range `[lambda_min, lambda_max]` using golden-section search
|
|
19
|
+
* and returns `{ lambda: number, at_bound: boolean }`. `at_bound` is `true`
|
|
20
|
+
* when the maximum lies on an end of the range — the likelihood was still
|
|
21
|
+
* rising there, so `lambda` is that range limit (reported exactly), not an
|
|
22
|
+
* interior estimate; widen the range to find the unconstrained optimum.
|
|
19
23
|
*
|
|
20
24
|
* # Errors
|
|
21
25
|
* Returns a `JsValue` error string if data contains non-positive values,
|
|
22
|
-
* has fewer than 2 elements, or
|
|
26
|
+
* has fewer than 2 elements, or the range is not finite with
|
|
27
|
+
* `lambda_min < lambda_max`.
|
|
23
28
|
*/
|
|
24
|
-
export function estimate_lambda(data: Float64Array, lambda_min: number, lambda_max: number):
|
|
29
|
+
export function estimate_lambda(data: Float64Array, lambda_min: number, lambda_max: number): any;
|
|
25
30
|
|
|
26
31
|
/**
|
|
27
32
|
* Arithmetic mean of `data` using Kahan compensated summation.
|
|
@@ -35,10 +40,20 @@ export function mean(data: Float64Array): number;
|
|
|
35
40
|
*
|
|
36
41
|
* To evaluate a general normal N(μ, σ), pass `(x - μ) / σ`.
|
|
37
42
|
*
|
|
38
|
-
*
|
|
43
|
+
* Computed as `erfc(−x/√2)/2` with a direct `erfc`, so the lower tail keeps
|
|
44
|
+
* relative precision. For the upper tail use [`normal_sf`].
|
|
39
45
|
*/
|
|
40
46
|
export function normal_cdf(x: number): number;
|
|
41
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Standard normal survival function P(Z > x) = 1 − Φ(x) for Z ~ N(0, 1).
|
|
50
|
+
*
|
|
51
|
+
* Computed directly (not as `1 − normal_cdf(x)`), so upper-tail
|
|
52
|
+
* probabilities such as PPM defect rates keep their significant digits:
|
|
53
|
+
* `normal_sf(6)` is `9.865876450376948e-10` to about 15 digits.
|
|
54
|
+
*/
|
|
55
|
+
export function normal_sf(x: number): number;
|
|
56
|
+
|
|
42
57
|
/**
|
|
43
58
|
* Forward DFT of a real sequence of any length.
|
|
44
59
|
*
|
package/node/u_numflow_bg.wasm
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/u_numflow.d.ts
CHANGED
|
@@ -15,13 +15,18 @@ export function box_cox(data: Float64Array, lambda: number): Float64Array;
|
|
|
15
15
|
/**
|
|
16
16
|
* Estimate the optimal Box-Cox lambda via profile maximum likelihood.
|
|
17
17
|
*
|
|
18
|
-
* Searches in the range `[lambda_min, lambda_max]` using golden-section search
|
|
18
|
+
* Searches in the range `[lambda_min, lambda_max]` using golden-section search
|
|
19
|
+
* and returns `{ lambda: number, at_bound: boolean }`. `at_bound` is `true`
|
|
20
|
+
* when the maximum lies on an end of the range — the likelihood was still
|
|
21
|
+
* rising there, so `lambda` is that range limit (reported exactly), not an
|
|
22
|
+
* interior estimate; widen the range to find the unconstrained optimum.
|
|
19
23
|
*
|
|
20
24
|
* # Errors
|
|
21
25
|
* Returns a `JsValue` error string if data contains non-positive values,
|
|
22
|
-
* has fewer than 2 elements, or
|
|
26
|
+
* has fewer than 2 elements, or the range is not finite with
|
|
27
|
+
* `lambda_min < lambda_max`.
|
|
23
28
|
*/
|
|
24
|
-
export function estimate_lambda(data: Float64Array, lambda_min: number, lambda_max: number):
|
|
29
|
+
export function estimate_lambda(data: Float64Array, lambda_min: number, lambda_max: number): any;
|
|
25
30
|
|
|
26
31
|
/**
|
|
27
32
|
* Arithmetic mean of `data` using Kahan compensated summation.
|
|
@@ -35,10 +40,20 @@ export function mean(data: Float64Array): number;
|
|
|
35
40
|
*
|
|
36
41
|
* To evaluate a general normal N(μ, σ), pass `(x - μ) / σ`.
|
|
37
42
|
*
|
|
38
|
-
*
|
|
43
|
+
* Computed as `erfc(−x/√2)/2` with a direct `erfc`, so the lower tail keeps
|
|
44
|
+
* relative precision. For the upper tail use [`normal_sf`].
|
|
39
45
|
*/
|
|
40
46
|
export function normal_cdf(x: number): number;
|
|
41
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Standard normal survival function P(Z > x) = 1 − Φ(x) for Z ~ N(0, 1).
|
|
50
|
+
*
|
|
51
|
+
* Computed directly (not as `1 − normal_cdf(x)`), so upper-tail
|
|
52
|
+
* probabilities such as PPM defect rates keep their significant digits:
|
|
53
|
+
* `normal_sf(6)` is `9.865876450376948e-10` to about 15 digits.
|
|
54
|
+
*/
|
|
55
|
+
export function normal_sf(x: number): number;
|
|
56
|
+
|
|
42
57
|
/**
|
|
43
58
|
* Forward DFT of a real sequence of any length.
|
|
44
59
|
*
|
package/u_numflow.js
CHANGED
|
@@ -5,5 +5,5 @@ import { __wbg_set_wasm } from "./u_numflow_bg.js";
|
|
|
5
5
|
__wbg_set_wasm(wasm);
|
|
6
6
|
wasm.__wbindgen_start();
|
|
7
7
|
export {
|
|
8
|
-
box_cox, estimate_lambda, mean, normal_cdf, rfft, std_dev, variance
|
|
8
|
+
box_cox, estimate_lambda, mean, normal_cdf, normal_sf, rfft, std_dev, variance
|
|
9
9
|
} from "./u_numflow_bg.js";
|
package/u_numflow_bg.js
CHANGED
|
@@ -25,15 +25,20 @@ export function box_cox(data, lambda) {
|
|
|
25
25
|
/**
|
|
26
26
|
* Estimate the optimal Box-Cox lambda via profile maximum likelihood.
|
|
27
27
|
*
|
|
28
|
-
* Searches in the range `[lambda_min, lambda_max]` using golden-section search
|
|
28
|
+
* Searches in the range `[lambda_min, lambda_max]` using golden-section search
|
|
29
|
+
* and returns `{ lambda: number, at_bound: boolean }`. `at_bound` is `true`
|
|
30
|
+
* when the maximum lies on an end of the range — the likelihood was still
|
|
31
|
+
* rising there, so `lambda` is that range limit (reported exactly), not an
|
|
32
|
+
* interior estimate; widen the range to find the unconstrained optimum.
|
|
29
33
|
*
|
|
30
34
|
* # Errors
|
|
31
35
|
* Returns a `JsValue` error string if data contains non-positive values,
|
|
32
|
-
* has fewer than 2 elements, or
|
|
36
|
+
* has fewer than 2 elements, or the range is not finite with
|
|
37
|
+
* `lambda_min < lambda_max`.
|
|
33
38
|
* @param {Float64Array} data
|
|
34
39
|
* @param {number} lambda_min
|
|
35
40
|
* @param {number} lambda_max
|
|
36
|
-
* @returns {
|
|
41
|
+
* @returns {any}
|
|
37
42
|
*/
|
|
38
43
|
export function estimate_lambda(data, lambda_min, lambda_max) {
|
|
39
44
|
const ptr0 = passArrayF64ToWasm0(data, wasm.__wbindgen_malloc);
|
|
@@ -42,7 +47,7 @@ export function estimate_lambda(data, lambda_min, lambda_max) {
|
|
|
42
47
|
if (ret[2]) {
|
|
43
48
|
throw takeFromExternrefTable0(ret[1]);
|
|
44
49
|
}
|
|
45
|
-
return ret[0];
|
|
50
|
+
return takeFromExternrefTable0(ret[0]);
|
|
46
51
|
}
|
|
47
52
|
|
|
48
53
|
/**
|
|
@@ -64,7 +69,8 @@ export function mean(data) {
|
|
|
64
69
|
*
|
|
65
70
|
* To evaluate a general normal N(μ, σ), pass `(x - μ) / σ`.
|
|
66
71
|
*
|
|
67
|
-
*
|
|
72
|
+
* Computed as `erfc(−x/√2)/2` with a direct `erfc`, so the lower tail keeps
|
|
73
|
+
* relative precision. For the upper tail use [`normal_sf`].
|
|
68
74
|
* @param {number} x
|
|
69
75
|
* @returns {number}
|
|
70
76
|
*/
|
|
@@ -73,6 +79,20 @@ export function normal_cdf(x) {
|
|
|
73
79
|
return ret;
|
|
74
80
|
}
|
|
75
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Standard normal survival function P(Z > x) = 1 − Φ(x) for Z ~ N(0, 1).
|
|
84
|
+
*
|
|
85
|
+
* Computed directly (not as `1 − normal_cdf(x)`), so upper-tail
|
|
86
|
+
* probabilities such as PPM defect rates keep their significant digits:
|
|
87
|
+
* `normal_sf(6)` is `9.865876450376948e-10` to about 15 digits.
|
|
88
|
+
* @param {number} x
|
|
89
|
+
* @returns {number}
|
|
90
|
+
*/
|
|
91
|
+
export function normal_sf(x) {
|
|
92
|
+
const ret = wasm.normal_sf(x);
|
|
93
|
+
return ret;
|
|
94
|
+
}
|
|
95
|
+
|
|
76
96
|
/**
|
|
77
97
|
* Forward DFT of a real sequence of any length.
|
|
78
98
|
*
|
|
@@ -118,7 +138,29 @@ export function variance(data) {
|
|
|
118
138
|
const ret = wasm.variance(ptr0, len0);
|
|
119
139
|
return ret;
|
|
120
140
|
}
|
|
121
|
-
export function
|
|
141
|
+
export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
142
|
+
const ret = String(arg1);
|
|
143
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
144
|
+
const len1 = WASM_VECTOR_LEN;
|
|
145
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
146
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
147
|
+
}
|
|
148
|
+
export function __wbg___wbindgen_throw_5d9e815e6fdf150f(arg0, arg1) {
|
|
149
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
150
|
+
}
|
|
151
|
+
export function __wbg_new_bebc3f4757acf305() {
|
|
152
|
+
const ret = new Object();
|
|
153
|
+
return ret;
|
|
154
|
+
}
|
|
155
|
+
export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
|
|
156
|
+
arg0[arg1] = arg2;
|
|
157
|
+
}
|
|
158
|
+
export function __wbindgen_generic_0000000000000001(arg0) {
|
|
159
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
160
|
+
const ret = arg0;
|
|
161
|
+
return ret;
|
|
162
|
+
}
|
|
163
|
+
export function __wbindgen_generic_0000000000000002(arg0, arg1) {
|
|
122
164
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
123
165
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
124
166
|
return ret;
|
|
@@ -137,6 +179,14 @@ function getArrayF64FromWasm0(ptr, len) {
|
|
|
137
179
|
return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
138
180
|
}
|
|
139
181
|
|
|
182
|
+
let cachedDataViewMemory0 = null;
|
|
183
|
+
function getDataViewMemory0() {
|
|
184
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
185
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
186
|
+
}
|
|
187
|
+
return cachedDataViewMemory0;
|
|
188
|
+
}
|
|
189
|
+
|
|
140
190
|
let cachedFloat64ArrayMemory0 = null;
|
|
141
191
|
function getFloat64ArrayMemory0() {
|
|
142
192
|
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
|
|
@@ -164,6 +214,43 @@ function passArrayF64ToWasm0(arg, malloc) {
|
|
|
164
214
|
return ptr;
|
|
165
215
|
}
|
|
166
216
|
|
|
217
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
218
|
+
if (realloc === undefined) {
|
|
219
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
220
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
221
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
222
|
+
WASM_VECTOR_LEN = buf.length;
|
|
223
|
+
return ptr;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
let len = arg.length;
|
|
227
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
228
|
+
|
|
229
|
+
const mem = getUint8ArrayMemory0();
|
|
230
|
+
|
|
231
|
+
let offset = 0;
|
|
232
|
+
|
|
233
|
+
for (; offset < len; offset++) {
|
|
234
|
+
const code = arg.charCodeAt(offset);
|
|
235
|
+
if (code > 0x7F) break;
|
|
236
|
+
mem[ptr + offset] = code;
|
|
237
|
+
}
|
|
238
|
+
if (offset !== len) {
|
|
239
|
+
if (offset !== 0) {
|
|
240
|
+
arg = arg.slice(offset);
|
|
241
|
+
}
|
|
242
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
243
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
244
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
245
|
+
|
|
246
|
+
offset += ret.written;
|
|
247
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
WASM_VECTOR_LEN = offset;
|
|
251
|
+
return ptr;
|
|
252
|
+
}
|
|
253
|
+
|
|
167
254
|
function takeFromExternrefTable0(idx) {
|
|
168
255
|
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
169
256
|
wasm.__externref_table_dealloc(idx);
|
|
@@ -184,6 +271,19 @@ function decodeText(ptr, len) {
|
|
|
184
271
|
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
185
272
|
}
|
|
186
273
|
|
|
274
|
+
const cachedTextEncoder = new TextEncoder();
|
|
275
|
+
|
|
276
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
277
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
278
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
279
|
+
view.set(buf);
|
|
280
|
+
return {
|
|
281
|
+
read: arg.length,
|
|
282
|
+
written: buf.length
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
|
|
187
287
|
let WASM_VECTOR_LEN = 0;
|
|
188
288
|
|
|
189
289
|
|
package/u_numflow_bg.wasm
CHANGED
|
Binary file
|