@danielsimonjr/mathts-wasm 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1484 @@
1
+ async function instantiate(module, imports = {}) {
2
+ const adaptedImports = {
3
+ env: Object.assign(Object.create(globalThis), imports.env || {}, {
4
+ abort(message, fileName, lineNumber, columnNumber) {
5
+ // ~lib/builtins/abort(~lib/string/String | null?, ~lib/string/String | null?, u32?, u32?) => void
6
+ message = __liftString(message >>> 0);
7
+ fileName = __liftString(fileName >>> 0);
8
+ lineNumber = lineNumber >>> 0;
9
+ columnNumber = columnNumber >>> 0;
10
+ (() => {
11
+ // @external.js
12
+ throw Error(`${message} in ${fileName}:${lineNumber}:${columnNumber}`);
13
+ })();
14
+ },
15
+ }),
16
+ };
17
+ const { exports } = await WebAssembly.instantiate(module, adaptedImports);
18
+ const memory = exports.memory || imports.env.memory;
19
+ const adaptedExports = Object.setPrototypeOf({
20
+ complex(re, im) {
21
+ // src/types/complex/complex(f64, f64) => src/types/complex/Complex
22
+ return __liftInternref(exports.complex(re, im) >>> 0);
23
+ },
24
+ complexFromPolar(r, theta) {
25
+ // src/types/complex/complexFromPolar(f64, f64) => src/types/complex/Complex
26
+ return __liftInternref(exports.complexFromPolar(r, theta) >>> 0);
27
+ },
28
+ isNaN_f64(a) {
29
+ // src/ops/scalar/isNaN_f64(f64) => bool
30
+ return exports.isNaN_f64(a) != 0;
31
+ },
32
+ isFinite_f64(a) {
33
+ // src/ops/scalar/isFinite_f64(f64) => bool
34
+ return exports.isFinite_f64(a) != 0;
35
+ },
36
+ array_sum(data) {
37
+ // src/ops/array/array_sum(~lib/typedarray/Float64Array) => f64
38
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
39
+ return exports.array_sum(data);
40
+ },
41
+ array_product(data) {
42
+ // src/ops/array/array_product(~lib/typedarray/Float64Array) => f64
43
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
44
+ return exports.array_product(data);
45
+ },
46
+ array_mean(data) {
47
+ // src/ops/array/array_mean(~lib/typedarray/Float64Array) => f64
48
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
49
+ return exports.array_mean(data);
50
+ },
51
+ array_variance(data) {
52
+ // src/ops/array/array_variance(~lib/typedarray/Float64Array) => f64
53
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
54
+ return exports.array_variance(data);
55
+ },
56
+ array_stddev(data) {
57
+ // src/ops/array/array_stddev(~lib/typedarray/Float64Array) => f64
58
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
59
+ return exports.array_stddev(data);
60
+ },
61
+ array_min(data) {
62
+ // src/ops/array/array_min(~lib/typedarray/Float64Array) => f64
63
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
64
+ return exports.array_min(data);
65
+ },
66
+ array_max(data) {
67
+ // src/ops/array/array_max(~lib/typedarray/Float64Array) => f64
68
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
69
+ return exports.array_max(data);
70
+ },
71
+ array_argmin(data) {
72
+ // src/ops/array/array_argmin(~lib/typedarray/Float64Array) => i32
73
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
74
+ return exports.array_argmin(data);
75
+ },
76
+ array_argmax(data) {
77
+ // src/ops/array/array_argmax(~lib/typedarray/Float64Array) => i32
78
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
79
+ return exports.array_argmax(data);
80
+ },
81
+ array_norm(data) {
82
+ // src/ops/array/array_norm(~lib/typedarray/Float64Array) => f64
83
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
84
+ return exports.array_norm(data);
85
+ },
86
+ array_norm_l1(data) {
87
+ // src/ops/array/array_norm_l1(~lib/typedarray/Float64Array) => f64
88
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
89
+ return exports.array_norm_l1(data);
90
+ },
91
+ array_norm_linf(data) {
92
+ // src/ops/array/array_norm_linf(~lib/typedarray/Float64Array) => f64
93
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
94
+ return exports.array_norm_linf(data);
95
+ },
96
+ array_dot(a, b) {
97
+ // src/ops/array/array_dot(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => f64
98
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
99
+ b = __lowerTypedArray(Float64Array, 5, 3, b) || __notnull();
100
+ try {
101
+ return exports.array_dot(a, b);
102
+ } finally {
103
+ __release(a);
104
+ }
105
+ },
106
+ array_add(a, b, result) {
107
+ // src/ops/array/array_add(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
108
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
109
+ b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
110
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
111
+ try {
112
+ exports.array_add(a, b, result);
113
+ } finally {
114
+ __release(a);
115
+ __release(b);
116
+ }
117
+ },
118
+ array_sub(a, b, result) {
119
+ // src/ops/array/array_sub(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
120
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
121
+ b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
122
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
123
+ try {
124
+ exports.array_sub(a, b, result);
125
+ } finally {
126
+ __release(a);
127
+ __release(b);
128
+ }
129
+ },
130
+ array_mul(a, b, result) {
131
+ // src/ops/array/array_mul(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
132
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
133
+ b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
134
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
135
+ try {
136
+ exports.array_mul(a, b, result);
137
+ } finally {
138
+ __release(a);
139
+ __release(b);
140
+ }
141
+ },
142
+ array_div(a, b, result) {
143
+ // src/ops/array/array_div(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
144
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
145
+ b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
146
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
147
+ try {
148
+ exports.array_div(a, b, result);
149
+ } finally {
150
+ __release(a);
151
+ __release(b);
152
+ }
153
+ },
154
+ array_scale(a, scalar, result) {
155
+ // src/ops/array/array_scale(~lib/typedarray/Float64Array, f64, ~lib/typedarray/Float64Array) => void
156
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
157
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
158
+ try {
159
+ exports.array_scale(a, scalar, result);
160
+ } finally {
161
+ __release(a);
162
+ }
163
+ },
164
+ array_add_scalar(a, scalar, result) {
165
+ // src/ops/array/array_add_scalar(~lib/typedarray/Float64Array, f64, ~lib/typedarray/Float64Array) => void
166
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
167
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
168
+ try {
169
+ exports.array_add_scalar(a, scalar, result);
170
+ } finally {
171
+ __release(a);
172
+ }
173
+ },
174
+ array_neg(a, result) {
175
+ // src/ops/array/array_neg(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
176
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
177
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
178
+ try {
179
+ exports.array_neg(a, result);
180
+ } finally {
181
+ __release(a);
182
+ }
183
+ },
184
+ array_abs(a, result) {
185
+ // src/ops/array/array_abs(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
186
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
187
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
188
+ try {
189
+ exports.array_abs(a, result);
190
+ } finally {
191
+ __release(a);
192
+ }
193
+ },
194
+ array_sqrt(a, result) {
195
+ // src/ops/array/array_sqrt(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
196
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
197
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
198
+ try {
199
+ exports.array_sqrt(a, result);
200
+ } finally {
201
+ __release(a);
202
+ }
203
+ },
204
+ array_square(a, result) {
205
+ // src/ops/array/array_square(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
206
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
207
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
208
+ try {
209
+ exports.array_square(a, result);
210
+ } finally {
211
+ __release(a);
212
+ }
213
+ },
214
+ array_exp(a, result) {
215
+ // src/ops/array/array_exp(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
216
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
217
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
218
+ try {
219
+ exports.array_exp(a, result);
220
+ } finally {
221
+ __release(a);
222
+ }
223
+ },
224
+ array_log(a, result) {
225
+ // src/ops/array/array_log(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
226
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
227
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
228
+ try {
229
+ exports.array_log(a, result);
230
+ } finally {
231
+ __release(a);
232
+ }
233
+ },
234
+ array_sin(a, result) {
235
+ // src/ops/array/array_sin(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
236
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
237
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
238
+ try {
239
+ exports.array_sin(a, result);
240
+ } finally {
241
+ __release(a);
242
+ }
243
+ },
244
+ array_cos(a, result) {
245
+ // src/ops/array/array_cos(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
246
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
247
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
248
+ try {
249
+ exports.array_cos(a, result);
250
+ } finally {
251
+ __release(a);
252
+ }
253
+ },
254
+ array_axpby(alpha, a, beta, b, result) {
255
+ // src/ops/array/array_axpby(f64, ~lib/typedarray/Float64Array, f64, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
256
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
257
+ b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
258
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
259
+ try {
260
+ exports.array_axpby(alpha, a, beta, b, result);
261
+ } finally {
262
+ __release(a);
263
+ __release(b);
264
+ }
265
+ },
266
+ array_distance(a, b) {
267
+ // src/ops/array/array_distance(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => f64
268
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
269
+ b = __lowerTypedArray(Float64Array, 5, 3, b) || __notnull();
270
+ try {
271
+ return exports.array_distance(a, b);
272
+ } finally {
273
+ __release(a);
274
+ }
275
+ },
276
+ array_cosine_similarity(a, b) {
277
+ // src/ops/array/array_cosine_similarity(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => f64
278
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
279
+ b = __lowerTypedArray(Float64Array, 5, 3, b) || __notnull();
280
+ try {
281
+ return exports.array_cosine_similarity(a, b);
282
+ } finally {
283
+ __release(a);
284
+ }
285
+ },
286
+ array_scale_inplace(a, scalar) {
287
+ // src/ops/array/array_scale_inplace(~lib/typedarray/Float64Array, f64) => void
288
+ a = __lowerTypedArray(Float64Array, 5, 3, a) || __notnull();
289
+ exports.array_scale_inplace(a, scalar);
290
+ },
291
+ array_add_scalar_inplace(a, scalar) {
292
+ // src/ops/array/array_add_scalar_inplace(~lib/typedarray/Float64Array, f64) => void
293
+ a = __lowerTypedArray(Float64Array, 5, 3, a) || __notnull();
294
+ exports.array_add_scalar_inplace(a, scalar);
295
+ },
296
+ array_add_inplace(a, b) {
297
+ // src/ops/array/array_add_inplace(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
298
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
299
+ b = __lowerTypedArray(Float64Array, 5, 3, b) || __notnull();
300
+ try {
301
+ exports.array_add_inplace(a, b);
302
+ } finally {
303
+ __release(a);
304
+ }
305
+ },
306
+ array_clamp_inplace(a, lo, hi) {
307
+ // src/ops/array/array_clamp_inplace(~lib/typedarray/Float64Array, f64, f64) => void
308
+ a = __lowerTypedArray(Float64Array, 5, 3, a) || __notnull();
309
+ exports.array_clamp_inplace(a, lo, hi);
310
+ },
311
+ array_fill(a, value) {
312
+ // src/ops/array/array_fill(~lib/typedarray/Float64Array, f64) => void
313
+ a = __lowerTypedArray(Float64Array, 5, 3, a) || __notnull();
314
+ exports.array_fill(a, value);
315
+ },
316
+ array_copy(src, dst) {
317
+ // src/ops/array/array_copy(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
318
+ src = __retain(__lowerTypedArray(Float64Array, 5, 3, src) || __notnull());
319
+ dst = __lowerTypedArray(Float64Array, 5, 3, dst) || __notnull();
320
+ try {
321
+ exports.array_copy(src, dst);
322
+ } finally {
323
+ __release(src);
324
+ }
325
+ },
326
+ matrix_zeros(rows, cols) {
327
+ // src/ops/matrix/matrix_zeros(i32, i32) => ~lib/typedarray/Float64Array
328
+ return __liftTypedArray(Float64Array, exports.matrix_zeros(rows, cols) >>> 0);
329
+ },
330
+ matrix_ones(rows, cols) {
331
+ // src/ops/matrix/matrix_ones(i32, i32) => ~lib/typedarray/Float64Array
332
+ return __liftTypedArray(Float64Array, exports.matrix_ones(rows, cols) >>> 0);
333
+ },
334
+ matrix_fill(rows, cols, value) {
335
+ // src/ops/matrix/matrix_fill(i32, i32, f64) => ~lib/typedarray/Float64Array
336
+ return __liftTypedArray(Float64Array, exports.matrix_fill(rows, cols, value) >>> 0);
337
+ },
338
+ matrix_identity(n) {
339
+ // src/ops/matrix/matrix_identity(i32) => ~lib/typedarray/Float64Array
340
+ return __liftTypedArray(Float64Array, exports.matrix_identity(n) >>> 0);
341
+ },
342
+ matrix_diag(values) {
343
+ // src/ops/matrix/matrix_diag(~lib/typedarray/Float64Array) => ~lib/typedarray/Float64Array
344
+ values = __lowerTypedArray(Float64Array, 5, 3, values) || __notnull();
345
+ return __liftTypedArray(Float64Array, exports.matrix_diag(values) >>> 0);
346
+ },
347
+ matrix_get(data, cols, row, col) {
348
+ // src/ops/matrix/matrix_get(~lib/typedarray/Float64Array, i32, i32, i32) => f64
349
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
350
+ return exports.matrix_get(data, cols, row, col);
351
+ },
352
+ matrix_set(data, cols, row, col, value) {
353
+ // src/ops/matrix/matrix_set(~lib/typedarray/Float64Array, i32, i32, i32, f64) => void
354
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
355
+ exports.matrix_set(data, cols, row, col, value);
356
+ },
357
+ matrix_get_row(data, cols, row) {
358
+ // src/ops/matrix/matrix_get_row(~lib/typedarray/Float64Array, i32, i32) => ~lib/typedarray/Float64Array
359
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
360
+ return __liftTypedArray(Float64Array, exports.matrix_get_row(data, cols, row) >>> 0);
361
+ },
362
+ matrix_get_col(data, rows, cols, col) {
363
+ // src/ops/matrix/matrix_get_col(~lib/typedarray/Float64Array, i32, i32, i32) => ~lib/typedarray/Float64Array
364
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
365
+ return __liftTypedArray(Float64Array, exports.matrix_get_col(data, rows, cols, col) >>> 0);
366
+ },
367
+ matrix_get_diag(data, rows, cols) {
368
+ // src/ops/matrix/matrix_get_diag(~lib/typedarray/Float64Array, i32, i32) => ~lib/typedarray/Float64Array
369
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
370
+ return __liftTypedArray(Float64Array, exports.matrix_get_diag(data, rows, cols) >>> 0);
371
+ },
372
+ matrix_add(a, b, result) {
373
+ // src/ops/matrix/matrix_add(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
374
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
375
+ b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
376
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
377
+ try {
378
+ exports.matrix_add(a, b, result);
379
+ } finally {
380
+ __release(a);
381
+ __release(b);
382
+ }
383
+ },
384
+ matrix_sub(a, b, result) {
385
+ // src/ops/matrix/matrix_sub(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
386
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
387
+ b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
388
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
389
+ try {
390
+ exports.matrix_sub(a, b, result);
391
+ } finally {
392
+ __release(a);
393
+ __release(b);
394
+ }
395
+ },
396
+ matrix_mul_elementwise(a, b, result) {
397
+ // src/ops/matrix/matrix_mul_elementwise(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
398
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
399
+ b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
400
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
401
+ try {
402
+ exports.matrix_mul_elementwise(a, b, result);
403
+ } finally {
404
+ __release(a);
405
+ __release(b);
406
+ }
407
+ },
408
+ matrix_div_elementwise(a, b, result) {
409
+ // src/ops/matrix/matrix_div_elementwise(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
410
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
411
+ b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
412
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
413
+ try {
414
+ exports.matrix_div_elementwise(a, b, result);
415
+ } finally {
416
+ __release(a);
417
+ __release(b);
418
+ }
419
+ },
420
+ matrix_scale(a, scalar, result) {
421
+ // src/ops/matrix/matrix_scale(~lib/typedarray/Float64Array, f64, ~lib/typedarray/Float64Array) => void
422
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
423
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
424
+ try {
425
+ exports.matrix_scale(a, scalar, result);
426
+ } finally {
427
+ __release(a);
428
+ }
429
+ },
430
+ matrix_add_scalar(a, scalar, result) {
431
+ // src/ops/matrix/matrix_add_scalar(~lib/typedarray/Float64Array, f64, ~lib/typedarray/Float64Array) => void
432
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
433
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
434
+ try {
435
+ exports.matrix_add_scalar(a, scalar, result);
436
+ } finally {
437
+ __release(a);
438
+ }
439
+ },
440
+ matrix_neg(a, result) {
441
+ // src/ops/matrix/matrix_neg(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
442
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
443
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
444
+ try {
445
+ exports.matrix_neg(a, result);
446
+ } finally {
447
+ __release(a);
448
+ }
449
+ },
450
+ matrix_multiply(a, aRows, aCols, b, bCols, result) {
451
+ // src/ops/matrix/matrix_multiply(~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array, i32, ~lib/typedarray/Float64Array) => void
452
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
453
+ b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
454
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
455
+ try {
456
+ exports.matrix_multiply(a, aRows, aCols, b, bCols, result);
457
+ } finally {
458
+ __release(a);
459
+ __release(b);
460
+ }
461
+ },
462
+ matrix_vector_multiply(a, rows, cols, x, result) {
463
+ // src/ops/matrix/matrix_vector_multiply(~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
464
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
465
+ x = __retain(__lowerTypedArray(Float64Array, 5, 3, x) || __notnull());
466
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
467
+ try {
468
+ exports.matrix_vector_multiply(a, rows, cols, x, result);
469
+ } finally {
470
+ __release(a);
471
+ __release(x);
472
+ }
473
+ },
474
+ vector_matrix_multiply(x, a, rows, cols, result) {
475
+ // src/ops/matrix/vector_matrix_multiply(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array) => void
476
+ x = __retain(__lowerTypedArray(Float64Array, 5, 3, x) || __notnull());
477
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
478
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
479
+ try {
480
+ exports.vector_matrix_multiply(x, a, rows, cols, result);
481
+ } finally {
482
+ __release(x);
483
+ __release(a);
484
+ }
485
+ },
486
+ matrix_outer(x, y, result) {
487
+ // src/ops/matrix/matrix_outer(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
488
+ x = __retain(__lowerTypedArray(Float64Array, 5, 3, x) || __notnull());
489
+ y = __retain(__lowerTypedArray(Float64Array, 5, 3, y) || __notnull());
490
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
491
+ try {
492
+ exports.matrix_outer(x, y, result);
493
+ } finally {
494
+ __release(x);
495
+ __release(y);
496
+ }
497
+ },
498
+ matrix_transpose(a, rows, cols, result) {
499
+ // src/ops/matrix/matrix_transpose(~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array) => void
500
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
501
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
502
+ try {
503
+ exports.matrix_transpose(a, rows, cols, result);
504
+ } finally {
505
+ __release(a);
506
+ }
507
+ },
508
+ matrix_sum(data) {
509
+ // src/ops/matrix/matrix_sum(~lib/typedarray/Float64Array) => f64
510
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
511
+ return exports.matrix_sum(data);
512
+ },
513
+ matrix_mean(data) {
514
+ // src/ops/matrix/matrix_mean(~lib/typedarray/Float64Array) => f64
515
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
516
+ return exports.matrix_mean(data);
517
+ },
518
+ matrix_min(data) {
519
+ // src/ops/matrix/matrix_min(~lib/typedarray/Float64Array) => f64
520
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
521
+ return exports.matrix_min(data);
522
+ },
523
+ matrix_max(data) {
524
+ // src/ops/matrix/matrix_max(~lib/typedarray/Float64Array) => f64
525
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
526
+ return exports.matrix_max(data);
527
+ },
528
+ matrix_norm_frobenius(data) {
529
+ // src/ops/matrix/matrix_norm_frobenius(~lib/typedarray/Float64Array) => f64
530
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
531
+ return exports.matrix_norm_frobenius(data);
532
+ },
533
+ matrix_trace(data, rows, cols) {
534
+ // src/ops/matrix/matrix_trace(~lib/typedarray/Float64Array, i32, i32) => f64
535
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
536
+ return exports.matrix_trace(data, rows, cols);
537
+ },
538
+ matrix_sum_rows(data, rows, cols, result) {
539
+ // src/ops/matrix/matrix_sum_rows(~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array) => void
540
+ data = __retain(__lowerTypedArray(Float64Array, 5, 3, data) || __notnull());
541
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
542
+ try {
543
+ exports.matrix_sum_rows(data, rows, cols, result);
544
+ } finally {
545
+ __release(data);
546
+ }
547
+ },
548
+ matrix_sum_cols(data, rows, cols, result) {
549
+ // src/ops/matrix/matrix_sum_cols(~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array) => void
550
+ data = __retain(__lowerTypedArray(Float64Array, 5, 3, data) || __notnull());
551
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
552
+ try {
553
+ exports.matrix_sum_cols(data, rows, cols, result);
554
+ } finally {
555
+ __release(data);
556
+ }
557
+ },
558
+ matrix_is_square(rows, cols) {
559
+ // src/ops/matrix/matrix_is_square(i32, i32) => bool
560
+ return exports.matrix_is_square(rows, cols) != 0;
561
+ },
562
+ matrix_is_symmetric(data, rows, cols, tolerance) {
563
+ // src/ops/matrix/matrix_is_symmetric(~lib/typedarray/Float64Array, i32, i32, f64) => bool
564
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
565
+ return exports.matrix_is_symmetric(data, rows, cols, tolerance) != 0;
566
+ },
567
+ matrix_is_diagonal(data, rows, cols, tolerance) {
568
+ // src/ops/matrix/matrix_is_diagonal(~lib/typedarray/Float64Array, i32, i32, f64) => bool
569
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
570
+ return exports.matrix_is_diagonal(data, rows, cols, tolerance) != 0;
571
+ },
572
+ matrix_is_identity(data, rows, cols, tolerance) {
573
+ // src/ops/matrix/matrix_is_identity(~lib/typedarray/Float64Array, i32, i32, f64) => bool
574
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
575
+ return exports.matrix_is_identity(data, rows, cols, tolerance) != 0;
576
+ },
577
+ matrix_scale_inplace(data, scalar) {
578
+ // src/ops/matrix/matrix_scale_inplace(~lib/typedarray/Float64Array, f64) => void
579
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
580
+ exports.matrix_scale_inplace(data, scalar);
581
+ },
582
+ matrix_add_scalar_inplace(data, scalar) {
583
+ // src/ops/matrix/matrix_add_scalar_inplace(~lib/typedarray/Float64Array, f64) => void
584
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
585
+ exports.matrix_add_scalar_inplace(data, scalar);
586
+ },
587
+ matrix_add_inplace(a, b) {
588
+ // src/ops/matrix/matrix_add_inplace(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
589
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
590
+ b = __lowerTypedArray(Float64Array, 5, 3, b) || __notnull();
591
+ try {
592
+ exports.matrix_add_inplace(a, b);
593
+ } finally {
594
+ __release(a);
595
+ }
596
+ },
597
+ matrix_copy(src, dst) {
598
+ // src/ops/matrix/matrix_copy(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
599
+ src = __retain(__lowerTypedArray(Float64Array, 5, 3, src) || __notnull());
600
+ dst = __lowerTypedArray(Float64Array, 5, 3, dst) || __notnull();
601
+ try {
602
+ exports.matrix_copy(src, dst);
603
+ } finally {
604
+ __release(src);
605
+ }
606
+ },
607
+ matrix_axpy(alpha, x, y) {
608
+ // src/ops/matrix/matrix_axpy(f64, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
609
+ x = __retain(__lowerTypedArray(Float64Array, 5, 3, x) || __notnull());
610
+ y = __lowerTypedArray(Float64Array, 5, 3, y) || __notnull();
611
+ try {
612
+ exports.matrix_axpy(alpha, x, y);
613
+ } finally {
614
+ __release(x);
615
+ }
616
+ },
617
+ matrix_gemm(alpha, a, m, k, b, n, beta, c) {
618
+ // src/ops/matrix/matrix_gemm(f64, ~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array, i32, f64, ~lib/typedarray/Float64Array) => void
619
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
620
+ b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
621
+ c = __lowerTypedArray(Float64Array, 5, 3, c) || __notnull();
622
+ try {
623
+ exports.matrix_gemm(alpha, a, m, k, b, n, beta, c);
624
+ } finally {
625
+ __release(a);
626
+ __release(b);
627
+ }
628
+ },
629
+ matrix_gemv(alpha, a, m, n, x, beta, y) {
630
+ // src/ops/matrix/matrix_gemv(f64, ~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array, f64, ~lib/typedarray/Float64Array) => void
631
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
632
+ x = __retain(__lowerTypedArray(Float64Array, 5, 3, x) || __notnull());
633
+ y = __lowerTypedArray(Float64Array, 5, 3, y) || __notnull();
634
+ try {
635
+ exports.matrix_gemv(alpha, a, m, n, x, beta, y);
636
+ } finally {
637
+ __release(a);
638
+ __release(x);
639
+ }
640
+ },
641
+ complex_add(a, b) {
642
+ // src/ops/complex-ops/complex_add(src/types/complex/Complex, src/types/complex/Complex) => src/types/complex/Complex
643
+ a = __retain(__lowerInternref(a) || __notnull());
644
+ b = __lowerInternref(b) || __notnull();
645
+ try {
646
+ return __liftInternref(exports.complex_add(a, b) >>> 0);
647
+ } finally {
648
+ __release(a);
649
+ }
650
+ },
651
+ complex_sub(a, b) {
652
+ // src/ops/complex-ops/complex_sub(src/types/complex/Complex, src/types/complex/Complex) => src/types/complex/Complex
653
+ a = __retain(__lowerInternref(a) || __notnull());
654
+ b = __lowerInternref(b) || __notnull();
655
+ try {
656
+ return __liftInternref(exports.complex_sub(a, b) >>> 0);
657
+ } finally {
658
+ __release(a);
659
+ }
660
+ },
661
+ complex_mul(a, b) {
662
+ // src/ops/complex-ops/complex_mul(src/types/complex/Complex, src/types/complex/Complex) => src/types/complex/Complex
663
+ a = __retain(__lowerInternref(a) || __notnull());
664
+ b = __lowerInternref(b) || __notnull();
665
+ try {
666
+ return __liftInternref(exports.complex_mul(a, b) >>> 0);
667
+ } finally {
668
+ __release(a);
669
+ }
670
+ },
671
+ complex_div(a, b) {
672
+ // src/ops/complex-ops/complex_div(src/types/complex/Complex, src/types/complex/Complex) => src/types/complex/Complex
673
+ a = __retain(__lowerInternref(a) || __notnull());
674
+ b = __lowerInternref(b) || __notnull();
675
+ try {
676
+ return __liftInternref(exports.complex_div(a, b) >>> 0);
677
+ } finally {
678
+ __release(a);
679
+ }
680
+ },
681
+ complex_neg(a) {
682
+ // src/ops/complex-ops/complex_neg(src/types/complex/Complex) => src/types/complex/Complex
683
+ a = __lowerInternref(a) || __notnull();
684
+ return __liftInternref(exports.complex_neg(a) >>> 0);
685
+ },
686
+ complex_conj(a) {
687
+ // src/ops/complex-ops/complex_conj(src/types/complex/Complex) => src/types/complex/Complex
688
+ a = __lowerInternref(a) || __notnull();
689
+ return __liftInternref(exports.complex_conj(a) >>> 0);
690
+ },
691
+ complex_reciprocal(a) {
692
+ // src/ops/complex-ops/complex_reciprocal(src/types/complex/Complex) => src/types/complex/Complex
693
+ a = __lowerInternref(a) || __notnull();
694
+ return __liftInternref(exports.complex_reciprocal(a) >>> 0);
695
+ },
696
+ complex_abs(a) {
697
+ // src/ops/complex-ops/complex_abs(src/types/complex/Complex) => f64
698
+ a = __lowerInternref(a) || __notnull();
699
+ return exports.complex_abs(a);
700
+ },
701
+ complex_arg(a) {
702
+ // src/ops/complex-ops/complex_arg(src/types/complex/Complex) => f64
703
+ a = __lowerInternref(a) || __notnull();
704
+ return exports.complex_arg(a);
705
+ },
706
+ complex_abs_squared(a) {
707
+ // src/ops/complex-ops/complex_abs_squared(src/types/complex/Complex) => f64
708
+ a = __lowerInternref(a) || __notnull();
709
+ return exports.complex_abs_squared(a);
710
+ },
711
+ complex_sqrt(a) {
712
+ // src/ops/complex-ops/complex_sqrt(src/types/complex/Complex) => src/types/complex/Complex
713
+ a = __lowerInternref(a) || __notnull();
714
+ return __liftInternref(exports.complex_sqrt(a) >>> 0);
715
+ },
716
+ complex_pow(a, n) {
717
+ // src/ops/complex-ops/complex_pow(src/types/complex/Complex, f64) => src/types/complex/Complex
718
+ a = __lowerInternref(a) || __notnull();
719
+ return __liftInternref(exports.complex_pow(a, n) >>> 0);
720
+ },
721
+ complex_cpow(a, b) {
722
+ // src/ops/complex-ops/complex_cpow(src/types/complex/Complex, src/types/complex/Complex) => src/types/complex/Complex
723
+ a = __retain(__lowerInternref(a) || __notnull());
724
+ b = __lowerInternref(b) || __notnull();
725
+ try {
726
+ return __liftInternref(exports.complex_cpow(a, b) >>> 0);
727
+ } finally {
728
+ __release(a);
729
+ }
730
+ },
731
+ complex_square(a) {
732
+ // src/ops/complex-ops/complex_square(src/types/complex/Complex) => src/types/complex/Complex
733
+ a = __lowerInternref(a) || __notnull();
734
+ return __liftInternref(exports.complex_square(a) >>> 0);
735
+ },
736
+ complex_cube(a) {
737
+ // src/ops/complex-ops/complex_cube(src/types/complex/Complex) => src/types/complex/Complex
738
+ a = __lowerInternref(a) || __notnull();
739
+ return __liftInternref(exports.complex_cube(a) >>> 0);
740
+ },
741
+ complex_exp(a) {
742
+ // src/ops/complex-ops/complex_exp(src/types/complex/Complex) => src/types/complex/Complex
743
+ a = __lowerInternref(a) || __notnull();
744
+ return __liftInternref(exports.complex_exp(a) >>> 0);
745
+ },
746
+ complex_log(a) {
747
+ // src/ops/complex-ops/complex_log(src/types/complex/Complex) => src/types/complex/Complex
748
+ a = __lowerInternref(a) || __notnull();
749
+ return __liftInternref(exports.complex_log(a) >>> 0);
750
+ },
751
+ complex_log10(a) {
752
+ // src/ops/complex-ops/complex_log10(src/types/complex/Complex) => src/types/complex/Complex
753
+ a = __lowerInternref(a) || __notnull();
754
+ return __liftInternref(exports.complex_log10(a) >>> 0);
755
+ },
756
+ complex_log2(a) {
757
+ // src/ops/complex-ops/complex_log2(src/types/complex/Complex) => src/types/complex/Complex
758
+ a = __lowerInternref(a) || __notnull();
759
+ return __liftInternref(exports.complex_log2(a) >>> 0);
760
+ },
761
+ complex_sin(a) {
762
+ // src/ops/complex-ops/complex_sin(src/types/complex/Complex) => src/types/complex/Complex
763
+ a = __lowerInternref(a) || __notnull();
764
+ return __liftInternref(exports.complex_sin(a) >>> 0);
765
+ },
766
+ complex_cos(a) {
767
+ // src/ops/complex-ops/complex_cos(src/types/complex/Complex) => src/types/complex/Complex
768
+ a = __lowerInternref(a) || __notnull();
769
+ return __liftInternref(exports.complex_cos(a) >>> 0);
770
+ },
771
+ complex_tan(a) {
772
+ // src/ops/complex-ops/complex_tan(src/types/complex/Complex) => src/types/complex/Complex
773
+ a = __lowerInternref(a) || __notnull();
774
+ return __liftInternref(exports.complex_tan(a) >>> 0);
775
+ },
776
+ complex_asin(a) {
777
+ // src/ops/complex-ops/complex_asin(src/types/complex/Complex) => src/types/complex/Complex
778
+ a = __lowerInternref(a) || __notnull();
779
+ return __liftInternref(exports.complex_asin(a) >>> 0);
780
+ },
781
+ complex_acos(a) {
782
+ // src/ops/complex-ops/complex_acos(src/types/complex/Complex) => src/types/complex/Complex
783
+ a = __lowerInternref(a) || __notnull();
784
+ return __liftInternref(exports.complex_acos(a) >>> 0);
785
+ },
786
+ complex_atan(a) {
787
+ // src/ops/complex-ops/complex_atan(src/types/complex/Complex) => src/types/complex/Complex
788
+ a = __lowerInternref(a) || __notnull();
789
+ return __liftInternref(exports.complex_atan(a) >>> 0);
790
+ },
791
+ complex_sinh(a) {
792
+ // src/ops/complex-ops/complex_sinh(src/types/complex/Complex) => src/types/complex/Complex
793
+ a = __lowerInternref(a) || __notnull();
794
+ return __liftInternref(exports.complex_sinh(a) >>> 0);
795
+ },
796
+ complex_cosh(a) {
797
+ // src/ops/complex-ops/complex_cosh(src/types/complex/Complex) => src/types/complex/Complex
798
+ a = __lowerInternref(a) || __notnull();
799
+ return __liftInternref(exports.complex_cosh(a) >>> 0);
800
+ },
801
+ complex_tanh(a) {
802
+ // src/ops/complex-ops/complex_tanh(src/types/complex/Complex) => src/types/complex/Complex
803
+ a = __lowerInternref(a) || __notnull();
804
+ return __liftInternref(exports.complex_tanh(a) >>> 0);
805
+ },
806
+ complex_asinh(a) {
807
+ // src/ops/complex-ops/complex_asinh(src/types/complex/Complex) => src/types/complex/Complex
808
+ a = __lowerInternref(a) || __notnull();
809
+ return __liftInternref(exports.complex_asinh(a) >>> 0);
810
+ },
811
+ complex_acosh(a) {
812
+ // src/ops/complex-ops/complex_acosh(src/types/complex/Complex) => src/types/complex/Complex
813
+ a = __lowerInternref(a) || __notnull();
814
+ return __liftInternref(exports.complex_acosh(a) >>> 0);
815
+ },
816
+ complex_atanh(a) {
817
+ // src/ops/complex-ops/complex_atanh(src/types/complex/Complex) => src/types/complex/Complex
818
+ a = __lowerInternref(a) || __notnull();
819
+ return __liftInternref(exports.complex_atanh(a) >>> 0);
820
+ },
821
+ complex_equals(a, b) {
822
+ // src/ops/complex-ops/complex_equals(src/types/complex/Complex, src/types/complex/Complex) => bool
823
+ a = __retain(__lowerInternref(a) || __notnull());
824
+ b = __lowerInternref(b) || __notnull();
825
+ try {
826
+ return exports.complex_equals(a, b) != 0;
827
+ } finally {
828
+ __release(a);
829
+ }
830
+ },
831
+ complex_approx_equals(a, b, tolerance) {
832
+ // src/ops/complex-ops/complex_approx_equals(src/types/complex/Complex, src/types/complex/Complex, f64) => bool
833
+ a = __retain(__lowerInternref(a) || __notnull());
834
+ b = __lowerInternref(b) || __notnull();
835
+ try {
836
+ return exports.complex_approx_equals(a, b, tolerance) != 0;
837
+ } finally {
838
+ __release(a);
839
+ }
840
+ },
841
+ complex_is_zero(a) {
842
+ // src/ops/complex-ops/complex_is_zero(src/types/complex/Complex) => bool
843
+ a = __lowerInternref(a) || __notnull();
844
+ return exports.complex_is_zero(a) != 0;
845
+ },
846
+ complex_is_real(a) {
847
+ // src/ops/complex-ops/complex_is_real(src/types/complex/Complex) => bool
848
+ a = __lowerInternref(a) || __notnull();
849
+ return exports.complex_is_real(a) != 0;
850
+ },
851
+ complex_is_imaginary(a) {
852
+ // src/ops/complex-ops/complex_is_imaginary(src/types/complex/Complex) => bool
853
+ a = __lowerInternref(a) || __notnull();
854
+ return exports.complex_is_imaginary(a) != 0;
855
+ },
856
+ complex_is_nan(a) {
857
+ // src/ops/complex-ops/complex_is_nan(src/types/complex/Complex) => bool
858
+ a = __lowerInternref(a) || __notnull();
859
+ return exports.complex_is_nan(a) != 0;
860
+ },
861
+ complex_is_finite(a) {
862
+ // src/ops/complex-ops/complex_is_finite(src/types/complex/Complex) => bool
863
+ a = __lowerInternref(a) || __notnull();
864
+ return exports.complex_is_finite(a) != 0;
865
+ },
866
+ complex_from_real(re) {
867
+ // src/ops/complex-ops/complex_from_real(f64) => src/types/complex/Complex
868
+ return __liftInternref(exports.complex_from_real(re) >>> 0);
869
+ },
870
+ complex_from_imag(im) {
871
+ // src/ops/complex-ops/complex_from_imag(f64) => src/types/complex/Complex
872
+ return __liftInternref(exports.complex_from_imag(im) >>> 0);
873
+ },
874
+ complex_from_polar(r, theta) {
875
+ // src/ops/complex-ops/complex_from_polar(f64, f64) => src/types/complex/Complex
876
+ return __liftInternref(exports.complex_from_polar(r, theta) >>> 0);
877
+ },
878
+ complex_to_polar(a) {
879
+ // src/ops/complex-ops/complex_to_polar(src/types/complex/Complex) => ~lib/typedarray/Float64Array
880
+ a = __lowerInternref(a) || __notnull();
881
+ return __liftTypedArray(Float64Array, exports.complex_to_polar(a) >>> 0);
882
+ },
883
+ complex_axpby(alpha, a, beta, b) {
884
+ // src/ops/complex-ops/complex_axpby(src/types/complex/Complex, src/types/complex/Complex, src/types/complex/Complex, src/types/complex/Complex) => src/types/complex/Complex
885
+ alpha = __retain(__lowerInternref(alpha) || __notnull());
886
+ a = __retain(__lowerInternref(a) || __notnull());
887
+ beta = __retain(__lowerInternref(beta) || __notnull());
888
+ b = __lowerInternref(b) || __notnull();
889
+ try {
890
+ return __liftInternref(exports.complex_axpby(alpha, a, beta, b) >>> 0);
891
+ } finally {
892
+ __release(alpha);
893
+ __release(a);
894
+ __release(beta);
895
+ }
896
+ },
897
+ complex_distance(a, b) {
898
+ // src/ops/complex-ops/complex_distance(src/types/complex/Complex, src/types/complex/Complex) => f64
899
+ a = __retain(__lowerInternref(a) || __notnull());
900
+ b = __lowerInternref(b) || __notnull();
901
+ try {
902
+ return exports.complex_distance(a, b);
903
+ } finally {
904
+ __release(a);
905
+ }
906
+ },
907
+ complex_array_zeros(n) {
908
+ // src/ops/complex-array/complex_array_zeros(i32) => ~lib/typedarray/Float64Array
909
+ return __liftTypedArray(Float64Array, exports.complex_array_zeros(n) >>> 0);
910
+ },
911
+ complex_array_ones(n) {
912
+ // src/ops/complex-array/complex_array_ones(i32) => ~lib/typedarray/Float64Array
913
+ return __liftTypedArray(Float64Array, exports.complex_array_ones(n) >>> 0);
914
+ },
915
+ complex_array_fill(n, re, im) {
916
+ // src/ops/complex-array/complex_array_fill(i32, f64, f64) => ~lib/typedarray/Float64Array
917
+ return __liftTypedArray(Float64Array, exports.complex_array_fill(n, re, im) >>> 0);
918
+ },
919
+ complex_array_get(data, index) {
920
+ // src/ops/complex-array/complex_array_get(~lib/typedarray/Float64Array, i32) => src/types/complex/Complex
921
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
922
+ return __liftInternref(exports.complex_array_get(data, index) >>> 0);
923
+ },
924
+ complex_array_set(data, index, value) {
925
+ // src/ops/complex-array/complex_array_set(~lib/typedarray/Float64Array, i32, src/types/complex/Complex) => void
926
+ data = __retain(__lowerTypedArray(Float64Array, 5, 3, data) || __notnull());
927
+ value = __lowerInternref(value) || __notnull();
928
+ try {
929
+ exports.complex_array_set(data, index, value);
930
+ } finally {
931
+ __release(data);
932
+ }
933
+ },
934
+ complex_array_set_parts(data, index, re, im) {
935
+ // src/ops/complex-array/complex_array_set_parts(~lib/typedarray/Float64Array, i32, f64, f64) => void
936
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
937
+ exports.complex_array_set_parts(data, index, re, im);
938
+ },
939
+ complex_array_get_re(data, index) {
940
+ // src/ops/complex-array/complex_array_get_re(~lib/typedarray/Float64Array, i32) => f64
941
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
942
+ return exports.complex_array_get_re(data, index);
943
+ },
944
+ complex_array_get_im(data, index) {
945
+ // src/ops/complex-array/complex_array_get_im(~lib/typedarray/Float64Array, i32) => f64
946
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
947
+ return exports.complex_array_get_im(data, index);
948
+ },
949
+ complex_array_length(data) {
950
+ // src/ops/complex-array/complex_array_length(~lib/typedarray/Float64Array) => i32
951
+ data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
952
+ return exports.complex_array_length(data);
953
+ },
954
+ complex_array_add(a, b, result) {
955
+ // src/ops/complex-array/complex_array_add(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
956
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
957
+ b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
958
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
959
+ try {
960
+ exports.complex_array_add(a, b, result);
961
+ } finally {
962
+ __release(a);
963
+ __release(b);
964
+ }
965
+ },
966
+ complex_array_sub(a, b, result) {
967
+ // src/ops/complex-array/complex_array_sub(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
968
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
969
+ b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
970
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
971
+ try {
972
+ exports.complex_array_sub(a, b, result);
973
+ } finally {
974
+ __release(a);
975
+ __release(b);
976
+ }
977
+ },
978
+ complex_array_mul(a, b, result) {
979
+ // src/ops/complex-array/complex_array_mul(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
980
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
981
+ b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
982
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
983
+ try {
984
+ exports.complex_array_mul(a, b, result);
985
+ } finally {
986
+ __release(a);
987
+ __release(b);
988
+ }
989
+ },
990
+ complex_array_div(a, b, result) {
991
+ // src/ops/complex-array/complex_array_div(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
992
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
993
+ b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
994
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
995
+ try {
996
+ exports.complex_array_div(a, b, result);
997
+ } finally {
998
+ __release(a);
999
+ __release(b);
1000
+ }
1001
+ },
1002
+ complex_array_scale_real(a, scalar, result) {
1003
+ // src/ops/complex-array/complex_array_scale_real(~lib/typedarray/Float64Array, f64, ~lib/typedarray/Float64Array) => void
1004
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1005
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1006
+ try {
1007
+ exports.complex_array_scale_real(a, scalar, result);
1008
+ } finally {
1009
+ __release(a);
1010
+ }
1011
+ },
1012
+ complex_array_scale_complex(a, re, im, result) {
1013
+ // src/ops/complex-array/complex_array_scale_complex(~lib/typedarray/Float64Array, f64, f64, ~lib/typedarray/Float64Array) => void
1014
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1015
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1016
+ try {
1017
+ exports.complex_array_scale_complex(a, re, im, result);
1018
+ } finally {
1019
+ __release(a);
1020
+ }
1021
+ },
1022
+ complex_array_neg(a, result) {
1023
+ // src/ops/complex-array/complex_array_neg(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1024
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1025
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1026
+ try {
1027
+ exports.complex_array_neg(a, result);
1028
+ } finally {
1029
+ __release(a);
1030
+ }
1031
+ },
1032
+ complex_array_conj(a, result) {
1033
+ // src/ops/complex-array/complex_array_conj(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1034
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1035
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1036
+ try {
1037
+ exports.complex_array_conj(a, result);
1038
+ } finally {
1039
+ __release(a);
1040
+ }
1041
+ },
1042
+ complex_array_abs(a, result) {
1043
+ // src/ops/complex-array/complex_array_abs(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1044
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1045
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1046
+ try {
1047
+ exports.complex_array_abs(a, result);
1048
+ } finally {
1049
+ __release(a);
1050
+ }
1051
+ },
1052
+ complex_array_arg(a, result) {
1053
+ // src/ops/complex-array/complex_array_arg(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1054
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1055
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1056
+ try {
1057
+ exports.complex_array_arg(a, result);
1058
+ } finally {
1059
+ __release(a);
1060
+ }
1061
+ },
1062
+ complex_array_abs_squared(a, result) {
1063
+ // src/ops/complex-array/complex_array_abs_squared(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1064
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1065
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1066
+ try {
1067
+ exports.complex_array_abs_squared(a, result);
1068
+ } finally {
1069
+ __release(a);
1070
+ }
1071
+ },
1072
+ complex_array_real(a, result) {
1073
+ // src/ops/complex-array/complex_array_real(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1074
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1075
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1076
+ try {
1077
+ exports.complex_array_real(a, result);
1078
+ } finally {
1079
+ __release(a);
1080
+ }
1081
+ },
1082
+ complex_array_imag(a, result) {
1083
+ // src/ops/complex-array/complex_array_imag(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1084
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1085
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1086
+ try {
1087
+ exports.complex_array_imag(a, result);
1088
+ } finally {
1089
+ __release(a);
1090
+ }
1091
+ },
1092
+ complex_array_exp(a, result) {
1093
+ // src/ops/complex-array/complex_array_exp(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1094
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1095
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1096
+ try {
1097
+ exports.complex_array_exp(a, result);
1098
+ } finally {
1099
+ __release(a);
1100
+ }
1101
+ },
1102
+ complex_array_log(a, result) {
1103
+ // src/ops/complex-array/complex_array_log(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1104
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1105
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1106
+ try {
1107
+ exports.complex_array_log(a, result);
1108
+ } finally {
1109
+ __release(a);
1110
+ }
1111
+ },
1112
+ complex_array_sqrt(a, result) {
1113
+ // src/ops/complex-array/complex_array_sqrt(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1114
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1115
+ result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1116
+ try {
1117
+ exports.complex_array_sqrt(a, result);
1118
+ } finally {
1119
+ __release(a);
1120
+ }
1121
+ },
1122
+ complex_array_sum(a) {
1123
+ // src/ops/complex-array/complex_array_sum(~lib/typedarray/Float64Array) => src/types/complex/Complex
1124
+ a = __lowerTypedArray(Float64Array, 5, 3, a) || __notnull();
1125
+ return __liftInternref(exports.complex_array_sum(a) >>> 0);
1126
+ },
1127
+ complex_array_mean(a) {
1128
+ // src/ops/complex-array/complex_array_mean(~lib/typedarray/Float64Array) => src/types/complex/Complex
1129
+ a = __lowerTypedArray(Float64Array, 5, 3, a) || __notnull();
1130
+ return __liftInternref(exports.complex_array_mean(a) >>> 0);
1131
+ },
1132
+ complex_array_dot(a, b) {
1133
+ // src/ops/complex-array/complex_array_dot(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => src/types/complex/Complex
1134
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1135
+ b = __lowerTypedArray(Float64Array, 5, 3, b) || __notnull();
1136
+ try {
1137
+ return __liftInternref(exports.complex_array_dot(a, b) >>> 0);
1138
+ } finally {
1139
+ __release(a);
1140
+ }
1141
+ },
1142
+ complex_array_norm(a) {
1143
+ // src/ops/complex-array/complex_array_norm(~lib/typedarray/Float64Array) => f64
1144
+ a = __lowerTypedArray(Float64Array, 5, 3, a) || __notnull();
1145
+ return exports.complex_array_norm(a);
1146
+ },
1147
+ complex_array_scale_inplace(a, scalar) {
1148
+ // src/ops/complex-array/complex_array_scale_inplace(~lib/typedarray/Float64Array, f64) => void
1149
+ a = __lowerTypedArray(Float64Array, 5, 3, a) || __notnull();
1150
+ exports.complex_array_scale_inplace(a, scalar);
1151
+ },
1152
+ complex_array_conj_inplace(a) {
1153
+ // src/ops/complex-array/complex_array_conj_inplace(~lib/typedarray/Float64Array) => void
1154
+ a = __lowerTypedArray(Float64Array, 5, 3, a) || __notnull();
1155
+ exports.complex_array_conj_inplace(a);
1156
+ },
1157
+ complex_array_add_inplace(a, b) {
1158
+ // src/ops/complex-array/complex_array_add_inplace(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1159
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1160
+ b = __lowerTypedArray(Float64Array, 5, 3, b) || __notnull();
1161
+ try {
1162
+ exports.complex_array_add_inplace(a, b);
1163
+ } finally {
1164
+ __release(a);
1165
+ }
1166
+ },
1167
+ complex_array_copy(src, dst) {
1168
+ // src/ops/complex-array/complex_array_copy(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1169
+ src = __retain(__lowerTypedArray(Float64Array, 5, 3, src) || __notnull());
1170
+ dst = __lowerTypedArray(Float64Array, 5, 3, dst) || __notnull();
1171
+ try {
1172
+ exports.complex_array_copy(src, dst);
1173
+ } finally {
1174
+ __release(src);
1175
+ }
1176
+ },
1177
+ }, exports);
1178
+ function __liftString(pointer) {
1179
+ if (!pointer) return null;
1180
+ const
1181
+ end = pointer + new Uint32Array(memory.buffer)[pointer - 4 >>> 2] >>> 1,
1182
+ memoryU16 = new Uint16Array(memory.buffer);
1183
+ let
1184
+ start = pointer >>> 1,
1185
+ string = "";
1186
+ while (end - start > 1024) string += String.fromCharCode(...memoryU16.subarray(start, start += 1024));
1187
+ return string + String.fromCharCode(...memoryU16.subarray(start, end));
1188
+ }
1189
+ function __liftTypedArray(constructor, pointer) {
1190
+ if (!pointer) return null;
1191
+ return new constructor(
1192
+ memory.buffer,
1193
+ __getU32(pointer + 4),
1194
+ __dataview.getUint32(pointer + 8, true) / constructor.BYTES_PER_ELEMENT
1195
+ ).slice();
1196
+ }
1197
+ function __lowerTypedArray(constructor, id, align, values) {
1198
+ if (values == null) return 0;
1199
+ const
1200
+ length = values.length,
1201
+ buffer = exports.__pin(exports.__new(length << align, 1)) >>> 0,
1202
+ header = exports.__new(12, id) >>> 0;
1203
+ __setU32(header + 0, buffer);
1204
+ __dataview.setUint32(header + 4, buffer, true);
1205
+ __dataview.setUint32(header + 8, length << align, true);
1206
+ new constructor(memory.buffer, buffer, length).set(values);
1207
+ exports.__unpin(buffer);
1208
+ return header;
1209
+ }
1210
+ class Internref extends Number {}
1211
+ const registry = new FinalizationRegistry(__release);
1212
+ function __liftInternref(pointer) {
1213
+ if (!pointer) return null;
1214
+ const sentinel = new Internref(__retain(pointer));
1215
+ registry.register(sentinel, pointer);
1216
+ return sentinel;
1217
+ }
1218
+ function __lowerInternref(value) {
1219
+ if (value == null) return 0;
1220
+ if (value instanceof Internref) return value.valueOf();
1221
+ throw TypeError("internref expected");
1222
+ }
1223
+ const refcounts = new Map();
1224
+ function __retain(pointer) {
1225
+ if (pointer) {
1226
+ const refcount = refcounts.get(pointer);
1227
+ if (refcount) refcounts.set(pointer, refcount + 1);
1228
+ else refcounts.set(exports.__pin(pointer), 1);
1229
+ }
1230
+ return pointer;
1231
+ }
1232
+ function __release(pointer) {
1233
+ if (pointer) {
1234
+ const refcount = refcounts.get(pointer);
1235
+ if (refcount === 1) exports.__unpin(pointer), refcounts.delete(pointer);
1236
+ else if (refcount) refcounts.set(pointer, refcount - 1);
1237
+ else throw Error(`invalid refcount '${refcount}' for reference '${pointer}'`);
1238
+ }
1239
+ }
1240
+ function __notnull() {
1241
+ throw TypeError("value must not be null");
1242
+ }
1243
+ let __dataview = new DataView(memory.buffer);
1244
+ function __setU32(pointer, value) {
1245
+ try {
1246
+ __dataview.setUint32(pointer, value, true);
1247
+ } catch {
1248
+ __dataview = new DataView(memory.buffer);
1249
+ __dataview.setUint32(pointer, value, true);
1250
+ }
1251
+ }
1252
+ function __getU32(pointer) {
1253
+ try {
1254
+ return __dataview.getUint32(pointer, true);
1255
+ } catch {
1256
+ __dataview = new DataView(memory.buffer);
1257
+ return __dataview.getUint32(pointer, true);
1258
+ }
1259
+ }
1260
+ return adaptedExports;
1261
+ }
1262
+ export const {
1263
+ memory,
1264
+ __new,
1265
+ __pin,
1266
+ __unpin,
1267
+ __collect,
1268
+ __rtti_base,
1269
+ complex,
1270
+ complexFromPolar,
1271
+ add_f64,
1272
+ sub_f64,
1273
+ mul_f64,
1274
+ div_f64,
1275
+ mod_f64,
1276
+ neg_f64,
1277
+ sqrt_f64,
1278
+ pow_f64,
1279
+ square_f64,
1280
+ cube_f64,
1281
+ cbrt_f64,
1282
+ nthRoot_f64,
1283
+ exp_f64,
1284
+ expm1_f64,
1285
+ log_f64,
1286
+ log1p_f64,
1287
+ log10_f64,
1288
+ log2_f64,
1289
+ sin_f64,
1290
+ cos_f64,
1291
+ tan_f64,
1292
+ asin_f64,
1293
+ acos_f64,
1294
+ atan_f64,
1295
+ atan2_f64,
1296
+ sinh_f64,
1297
+ cosh_f64,
1298
+ tanh_f64,
1299
+ asinh_f64,
1300
+ acosh_f64,
1301
+ atanh_f64,
1302
+ abs_f64,
1303
+ floor_f64,
1304
+ ceil_f64,
1305
+ round_f64,
1306
+ trunc_f64,
1307
+ sign_f64,
1308
+ min_f64,
1309
+ max_f64,
1310
+ clamp_f64,
1311
+ isNaN_f64,
1312
+ isFinite_f64,
1313
+ PI,
1314
+ E,
1315
+ PHI,
1316
+ SQRT2,
1317
+ SQRT1_2,
1318
+ LN2,
1319
+ LN10,
1320
+ LOG2E,
1321
+ LOG10E,
1322
+ EPSILON,
1323
+ array_sum,
1324
+ array_product,
1325
+ array_mean,
1326
+ array_variance,
1327
+ array_stddev,
1328
+ array_min,
1329
+ array_max,
1330
+ array_argmin,
1331
+ array_argmax,
1332
+ array_norm,
1333
+ array_norm_l1,
1334
+ array_norm_linf,
1335
+ array_dot,
1336
+ array_add,
1337
+ array_sub,
1338
+ array_mul,
1339
+ array_div,
1340
+ array_scale,
1341
+ array_add_scalar,
1342
+ array_neg,
1343
+ array_abs,
1344
+ array_sqrt,
1345
+ array_square,
1346
+ array_exp,
1347
+ array_log,
1348
+ array_sin,
1349
+ array_cos,
1350
+ array_axpby,
1351
+ array_distance,
1352
+ array_cosine_similarity,
1353
+ array_scale_inplace,
1354
+ array_add_scalar_inplace,
1355
+ array_add_inplace,
1356
+ array_clamp_inplace,
1357
+ array_fill,
1358
+ array_copy,
1359
+ matrix_zeros,
1360
+ matrix_ones,
1361
+ matrix_fill,
1362
+ matrix_identity,
1363
+ matrix_diag,
1364
+ matrix_get,
1365
+ matrix_set,
1366
+ matrix_get_row,
1367
+ matrix_get_col,
1368
+ matrix_get_diag,
1369
+ matrix_add,
1370
+ matrix_sub,
1371
+ matrix_mul_elementwise,
1372
+ matrix_div_elementwise,
1373
+ matrix_scale,
1374
+ matrix_add_scalar,
1375
+ matrix_neg,
1376
+ matrix_multiply,
1377
+ matrix_vector_multiply,
1378
+ vector_matrix_multiply,
1379
+ matrix_outer,
1380
+ matrix_transpose,
1381
+ matrix_sum,
1382
+ matrix_mean,
1383
+ matrix_min,
1384
+ matrix_max,
1385
+ matrix_norm_frobenius,
1386
+ matrix_trace,
1387
+ matrix_sum_rows,
1388
+ matrix_sum_cols,
1389
+ matrix_is_square,
1390
+ matrix_is_symmetric,
1391
+ matrix_is_diagonal,
1392
+ matrix_is_identity,
1393
+ matrix_scale_inplace,
1394
+ matrix_add_scalar_inplace,
1395
+ matrix_add_inplace,
1396
+ matrix_copy,
1397
+ matrix_axpy,
1398
+ matrix_gemm,
1399
+ matrix_gemv,
1400
+ complex_add,
1401
+ complex_sub,
1402
+ complex_mul,
1403
+ complex_div,
1404
+ complex_neg,
1405
+ complex_conj,
1406
+ complex_reciprocal,
1407
+ complex_abs,
1408
+ complex_arg,
1409
+ complex_abs_squared,
1410
+ complex_sqrt,
1411
+ complex_pow,
1412
+ complex_cpow,
1413
+ complex_square,
1414
+ complex_cube,
1415
+ complex_exp,
1416
+ complex_log,
1417
+ complex_log10,
1418
+ complex_log2,
1419
+ complex_sin,
1420
+ complex_cos,
1421
+ complex_tan,
1422
+ complex_asin,
1423
+ complex_acos,
1424
+ complex_atan,
1425
+ complex_sinh,
1426
+ complex_cosh,
1427
+ complex_tanh,
1428
+ complex_asinh,
1429
+ complex_acosh,
1430
+ complex_atanh,
1431
+ complex_equals,
1432
+ complex_approx_equals,
1433
+ complex_is_zero,
1434
+ complex_is_real,
1435
+ complex_is_imaginary,
1436
+ complex_is_nan,
1437
+ complex_is_finite,
1438
+ complex_from_real,
1439
+ complex_from_imag,
1440
+ complex_from_polar,
1441
+ complex_to_polar,
1442
+ complex_axpby,
1443
+ complex_distance,
1444
+ complex_array_zeros,
1445
+ complex_array_ones,
1446
+ complex_array_fill,
1447
+ complex_array_get,
1448
+ complex_array_set,
1449
+ complex_array_set_parts,
1450
+ complex_array_get_re,
1451
+ complex_array_get_im,
1452
+ complex_array_length,
1453
+ complex_array_add,
1454
+ complex_array_sub,
1455
+ complex_array_mul,
1456
+ complex_array_div,
1457
+ complex_array_scale_real,
1458
+ complex_array_scale_complex,
1459
+ complex_array_neg,
1460
+ complex_array_conj,
1461
+ complex_array_abs,
1462
+ complex_array_arg,
1463
+ complex_array_abs_squared,
1464
+ complex_array_real,
1465
+ complex_array_imag,
1466
+ complex_array_exp,
1467
+ complex_array_log,
1468
+ complex_array_sqrt,
1469
+ complex_array_sum,
1470
+ complex_array_mean,
1471
+ complex_array_dot,
1472
+ complex_array_norm,
1473
+ complex_array_scale_inplace,
1474
+ complex_array_conj_inplace,
1475
+ complex_array_add_inplace,
1476
+ complex_array_copy,
1477
+ } = await (async url => instantiate(
1478
+ await (async () => {
1479
+ const isNodeOrBun = typeof process != "undefined" && process.versions != null && (process.versions.node != null || process.versions.bun != null);
1480
+ if (isNodeOrBun) { return globalThis.WebAssembly.compile(await (await import("node:fs/promises")).readFile(url)); }
1481
+ else { return await globalThis.WebAssembly.compileStreaming(globalThis.fetch(url)); }
1482
+ })(), {
1483
+ }
1484
+ ))(new URL("mathts.wasm", import.meta.url));