@danielsimonjr/mathts-wasm 0.4.0 → 0.5.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/build/mathts.js CHANGED
@@ -1,22 +1,27 @@
1
1
  async function instantiate(module, imports = {}) {
2
- const adaptedImports = {
3
- env: Object.setPrototypeOf({
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
- }, Object.assign(Object.create(globalThis), imports.env || {})),
16
- };
17
- const { exports } = await WebAssembly.instantiate(module, adaptedImports);
2
+ const { exports } = await WebAssembly.instantiate(module, imports);
18
3
  const memory = exports.memory || imports.env.memory;
19
4
  const adaptedExports = Object.setPrototypeOf({
5
+ abort_take() {
6
+ // src/abort/abort_take() => bool
7
+ return exports.abort_take() != 0;
8
+ },
9
+ abort_message() {
10
+ // src/abort/abort_message() => usize
11
+ return exports.abort_message() >>> 0;
12
+ },
13
+ abort_file() {
14
+ // src/abort/abort_file() => usize
15
+ return exports.abort_file() >>> 0;
16
+ },
17
+ abort_line() {
18
+ // src/abort/abort_line() => u32
19
+ return exports.abort_line() >>> 0;
20
+ },
21
+ abort_column() {
22
+ // src/abort/abort_column() => u32
23
+ return exports.abort_column() >>> 0;
24
+ },
20
25
  complex(re, im) {
21
26
  // src/types/complex/complex(f64, f64) => src/types/complex/Complex
22
27
  return __liftInternref(exports.complex(re, im) >>> 0);
@@ -107,9 +112,9 @@ async function instantiate(module, imports = {}) {
107
112
  // src/ops/array/array_add(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
108
113
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
109
114
  b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
110
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
115
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
111
116
  try {
112
- exports.array_add(a, b, result);
117
+ __writeBack(exports.array_add(a, b, result));
113
118
  } finally {
114
119
  __release(a);
115
120
  __release(b);
@@ -119,9 +124,9 @@ async function instantiate(module, imports = {}) {
119
124
  // src/ops/array/array_sub(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
120
125
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
121
126
  b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
122
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
127
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
123
128
  try {
124
- exports.array_sub(a, b, result);
129
+ __writeBack(exports.array_sub(a, b, result));
125
130
  } finally {
126
131
  __release(a);
127
132
  __release(b);
@@ -131,9 +136,9 @@ async function instantiate(module, imports = {}) {
131
136
  // src/ops/array/array_mul(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
132
137
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
133
138
  b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
134
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
139
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
135
140
  try {
136
- exports.array_mul(a, b, result);
141
+ __writeBack(exports.array_mul(a, b, result));
137
142
  } finally {
138
143
  __release(a);
139
144
  __release(b);
@@ -143,9 +148,9 @@ async function instantiate(module, imports = {}) {
143
148
  // src/ops/array/array_div(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
144
149
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
145
150
  b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
146
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
151
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
147
152
  try {
148
- exports.array_div(a, b, result);
153
+ __writeBack(exports.array_div(a, b, result));
149
154
  } finally {
150
155
  __release(a);
151
156
  __release(b);
@@ -154,9 +159,9 @@ async function instantiate(module, imports = {}) {
154
159
  array_scale(a, scalar, result) {
155
160
  // src/ops/array/array_scale(~lib/typedarray/Float64Array, f64, ~lib/typedarray/Float64Array) => void
156
161
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
157
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
162
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
158
163
  try {
159
- exports.array_scale(a, scalar, result);
164
+ __writeBack(exports.array_scale(a, scalar, result));
160
165
  } finally {
161
166
  __release(a);
162
167
  }
@@ -164,9 +169,9 @@ async function instantiate(module, imports = {}) {
164
169
  array_add_scalar(a, scalar, result) {
165
170
  // src/ops/array/array_add_scalar(~lib/typedarray/Float64Array, f64, ~lib/typedarray/Float64Array) => void
166
171
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
167
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
172
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
168
173
  try {
169
- exports.array_add_scalar(a, scalar, result);
174
+ __writeBack(exports.array_add_scalar(a, scalar, result));
170
175
  } finally {
171
176
  __release(a);
172
177
  }
@@ -174,9 +179,9 @@ async function instantiate(module, imports = {}) {
174
179
  array_neg(a, result) {
175
180
  // src/ops/array/array_neg(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
176
181
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
177
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
182
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
178
183
  try {
179
- exports.array_neg(a, result);
184
+ __writeBack(exports.array_neg(a, result));
180
185
  } finally {
181
186
  __release(a);
182
187
  }
@@ -184,9 +189,9 @@ async function instantiate(module, imports = {}) {
184
189
  array_abs(a, result) {
185
190
  // src/ops/array/array_abs(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
186
191
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
187
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
192
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
188
193
  try {
189
- exports.array_abs(a, result);
194
+ __writeBack(exports.array_abs(a, result));
190
195
  } finally {
191
196
  __release(a);
192
197
  }
@@ -194,9 +199,9 @@ async function instantiate(module, imports = {}) {
194
199
  array_sqrt(a, result) {
195
200
  // src/ops/array/array_sqrt(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
196
201
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
197
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
202
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
198
203
  try {
199
- exports.array_sqrt(a, result);
204
+ __writeBack(exports.array_sqrt(a, result));
200
205
  } finally {
201
206
  __release(a);
202
207
  }
@@ -204,9 +209,9 @@ async function instantiate(module, imports = {}) {
204
209
  array_square(a, result) {
205
210
  // src/ops/array/array_square(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
206
211
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
207
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
212
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
208
213
  try {
209
- exports.array_square(a, result);
214
+ __writeBack(exports.array_square(a, result));
210
215
  } finally {
211
216
  __release(a);
212
217
  }
@@ -214,9 +219,9 @@ async function instantiate(module, imports = {}) {
214
219
  array_exp(a, result) {
215
220
  // src/ops/array/array_exp(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
216
221
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
217
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
222
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
218
223
  try {
219
- exports.array_exp(a, result);
224
+ __writeBack(exports.array_exp(a, result));
220
225
  } finally {
221
226
  __release(a);
222
227
  }
@@ -224,9 +229,9 @@ async function instantiate(module, imports = {}) {
224
229
  array_log(a, result) {
225
230
  // src/ops/array/array_log(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
226
231
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
227
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
232
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
228
233
  try {
229
- exports.array_log(a, result);
234
+ __writeBack(exports.array_log(a, result));
230
235
  } finally {
231
236
  __release(a);
232
237
  }
@@ -234,9 +239,9 @@ async function instantiate(module, imports = {}) {
234
239
  array_sin(a, result) {
235
240
  // src/ops/array/array_sin(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
236
241
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
237
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
242
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
238
243
  try {
239
- exports.array_sin(a, result);
244
+ __writeBack(exports.array_sin(a, result));
240
245
  } finally {
241
246
  __release(a);
242
247
  }
@@ -244,9 +249,9 @@ async function instantiate(module, imports = {}) {
244
249
  array_cos(a, result) {
245
250
  // src/ops/array/array_cos(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
246
251
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
247
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
252
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
248
253
  try {
249
- exports.array_cos(a, result);
254
+ __writeBack(exports.array_cos(a, result));
250
255
  } finally {
251
256
  __release(a);
252
257
  }
@@ -255,9 +260,9 @@ async function instantiate(module, imports = {}) {
255
260
  // src/ops/array/array_axpby(f64, ~lib/typedarray/Float64Array, f64, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
256
261
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
257
262
  b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
258
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
263
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
259
264
  try {
260
- exports.array_axpby(alpha, a, beta, b, result);
265
+ __writeBack(exports.array_axpby(alpha, a, beta, b, result));
261
266
  } finally {
262
267
  __release(a);
263
268
  __release(b);
@@ -285,40 +290,40 @@ async function instantiate(module, imports = {}) {
285
290
  },
286
291
  array_scale_inplace(a, scalar) {
287
292
  // 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);
293
+ a = __lowerTypedArray(Float64Array, 5, 3, a, 5) || __notnull();
294
+ __writeBack(exports.array_scale_inplace(a, scalar));
290
295
  },
291
296
  array_add_scalar_inplace(a, scalar) {
292
297
  // 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);
298
+ a = __lowerTypedArray(Float64Array, 5, 3, a, 5) || __notnull();
299
+ __writeBack(exports.array_add_scalar_inplace(a, scalar));
295
300
  },
296
301
  array_add_inplace(a, b) {
297
302
  // src/ops/array/array_add_inplace(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
298
- a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
303
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a, 5) || __notnull());
299
304
  b = __lowerTypedArray(Float64Array, 5, 3, b) || __notnull();
300
305
  try {
301
- exports.array_add_inplace(a, b);
306
+ __writeBack(exports.array_add_inplace(a, b));
302
307
  } finally {
303
308
  __release(a);
304
309
  }
305
310
  },
306
311
  array_clamp_inplace(a, lo, hi) {
307
312
  // 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);
313
+ a = __lowerTypedArray(Float64Array, 5, 3, a, 5) || __notnull();
314
+ __writeBack(exports.array_clamp_inplace(a, lo, hi));
310
315
  },
311
316
  array_fill(a, value) {
312
317
  // src/ops/array/array_fill(~lib/typedarray/Float64Array, f64) => void
313
- a = __lowerTypedArray(Float64Array, 5, 3, a) || __notnull();
314
- exports.array_fill(a, value);
318
+ a = __lowerTypedArray(Float64Array, 5, 3, a, 5) || __notnull();
319
+ __writeBack(exports.array_fill(a, value));
315
320
  },
316
321
  array_copy(src, dst) {
317
322
  // src/ops/array/array_copy(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
318
323
  src = __retain(__lowerTypedArray(Float64Array, 5, 3, src) || __notnull());
319
- dst = __lowerTypedArray(Float64Array, 5, 3, dst) || __notnull();
324
+ dst = __lowerTypedArray(Float64Array, 5, 3, dst, 5) || __notnull();
320
325
  try {
321
- exports.array_copy(src, dst);
326
+ __writeBack(exports.array_copy(src, dst));
322
327
  } finally {
323
328
  __release(src);
324
329
  }
@@ -351,8 +356,8 @@ async function instantiate(module, imports = {}) {
351
356
  },
352
357
  matrix_set(data, cols, row, col, value) {
353
358
  // 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);
359
+ data = __lowerTypedArray(Float64Array, 5, 3, data, 5) || __notnull();
360
+ __writeBack(exports.matrix_set(data, cols, row, col, value));
356
361
  },
357
362
  matrix_get_row(data, cols, row) {
358
363
  // src/ops/matrix/matrix_get_row(~lib/typedarray/Float64Array, i32, i32) => ~lib/typedarray/Float64Array
@@ -373,9 +378,9 @@ async function instantiate(module, imports = {}) {
373
378
  // src/ops/matrix/matrix_add(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
374
379
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
375
380
  b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
376
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
381
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
377
382
  try {
378
- exports.matrix_add(a, b, result);
383
+ __writeBack(exports.matrix_add(a, b, result));
379
384
  } finally {
380
385
  __release(a);
381
386
  __release(b);
@@ -385,9 +390,9 @@ async function instantiate(module, imports = {}) {
385
390
  // src/ops/matrix/matrix_sub(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
386
391
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
387
392
  b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
388
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
393
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
389
394
  try {
390
- exports.matrix_sub(a, b, result);
395
+ __writeBack(exports.matrix_sub(a, b, result));
391
396
  } finally {
392
397
  __release(a);
393
398
  __release(b);
@@ -397,9 +402,9 @@ async function instantiate(module, imports = {}) {
397
402
  // src/ops/matrix/matrix_mul_elementwise(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
398
403
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
399
404
  b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
400
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
405
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
401
406
  try {
402
- exports.matrix_mul_elementwise(a, b, result);
407
+ __writeBack(exports.matrix_mul_elementwise(a, b, result));
403
408
  } finally {
404
409
  __release(a);
405
410
  __release(b);
@@ -409,9 +414,9 @@ async function instantiate(module, imports = {}) {
409
414
  // src/ops/matrix/matrix_div_elementwise(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
410
415
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
411
416
  b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
412
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
417
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
413
418
  try {
414
- exports.matrix_div_elementwise(a, b, result);
419
+ __writeBack(exports.matrix_div_elementwise(a, b, result));
415
420
  } finally {
416
421
  __release(a);
417
422
  __release(b);
@@ -420,9 +425,9 @@ async function instantiate(module, imports = {}) {
420
425
  matrix_scale(a, scalar, result) {
421
426
  // src/ops/matrix/matrix_scale(~lib/typedarray/Float64Array, f64, ~lib/typedarray/Float64Array) => void
422
427
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
423
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
428
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
424
429
  try {
425
- exports.matrix_scale(a, scalar, result);
430
+ __writeBack(exports.matrix_scale(a, scalar, result));
426
431
  } finally {
427
432
  __release(a);
428
433
  }
@@ -430,9 +435,9 @@ async function instantiate(module, imports = {}) {
430
435
  matrix_add_scalar(a, scalar, result) {
431
436
  // src/ops/matrix/matrix_add_scalar(~lib/typedarray/Float64Array, f64, ~lib/typedarray/Float64Array) => void
432
437
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
433
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
438
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
434
439
  try {
435
- exports.matrix_add_scalar(a, scalar, result);
440
+ __writeBack(exports.matrix_add_scalar(a, scalar, result));
436
441
  } finally {
437
442
  __release(a);
438
443
  }
@@ -440,9 +445,9 @@ async function instantiate(module, imports = {}) {
440
445
  matrix_neg(a, result) {
441
446
  // src/ops/matrix/matrix_neg(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
442
447
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
443
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
448
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
444
449
  try {
445
- exports.matrix_neg(a, result);
450
+ __writeBack(exports.matrix_neg(a, result));
446
451
  } finally {
447
452
  __release(a);
448
453
  }
@@ -451,9 +456,9 @@ async function instantiate(module, imports = {}) {
451
456
  // src/ops/matrix/matrix_multiply(~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array, i32, ~lib/typedarray/Float64Array) => void
452
457
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
453
458
  b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
454
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
459
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
455
460
  try {
456
- exports.matrix_multiply(a, aRows, aCols, b, bCols, result);
461
+ __writeBack(exports.matrix_multiply(a, aRows, aCols, b, bCols, result));
457
462
  } finally {
458
463
  __release(a);
459
464
  __release(b);
@@ -463,9 +468,9 @@ async function instantiate(module, imports = {}) {
463
468
  // src/ops/matrix/matrix_vector_multiply(~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
464
469
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
465
470
  x = __retain(__lowerTypedArray(Float64Array, 5, 3, x) || __notnull());
466
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
471
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
467
472
  try {
468
- exports.matrix_vector_multiply(a, rows, cols, x, result);
473
+ __writeBack(exports.matrix_vector_multiply(a, rows, cols, x, result));
469
474
  } finally {
470
475
  __release(a);
471
476
  __release(x);
@@ -475,9 +480,9 @@ async function instantiate(module, imports = {}) {
475
480
  // src/ops/matrix/vector_matrix_multiply(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array) => void
476
481
  x = __retain(__lowerTypedArray(Float64Array, 5, 3, x) || __notnull());
477
482
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
478
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
483
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
479
484
  try {
480
- exports.vector_matrix_multiply(x, a, rows, cols, result);
485
+ __writeBack(exports.vector_matrix_multiply(x, a, rows, cols, result));
481
486
  } finally {
482
487
  __release(x);
483
488
  __release(a);
@@ -487,9 +492,9 @@ async function instantiate(module, imports = {}) {
487
492
  // src/ops/matrix/matrix_outer(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
488
493
  x = __retain(__lowerTypedArray(Float64Array, 5, 3, x) || __notnull());
489
494
  y = __retain(__lowerTypedArray(Float64Array, 5, 3, y) || __notnull());
490
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
495
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
491
496
  try {
492
- exports.matrix_outer(x, y, result);
497
+ __writeBack(exports.matrix_outer(x, y, result));
493
498
  } finally {
494
499
  __release(x);
495
500
  __release(y);
@@ -498,9 +503,9 @@ async function instantiate(module, imports = {}) {
498
503
  matrix_transpose(a, rows, cols, result) {
499
504
  // src/ops/matrix/matrix_transpose(~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array) => void
500
505
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
501
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
506
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
502
507
  try {
503
- exports.matrix_transpose(a, rows, cols, result);
508
+ __writeBack(exports.matrix_transpose(a, rows, cols, result));
504
509
  } finally {
505
510
  __release(a);
506
511
  }
@@ -538,9 +543,9 @@ async function instantiate(module, imports = {}) {
538
543
  matrix_sum_rows(data, rows, cols, result) {
539
544
  // src/ops/matrix/matrix_sum_rows(~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array) => void
540
545
  data = __retain(__lowerTypedArray(Float64Array, 5, 3, data) || __notnull());
541
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
546
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
542
547
  try {
543
- exports.matrix_sum_rows(data, rows, cols, result);
548
+ __writeBack(exports.matrix_sum_rows(data, rows, cols, result));
544
549
  } finally {
545
550
  __release(data);
546
551
  }
@@ -548,9 +553,9 @@ async function instantiate(module, imports = {}) {
548
553
  matrix_sum_cols(data, rows, cols, result) {
549
554
  // src/ops/matrix/matrix_sum_cols(~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array) => void
550
555
  data = __retain(__lowerTypedArray(Float64Array, 5, 3, data) || __notnull());
551
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
556
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
552
557
  try {
553
- exports.matrix_sum_cols(data, rows, cols, result);
558
+ __writeBack(exports.matrix_sum_cols(data, rows, cols, result));
554
559
  } finally {
555
560
  __release(data);
556
561
  }
@@ -576,20 +581,20 @@ async function instantiate(module, imports = {}) {
576
581
  },
577
582
  matrix_scale_inplace(data, scalar) {
578
583
  // 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);
584
+ data = __lowerTypedArray(Float64Array, 5, 3, data, 5) || __notnull();
585
+ __writeBack(exports.matrix_scale_inplace(data, scalar));
581
586
  },
582
587
  matrix_add_scalar_inplace(data, scalar) {
583
588
  // 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);
589
+ data = __lowerTypedArray(Float64Array, 5, 3, data, 5) || __notnull();
590
+ __writeBack(exports.matrix_add_scalar_inplace(data, scalar));
586
591
  },
587
592
  matrix_add_inplace(a, b) {
588
593
  // src/ops/matrix/matrix_add_inplace(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
589
- a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
594
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a, 5) || __notnull());
590
595
  b = __lowerTypedArray(Float64Array, 5, 3, b) || __notnull();
591
596
  try {
592
- exports.matrix_add_inplace(a, b);
597
+ __writeBack(exports.matrix_add_inplace(a, b));
593
598
  } finally {
594
599
  __release(a);
595
600
  }
@@ -597,9 +602,9 @@ async function instantiate(module, imports = {}) {
597
602
  matrix_copy(src, dst) {
598
603
  // src/ops/matrix/matrix_copy(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
599
604
  src = __retain(__lowerTypedArray(Float64Array, 5, 3, src) || __notnull());
600
- dst = __lowerTypedArray(Float64Array, 5, 3, dst) || __notnull();
605
+ dst = __lowerTypedArray(Float64Array, 5, 3, dst, 5) || __notnull();
601
606
  try {
602
- exports.matrix_copy(src, dst);
607
+ __writeBack(exports.matrix_copy(src, dst));
603
608
  } finally {
604
609
  __release(src);
605
610
  }
@@ -607,9 +612,9 @@ async function instantiate(module, imports = {}) {
607
612
  matrix_axpy(alpha, x, y) {
608
613
  // src/ops/matrix/matrix_axpy(f64, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
609
614
  x = __retain(__lowerTypedArray(Float64Array, 5, 3, x) || __notnull());
610
- y = __lowerTypedArray(Float64Array, 5, 3, y) || __notnull();
615
+ y = __lowerTypedArray(Float64Array, 5, 3, y, 5) || __notnull();
611
616
  try {
612
- exports.matrix_axpy(alpha, x, y);
617
+ __writeBack(exports.matrix_axpy(alpha, x, y));
613
618
  } finally {
614
619
  __release(x);
615
620
  }
@@ -618,9 +623,9 @@ async function instantiate(module, imports = {}) {
618
623
  // src/ops/matrix/matrix_gemm(f64, ~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array, i32, f64, ~lib/typedarray/Float64Array) => void
619
624
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
620
625
  b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
621
- c = __lowerTypedArray(Float64Array, 5, 3, c) || __notnull();
626
+ c = __lowerTypedArray(Float64Array, 5, 3, c, 5) || __notnull();
622
627
  try {
623
- exports.matrix_gemm(alpha, a, m, k, b, n, beta, c);
628
+ __writeBack(exports.matrix_gemm(alpha, a, m, k, b, n, beta, c));
624
629
  } finally {
625
630
  __release(a);
626
631
  __release(b);
@@ -630,9 +635,9 @@ async function instantiate(module, imports = {}) {
630
635
  // src/ops/matrix/matrix_gemv(f64, ~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array, f64, ~lib/typedarray/Float64Array) => void
631
636
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
632
637
  x = __retain(__lowerTypedArray(Float64Array, 5, 3, x) || __notnull());
633
- y = __lowerTypedArray(Float64Array, 5, 3, y) || __notnull();
638
+ y = __lowerTypedArray(Float64Array, 5, 3, y, 5) || __notnull();
634
639
  try {
635
- exports.matrix_gemv(alpha, a, m, n, x, beta, y);
640
+ __writeBack(exports.matrix_gemv(alpha, a, m, n, x, beta, y));
636
641
  } finally {
637
642
  __release(a);
638
643
  __release(x);
@@ -640,15 +645,15 @@ async function instantiate(module, imports = {}) {
640
645
  },
641
646
  fft(data, n, inverse) {
642
647
  // src/ops/fft/fft(~lib/typedarray/Float64Array, i32, i32) => void
643
- data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
644
- exports.fft(data, n, inverse);
648
+ data = __lowerTypedArray(Float64Array, 5, 3, data, 5) || __notnull();
649
+ __writeBack(exports.fft(data, n, inverse));
645
650
  },
646
651
  rfft(data, n, result) {
647
652
  // src/ops/fft/rfft(~lib/typedarray/Float64Array, i32, ~lib/typedarray/Float64Array) => void
648
653
  data = __retain(__lowerTypedArray(Float64Array, 5, 3, data) || __notnull());
649
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
654
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
650
655
  try {
651
- exports.rfft(data, n, result);
656
+ __writeBack(exports.rfft(data, n, result));
652
657
  } finally {
653
658
  __release(data);
654
659
  }
@@ -656,9 +661,9 @@ async function instantiate(module, imports = {}) {
656
661
  powerSpectrum(data, n, result) {
657
662
  // src/ops/fft/powerSpectrum(~lib/typedarray/Float64Array, i32, ~lib/typedarray/Float64Array) => void
658
663
  data = __retain(__lowerTypedArray(Float64Array, 5, 3, data) || __notnull());
659
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
664
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
660
665
  try {
661
- exports.powerSpectrum(data, n, result);
666
+ __writeBack(exports.powerSpectrum(data, n, result));
662
667
  } finally {
663
668
  __release(data);
664
669
  }
@@ -666,11 +671,11 @@ async function instantiate(module, imports = {}) {
666
671
  matrix_lu_decompose(a, n, l_out, u_out, perm_out) {
667
672
  // src/algebra/decomposition/matrix_lu_decompose(~lib/typedarray/Float64Array, i32, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Int32Array) => i32
668
673
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
669
- l_out = __retain(__lowerTypedArray(Float64Array, 5, 3, l_out) || __notnull());
670
- u_out = __retain(__lowerTypedArray(Float64Array, 5, 3, u_out) || __notnull());
671
- perm_out = __lowerTypedArray(Int32Array, 6, 2, perm_out) || __notnull();
674
+ l_out = __retain(__lowerTypedArray(Float64Array, 5, 3, l_out, 5) || __notnull());
675
+ u_out = __retain(__lowerTypedArray(Float64Array, 5, 3, u_out, 1) || __notnull());
676
+ perm_out = __lowerTypedArray(Int32Array, 6, 2, perm_out, 1) || __notnull();
672
677
  try {
673
- return exports.matrix_lu_decompose(a, n, l_out, u_out, perm_out);
678
+ return __writeBack(exports.matrix_lu_decompose(a, n, l_out, u_out, perm_out));
674
679
  } finally {
675
680
  __release(a);
676
681
  __release(l_out);
@@ -680,11 +685,11 @@ async function instantiate(module, imports = {}) {
680
685
  matrix_qr_decompose(a, m, n, q_out, r_out, v_work) {
681
686
  // src/algebra/decomposition/matrix_qr_decompose(~lib/typedarray/Float64Array, i32, i32, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array | null) => i32
682
687
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
683
- q_out = __retain(__lowerTypedArray(Float64Array, 5, 3, q_out) || __notnull());
684
- r_out = __retain(__lowerTypedArray(Float64Array, 5, 3, r_out) || __notnull());
685
- v_work = __lowerTypedArray(Float64Array, 5, 3, v_work);
688
+ q_out = __retain(__lowerTypedArray(Float64Array, 5, 3, q_out, 5) || __notnull());
689
+ r_out = __retain(__lowerTypedArray(Float64Array, 5, 3, r_out, 1) || __notnull());
690
+ v_work = __lowerTypedArray(Float64Array, 5, 3, v_work, 1);
686
691
  try {
687
- return exports.matrix_qr_decompose(a, m, n, q_out, r_out, v_work);
692
+ return __writeBack(exports.matrix_qr_decompose(a, m, n, q_out, r_out, v_work));
688
693
  } finally {
689
694
  __release(a);
690
695
  __release(q_out);
@@ -694,9 +699,9 @@ async function instantiate(module, imports = {}) {
694
699
  matrix_cholesky(a, n, l_out) {
695
700
  // src/algebra/decomposition/matrix_cholesky(~lib/typedarray/Float64Array, i32, ~lib/typedarray/Float64Array) => i32
696
701
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
697
- l_out = __lowerTypedArray(Float64Array, 5, 3, l_out) || __notnull();
702
+ l_out = __lowerTypedArray(Float64Array, 5, 3, l_out, 5) || __notnull();
698
703
  try {
699
- return exports.matrix_cholesky(a, n, l_out);
704
+ return __writeBack(exports.matrix_cholesky(a, n, l_out));
700
705
  } finally {
701
706
  __release(a);
702
707
  }
@@ -704,10 +709,10 @@ async function instantiate(module, imports = {}) {
704
709
  matrix_inverse(a, n, result, work) {
705
710
  // src/algebra/decomposition/matrix_inverse(~lib/typedarray/Float64Array, i32, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => i32
706
711
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
707
- result = __retain(__lowerTypedArray(Float64Array, 5, 3, result) || __notnull());
708
- work = __lowerTypedArray(Float64Array, 5, 3, work) || __notnull();
712
+ result = __retain(__lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull());
713
+ work = __lowerTypedArray(Float64Array, 5, 3, work, 1) || __notnull();
709
714
  try {
710
- return exports.matrix_inverse(a, n, result, work);
715
+ return __writeBack(exports.matrix_inverse(a, n, result, work));
711
716
  } finally {
712
717
  __release(a);
713
718
  __release(result);
@@ -716,9 +721,9 @@ async function instantiate(module, imports = {}) {
716
721
  matrix_determinant(a, n, work) {
717
722
  // src/algebra/decomposition/matrix_determinant(~lib/typedarray/Float64Array, i32, ~lib/typedarray/Float64Array) => f64
718
723
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
719
- work = __lowerTypedArray(Float64Array, 5, 3, work) || __notnull();
724
+ work = __lowerTypedArray(Float64Array, 5, 3, work, 5) || __notnull();
720
725
  try {
721
- return exports.matrix_determinant(a, n, work);
726
+ return __writeBack(exports.matrix_determinant(a, n, work));
722
727
  } finally {
723
728
  __release(a);
724
729
  }
@@ -826,8 +831,8 @@ async function instantiate(module, imports = {}) {
826
831
  },
827
832
  apply_window_f64(samples, windowType) {
828
833
  // src/signal/apply_window_f64(~lib/typedarray/Float64Array, i32) => i32
829
- samples = __lowerTypedArray(Float64Array, 5, 3, samples) || __notnull();
830
- return exports.apply_window_f64(samples, windowType);
834
+ samples = __lowerTypedArray(Float64Array, 5, 3, samples, 5) || __notnull();
835
+ return __writeBack(exports.apply_window_f64(samples, windowType));
831
836
  },
832
837
  welch_psd_f64(samples, frameLength, overlap, windowType) {
833
838
  // src/signal/welch_psd_f64(~lib/typedarray/Float64Array, i32, i32, i32) => ~lib/typedarray/Float64Array
@@ -1217,9 +1222,9 @@ async function instantiate(module, imports = {}) {
1217
1222
  // src/ops/bitwise/bitAnd_i32_array(~lib/typedarray/Int32Array, ~lib/typedarray/Int32Array, ~lib/typedarray/Int32Array) => void
1218
1223
  a = __retain(__lowerTypedArray(Int32Array, 6, 2, a) || __notnull());
1219
1224
  b = __retain(__lowerTypedArray(Int32Array, 6, 2, b) || __notnull());
1220
- result = __lowerTypedArray(Int32Array, 6, 2, result) || __notnull();
1225
+ result = __lowerTypedArray(Int32Array, 6, 2, result, 5) || __notnull();
1221
1226
  try {
1222
- exports.bitAnd_i32_array(a, b, result);
1227
+ __writeBack(exports.bitAnd_i32_array(a, b, result));
1223
1228
  } finally {
1224
1229
  __release(a);
1225
1230
  __release(b);
@@ -1229,9 +1234,9 @@ async function instantiate(module, imports = {}) {
1229
1234
  // src/ops/bitwise/bitOr_i32_array(~lib/typedarray/Int32Array, ~lib/typedarray/Int32Array, ~lib/typedarray/Int32Array) => void
1230
1235
  a = __retain(__lowerTypedArray(Int32Array, 6, 2, a) || __notnull());
1231
1236
  b = __retain(__lowerTypedArray(Int32Array, 6, 2, b) || __notnull());
1232
- result = __lowerTypedArray(Int32Array, 6, 2, result) || __notnull();
1237
+ result = __lowerTypedArray(Int32Array, 6, 2, result, 5) || __notnull();
1233
1238
  try {
1234
- exports.bitOr_i32_array(a, b, result);
1239
+ __writeBack(exports.bitOr_i32_array(a, b, result));
1235
1240
  } finally {
1236
1241
  __release(a);
1237
1242
  __release(b);
@@ -1241,9 +1246,9 @@ async function instantiate(module, imports = {}) {
1241
1246
  // src/ops/bitwise/bitXor_i32_array(~lib/typedarray/Int32Array, ~lib/typedarray/Int32Array, ~lib/typedarray/Int32Array) => void
1242
1247
  a = __retain(__lowerTypedArray(Int32Array, 6, 2, a) || __notnull());
1243
1248
  b = __retain(__lowerTypedArray(Int32Array, 6, 2, b) || __notnull());
1244
- result = __lowerTypedArray(Int32Array, 6, 2, result) || __notnull();
1249
+ result = __lowerTypedArray(Int32Array, 6, 2, result, 5) || __notnull();
1245
1250
  try {
1246
- exports.bitXor_i32_array(a, b, result);
1251
+ __writeBack(exports.bitXor_i32_array(a, b, result));
1247
1252
  } finally {
1248
1253
  __release(a);
1249
1254
  __release(b);
@@ -1252,9 +1257,9 @@ async function instantiate(module, imports = {}) {
1252
1257
  bitNot_i32_array(a, result) {
1253
1258
  // src/ops/bitwise/bitNot_i32_array(~lib/typedarray/Int32Array, ~lib/typedarray/Int32Array) => void
1254
1259
  a = __retain(__lowerTypedArray(Int32Array, 6, 2, a) || __notnull());
1255
- result = __lowerTypedArray(Int32Array, 6, 2, result) || __notnull();
1260
+ result = __lowerTypedArray(Int32Array, 6, 2, result, 5) || __notnull();
1256
1261
  try {
1257
- exports.bitNot_i32_array(a, result);
1262
+ __writeBack(exports.bitNot_i32_array(a, result));
1258
1263
  } finally {
1259
1264
  __release(a);
1260
1265
  }
@@ -1263,9 +1268,9 @@ async function instantiate(module, imports = {}) {
1263
1268
  // src/ops/bitwise/leftShift_i32_array(~lib/typedarray/Int32Array, ~lib/typedarray/Int32Array, ~lib/typedarray/Int32Array) => void
1264
1269
  a = __retain(__lowerTypedArray(Int32Array, 6, 2, a) || __notnull());
1265
1270
  b = __retain(__lowerTypedArray(Int32Array, 6, 2, b) || __notnull());
1266
- result = __lowerTypedArray(Int32Array, 6, 2, result) || __notnull();
1271
+ result = __lowerTypedArray(Int32Array, 6, 2, result, 5) || __notnull();
1267
1272
  try {
1268
- exports.leftShift_i32_array(a, b, result);
1273
+ __writeBack(exports.leftShift_i32_array(a, b, result));
1269
1274
  } finally {
1270
1275
  __release(a);
1271
1276
  __release(b);
@@ -1275,9 +1280,9 @@ async function instantiate(module, imports = {}) {
1275
1280
  // src/ops/bitwise/rightArithShift_i32_array(~lib/typedarray/Int32Array, ~lib/typedarray/Int32Array, ~lib/typedarray/Int32Array) => void
1276
1281
  a = __retain(__lowerTypedArray(Int32Array, 6, 2, a) || __notnull());
1277
1282
  b = __retain(__lowerTypedArray(Int32Array, 6, 2, b) || __notnull());
1278
- result = __lowerTypedArray(Int32Array, 6, 2, result) || __notnull();
1283
+ result = __lowerTypedArray(Int32Array, 6, 2, result, 5) || __notnull();
1279
1284
  try {
1280
- exports.rightArithShift_i32_array(a, b, result);
1285
+ __writeBack(exports.rightArithShift_i32_array(a, b, result));
1281
1286
  } finally {
1282
1287
  __release(a);
1283
1288
  __release(b);
@@ -1287,9 +1292,9 @@ async function instantiate(module, imports = {}) {
1287
1292
  // src/ops/bitwise/rightLogShift_i32_array(~lib/typedarray/Int32Array, ~lib/typedarray/Int32Array, ~lib/typedarray/Int32Array) => void
1288
1293
  a = __retain(__lowerTypedArray(Int32Array, 6, 2, a) || __notnull());
1289
1294
  b = __retain(__lowerTypedArray(Int32Array, 6, 2, b) || __notnull());
1290
- result = __lowerTypedArray(Int32Array, 6, 2, result) || __notnull();
1295
+ result = __lowerTypedArray(Int32Array, 6, 2, result, 5) || __notnull();
1291
1296
  try {
1292
- exports.rightLogShift_i32_array(a, b, result);
1297
+ __writeBack(exports.rightLogShift_i32_array(a, b, result));
1293
1298
  } finally {
1294
1299
  __release(a);
1295
1300
  __release(b);
@@ -1531,8 +1536,8 @@ async function instantiate(module, imports = {}) {
1531
1536
  },
1532
1537
  sort_f64(data) {
1533
1538
  // src/sort/sort_f64(~lib/typedarray/Float64Array) => ~lib/typedarray/Float64Array
1534
- data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
1535
- return __liftTypedArray(Float64Array, exports.sort_f64(data) >>> 0);
1539
+ data = __lowerTypedArray(Float64Array, 5, 3, data, 5) || __notnull();
1540
+ return __liftTypedArray(Float64Array, __writeBack(exports.sort_f64(data)) >>> 0);
1536
1541
  },
1537
1542
  argsort_f64(data) {
1538
1543
  // src/sort/argsort_f64(~lib/typedarray/Float64Array) => ~lib/typedarray/Int32Array
@@ -1563,18 +1568,18 @@ async function instantiate(module, imports = {}) {
1563
1568
  },
1564
1569
  complex_array_set(data, index, value) {
1565
1570
  // src/ops/complex-array/complex_array_set(~lib/typedarray/Float64Array, i32, src/types/complex/Complex) => void
1566
- data = __retain(__lowerTypedArray(Float64Array, 5, 3, data) || __notnull());
1571
+ data = __retain(__lowerTypedArray(Float64Array, 5, 3, data, 5) || __notnull());
1567
1572
  value = __lowerInternref(value) || __notnull();
1568
1573
  try {
1569
- exports.complex_array_set(data, index, value);
1574
+ __writeBack(exports.complex_array_set(data, index, value));
1570
1575
  } finally {
1571
1576
  __release(data);
1572
1577
  }
1573
1578
  },
1574
1579
  complex_array_set_parts(data, index, re, im) {
1575
1580
  // src/ops/complex-array/complex_array_set_parts(~lib/typedarray/Float64Array, i32, f64, f64) => void
1576
- data = __lowerTypedArray(Float64Array, 5, 3, data) || __notnull();
1577
- exports.complex_array_set_parts(data, index, re, im);
1581
+ data = __lowerTypedArray(Float64Array, 5, 3, data, 5) || __notnull();
1582
+ __writeBack(exports.complex_array_set_parts(data, index, re, im));
1578
1583
  },
1579
1584
  complex_array_get_re(data, index) {
1580
1585
  // src/ops/complex-array/complex_array_get_re(~lib/typedarray/Float64Array, i32) => f64
@@ -1595,9 +1600,9 @@ async function instantiate(module, imports = {}) {
1595
1600
  // src/ops/complex-array/complex_array_add(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1596
1601
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1597
1602
  b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
1598
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1603
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1599
1604
  try {
1600
- exports.complex_array_add(a, b, result);
1605
+ __writeBack(exports.complex_array_add(a, b, result));
1601
1606
  } finally {
1602
1607
  __release(a);
1603
1608
  __release(b);
@@ -1607,9 +1612,9 @@ async function instantiate(module, imports = {}) {
1607
1612
  // src/ops/complex-array/complex_array_sub(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1608
1613
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1609
1614
  b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
1610
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1615
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1611
1616
  try {
1612
- exports.complex_array_sub(a, b, result);
1617
+ __writeBack(exports.complex_array_sub(a, b, result));
1613
1618
  } finally {
1614
1619
  __release(a);
1615
1620
  __release(b);
@@ -1619,9 +1624,9 @@ async function instantiate(module, imports = {}) {
1619
1624
  // src/ops/complex-array/complex_array_mul(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1620
1625
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1621
1626
  b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
1622
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1627
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1623
1628
  try {
1624
- exports.complex_array_mul(a, b, result);
1629
+ __writeBack(exports.complex_array_mul(a, b, result));
1625
1630
  } finally {
1626
1631
  __release(a);
1627
1632
  __release(b);
@@ -1631,9 +1636,9 @@ async function instantiate(module, imports = {}) {
1631
1636
  // src/ops/complex-array/complex_array_div(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1632
1637
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1633
1638
  b = __retain(__lowerTypedArray(Float64Array, 5, 3, b) || __notnull());
1634
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1639
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1635
1640
  try {
1636
- exports.complex_array_div(a, b, result);
1641
+ __writeBack(exports.complex_array_div(a, b, result));
1637
1642
  } finally {
1638
1643
  __release(a);
1639
1644
  __release(b);
@@ -1642,9 +1647,9 @@ async function instantiate(module, imports = {}) {
1642
1647
  complex_array_scale_real(a, scalar, result) {
1643
1648
  // src/ops/complex-array/complex_array_scale_real(~lib/typedarray/Float64Array, f64, ~lib/typedarray/Float64Array) => void
1644
1649
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1645
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1650
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1646
1651
  try {
1647
- exports.complex_array_scale_real(a, scalar, result);
1652
+ __writeBack(exports.complex_array_scale_real(a, scalar, result));
1648
1653
  } finally {
1649
1654
  __release(a);
1650
1655
  }
@@ -1652,9 +1657,9 @@ async function instantiate(module, imports = {}) {
1652
1657
  complex_array_scale_complex(a, re, im, result) {
1653
1658
  // src/ops/complex-array/complex_array_scale_complex(~lib/typedarray/Float64Array, f64, f64, ~lib/typedarray/Float64Array) => void
1654
1659
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1655
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1660
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1656
1661
  try {
1657
- exports.complex_array_scale_complex(a, re, im, result);
1662
+ __writeBack(exports.complex_array_scale_complex(a, re, im, result));
1658
1663
  } finally {
1659
1664
  __release(a);
1660
1665
  }
@@ -1662,9 +1667,9 @@ async function instantiate(module, imports = {}) {
1662
1667
  complex_array_neg(a, result) {
1663
1668
  // src/ops/complex-array/complex_array_neg(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1664
1669
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1665
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1670
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1666
1671
  try {
1667
- exports.complex_array_neg(a, result);
1672
+ __writeBack(exports.complex_array_neg(a, result));
1668
1673
  } finally {
1669
1674
  __release(a);
1670
1675
  }
@@ -1672,9 +1677,9 @@ async function instantiate(module, imports = {}) {
1672
1677
  complex_array_conj(a, result) {
1673
1678
  // src/ops/complex-array/complex_array_conj(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1674
1679
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1675
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1680
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1676
1681
  try {
1677
- exports.complex_array_conj(a, result);
1682
+ __writeBack(exports.complex_array_conj(a, result));
1678
1683
  } finally {
1679
1684
  __release(a);
1680
1685
  }
@@ -1682,9 +1687,9 @@ async function instantiate(module, imports = {}) {
1682
1687
  complex_array_abs(a, result) {
1683
1688
  // src/ops/complex-array/complex_array_abs(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1684
1689
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1685
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1690
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1686
1691
  try {
1687
- exports.complex_array_abs(a, result);
1692
+ __writeBack(exports.complex_array_abs(a, result));
1688
1693
  } finally {
1689
1694
  __release(a);
1690
1695
  }
@@ -1692,9 +1697,9 @@ async function instantiate(module, imports = {}) {
1692
1697
  complex_array_arg(a, result) {
1693
1698
  // src/ops/complex-array/complex_array_arg(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1694
1699
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1695
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1700
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1696
1701
  try {
1697
- exports.complex_array_arg(a, result);
1702
+ __writeBack(exports.complex_array_arg(a, result));
1698
1703
  } finally {
1699
1704
  __release(a);
1700
1705
  }
@@ -1702,9 +1707,9 @@ async function instantiate(module, imports = {}) {
1702
1707
  complex_array_abs_squared(a, result) {
1703
1708
  // src/ops/complex-array/complex_array_abs_squared(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1704
1709
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1705
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1710
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1706
1711
  try {
1707
- exports.complex_array_abs_squared(a, result);
1712
+ __writeBack(exports.complex_array_abs_squared(a, result));
1708
1713
  } finally {
1709
1714
  __release(a);
1710
1715
  }
@@ -1712,9 +1717,9 @@ async function instantiate(module, imports = {}) {
1712
1717
  complex_array_real(a, result) {
1713
1718
  // src/ops/complex-array/complex_array_real(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1714
1719
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1715
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1720
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1716
1721
  try {
1717
- exports.complex_array_real(a, result);
1722
+ __writeBack(exports.complex_array_real(a, result));
1718
1723
  } finally {
1719
1724
  __release(a);
1720
1725
  }
@@ -1722,9 +1727,9 @@ async function instantiate(module, imports = {}) {
1722
1727
  complex_array_imag(a, result) {
1723
1728
  // src/ops/complex-array/complex_array_imag(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1724
1729
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1725
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1730
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1726
1731
  try {
1727
- exports.complex_array_imag(a, result);
1732
+ __writeBack(exports.complex_array_imag(a, result));
1728
1733
  } finally {
1729
1734
  __release(a);
1730
1735
  }
@@ -1732,9 +1737,9 @@ async function instantiate(module, imports = {}) {
1732
1737
  complex_array_exp(a, result) {
1733
1738
  // src/ops/complex-array/complex_array_exp(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1734
1739
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1735
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1740
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1736
1741
  try {
1737
- exports.complex_array_exp(a, result);
1742
+ __writeBack(exports.complex_array_exp(a, result));
1738
1743
  } finally {
1739
1744
  __release(a);
1740
1745
  }
@@ -1742,9 +1747,9 @@ async function instantiate(module, imports = {}) {
1742
1747
  complex_array_log(a, result) {
1743
1748
  // src/ops/complex-array/complex_array_log(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1744
1749
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1745
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1750
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1746
1751
  try {
1747
- exports.complex_array_log(a, result);
1752
+ __writeBack(exports.complex_array_log(a, result));
1748
1753
  } finally {
1749
1754
  __release(a);
1750
1755
  }
@@ -1752,9 +1757,9 @@ async function instantiate(module, imports = {}) {
1752
1757
  complex_array_sqrt(a, result) {
1753
1758
  // src/ops/complex-array/complex_array_sqrt(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1754
1759
  a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1755
- result = __lowerTypedArray(Float64Array, 5, 3, result) || __notnull();
1760
+ result = __lowerTypedArray(Float64Array, 5, 3, result, 5) || __notnull();
1756
1761
  try {
1757
- exports.complex_array_sqrt(a, result);
1762
+ __writeBack(exports.complex_array_sqrt(a, result));
1758
1763
  } finally {
1759
1764
  __release(a);
1760
1765
  }
@@ -1786,20 +1791,20 @@ async function instantiate(module, imports = {}) {
1786
1791
  },
1787
1792
  complex_array_scale_inplace(a, scalar) {
1788
1793
  // src/ops/complex-array/complex_array_scale_inplace(~lib/typedarray/Float64Array, f64) => void
1789
- a = __lowerTypedArray(Float64Array, 5, 3, a) || __notnull();
1790
- exports.complex_array_scale_inplace(a, scalar);
1794
+ a = __lowerTypedArray(Float64Array, 5, 3, a, 5) || __notnull();
1795
+ __writeBack(exports.complex_array_scale_inplace(a, scalar));
1791
1796
  },
1792
1797
  complex_array_conj_inplace(a) {
1793
1798
  // src/ops/complex-array/complex_array_conj_inplace(~lib/typedarray/Float64Array) => void
1794
- a = __lowerTypedArray(Float64Array, 5, 3, a) || __notnull();
1795
- exports.complex_array_conj_inplace(a);
1799
+ a = __lowerTypedArray(Float64Array, 5, 3, a, 5) || __notnull();
1800
+ __writeBack(exports.complex_array_conj_inplace(a));
1796
1801
  },
1797
1802
  complex_array_add_inplace(a, b) {
1798
1803
  // src/ops/complex-array/complex_array_add_inplace(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1799
- a = __retain(__lowerTypedArray(Float64Array, 5, 3, a) || __notnull());
1804
+ a = __retain(__lowerTypedArray(Float64Array, 5, 3, a, 5) || __notnull());
1800
1805
  b = __lowerTypedArray(Float64Array, 5, 3, b) || __notnull();
1801
1806
  try {
1802
- exports.complex_array_add_inplace(a, b);
1807
+ __writeBack(exports.complex_array_add_inplace(a, b));
1803
1808
  } finally {
1804
1809
  __release(a);
1805
1810
  }
@@ -1807,25 +1812,14 @@ async function instantiate(module, imports = {}) {
1807
1812
  complex_array_copy(src, dst) {
1808
1813
  // src/ops/complex-array/complex_array_copy(~lib/typedarray/Float64Array, ~lib/typedarray/Float64Array) => void
1809
1814
  src = __retain(__lowerTypedArray(Float64Array, 5, 3, src) || __notnull());
1810
- dst = __lowerTypedArray(Float64Array, 5, 3, dst) || __notnull();
1815
+ dst = __lowerTypedArray(Float64Array, 5, 3, dst, 5) || __notnull();
1811
1816
  try {
1812
- exports.complex_array_copy(src, dst);
1817
+ __writeBack(exports.complex_array_copy(src, dst));
1813
1818
  } finally {
1814
1819
  __release(src);
1815
1820
  }
1816
1821
  },
1817
1822
  }, exports);
1818
- function __liftString(pointer) {
1819
- if (!pointer) return null;
1820
- const
1821
- end = pointer + new Uint32Array(memory.buffer)[pointer - 4 >>> 2] >>> 1,
1822
- memoryU16 = new Uint16Array(memory.buffer);
1823
- let
1824
- start = pointer >>> 1,
1825
- string = "";
1826
- while (end - start > 1024) string += String.fromCharCode(...memoryU16.subarray(start, start += 1024));
1827
- return string + String.fromCharCode(...memoryU16.subarray(start, end));
1828
- }
1829
1823
  function __liftTypedArray(constructor, pointer) {
1830
1824
  if (!pointer) return null;
1831
1825
  return new constructor(
@@ -1834,7 +1828,10 @@ async function instantiate(module, imports = {}) {
1834
1828
  __dataview.getUint32(pointer + 8, true) / constructor.BYTES_PER_ELEMENT
1835
1829
  ).slice();
1836
1830
  }
1837
- function __lowerTypedArray(constructor, id, align, values) {
1831
+ /* mathts: typed-array write-back */
1832
+ const __out = [];
1833
+ function __lowerTypedArray(constructor, id, align, values, track, name) {
1834
+ if (track & 4) __out.length = 0;
1838
1835
  if (values == null) return 0;
1839
1836
  const
1840
1837
  length = values.length,
@@ -1845,8 +1842,21 @@ async function instantiate(module, imports = {}) {
1845
1842
  __dataview.setUint32(header + 8, length << align, true);
1846
1843
  new constructor(memory.buffer, buffer, length).set(values);
1847
1844
  exports.__unpin(buffer);
1845
+ if (track) __out.push({ values, header, constructor });
1848
1846
  return header;
1849
1847
  }
1848
+ function __writeBack(result) {
1849
+ for (const { values, header, constructor } of __out.splice(0)) {
1850
+ const view = new constructor(
1851
+ memory.buffer,
1852
+ __getU32(header + 4),
1853
+ __dataview.getUint32(header + 8, true) / constructor.BYTES_PER_ELEMENT
1854
+ );
1855
+ if (ArrayBuffer.isView(values)) values.set(view);
1856
+ else for (let i = 0; i < view.length; i++) values[i] = view[i];
1857
+ }
1858
+ return result;
1859
+ }
1850
1860
  class Internref extends Number {}
1851
1861
  const registry = new FinalizationRegistry(__release);
1852
1862
  function __liftInternref(pointer) {
@@ -1897,7 +1907,38 @@ async function instantiate(module, imports = {}) {
1897
1907
  return __dataview.getUint32(pointer, true);
1898
1908
  }
1899
1909
  }
1900
- return adaptedExports;
1910
+ function __liftString(pointer) {
1911
+ if (!pointer) return null;
1912
+ const end = pointer + new Uint32Array(memory.buffer)[pointer - 4 >>> 2] >>> 1,
1913
+ memoryU16 = new Uint16Array(memory.buffer);
1914
+ let start = pointer >>> 1, string = "";
1915
+ while (end - start > 1024) string += String.fromCharCode(...memoryU16.subarray(start, start += 1024));
1916
+ return string + String.fromCharCode(...memoryU16.subarray(start, end));
1917
+ }
1918
+ function __abortError(error) {
1919
+ if (!(error instanceof WebAssembly.RuntimeError) || !exports.abort_take()) return error;
1920
+ const message = __liftString(exports.abort_message() >>> 0);
1921
+ const fileName = __liftString(exports.abort_file() >>> 0);
1922
+ return Error(`${message} in ${fileName}:${exports.abort_line() >>> 0}:${exports.abort_column() >>> 0}`, { cause: error });
1923
+ }
1924
+ function __abortAware(adapted) {
1925
+ const guarded = {};
1926
+ for (const key of new Set([...Object.keys(exports), ...Object.keys(adapted)])) {
1927
+ const value = adapted[key];
1928
+ guarded[key] =
1929
+ typeof value === "function" && !key.startsWith("abort_")
1930
+ ? (...args) => {
1931
+ try {
1932
+ return value(...args);
1933
+ } catch (error) {
1934
+ throw __abortError(error);
1935
+ }
1936
+ }
1937
+ : value;
1938
+ }
1939
+ return guarded;
1940
+ }
1941
+ return __abortAware(adaptedExports);
1901
1942
  }
1902
1943
  export const {
1903
1944
  memory,
@@ -1907,6 +1948,11 @@ export const {
1907
1948
  __collect,
1908
1949
  __rtti_base,
1909
1950
  heap_reset,
1951
+ abort_take,
1952
+ abort_message,
1953
+ abort_file,
1954
+ abort_line,
1955
+ abort_column,
1910
1956
  complex,
1911
1957
  complexFromPolar,
1912
1958
  add_f64,