@justinelliottcobb/amari-wasm 0.11.0 → 0.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -10
- package/amari_wasm.d.ts +197 -113
- package/amari_wasm.js +605 -387
- package/amari_wasm_bg.wasm +0 -0
- package/package.json +2 -2
package/amari_wasm.js
CHANGED
|
@@ -1,71 +1,19 @@
|
|
|
1
1
|
let wasm;
|
|
2
2
|
|
|
3
|
-
function
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return `${val}`;
|
|
8
|
-
}
|
|
9
|
-
if (type == 'string') {
|
|
10
|
-
return `"${val}"`;
|
|
11
|
-
}
|
|
12
|
-
if (type == 'symbol') {
|
|
13
|
-
const description = val.description;
|
|
14
|
-
if (description == null) {
|
|
15
|
-
return 'Symbol';
|
|
16
|
-
} else {
|
|
17
|
-
return `Symbol(${description})`;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
if (type == 'function') {
|
|
21
|
-
const name = val.name;
|
|
22
|
-
if (typeof name == 'string' && name.length > 0) {
|
|
23
|
-
return `Function(${name})`;
|
|
24
|
-
} else {
|
|
25
|
-
return 'Function';
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
// objects
|
|
29
|
-
if (Array.isArray(val)) {
|
|
30
|
-
const length = val.length;
|
|
31
|
-
let debug = '[';
|
|
32
|
-
if (length > 0) {
|
|
33
|
-
debug += debugString(val[0]);
|
|
34
|
-
}
|
|
35
|
-
for(let i = 1; i < length; i++) {
|
|
36
|
-
debug += ', ' + debugString(val[i]);
|
|
37
|
-
}
|
|
38
|
-
debug += ']';
|
|
39
|
-
return debug;
|
|
40
|
-
}
|
|
41
|
-
// Test for built-in
|
|
42
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
43
|
-
let className;
|
|
44
|
-
if (builtInMatches && builtInMatches.length > 1) {
|
|
45
|
-
className = builtInMatches[1];
|
|
46
|
-
} else {
|
|
47
|
-
// Failed to match the standard '[object ClassName]'
|
|
48
|
-
return toString.call(val);
|
|
49
|
-
}
|
|
50
|
-
if (className == 'Object') {
|
|
51
|
-
// we're a user defined class or Object
|
|
52
|
-
// JSON.stringify avoids problems with cycles, and is generally much
|
|
53
|
-
// easier than looping through ownProperties of `val`.
|
|
54
|
-
try {
|
|
55
|
-
return 'Object(' + JSON.stringify(val) + ')';
|
|
56
|
-
} catch (_) {
|
|
57
|
-
return 'Object';
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
// errors
|
|
61
|
-
if (val instanceof Error) {
|
|
62
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
63
|
-
}
|
|
64
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
65
|
-
return className;
|
|
3
|
+
function addToExternrefTable0(obj) {
|
|
4
|
+
const idx = wasm.__externref_table_alloc();
|
|
5
|
+
wasm.__wbindgen_export_2.set(idx, obj);
|
|
6
|
+
return idx;
|
|
66
7
|
}
|
|
67
8
|
|
|
68
|
-
|
|
9
|
+
function handleError(f, args) {
|
|
10
|
+
try {
|
|
11
|
+
return f.apply(this, args);
|
|
12
|
+
} catch (e) {
|
|
13
|
+
const idx = addToExternrefTable0(e);
|
|
14
|
+
wasm.__wbindgen_exn_store(idx);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
69
17
|
|
|
70
18
|
let cachedUint8ArrayMemory0 = null;
|
|
71
19
|
|
|
@@ -76,19 +24,58 @@ function getUint8ArrayMemory0() {
|
|
|
76
24
|
return cachedUint8ArrayMemory0;
|
|
77
25
|
}
|
|
78
26
|
|
|
79
|
-
|
|
27
|
+
let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
80
28
|
|
|
81
|
-
if (
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
};
|
|
29
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
30
|
+
|
|
31
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
32
|
+
let numBytesDecoded = 0;
|
|
33
|
+
function decodeText(ptr, len) {
|
|
34
|
+
numBytesDecoded += len;
|
|
35
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
36
|
+
cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
37
|
+
cachedTextDecoder.decode();
|
|
38
|
+
numBytesDecoded = len;
|
|
39
|
+
}
|
|
40
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function getStringFromWasm0(ptr, len) {
|
|
44
|
+
ptr = ptr >>> 0;
|
|
45
|
+
return decodeText(ptr, len);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let cachedFloat64ArrayMemory0 = null;
|
|
49
|
+
|
|
50
|
+
function getFloat64ArrayMemory0() {
|
|
51
|
+
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
|
|
52
|
+
cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
|
|
89
53
|
}
|
|
54
|
+
return cachedFloat64ArrayMemory0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function getArrayF64FromWasm0(ptr, len) {
|
|
58
|
+
ptr = ptr >>> 0;
|
|
59
|
+
return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
90
60
|
}
|
|
91
61
|
|
|
62
|
+
let WASM_VECTOR_LEN = 0;
|
|
63
|
+
|
|
64
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
65
|
+
|
|
66
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
67
|
+
? function (arg, view) {
|
|
68
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
69
|
+
}
|
|
70
|
+
: function (arg, view) {
|
|
71
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
72
|
+
view.set(buf);
|
|
73
|
+
return {
|
|
74
|
+
read: arg.length,
|
|
75
|
+
written: buf.length
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
|
|
92
79
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
93
80
|
|
|
94
81
|
if (realloc === undefined) {
|
|
@@ -118,7 +105,7 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
118
105
|
}
|
|
119
106
|
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
120
107
|
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
121
|
-
const ret =
|
|
108
|
+
const ret = encodeString(arg, view);
|
|
122
109
|
|
|
123
110
|
offset += ret.written;
|
|
124
111
|
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
@@ -141,64 +128,15 @@ function isLikeNone(x) {
|
|
|
141
128
|
return x === undefined || x === null;
|
|
142
129
|
}
|
|
143
130
|
|
|
144
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
145
|
-
|
|
146
|
-
cachedTextDecoder.decode();
|
|
147
|
-
|
|
148
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
149
|
-
let numBytesDecoded = 0;
|
|
150
|
-
function decodeText(ptr, len) {
|
|
151
|
-
numBytesDecoded += len;
|
|
152
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
153
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
154
|
-
cachedTextDecoder.decode();
|
|
155
|
-
numBytesDecoded = len;
|
|
156
|
-
}
|
|
157
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
function getStringFromWasm0(ptr, len) {
|
|
161
|
-
ptr = ptr >>> 0;
|
|
162
|
-
return decodeText(ptr, len);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function addToExternrefTable0(obj) {
|
|
166
|
-
const idx = wasm.__externref_table_alloc();
|
|
167
|
-
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
168
|
-
return idx;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
function handleError(f, args) {
|
|
172
|
-
try {
|
|
173
|
-
return f.apply(this, args);
|
|
174
|
-
} catch (e) {
|
|
175
|
-
const idx = addToExternrefTable0(e);
|
|
176
|
-
wasm.__wbindgen_exn_store(idx);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
let cachedFloat64ArrayMemory0 = null;
|
|
181
|
-
|
|
182
|
-
function getFloat64ArrayMemory0() {
|
|
183
|
-
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
|
|
184
|
-
cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
|
|
185
|
-
}
|
|
186
|
-
return cachedFloat64ArrayMemory0;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
function getArrayF64FromWasm0(ptr, len) {
|
|
190
|
-
ptr = ptr >>> 0;
|
|
191
|
-
return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
131
|
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
195
132
|
? { register: () => {}, unregister: () => {} }
|
|
196
|
-
: new FinalizationRegistry(state =>
|
|
133
|
+
: new FinalizationRegistry(state => {
|
|
134
|
+
wasm.__wbindgen_export_6.get(state.dtor)(state.a, state.b)
|
|
135
|
+
});
|
|
197
136
|
|
|
198
137
|
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
199
138
|
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
200
139
|
const real = (...args) => {
|
|
201
|
-
|
|
202
140
|
// First up with a closure we increment the internal reference
|
|
203
141
|
// count. This ensures that the Rust closure environment won't
|
|
204
142
|
// be deallocated while we're invoking it.
|
|
@@ -208,20 +146,83 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
208
146
|
try {
|
|
209
147
|
return f(a, state.b, ...args);
|
|
210
148
|
} finally {
|
|
211
|
-
state.
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
state.dtor(state.a, state.b);
|
|
218
|
-
state.a = 0;
|
|
219
|
-
CLOSURE_DTORS.unregister(state);
|
|
149
|
+
if (--state.cnt === 0) {
|
|
150
|
+
wasm.__wbindgen_export_6.get(state.dtor)(a, state.b);
|
|
151
|
+
CLOSURE_DTORS.unregister(state);
|
|
152
|
+
} else {
|
|
153
|
+
state.a = a;
|
|
154
|
+
}
|
|
220
155
|
}
|
|
221
156
|
};
|
|
157
|
+
real.original = state;
|
|
222
158
|
CLOSURE_DTORS.register(real, state, state);
|
|
223
159
|
return real;
|
|
224
160
|
}
|
|
161
|
+
|
|
162
|
+
function debugString(val) {
|
|
163
|
+
// primitive types
|
|
164
|
+
const type = typeof val;
|
|
165
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
166
|
+
return `${val}`;
|
|
167
|
+
}
|
|
168
|
+
if (type == 'string') {
|
|
169
|
+
return `"${val}"`;
|
|
170
|
+
}
|
|
171
|
+
if (type == 'symbol') {
|
|
172
|
+
const description = val.description;
|
|
173
|
+
if (description == null) {
|
|
174
|
+
return 'Symbol';
|
|
175
|
+
} else {
|
|
176
|
+
return `Symbol(${description})`;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (type == 'function') {
|
|
180
|
+
const name = val.name;
|
|
181
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
182
|
+
return `Function(${name})`;
|
|
183
|
+
} else {
|
|
184
|
+
return 'Function';
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
// objects
|
|
188
|
+
if (Array.isArray(val)) {
|
|
189
|
+
const length = val.length;
|
|
190
|
+
let debug = '[';
|
|
191
|
+
if (length > 0) {
|
|
192
|
+
debug += debugString(val[0]);
|
|
193
|
+
}
|
|
194
|
+
for(let i = 1; i < length; i++) {
|
|
195
|
+
debug += ', ' + debugString(val[i]);
|
|
196
|
+
}
|
|
197
|
+
debug += ']';
|
|
198
|
+
return debug;
|
|
199
|
+
}
|
|
200
|
+
// Test for built-in
|
|
201
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
202
|
+
let className;
|
|
203
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
204
|
+
className = builtInMatches[1];
|
|
205
|
+
} else {
|
|
206
|
+
// Failed to match the standard '[object ClassName]'
|
|
207
|
+
return toString.call(val);
|
|
208
|
+
}
|
|
209
|
+
if (className == 'Object') {
|
|
210
|
+
// we're a user defined class or Object
|
|
211
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
212
|
+
// easier than looping through ownProperties of `val`.
|
|
213
|
+
try {
|
|
214
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
215
|
+
} catch (_) {
|
|
216
|
+
return 'Object';
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
// errors
|
|
220
|
+
if (val instanceof Error) {
|
|
221
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
222
|
+
}
|
|
223
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
224
|
+
return className;
|
|
225
|
+
}
|
|
225
226
|
/**
|
|
226
227
|
* Initialize the WASM module
|
|
227
228
|
*/
|
|
@@ -254,7 +255,7 @@ export function light_deflection_angle(impact_parameter, mass) {
|
|
|
254
255
|
}
|
|
255
256
|
|
|
256
257
|
function takeFromExternrefTable0(idx) {
|
|
257
|
-
const value = wasm.
|
|
258
|
+
const value = wasm.__wbindgen_export_2.get(idx);
|
|
258
259
|
wasm.__externref_table_dealloc(idx);
|
|
259
260
|
return value;
|
|
260
261
|
}
|
|
@@ -300,6 +301,13 @@ export function initFusion() {
|
|
|
300
301
|
wasm.initFusion();
|
|
301
302
|
}
|
|
302
303
|
|
|
304
|
+
/**
|
|
305
|
+
* Initialize the holographic memory module
|
|
306
|
+
*/
|
|
307
|
+
export function initHolographic() {
|
|
308
|
+
wasm.initHolographic();
|
|
309
|
+
}
|
|
310
|
+
|
|
303
311
|
/**
|
|
304
312
|
* Integrate a JavaScript function over an interval
|
|
305
313
|
*
|
|
@@ -395,6 +403,11 @@ export function initAutomata() {
|
|
|
395
403
|
wasm.initAutomata();
|
|
396
404
|
}
|
|
397
405
|
|
|
406
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
407
|
+
ptr = ptr >>> 0;
|
|
408
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
409
|
+
}
|
|
410
|
+
|
|
398
411
|
let cachedUint32ArrayMemory0 = null;
|
|
399
412
|
|
|
400
413
|
function getUint32ArrayMemory0() {
|
|
@@ -409,23 +422,18 @@ function getArrayU32FromWasm0(ptr, len) {
|
|
|
409
422
|
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
410
423
|
}
|
|
411
424
|
|
|
412
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
413
|
-
ptr = ptr >>> 0;
|
|
414
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
415
|
-
}
|
|
416
|
-
|
|
417
425
|
function passArray32ToWasm0(arg, malloc) {
|
|
418
426
|
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
419
427
|
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
420
428
|
WASM_VECTOR_LEN = arg.length;
|
|
421
429
|
return ptr;
|
|
422
430
|
}
|
|
423
|
-
function
|
|
424
|
-
wasm.
|
|
431
|
+
function __wbg_adapter_28(arg0, arg1, arg2) {
|
|
432
|
+
wasm.closure40_externref_shim(arg0, arg1, arg2);
|
|
425
433
|
}
|
|
426
434
|
|
|
427
|
-
function
|
|
428
|
-
wasm.
|
|
435
|
+
function __wbg_adapter_486(arg0, arg1, arg2, arg3) {
|
|
436
|
+
wasm.closure33_externref_shim(arg0, arg1, arg2, arg3);
|
|
429
437
|
}
|
|
430
438
|
|
|
431
439
|
/**
|
|
@@ -542,7 +550,6 @@ export class AutoDiff {
|
|
|
542
550
|
return ret[0];
|
|
543
551
|
}
|
|
544
552
|
}
|
|
545
|
-
if (Symbol.dispose) AutoDiff.prototype[Symbol.dispose] = AutoDiff.prototype.free;
|
|
546
553
|
|
|
547
554
|
const AutomataBatchOperationsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
548
555
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -624,7 +631,6 @@ export class AutomataBatchOperations {
|
|
|
624
631
|
return v2;
|
|
625
632
|
}
|
|
626
633
|
}
|
|
627
|
-
if (Symbol.dispose) AutomataBatchOperations.prototype[Symbol.dispose] = AutomataBatchOperations.prototype.free;
|
|
628
634
|
|
|
629
635
|
const AutomataUtilsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
630
636
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -704,7 +710,6 @@ export class AutomataUtils {
|
|
|
704
710
|
return v1;
|
|
705
711
|
}
|
|
706
712
|
}
|
|
707
|
-
if (Symbol.dispose) AutomataUtils.prototype[Symbol.dispose] = AutomataUtils.prototype.free;
|
|
708
713
|
|
|
709
714
|
const BatchOperationsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
710
715
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -765,7 +770,6 @@ export class BatchOperations {
|
|
|
765
770
|
return v3;
|
|
766
771
|
}
|
|
767
772
|
}
|
|
768
|
-
if (Symbol.dispose) BatchOperations.prototype[Symbol.dispose] = BatchOperations.prototype.free;
|
|
769
773
|
|
|
770
774
|
const BatchOpsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
771
775
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -848,7 +852,6 @@ export class BatchOps {
|
|
|
848
852
|
return v3;
|
|
849
853
|
}
|
|
850
854
|
}
|
|
851
|
-
if (Symbol.dispose) BatchOps.prototype[Symbol.dispose] = BatchOps.prototype.free;
|
|
852
855
|
|
|
853
856
|
const EnumerativeBatchFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
854
857
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -918,7 +921,6 @@ export class EnumerativeBatch {
|
|
|
918
921
|
return ret >>> 0;
|
|
919
922
|
}
|
|
920
923
|
}
|
|
921
|
-
if (Symbol.dispose) EnumerativeBatch.prototype[Symbol.dispose] = EnumerativeBatch.prototype.free;
|
|
922
924
|
|
|
923
925
|
const EnumerativeUtilsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
924
926
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -1010,7 +1012,6 @@ export class EnumerativeUtils {
|
|
|
1010
1012
|
return ret[0];
|
|
1011
1013
|
}
|
|
1012
1014
|
}
|
|
1013
|
-
if (Symbol.dispose) EnumerativeUtils.prototype[Symbol.dispose] = EnumerativeUtils.prototype.free;
|
|
1014
1015
|
|
|
1015
1016
|
const FusionBatchOperationsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1016
1017
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -1084,6 +1085,8 @@ export class FusionBatchOperations {
|
|
|
1084
1085
|
}
|
|
1085
1086
|
/**
|
|
1086
1087
|
* Batch sensitivity analysis for gradient-based optimization
|
|
1088
|
+
*
|
|
1089
|
+
* Note: Using simplified implementation based on gradient norms
|
|
1087
1090
|
* @param {Float64Array} tdc_batch
|
|
1088
1091
|
* @param {number} batch_size
|
|
1089
1092
|
* @returns {Float64Array}
|
|
@@ -1135,7 +1138,6 @@ export class FusionBatchOperations {
|
|
|
1135
1138
|
return v4;
|
|
1136
1139
|
}
|
|
1137
1140
|
}
|
|
1138
|
-
if (Symbol.dispose) FusionBatchOperations.prototype[Symbol.dispose] = FusionBatchOperations.prototype.free;
|
|
1139
1141
|
|
|
1140
1142
|
const FusionUtilsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1141
1143
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -1182,6 +1184,8 @@ export class FusionUtils {
|
|
|
1182
1184
|
}
|
|
1183
1185
|
/**
|
|
1184
1186
|
* Convert softmax probabilities to tropical representation
|
|
1187
|
+
*
|
|
1188
|
+
* Note: Direct conversion helpers are not in v0.12.0, using manual implementation
|
|
1185
1189
|
* @param {Float64Array} probs
|
|
1186
1190
|
* @returns {Float64Array}
|
|
1187
1191
|
*/
|
|
@@ -1195,6 +1199,8 @@ export class FusionUtils {
|
|
|
1195
1199
|
}
|
|
1196
1200
|
/**
|
|
1197
1201
|
* Convert tropical numbers back to softmax probabilities
|
|
1202
|
+
*
|
|
1203
|
+
* Note: Direct conversion helpers are not in v0.12.0, using manual implementation
|
|
1198
1204
|
* @param {Float64Array} tropical_values
|
|
1199
1205
|
* @returns {Float64Array}
|
|
1200
1206
|
*/
|
|
@@ -1207,7 +1213,6 @@ export class FusionUtils {
|
|
|
1207
1213
|
return v2;
|
|
1208
1214
|
}
|
|
1209
1215
|
}
|
|
1210
|
-
if (Symbol.dispose) FusionUtils.prototype[Symbol.dispose] = FusionUtils.prototype.free;
|
|
1211
1216
|
|
|
1212
1217
|
const InfoGeomUtilsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1213
1218
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -1322,7 +1327,6 @@ export class InfoGeomUtils {
|
|
|
1322
1327
|
return v2;
|
|
1323
1328
|
}
|
|
1324
1329
|
}
|
|
1325
|
-
if (Symbol.dispose) InfoGeomUtils.prototype[Symbol.dispose] = InfoGeomUtils.prototype.free;
|
|
1326
1330
|
|
|
1327
1331
|
const IntegrationFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1328
1332
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -1413,7 +1417,6 @@ export class Integration {
|
|
|
1413
1417
|
return ret[0];
|
|
1414
1418
|
}
|
|
1415
1419
|
}
|
|
1416
|
-
if (Symbol.dispose) Integration.prototype[Symbol.dispose] = Integration.prototype.free;
|
|
1417
1420
|
|
|
1418
1421
|
const MLOpsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1419
1422
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -1504,7 +1507,6 @@ export class MLOps {
|
|
|
1504
1507
|
return v2;
|
|
1505
1508
|
}
|
|
1506
1509
|
}
|
|
1507
|
-
if (Symbol.dispose) MLOps.prototype[Symbol.dispose] = MLOps.prototype.free;
|
|
1508
1510
|
|
|
1509
1511
|
const NetworkUtilsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1510
1512
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -1563,7 +1565,6 @@ export class NetworkUtils {
|
|
|
1563
1565
|
return WasmGeometricNetwork.__wrap(ret[0]);
|
|
1564
1566
|
}
|
|
1565
1567
|
}
|
|
1566
|
-
if (Symbol.dispose) NetworkUtils.prototype[Symbol.dispose] = NetworkUtils.prototype.free;
|
|
1567
1568
|
|
|
1568
1569
|
const NumericalDerivativeFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1569
1570
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -1722,7 +1723,6 @@ export class NumericalDerivative {
|
|
|
1722
1723
|
return ret[0];
|
|
1723
1724
|
}
|
|
1724
1725
|
}
|
|
1725
|
-
if (Symbol.dispose) NumericalDerivative.prototype[Symbol.dispose] = NumericalDerivative.prototype.free;
|
|
1726
1726
|
|
|
1727
1727
|
const PerformanceOperationsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1728
1728
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -1804,7 +1804,6 @@ export class PerformanceOperations {
|
|
|
1804
1804
|
return v3;
|
|
1805
1805
|
}
|
|
1806
1806
|
}
|
|
1807
|
-
if (Symbol.dispose) PerformanceOperations.prototype[Symbol.dispose] = PerformanceOperations.prototype.free;
|
|
1808
1807
|
|
|
1809
1808
|
const RiemannianManifoldFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1810
1809
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -2027,7 +2026,6 @@ export class RiemannianManifold {
|
|
|
2027
2026
|
return RiemannianManifold.__wrap(ret[0]);
|
|
2028
2027
|
}
|
|
2029
2028
|
}
|
|
2030
|
-
if (Symbol.dispose) RiemannianManifold.prototype[Symbol.dispose] = RiemannianManifold.prototype.free;
|
|
2031
2029
|
|
|
2032
2030
|
const ScalarFieldFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2033
2031
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -2156,7 +2154,6 @@ export class ScalarField {
|
|
|
2156
2154
|
return ret[0];
|
|
2157
2155
|
}
|
|
2158
2156
|
}
|
|
2159
|
-
if (Symbol.dispose) ScalarField.prototype[Symbol.dispose] = ScalarField.prototype.free;
|
|
2160
2157
|
|
|
2161
2158
|
const TropicalBatchFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2162
2159
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -2234,7 +2231,6 @@ export class TropicalBatch {
|
|
|
2234
2231
|
return ret;
|
|
2235
2232
|
}
|
|
2236
2233
|
}
|
|
2237
|
-
if (Symbol.dispose) TropicalBatch.prototype[Symbol.dispose] = TropicalBatch.prototype.free;
|
|
2238
2234
|
|
|
2239
2235
|
const TropicalMLOpsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2240
2236
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -2298,7 +2294,6 @@ export class TropicalMLOps {
|
|
|
2298
2294
|
return ret[0];
|
|
2299
2295
|
}
|
|
2300
2296
|
}
|
|
2301
|
-
if (Symbol.dispose) TropicalMLOps.prototype[Symbol.dispose] = TropicalMLOps.prototype.free;
|
|
2302
2297
|
|
|
2303
2298
|
const VectorFieldFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2304
2299
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -2401,7 +2396,6 @@ export class VectorField {
|
|
|
2401
2396
|
return v2;
|
|
2402
2397
|
}
|
|
2403
2398
|
}
|
|
2404
|
-
if (Symbol.dispose) VectorField.prototype[Symbol.dispose] = VectorField.prototype.free;
|
|
2405
2399
|
|
|
2406
2400
|
const WasmAlphaConnectionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2407
2401
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -2468,7 +2462,6 @@ export class WasmAlphaConnection {
|
|
|
2468
2462
|
return ret;
|
|
2469
2463
|
}
|
|
2470
2464
|
}
|
|
2471
|
-
if (Symbol.dispose) WasmAlphaConnection.prototype[Symbol.dispose] = WasmAlphaConnection.prototype.free;
|
|
2472
2465
|
|
|
2473
2466
|
const WasmChowClassFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2474
2467
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -2578,7 +2571,6 @@ export class WasmChowClass {
|
|
|
2578
2571
|
return WasmChowClass.__wrap(ret);
|
|
2579
2572
|
}
|
|
2580
2573
|
}
|
|
2581
|
-
if (Symbol.dispose) WasmChowClass.prototype[Symbol.dispose] = WasmChowClass.prototype.free;
|
|
2582
2574
|
|
|
2583
2575
|
const WasmCommunityFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2584
2576
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -2636,7 +2628,6 @@ export class WasmCommunity {
|
|
|
2636
2628
|
return v1;
|
|
2637
2629
|
}
|
|
2638
2630
|
}
|
|
2639
|
-
if (Symbol.dispose) WasmCommunity.prototype[Symbol.dispose] = WasmCommunity.prototype.free;
|
|
2640
2631
|
|
|
2641
2632
|
const WasmCountingMeasureFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2642
2633
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -2690,7 +2681,6 @@ export class WasmCountingMeasure {
|
|
|
2690
2681
|
return this;
|
|
2691
2682
|
}
|
|
2692
2683
|
}
|
|
2693
|
-
if (Symbol.dispose) WasmCountingMeasure.prototype[Symbol.dispose] = WasmCountingMeasure.prototype.free;
|
|
2694
2684
|
|
|
2695
2685
|
const WasmDualNumberFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2696
2686
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -2872,6 +2862,8 @@ export class WasmDualNumber {
|
|
|
2872
2862
|
}
|
|
2873
2863
|
/**
|
|
2874
2864
|
* ReLU activation function
|
|
2865
|
+
*
|
|
2866
|
+
* Note: Manual implementation as relu() is not in v0.12.0 DualNumber API
|
|
2875
2867
|
* @returns {WasmDualNumber}
|
|
2876
2868
|
*/
|
|
2877
2869
|
relu() {
|
|
@@ -2940,6 +2932,9 @@ export class WasmDualNumber {
|
|
|
2940
2932
|
}
|
|
2941
2933
|
/**
|
|
2942
2934
|
* Softplus activation function
|
|
2935
|
+
*
|
|
2936
|
+
* Note: Manual implementation as softplus() is not in v0.12.0 DualNumber API
|
|
2937
|
+
* softplus(x) = ln(1 + exp(x))
|
|
2943
2938
|
* @returns {WasmDualNumber}
|
|
2944
2939
|
*/
|
|
2945
2940
|
softplus() {
|
|
@@ -2956,7 +2951,6 @@ export class WasmDualNumber {
|
|
|
2956
2951
|
return WasmDualNumber.__wrap(ret);
|
|
2957
2952
|
}
|
|
2958
2953
|
}
|
|
2959
|
-
if (Symbol.dispose) WasmDualNumber.prototype[Symbol.dispose] = WasmDualNumber.prototype.free;
|
|
2960
2954
|
|
|
2961
2955
|
const WasmDuallyFlatManifoldFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2962
2956
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -3065,7 +3059,6 @@ export class WasmDuallyFlatManifold {
|
|
|
3065
3059
|
return this;
|
|
3066
3060
|
}
|
|
3067
3061
|
}
|
|
3068
|
-
if (Symbol.dispose) WasmDuallyFlatManifold.prototype[Symbol.dispose] = WasmDuallyFlatManifold.prototype.free;
|
|
3069
3062
|
|
|
3070
3063
|
const WasmEvaluationResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3071
3064
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -3138,7 +3131,6 @@ export class WasmEvaluationResult {
|
|
|
3138
3131
|
return takeFromExternrefTable0(ret[0]);
|
|
3139
3132
|
}
|
|
3140
3133
|
}
|
|
3141
|
-
if (Symbol.dispose) WasmEvaluationResult.prototype[Symbol.dispose] = WasmEvaluationResult.prototype.free;
|
|
3142
3134
|
|
|
3143
3135
|
const WasmFisherInformationMatrixFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3144
3136
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -3194,7 +3186,6 @@ export class WasmFisherInformationMatrix {
|
|
|
3194
3186
|
return ret !== 0;
|
|
3195
3187
|
}
|
|
3196
3188
|
}
|
|
3197
|
-
if (Symbol.dispose) WasmFisherInformationMatrix.prototype[Symbol.dispose] = WasmFisherInformationMatrix.prototype.free;
|
|
3198
3189
|
|
|
3199
3190
|
const WasmFisherMeasureFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3200
3191
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -3271,7 +3262,6 @@ export class WasmFisherMeasure {
|
|
|
3271
3262
|
return ret[0];
|
|
3272
3263
|
}
|
|
3273
3264
|
}
|
|
3274
|
-
if (Symbol.dispose) WasmFisherMeasure.prototype[Symbol.dispose] = WasmFisherMeasure.prototype.free;
|
|
3275
3265
|
|
|
3276
3266
|
const WasmFourVelocityFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3277
3267
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -3371,7 +3361,6 @@ export class WasmFourVelocity {
|
|
|
3371
3361
|
}
|
|
3372
3362
|
}
|
|
3373
3363
|
}
|
|
3374
|
-
if (Symbol.dispose) WasmFourVelocity.prototype[Symbol.dispose] = WasmFourVelocity.prototype.free;
|
|
3375
3364
|
|
|
3376
3365
|
const WasmGeodesicIntegratorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3377
3366
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -3426,7 +3415,6 @@ export class WasmGeodesicIntegrator {
|
|
|
3426
3415
|
return WasmGeodesicIntegrator.__wrap(ret);
|
|
3427
3416
|
}
|
|
3428
3417
|
}
|
|
3429
|
-
if (Symbol.dispose) WasmGeodesicIntegrator.prototype[Symbol.dispose] = WasmGeodesicIntegrator.prototype.free;
|
|
3430
3418
|
|
|
3431
3419
|
const WasmGeometricCAFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3432
3420
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -3603,7 +3591,6 @@ export class WasmGeometricCA {
|
|
|
3603
3591
|
}
|
|
3604
3592
|
}
|
|
3605
3593
|
}
|
|
3606
|
-
if (Symbol.dispose) WasmGeometricCA.prototype[Symbol.dispose] = WasmGeometricCA.prototype.free;
|
|
3607
3594
|
|
|
3608
3595
|
const WasmGeometricEdgeFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3609
3596
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -3661,7 +3648,6 @@ export class WasmGeometricEdge {
|
|
|
3661
3648
|
return ret;
|
|
3662
3649
|
}
|
|
3663
3650
|
}
|
|
3664
|
-
if (Symbol.dispose) WasmGeometricEdge.prototype[Symbol.dispose] = WasmGeometricEdge.prototype.free;
|
|
3665
3651
|
|
|
3666
3652
|
const WasmGeometricNetworkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3667
3653
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -3931,7 +3917,6 @@ export class WasmGeometricNetwork {
|
|
|
3931
3917
|
return ret >>> 0;
|
|
3932
3918
|
}
|
|
3933
3919
|
}
|
|
3934
|
-
if (Symbol.dispose) WasmGeometricNetwork.prototype[Symbol.dispose] = WasmGeometricNetwork.prototype.free;
|
|
3935
3920
|
|
|
3936
3921
|
const WasmGpuOptimizerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
3937
3922
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -4009,7 +3994,6 @@ export class WasmGpuOptimizer {
|
|
|
4009
3994
|
return this;
|
|
4010
3995
|
}
|
|
4011
3996
|
}
|
|
4012
|
-
if (Symbol.dispose) WasmGpuOptimizer.prototype[Symbol.dispose] = WasmGpuOptimizer.prototype.free;
|
|
4013
3997
|
|
|
4014
3998
|
const WasmGrassmannianFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4015
3999
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -4063,15 +4047,158 @@ export class WasmGrassmannian {
|
|
|
4063
4047
|
return this;
|
|
4064
4048
|
}
|
|
4065
4049
|
}
|
|
4066
|
-
if (Symbol.dispose) WasmGrassmannian.prototype[Symbol.dispose] = WasmGrassmannian.prototype.free;
|
|
4067
4050
|
|
|
4068
|
-
const
|
|
4051
|
+
const WasmHolographicMemoryFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4069
4052
|
? { register: () => {}, unregister: () => {} }
|
|
4070
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
4053
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmholographicmemory_free(ptr >>> 0, 1));
|
|
4071
4054
|
/**
|
|
4072
|
-
* WASM wrapper for
|
|
4055
|
+
* WASM wrapper for HolographicMemory using ProductClifford algebra
|
|
4073
4056
|
*/
|
|
4074
|
-
export class
|
|
4057
|
+
export class WasmHolographicMemory {
|
|
4058
|
+
|
|
4059
|
+
static __wrap(ptr) {
|
|
4060
|
+
ptr = ptr >>> 0;
|
|
4061
|
+
const obj = Object.create(WasmHolographicMemory.prototype);
|
|
4062
|
+
obj.__wbg_ptr = ptr;
|
|
4063
|
+
WasmHolographicMemoryFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
4064
|
+
return obj;
|
|
4065
|
+
}
|
|
4066
|
+
|
|
4067
|
+
__destroy_into_raw() {
|
|
4068
|
+
const ptr = this.__wbg_ptr;
|
|
4069
|
+
this.__wbg_ptr = 0;
|
|
4070
|
+
WasmHolographicMemoryFinalization.unregister(this);
|
|
4071
|
+
return ptr;
|
|
4072
|
+
}
|
|
4073
|
+
|
|
4074
|
+
free() {
|
|
4075
|
+
const ptr = this.__destroy_into_raw();
|
|
4076
|
+
wasm.__wbg_wasmholographicmemory_free(ptr, 0);
|
|
4077
|
+
}
|
|
4078
|
+
/**
|
|
4079
|
+
* Get the number of stored items
|
|
4080
|
+
* @returns {number}
|
|
4081
|
+
*/
|
|
4082
|
+
itemCount() {
|
|
4083
|
+
const ret = wasm.wasmholographicmemory_itemCount(this.__wbg_ptr);
|
|
4084
|
+
return ret >>> 0;
|
|
4085
|
+
}
|
|
4086
|
+
/**
|
|
4087
|
+
* Get the estimated SNR (signal-to-noise ratio)
|
|
4088
|
+
* @returns {number}
|
|
4089
|
+
*/
|
|
4090
|
+
estimatedSnr() {
|
|
4091
|
+
const ret = wasm.wasmholographicmemory_estimatedSnr(this.__wbg_ptr);
|
|
4092
|
+
return ret;
|
|
4093
|
+
}
|
|
4094
|
+
/**
|
|
4095
|
+
* Generate a random versor (for use as key/value)
|
|
4096
|
+
* @param {number} num_factors
|
|
4097
|
+
* @returns {Float64Array}
|
|
4098
|
+
*/
|
|
4099
|
+
static randomVersor(num_factors) {
|
|
4100
|
+
const ret = wasm.wasmholographicmemory_randomVersor(num_factors);
|
|
4101
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
4102
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
4103
|
+
return v1;
|
|
4104
|
+
}
|
|
4105
|
+
/**
|
|
4106
|
+
* Check if memory is near capacity
|
|
4107
|
+
* @returns {boolean}
|
|
4108
|
+
*/
|
|
4109
|
+
isNearCapacity() {
|
|
4110
|
+
const ret = wasm.wasmholographicmemory_isNearCapacity(this.__wbg_ptr);
|
|
4111
|
+
return ret !== 0;
|
|
4112
|
+
}
|
|
4113
|
+
/**
|
|
4114
|
+
* Create with key tracking enabled (for attribution)
|
|
4115
|
+
* @returns {WasmHolographicMemory}
|
|
4116
|
+
*/
|
|
4117
|
+
static withKeyTracking() {
|
|
4118
|
+
const ret = wasm.wasmholographicmemory_withKeyTracking();
|
|
4119
|
+
return WasmHolographicMemory.__wrap(ret);
|
|
4120
|
+
}
|
|
4121
|
+
/**
|
|
4122
|
+
* Get retrieval confidence for a key
|
|
4123
|
+
* @param {Float64Array} key
|
|
4124
|
+
* @returns {number}
|
|
4125
|
+
*/
|
|
4126
|
+
retrieveConfidence(key) {
|
|
4127
|
+
const ptr0 = passArrayF64ToWasm0(key, wasm.__wbindgen_malloc);
|
|
4128
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4129
|
+
const ret = wasm.wasmholographicmemory_retrieveConfidence(this.__wbg_ptr, ptr0, len0);
|
|
4130
|
+
if (ret[2]) {
|
|
4131
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4132
|
+
}
|
|
4133
|
+
return ret[0];
|
|
4134
|
+
}
|
|
4135
|
+
/**
|
|
4136
|
+
* Get capacity information
|
|
4137
|
+
* @returns {number}
|
|
4138
|
+
*/
|
|
4139
|
+
theoreticalCapacity() {
|
|
4140
|
+
const ret = wasm.wasmholographicmemory_theoreticalCapacity(this.__wbg_ptr);
|
|
4141
|
+
return ret >>> 0;
|
|
4142
|
+
}
|
|
4143
|
+
/**
|
|
4144
|
+
* Create a new holographic memory with default settings
|
|
4145
|
+
*/
|
|
4146
|
+
constructor() {
|
|
4147
|
+
const ret = wasm.wasmholographicmemory_new();
|
|
4148
|
+
this.__wbg_ptr = ret >>> 0;
|
|
4149
|
+
WasmHolographicMemoryFinalization.register(this, this.__wbg_ptr, this);
|
|
4150
|
+
return this;
|
|
4151
|
+
}
|
|
4152
|
+
/**
|
|
4153
|
+
* Clear all stored items
|
|
4154
|
+
*/
|
|
4155
|
+
clear() {
|
|
4156
|
+
wasm.wasmholographicmemory_clear(this.__wbg_ptr);
|
|
4157
|
+
}
|
|
4158
|
+
/**
|
|
4159
|
+
* Store a key-value pair in memory (using flat coefficient arrays)
|
|
4160
|
+
*
|
|
4161
|
+
* Each array should have 256 coefficients for ProductCl3x32.
|
|
4162
|
+
* @param {Float64Array} key
|
|
4163
|
+
* @param {Float64Array} value
|
|
4164
|
+
*/
|
|
4165
|
+
store(key, value) {
|
|
4166
|
+
const ptr0 = passArrayF64ToWasm0(key, wasm.__wbindgen_malloc);
|
|
4167
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4168
|
+
const ptr1 = passArrayF64ToWasm0(value, wasm.__wbindgen_malloc);
|
|
4169
|
+
const len1 = WASM_VECTOR_LEN;
|
|
4170
|
+
const ret = wasm.wasmholographicmemory_store(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
4171
|
+
if (ret[1]) {
|
|
4172
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
4173
|
+
}
|
|
4174
|
+
}
|
|
4175
|
+
/**
|
|
4176
|
+
* Retrieve a value by key
|
|
4177
|
+
*
|
|
4178
|
+
* Returns the retrieved coefficients as a Float64Array.
|
|
4179
|
+
* @param {Float64Array} key
|
|
4180
|
+
* @returns {Float64Array}
|
|
4181
|
+
*/
|
|
4182
|
+
retrieve(key) {
|
|
4183
|
+
const ptr0 = passArrayF64ToWasm0(key, wasm.__wbindgen_malloc);
|
|
4184
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4185
|
+
const ret = wasm.wasmholographicmemory_retrieve(this.__wbg_ptr, ptr0, len0);
|
|
4186
|
+
if (ret[3]) {
|
|
4187
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
4188
|
+
}
|
|
4189
|
+
var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
4190
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
4191
|
+
return v2;
|
|
4192
|
+
}
|
|
4193
|
+
}
|
|
4194
|
+
|
|
4195
|
+
const WasmInverseCADesignerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4196
|
+
? { register: () => {}, unregister: () => {} }
|
|
4197
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasminversecadesigner_free(ptr >>> 0, 1));
|
|
4198
|
+
/**
|
|
4199
|
+
* WASM wrapper for Inverse CA Designer (simplified)
|
|
4200
|
+
*/
|
|
4201
|
+
export class WasmInverseCADesigner {
|
|
4075
4202
|
|
|
4076
4203
|
__destroy_into_raw() {
|
|
4077
4204
|
const ptr = this.__wbg_ptr;
|
|
@@ -4137,7 +4264,6 @@ export class WasmInverseCADesigner {
|
|
|
4137
4264
|
return v1;
|
|
4138
4265
|
}
|
|
4139
4266
|
}
|
|
4140
|
-
if (Symbol.dispose) WasmInverseCADesigner.prototype[Symbol.dispose] = WasmInverseCADesigner.prototype.free;
|
|
4141
4267
|
|
|
4142
4268
|
const WasmLebesgueMeasureFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4143
4269
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -4220,7 +4346,6 @@ export class WasmLebesgueMeasure {
|
|
|
4220
4346
|
return this;
|
|
4221
4347
|
}
|
|
4222
4348
|
}
|
|
4223
|
-
if (Symbol.dispose) WasmLebesgueMeasure.prototype[Symbol.dispose] = WasmLebesgueMeasure.prototype.free;
|
|
4224
4349
|
|
|
4225
4350
|
const WasmModuliSpaceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4226
4351
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -4302,7 +4427,6 @@ export class WasmModuliSpace {
|
|
|
4302
4427
|
return WasmModuliSpace.__wrap(ret);
|
|
4303
4428
|
}
|
|
4304
4429
|
}
|
|
4305
|
-
if (Symbol.dispose) WasmModuliSpace.prototype[Symbol.dispose] = WasmModuliSpace.prototype.free;
|
|
4306
4430
|
|
|
4307
4431
|
const WasmMultiDualNumberFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4308
4432
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -4441,7 +4565,6 @@ export class WasmMultiDualNumber {
|
|
|
4441
4565
|
return WasmMultiDualNumber.__wrap(ret);
|
|
4442
4566
|
}
|
|
4443
4567
|
}
|
|
4444
|
-
if (Symbol.dispose) WasmMultiDualNumber.prototype[Symbol.dispose] = WasmMultiDualNumber.prototype.free;
|
|
4445
4568
|
|
|
4446
4569
|
const WasmMultiObjectiveOptimizerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4447
4570
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -4487,7 +4610,6 @@ export class WasmMultiObjectiveOptimizer {
|
|
|
4487
4610
|
return this;
|
|
4488
4611
|
}
|
|
4489
4612
|
}
|
|
4490
|
-
if (Symbol.dispose) WasmMultiObjectiveOptimizer.prototype[Symbol.dispose] = WasmMultiObjectiveOptimizer.prototype.free;
|
|
4491
4613
|
|
|
4492
4614
|
const WasmMultiObjectiveResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4493
4615
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -4543,7 +4665,6 @@ export class WasmMultiObjectiveResult {
|
|
|
4543
4665
|
return ret !== 0;
|
|
4544
4666
|
}
|
|
4545
4667
|
}
|
|
4546
|
-
if (Symbol.dispose) WasmMultiObjectiveResult.prototype[Symbol.dispose] = WasmMultiObjectiveResult.prototype.free;
|
|
4547
4668
|
|
|
4548
4669
|
const WasmMultivectorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4549
4670
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -4776,7 +4897,6 @@ export class WasmMultivector {
|
|
|
4776
4897
|
return WasmMultivector.__wrap(ret[0]);
|
|
4777
4898
|
}
|
|
4778
4899
|
}
|
|
4779
|
-
if (Symbol.dispose) WasmMultivector.prototype[Symbol.dispose] = WasmMultivector.prototype.free;
|
|
4780
4900
|
|
|
4781
4901
|
const WasmNodeMetadataFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4782
4902
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -4869,7 +4989,6 @@ export class WasmNodeMetadata {
|
|
|
4869
4989
|
wasm.wasmnodemetadata_set_label(this.__wbg_ptr, ptr0, len0);
|
|
4870
4990
|
}
|
|
4871
4991
|
}
|
|
4872
|
-
if (Symbol.dispose) WasmNodeMetadata.prototype[Symbol.dispose] = WasmNodeMetadata.prototype.free;
|
|
4873
4992
|
|
|
4874
4993
|
const WasmOptimizationResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4875
4994
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -4933,7 +5052,6 @@ export class WasmOptimizationResult {
|
|
|
4933
5052
|
return ret !== 0;
|
|
4934
5053
|
}
|
|
4935
5054
|
}
|
|
4936
|
-
if (Symbol.dispose) WasmOptimizationResult.prototype[Symbol.dispose] = WasmOptimizationResult.prototype.free;
|
|
4937
5055
|
|
|
4938
5056
|
const WasmOptimizationUtilsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4939
5057
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -4989,7 +5107,6 @@ export class WasmOptimizationUtils {
|
|
|
4989
5107
|
return ret !== 0;
|
|
4990
5108
|
}
|
|
4991
5109
|
}
|
|
4992
|
-
if (Symbol.dispose) WasmOptimizationUtils.prototype[Symbol.dispose] = WasmOptimizationUtils.prototype.free;
|
|
4993
5110
|
|
|
4994
5111
|
const WasmParametricDensityFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4995
5112
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -5121,7 +5238,6 @@ export class WasmParametricDensity {
|
|
|
5121
5238
|
return v2;
|
|
5122
5239
|
}
|
|
5123
5240
|
}
|
|
5124
|
-
if (Symbol.dispose) WasmParametricDensity.prototype[Symbol.dispose] = WasmParametricDensity.prototype.free;
|
|
5125
5241
|
|
|
5126
5242
|
const WasmProbabilityMeasureFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5127
5243
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -5203,7 +5319,6 @@ export class WasmProbabilityMeasure {
|
|
|
5203
5319
|
return WasmProbabilityMeasure.__wrap(ret[0]);
|
|
5204
5320
|
}
|
|
5205
5321
|
}
|
|
5206
|
-
if (Symbol.dispose) WasmProbabilityMeasure.prototype[Symbol.dispose] = WasmProbabilityMeasure.prototype.free;
|
|
5207
5322
|
|
|
5208
5323
|
const WasmProjectiveSpaceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5209
5324
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -5262,7 +5377,6 @@ export class WasmProjectiveSpace {
|
|
|
5262
5377
|
return this;
|
|
5263
5378
|
}
|
|
5264
5379
|
}
|
|
5265
|
-
if (Symbol.dispose) WasmProjectiveSpace.prototype[Symbol.dispose] = WasmProjectiveSpace.prototype.free;
|
|
5266
5380
|
|
|
5267
5381
|
const WasmPropagationAnalysisFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5268
5382
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -5320,7 +5434,6 @@ export class WasmPropagationAnalysis {
|
|
|
5320
5434
|
return v1;
|
|
5321
5435
|
}
|
|
5322
5436
|
}
|
|
5323
|
-
if (Symbol.dispose) WasmPropagationAnalysis.prototype[Symbol.dispose] = WasmPropagationAnalysis.prototype.free;
|
|
5324
5437
|
|
|
5325
5438
|
const WasmRelativisticConstantsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5326
5439
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -5374,7 +5487,6 @@ export class WasmRelativisticConstants {
|
|
|
5374
5487
|
return ret;
|
|
5375
5488
|
}
|
|
5376
5489
|
}
|
|
5377
|
-
if (Symbol.dispose) WasmRelativisticConstants.prototype[Symbol.dispose] = WasmRelativisticConstants.prototype.free;
|
|
5378
5490
|
|
|
5379
5491
|
const WasmRelativisticParticleFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5380
5492
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -5525,7 +5637,82 @@ export class WasmRelativisticParticle {
|
|
|
5525
5637
|
}
|
|
5526
5638
|
}
|
|
5527
5639
|
}
|
|
5528
|
-
|
|
5640
|
+
|
|
5641
|
+
const WasmResonatorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5642
|
+
? { register: () => {}, unregister: () => {} }
|
|
5643
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmresonator_free(ptr >>> 0, 1));
|
|
5644
|
+
/**
|
|
5645
|
+
* WASM wrapper for Resonator using ProductClifford algebra
|
|
5646
|
+
*/
|
|
5647
|
+
export class WasmResonator {
|
|
5648
|
+
|
|
5649
|
+
__destroy_into_raw() {
|
|
5650
|
+
const ptr = this.__wbg_ptr;
|
|
5651
|
+
this.__wbg_ptr = 0;
|
|
5652
|
+
WasmResonatorFinalization.unregister(this);
|
|
5653
|
+
return ptr;
|
|
5654
|
+
}
|
|
5655
|
+
|
|
5656
|
+
free() {
|
|
5657
|
+
const ptr = this.__destroy_into_raw();
|
|
5658
|
+
wasm.__wbg_wasmresonator_free(ptr, 0);
|
|
5659
|
+
}
|
|
5660
|
+
/**
|
|
5661
|
+
* Get the codebook size
|
|
5662
|
+
* @returns {number}
|
|
5663
|
+
*/
|
|
5664
|
+
codebookSize() {
|
|
5665
|
+
const ret = wasm.wasmresonator_codebookSize(this.__wbg_ptr);
|
|
5666
|
+
return ret >>> 0;
|
|
5667
|
+
}
|
|
5668
|
+
/**
|
|
5669
|
+
* Get cleanup result with metadata
|
|
5670
|
+
* @param {Float64Array} input
|
|
5671
|
+
* @returns {any}
|
|
5672
|
+
*/
|
|
5673
|
+
cleanupWithInfo(input) {
|
|
5674
|
+
const ptr0 = passArrayF64ToWasm0(input, wasm.__wbindgen_malloc);
|
|
5675
|
+
const len0 = WASM_VECTOR_LEN;
|
|
5676
|
+
const ret = wasm.wasmresonator_cleanupWithInfo(this.__wbg_ptr, ptr0, len0);
|
|
5677
|
+
if (ret[2]) {
|
|
5678
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
5679
|
+
}
|
|
5680
|
+
return takeFromExternrefTable0(ret[0]);
|
|
5681
|
+
}
|
|
5682
|
+
/**
|
|
5683
|
+
* Create a resonator from a flat codebook array
|
|
5684
|
+
*
|
|
5685
|
+
* Each item should have 256 coefficients for ProductCl3x32.
|
|
5686
|
+
* @param {Float64Array} codebook_flat
|
|
5687
|
+
*/
|
|
5688
|
+
constructor(codebook_flat) {
|
|
5689
|
+
const ptr0 = passArrayF64ToWasm0(codebook_flat, wasm.__wbindgen_malloc);
|
|
5690
|
+
const len0 = WASM_VECTOR_LEN;
|
|
5691
|
+
const ret = wasm.wasmresonator_new(ptr0, len0);
|
|
5692
|
+
if (ret[2]) {
|
|
5693
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
5694
|
+
}
|
|
5695
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
5696
|
+
WasmResonatorFinalization.register(this, this.__wbg_ptr, this);
|
|
5697
|
+
return this;
|
|
5698
|
+
}
|
|
5699
|
+
/**
|
|
5700
|
+
* Clean up a noisy input to find the closest codebook item
|
|
5701
|
+
* @param {Float64Array} input
|
|
5702
|
+
* @returns {Float64Array}
|
|
5703
|
+
*/
|
|
5704
|
+
cleanup(input) {
|
|
5705
|
+
const ptr0 = passArrayF64ToWasm0(input, wasm.__wbindgen_malloc);
|
|
5706
|
+
const len0 = WASM_VECTOR_LEN;
|
|
5707
|
+
const ret = wasm.wasmresonator_cleanup(this.__wbg_ptr, ptr0, len0);
|
|
5708
|
+
if (ret[3]) {
|
|
5709
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
5710
|
+
}
|
|
5711
|
+
var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
5712
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
5713
|
+
return v2;
|
|
5714
|
+
}
|
|
5715
|
+
}
|
|
5529
5716
|
|
|
5530
5717
|
const WasmRotorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5531
5718
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -5594,7 +5781,6 @@ export class WasmRotor {
|
|
|
5594
5781
|
return WasmRotor.__wrap(ret);
|
|
5595
5782
|
}
|
|
5596
5783
|
}
|
|
5597
|
-
if (Symbol.dispose) WasmRotor.prototype[Symbol.dispose] = WasmRotor.prototype.free;
|
|
5598
5784
|
|
|
5599
5785
|
const WasmSchwarzschildMetricFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5600
5786
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -5685,7 +5871,6 @@ export class WasmSchwarzschildMetric {
|
|
|
5685
5871
|
return WasmSchwarzschildMetric.__wrap(ret);
|
|
5686
5872
|
}
|
|
5687
5873
|
}
|
|
5688
|
-
if (Symbol.dispose) WasmSchwarzschildMetric.prototype[Symbol.dispose] = WasmSchwarzschildMetric.prototype.free;
|
|
5689
5874
|
|
|
5690
5875
|
const WasmSelfAssemblerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5691
5876
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -5746,7 +5931,6 @@ export class WasmSelfAssembler {
|
|
|
5746
5931
|
return this;
|
|
5747
5932
|
}
|
|
5748
5933
|
}
|
|
5749
|
-
if (Symbol.dispose) WasmSelfAssembler.prototype[Symbol.dispose] = WasmSelfAssembler.prototype.free;
|
|
5750
5934
|
|
|
5751
5935
|
const WasmSensitivityMapFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5752
5936
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -5806,7 +5990,6 @@ export class WasmSensitivityMap {
|
|
|
5806
5990
|
return ret;
|
|
5807
5991
|
}
|
|
5808
5992
|
}
|
|
5809
|
-
if (Symbol.dispose) WasmSensitivityMap.prototype[Symbol.dispose] = WasmSensitivityMap.prototype.free;
|
|
5810
5993
|
|
|
5811
5994
|
const WasmSimpleOptimizerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5812
5995
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -5854,7 +6037,6 @@ export class WasmSimpleOptimizer {
|
|
|
5854
6037
|
return this;
|
|
5855
6038
|
}
|
|
5856
6039
|
}
|
|
5857
|
-
if (Symbol.dispose) WasmSimpleOptimizer.prototype[Symbol.dispose] = WasmSimpleOptimizer.prototype.free;
|
|
5858
6040
|
|
|
5859
6041
|
const WasmSpacetimeVectorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5860
6042
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -6007,7 +6189,6 @@ export class WasmSpacetimeVector {
|
|
|
6007
6189
|
}
|
|
6008
6190
|
}
|
|
6009
6191
|
}
|
|
6010
|
-
if (Symbol.dispose) WasmSpacetimeVector.prototype[Symbol.dispose] = WasmSpacetimeVector.prototype.free;
|
|
6011
6192
|
|
|
6012
6193
|
const WasmTrajectoryPointFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6013
6194
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -6052,7 +6233,6 @@ export class WasmTrajectoryPoint {
|
|
|
6052
6233
|
return WasmSpacetimeVector.__wrap(ret);
|
|
6053
6234
|
}
|
|
6054
6235
|
}
|
|
6055
|
-
if (Symbol.dispose) WasmTrajectoryPoint.prototype[Symbol.dispose] = WasmTrajectoryPoint.prototype.free;
|
|
6056
6236
|
|
|
6057
6237
|
const WasmTropicalCurveFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6058
6238
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -6109,7 +6289,6 @@ export class WasmTropicalCurve {
|
|
|
6109
6289
|
return ret >>> 0;
|
|
6110
6290
|
}
|
|
6111
6291
|
}
|
|
6112
|
-
if (Symbol.dispose) WasmTropicalCurve.prototype[Symbol.dispose] = WasmTropicalCurve.prototype.free;
|
|
6113
6292
|
|
|
6114
6293
|
const WasmTropicalDualCliffordFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6115
6294
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -6138,6 +6317,111 @@ export class WasmTropicalDualClifford {
|
|
|
6138
6317
|
const ptr = this.__destroy_into_raw();
|
|
6139
6318
|
wasm.__wbg_wasmtropicaldualclifford_free(ptr, 0);
|
|
6140
6319
|
}
|
|
6320
|
+
/**
|
|
6321
|
+
* Compute similarity between two TDC objects
|
|
6322
|
+
*
|
|
6323
|
+
* Uses the proper Clifford inner product with reverse: <A B̃>₀ / (|A| |B|)
|
|
6324
|
+
* Returns a value in [-1, 1].
|
|
6325
|
+
* @param {WasmTropicalDualClifford} other
|
|
6326
|
+
* @returns {number}
|
|
6327
|
+
*/
|
|
6328
|
+
similarity(other) {
|
|
6329
|
+
_assertClass(other, WasmTropicalDualClifford);
|
|
6330
|
+
const ret = wasm.wasmtropicaldualclifford_similarity(this.__wbg_ptr, other.__wbg_ptr);
|
|
6331
|
+
return ret;
|
|
6332
|
+
}
|
|
6333
|
+
/**
|
|
6334
|
+
* Create a random unit vector TDC (grade 1 only)
|
|
6335
|
+
*
|
|
6336
|
+
* Unit vectors are guaranteed invertible and useful for
|
|
6337
|
+
* proper VSA (Vector Symbolic Architecture) operations.
|
|
6338
|
+
* @returns {WasmTropicalDualClifford}
|
|
6339
|
+
*/
|
|
6340
|
+
static randomVector() {
|
|
6341
|
+
const ret = wasm.wasmtropicaldualclifford_randomVector();
|
|
6342
|
+
return WasmTropicalDualClifford.__wrap(ret);
|
|
6343
|
+
}
|
|
6344
|
+
/**
|
|
6345
|
+
* Compute binding inverse
|
|
6346
|
+
*
|
|
6347
|
+
* If successful, `x.bind(x.bindingInverse()) ≈ identity`
|
|
6348
|
+
* @returns {WasmTropicalDualClifford}
|
|
6349
|
+
*/
|
|
6350
|
+
bindingInverse() {
|
|
6351
|
+
const ret = wasm.wasmtropicaldualclifford_bindingInverse(this.__wbg_ptr);
|
|
6352
|
+
if (ret[2]) {
|
|
6353
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
6354
|
+
}
|
|
6355
|
+
return WasmTropicalDualClifford.__wrap(ret[0]);
|
|
6356
|
+
}
|
|
6357
|
+
/**
|
|
6358
|
+
* Get the binding identity element
|
|
6359
|
+
*
|
|
6360
|
+
* `x.bind(identity) = x` for any x
|
|
6361
|
+
* @returns {WasmTropicalDualClifford}
|
|
6362
|
+
*/
|
|
6363
|
+
static bindingIdentity() {
|
|
6364
|
+
const ret = wasm.wasmtropicaldualclifford_bindingIdentity();
|
|
6365
|
+
return WasmTropicalDualClifford.__wrap(ret);
|
|
6366
|
+
}
|
|
6367
|
+
/**
|
|
6368
|
+
* Normalize the TDC to unit norm
|
|
6369
|
+
* @returns {WasmTropicalDualClifford}
|
|
6370
|
+
*/
|
|
6371
|
+
normalizeToUnit() {
|
|
6372
|
+
const ret = wasm.wasmtropicaldualclifford_normalizeToUnit(this.__wbg_ptr);
|
|
6373
|
+
return WasmTropicalDualClifford.__wrap(ret);
|
|
6374
|
+
}
|
|
6375
|
+
/**
|
|
6376
|
+
* Compute Clifford similarity (proper inner product with reverse)
|
|
6377
|
+
* @param {WasmTropicalDualClifford} other
|
|
6378
|
+
* @returns {number}
|
|
6379
|
+
*/
|
|
6380
|
+
cliffordSimilarity(other) {
|
|
6381
|
+
_assertClass(other, WasmTropicalDualClifford);
|
|
6382
|
+
const ret = wasm.wasmtropicaldualclifford_cliffordSimilarity(this.__wbg_ptr, other.__wbg_ptr);
|
|
6383
|
+
return ret;
|
|
6384
|
+
}
|
|
6385
|
+
/**
|
|
6386
|
+
* Bind two TDC objects using geometric product (creates associations)
|
|
6387
|
+
*
|
|
6388
|
+
* The result is dissimilar to both inputs - useful for creating
|
|
6389
|
+
* key-value associations in holographic memory.
|
|
6390
|
+
* @param {WasmTropicalDualClifford} other
|
|
6391
|
+
* @returns {WasmTropicalDualClifford}
|
|
6392
|
+
*/
|
|
6393
|
+
bind(other) {
|
|
6394
|
+
_assertClass(other, WasmTropicalDualClifford);
|
|
6395
|
+
const ret = wasm.wasmtropicaldualclifford_bind(this.__wbg_ptr, other.__wbg_ptr);
|
|
6396
|
+
return WasmTropicalDualClifford.__wrap(ret);
|
|
6397
|
+
}
|
|
6398
|
+
/**
|
|
6399
|
+
* Bundle two TDC objects (superposition/aggregation)
|
|
6400
|
+
*
|
|
6401
|
+
* The result is similar to both inputs - useful for storing
|
|
6402
|
+
* multiple associations in the same memory trace.
|
|
6403
|
+
* `beta` controls soft (1.0) vs hard (∞) bundling.
|
|
6404
|
+
* @param {WasmTropicalDualClifford} other
|
|
6405
|
+
* @param {number} beta
|
|
6406
|
+
* @returns {WasmTropicalDualClifford}
|
|
6407
|
+
*/
|
|
6408
|
+
bundle(other, beta) {
|
|
6409
|
+
_assertClass(other, WasmTropicalDualClifford);
|
|
6410
|
+
const ret = wasm.wasmtropicaldualclifford_bundle(this.__wbg_ptr, other.__wbg_ptr, beta);
|
|
6411
|
+
return WasmTropicalDualClifford.__wrap(ret);
|
|
6412
|
+
}
|
|
6413
|
+
/**
|
|
6414
|
+
* Unbind: retrieve associated value
|
|
6415
|
+
*
|
|
6416
|
+
* If `bound = key.bind(value)`, then `key.unbind(bound) ≈ value`
|
|
6417
|
+
* @param {WasmTropicalDualClifford} other
|
|
6418
|
+
* @returns {WasmTropicalDualClifford}
|
|
6419
|
+
*/
|
|
6420
|
+
unbind(other) {
|
|
6421
|
+
_assertClass(other, WasmTropicalDualClifford);
|
|
6422
|
+
const ret = wasm.wasmtropicaldualclifford_unbind(this.__wbg_ptr, other.__wbg_ptr);
|
|
6423
|
+
return WasmTropicalDualClifford.__wrap(ret);
|
|
6424
|
+
}
|
|
6141
6425
|
/**
|
|
6142
6426
|
* Create from logits (array of log-probabilities)
|
|
6143
6427
|
* @param {Float64Array} logits
|
|
@@ -6189,6 +6473,8 @@ export class WasmTropicalDualClifford {
|
|
|
6189
6473
|
}
|
|
6190
6474
|
/**
|
|
6191
6475
|
* Create from probability distribution
|
|
6476
|
+
*
|
|
6477
|
+
* Note: Converts probabilities to log space for tropical representation
|
|
6192
6478
|
* @param {Float64Array} probs
|
|
6193
6479
|
* @returns {WasmTropicalDualClifford}
|
|
6194
6480
|
*/
|
|
@@ -6229,6 +6515,9 @@ export class WasmTropicalDualClifford {
|
|
|
6229
6515
|
}
|
|
6230
6516
|
/**
|
|
6231
6517
|
* Perform sensitivity analysis for gradient-based optimization
|
|
6518
|
+
*
|
|
6519
|
+
* Note: This feature is not yet available in v0.12.0
|
|
6520
|
+
* TODO: Re-enable when sensitivity_analysis is added to TropicalDualClifford
|
|
6232
6521
|
* @returns {WasmSensitivityMap}
|
|
6233
6522
|
*/
|
|
6234
6523
|
sensitivityAnalysis() {
|
|
@@ -6340,93 +6629,6 @@ export class WasmTropicalDualClifford {
|
|
|
6340
6629
|
return WasmTropicalDualClifford.__wrap(ret);
|
|
6341
6630
|
}
|
|
6342
6631
|
}
|
|
6343
|
-
if (Symbol.dispose) WasmTropicalDualClifford.prototype[Symbol.dispose] = WasmTropicalDualClifford.prototype.free;
|
|
6344
|
-
|
|
6345
|
-
const WasmTropicalDualDistributionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6346
|
-
? { register: () => {}, unregister: () => {} }
|
|
6347
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmtropicaldualdistribution_free(ptr >>> 0, 1));
|
|
6348
|
-
/**
|
|
6349
|
-
* WASM wrapper for LLM token distributions
|
|
6350
|
-
*/
|
|
6351
|
-
export class WasmTropicalDualDistribution {
|
|
6352
|
-
|
|
6353
|
-
__destroy_into_raw() {
|
|
6354
|
-
const ptr = this.__wbg_ptr;
|
|
6355
|
-
this.__wbg_ptr = 0;
|
|
6356
|
-
WasmTropicalDualDistributionFinalization.unregister(this);
|
|
6357
|
-
return ptr;
|
|
6358
|
-
}
|
|
6359
|
-
|
|
6360
|
-
free() {
|
|
6361
|
-
const ptr = this.__destroy_into_raw();
|
|
6362
|
-
wasm.__wbg_wasmtropicaldualdistribution_free(ptr, 0);
|
|
6363
|
-
}
|
|
6364
|
-
/**
|
|
6365
|
-
* Compute KL divergence with automatic gradients
|
|
6366
|
-
* @param {WasmTropicalDualDistribution} other
|
|
6367
|
-
* @returns {any}
|
|
6368
|
-
*/
|
|
6369
|
-
klDivergence(other) {
|
|
6370
|
-
_assertClass(other, WasmTropicalDualDistribution);
|
|
6371
|
-
const ret = wasm.wasmtropicaldualdistribution_klDivergence(this.__wbg_ptr, other.__wbg_ptr);
|
|
6372
|
-
if (ret[2]) {
|
|
6373
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
6374
|
-
}
|
|
6375
|
-
return takeFromExternrefTable0(ret[0]);
|
|
6376
|
-
}
|
|
6377
|
-
/**
|
|
6378
|
-
* Get vocabulary size
|
|
6379
|
-
* @returns {number}
|
|
6380
|
-
*/
|
|
6381
|
-
getVocabSize() {
|
|
6382
|
-
const ret = wasm.wasmtropicaldualdistribution_getVocabSize(this.__wbg_ptr);
|
|
6383
|
-
return ret >>> 0;
|
|
6384
|
-
}
|
|
6385
|
-
/**
|
|
6386
|
-
* Get attention pattern as tropical polytope vertices
|
|
6387
|
-
* @returns {Float64Array}
|
|
6388
|
-
*/
|
|
6389
|
-
attentionPolytope() {
|
|
6390
|
-
const ret = wasm.wasmtropicaldualdistribution_attentionPolytope(this.__wbg_ptr);
|
|
6391
|
-
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
6392
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
6393
|
-
return v1;
|
|
6394
|
-
}
|
|
6395
|
-
/**
|
|
6396
|
-
* Compute geometric alignment with reference distribution
|
|
6397
|
-
* @param {WasmTropicalDualDistribution} reference
|
|
6398
|
-
* @returns {number}
|
|
6399
|
-
*/
|
|
6400
|
-
geometricAlignment(reference) {
|
|
6401
|
-
_assertClass(reference, WasmTropicalDualDistribution);
|
|
6402
|
-
const ret = wasm.wasmtropicaldualdistribution_geometricAlignment(this.__wbg_ptr, reference.__wbg_ptr);
|
|
6403
|
-
return ret;
|
|
6404
|
-
}
|
|
6405
|
-
/**
|
|
6406
|
-
* Generate most likely sequence using tropical algebra (Viterbi-like)
|
|
6407
|
-
* @param {number} length
|
|
6408
|
-
* @returns {Uint32Array}
|
|
6409
|
-
*/
|
|
6410
|
-
mostLikelySequence(length) {
|
|
6411
|
-
const ret = wasm.wasmtropicaldualdistribution_mostLikelySequence(this.__wbg_ptr, length);
|
|
6412
|
-
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
6413
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
6414
|
-
return v1;
|
|
6415
|
-
}
|
|
6416
|
-
/**
|
|
6417
|
-
* Create from logit vector (typical LLM output)
|
|
6418
|
-
* @param {Float64Array} logits
|
|
6419
|
-
*/
|
|
6420
|
-
constructor(logits) {
|
|
6421
|
-
const ptr0 = passArrayF64ToWasm0(logits, wasm.__wbindgen_malloc);
|
|
6422
|
-
const len0 = WASM_VECTOR_LEN;
|
|
6423
|
-
const ret = wasm.wasmtropicaldualdistribution_new(ptr0, len0);
|
|
6424
|
-
this.__wbg_ptr = ret >>> 0;
|
|
6425
|
-
WasmTropicalDualDistributionFinalization.register(this, this.__wbg_ptr, this);
|
|
6426
|
-
return this;
|
|
6427
|
-
}
|
|
6428
|
-
}
|
|
6429
|
-
if (Symbol.dispose) WasmTropicalDualDistribution.prototype[Symbol.dispose] = WasmTropicalDualDistribution.prototype.free;
|
|
6430
6632
|
|
|
6431
6633
|
const WasmTropicalMeasureFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6432
6634
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -6510,7 +6712,6 @@ export class WasmTropicalMeasure {
|
|
|
6510
6712
|
return v2;
|
|
6511
6713
|
}
|
|
6512
6714
|
}
|
|
6513
|
-
if (Symbol.dispose) WasmTropicalMeasure.prototype[Symbol.dispose] = WasmTropicalMeasure.prototype.free;
|
|
6514
6715
|
|
|
6515
6716
|
const WasmTropicalNetworkFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6516
6717
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -6611,7 +6812,6 @@ export class WasmTropicalNetwork {
|
|
|
6611
6812
|
}
|
|
6612
6813
|
}
|
|
6613
6814
|
}
|
|
6614
|
-
if (Symbol.dispose) WasmTropicalNetwork.prototype[Symbol.dispose] = WasmTropicalNetwork.prototype.free;
|
|
6615
6815
|
|
|
6616
6816
|
const WasmTropicalNumberFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6617
6817
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -6642,6 +6842,8 @@ export class WasmTropicalNumber {
|
|
|
6642
6842
|
}
|
|
6643
6843
|
/**
|
|
6644
6844
|
* Check if this is infinite
|
|
6845
|
+
*
|
|
6846
|
+
* Note: Manual implementation as is_infinity() not in v0.12.0 API
|
|
6645
6847
|
* @returns {boolean}
|
|
6646
6848
|
*/
|
|
6647
6849
|
isInfinity() {
|
|
@@ -6679,6 +6881,8 @@ export class WasmTropicalNumber {
|
|
|
6679
6881
|
}
|
|
6680
6882
|
/**
|
|
6681
6883
|
* Create from log probability
|
|
6884
|
+
*
|
|
6885
|
+
* Note: Manual implementation as from_log_prob() not in v0.12.0 API
|
|
6682
6886
|
* @param {number} log_p
|
|
6683
6887
|
* @returns {WasmTropicalNumber}
|
|
6684
6888
|
*/
|
|
@@ -6708,6 +6912,8 @@ export class WasmTropicalNumber {
|
|
|
6708
6912
|
}
|
|
6709
6913
|
/**
|
|
6710
6914
|
* Negation
|
|
6915
|
+
*
|
|
6916
|
+
* Note: Manual implementation as Neg trait not implemented in v0.12.0 API
|
|
6711
6917
|
* @returns {WasmTropicalNumber}
|
|
6712
6918
|
*/
|
|
6713
6919
|
neg() {
|
|
@@ -6737,7 +6943,7 @@ export class WasmTropicalNumber {
|
|
|
6737
6943
|
* @returns {WasmTropicalNumber}
|
|
6738
6944
|
*/
|
|
6739
6945
|
static zero() {
|
|
6740
|
-
const ret = wasm.
|
|
6946
|
+
const ret = wasm.wasmtropicalnumber_one();
|
|
6741
6947
|
return WasmTropicalNumber.__wrap(ret);
|
|
6742
6948
|
}
|
|
6743
6949
|
/**
|
|
@@ -6753,11 +6959,13 @@ export class WasmTropicalNumber {
|
|
|
6753
6959
|
* @returns {boolean}
|
|
6754
6960
|
*/
|
|
6755
6961
|
isZero() {
|
|
6756
|
-
const ret = wasm.
|
|
6962
|
+
const ret = wasm.wasmtropicalnumber_isInfinity(this.__wbg_ptr);
|
|
6757
6963
|
return ret !== 0;
|
|
6758
6964
|
}
|
|
6759
6965
|
/**
|
|
6760
6966
|
* Convert to probability (via exp)
|
|
6967
|
+
*
|
|
6968
|
+
* Note: Manual implementation as to_prob() not in v0.12.0 API
|
|
6761
6969
|
* @returns {number}
|
|
6762
6970
|
*/
|
|
6763
6971
|
toProb() {
|
|
@@ -6773,7 +6981,6 @@ export class WasmTropicalNumber {
|
|
|
6773
6981
|
return ret;
|
|
6774
6982
|
}
|
|
6775
6983
|
}
|
|
6776
|
-
if (Symbol.dispose) WasmTropicalNumber.prototype[Symbol.dispose] = WasmTropicalNumber.prototype.free;
|
|
6777
6984
|
|
|
6778
6985
|
const WasmTropicalPolynomialFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6779
6986
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -6833,7 +7040,6 @@ export class WasmTropicalPolynomial {
|
|
|
6833
7040
|
return WasmTropicalNumber.__wrap(ret);
|
|
6834
7041
|
}
|
|
6835
7042
|
}
|
|
6836
|
-
if (Symbol.dispose) WasmTropicalPolynomial.prototype[Symbol.dispose] = WasmTropicalPolynomial.prototype.free;
|
|
6837
7043
|
|
|
6838
7044
|
const WasmTropicalViterbiFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6839
7045
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -6903,7 +7109,6 @@ export class WasmTropicalViterbi {
|
|
|
6903
7109
|
return takeFromExternrefTable0(ret[0]);
|
|
6904
7110
|
}
|
|
6905
7111
|
}
|
|
6906
|
-
if (Symbol.dispose) WasmTropicalViterbi.prototype[Symbol.dispose] = WasmTropicalViterbi.prototype.free;
|
|
6907
7112
|
|
|
6908
7113
|
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
6909
7114
|
|
|
@@ -6943,50 +7148,23 @@ async function __wbg_load(module, imports) {
|
|
|
6943
7148
|
function __wbg_get_imports() {
|
|
6944
7149
|
const imports = {};
|
|
6945
7150
|
imports.wbg = {};
|
|
6946
|
-
imports.wbg.
|
|
6947
|
-
const ret = debugString(arg1);
|
|
6948
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
6949
|
-
const len1 = WASM_VECTOR_LEN;
|
|
6950
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
6951
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
6952
|
-
};
|
|
6953
|
-
imports.wbg.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
|
|
6954
|
-
const ret = typeof(arg0) === 'function';
|
|
6955
|
-
return ret;
|
|
6956
|
-
};
|
|
6957
|
-
imports.wbg.__wbg___wbindgen_is_undefined_2d472862bd29a478 = function(arg0) {
|
|
6958
|
-
const ret = arg0 === undefined;
|
|
6959
|
-
return ret;
|
|
6960
|
-
};
|
|
6961
|
-
imports.wbg.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
|
|
6962
|
-
const obj = arg1;
|
|
6963
|
-
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
6964
|
-
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
6965
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
6966
|
-
};
|
|
6967
|
-
imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
|
|
6968
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
6969
|
-
};
|
|
6970
|
-
imports.wbg.__wbg__wbg_cb_unref_2454a539ea5790d9 = function(arg0) {
|
|
6971
|
-
arg0._wbg_cb_unref();
|
|
6972
|
-
};
|
|
6973
|
-
imports.wbg.__wbg_apply_04097a755e1e4a1e = function() { return handleError(function (arg0, arg1, arg2) {
|
|
7151
|
+
imports.wbg.__wbg_apply_8745fdcf855d21f5 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
6974
7152
|
const ret = arg0.apply(arg1, arg2);
|
|
6975
7153
|
return ret;
|
|
6976
7154
|
}, arguments) };
|
|
6977
|
-
imports.wbg.
|
|
6978
|
-
const ret = arg0.call(arg1, arg2, arg3
|
|
7155
|
+
imports.wbg.__wbg_call_1b920c3ac0afee4b = function() { return handleError(function (arg0, arg1, arg2, arg3) {
|
|
7156
|
+
const ret = arg0.call(arg1, arg2, arg3);
|
|
6979
7157
|
return ret;
|
|
6980
7158
|
}, arguments) };
|
|
6981
|
-
imports.wbg.
|
|
6982
|
-
const ret = arg0.call(arg1, arg2);
|
|
7159
|
+
imports.wbg.__wbg_call_36f1bbf64b4cf7c7 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
7160
|
+
const ret = arg0.call(arg1, arg2, arg3, arg4);
|
|
6983
7161
|
return ret;
|
|
6984
7162
|
}, arguments) };
|
|
6985
|
-
imports.wbg.
|
|
6986
|
-
const ret = arg0.call(arg1, arg2
|
|
7163
|
+
imports.wbg.__wbg_call_f2db6205e5c51dc8 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
7164
|
+
const ret = arg0.call(arg1, arg2);
|
|
6987
7165
|
return ret;
|
|
6988
7166
|
}, arguments) };
|
|
6989
|
-
imports.wbg.
|
|
7167
|
+
imports.wbg.__wbg_call_fbe8be8bf6436ce5 = function() { return handleError(function (arg0, arg1) {
|
|
6990
7168
|
const ret = arg0.call(arg1);
|
|
6991
7169
|
return ret;
|
|
6992
7170
|
}, arguments) };
|
|
@@ -7001,36 +7179,44 @@ function __wbg_get_imports() {
|
|
|
7001
7179
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
7002
7180
|
}
|
|
7003
7181
|
};
|
|
7004
|
-
imports.wbg.
|
|
7182
|
+
imports.wbg.__wbg_from_12ff8e47307bd4c7 = function(arg0) {
|
|
7005
7183
|
const ret = Array.from(arg0);
|
|
7006
7184
|
return ret;
|
|
7007
7185
|
};
|
|
7008
|
-
imports.wbg.
|
|
7186
|
+
imports.wbg.__wbg_get_a131a44bd1eb6979 = function(arg0, arg1) {
|
|
7009
7187
|
const ret = arg0[arg1 >>> 0];
|
|
7010
7188
|
return ret;
|
|
7011
7189
|
};
|
|
7012
|
-
imports.wbg.
|
|
7190
|
+
imports.wbg.__wbg_length_f00ec12454a5d9fd = function(arg0) {
|
|
7013
7191
|
const ret = arg0.length;
|
|
7014
7192
|
return ret;
|
|
7015
7193
|
};
|
|
7016
|
-
imports.wbg.
|
|
7017
|
-
console.log(arg0);
|
|
7018
|
-
};
|
|
7019
|
-
imports.wbg.__wbg_log_bf0922dbf69432a1 = function(arg0, arg1) {
|
|
7194
|
+
imports.wbg.__wbg_log_73e7856ded7435b4 = function(arg0, arg1) {
|
|
7020
7195
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
7021
7196
|
};
|
|
7022
|
-
imports.wbg.
|
|
7197
|
+
imports.wbg.__wbg_log_ea240990d83e374e = function(arg0) {
|
|
7198
|
+
console.log(arg0);
|
|
7199
|
+
};
|
|
7200
|
+
imports.wbg.__wbg_new_07b483f72211fd66 = function() {
|
|
7023
7201
|
const ret = new Object();
|
|
7024
7202
|
return ret;
|
|
7025
7203
|
};
|
|
7026
|
-
imports.wbg.
|
|
7204
|
+
imports.wbg.__wbg_new_58353953ad2097cc = function() {
|
|
7205
|
+
const ret = new Array();
|
|
7206
|
+
return ret;
|
|
7207
|
+
};
|
|
7208
|
+
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
|
|
7209
|
+
const ret = new Error();
|
|
7210
|
+
return ret;
|
|
7211
|
+
};
|
|
7212
|
+
imports.wbg.__wbg_new_e30c39c06edaabf2 = function(arg0, arg1) {
|
|
7027
7213
|
try {
|
|
7028
7214
|
var state0 = {a: arg0, b: arg1};
|
|
7029
7215
|
var cb0 = (arg0, arg1) => {
|
|
7030
7216
|
const a = state0.a;
|
|
7031
7217
|
state0.a = 0;
|
|
7032
7218
|
try {
|
|
7033
|
-
return
|
|
7219
|
+
return __wbg_adapter_486(a, state0.b, arg0, arg1);
|
|
7034
7220
|
} finally {
|
|
7035
7221
|
state0.a = a;
|
|
7036
7222
|
}
|
|
@@ -7041,40 +7227,36 @@ function __wbg_get_imports() {
|
|
|
7041
7227
|
state0.a = state0.b = 0;
|
|
7042
7228
|
}
|
|
7043
7229
|
};
|
|
7044
|
-
imports.wbg.
|
|
7045
|
-
const ret = new
|
|
7230
|
+
imports.wbg.__wbg_newfromslice_bcd6b1e87ab624a5 = function(arg0, arg1) {
|
|
7231
|
+
const ret = new Float64Array(getArrayF64FromWasm0(arg0, arg1));
|
|
7046
7232
|
return ret;
|
|
7047
7233
|
};
|
|
7048
|
-
imports.wbg.
|
|
7049
|
-
const ret = new Array();
|
|
7050
|
-
return ret;
|
|
7051
|
-
};
|
|
7052
|
-
imports.wbg.__wbg_new_no_args_ee98eee5275000a4 = function(arg0, arg1) {
|
|
7234
|
+
imports.wbg.__wbg_newnoargs_ff528e72d35de39a = function(arg0, arg1) {
|
|
7053
7235
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
7054
7236
|
return ret;
|
|
7055
7237
|
};
|
|
7056
|
-
imports.wbg.
|
|
7238
|
+
imports.wbg.__wbg_push_73fd7b5550ebf707 = function(arg0, arg1) {
|
|
7057
7239
|
const ret = arg0.push(arg1);
|
|
7058
7240
|
return ret;
|
|
7059
7241
|
};
|
|
7060
|
-
imports.wbg.
|
|
7242
|
+
imports.wbg.__wbg_queueMicrotask_46c1df247678729f = function(arg0) {
|
|
7243
|
+
queueMicrotask(arg0);
|
|
7244
|
+
};
|
|
7245
|
+
imports.wbg.__wbg_queueMicrotask_8acf3ccb75ed8d11 = function(arg0) {
|
|
7061
7246
|
const ret = arg0.queueMicrotask;
|
|
7062
7247
|
return ret;
|
|
7063
7248
|
};
|
|
7064
|
-
imports.wbg.
|
|
7065
|
-
queueMicrotask(arg0);
|
|
7066
|
-
};
|
|
7067
|
-
imports.wbg.__wbg_resolve_caf97c30b83f7053 = function(arg0) {
|
|
7249
|
+
imports.wbg.__wbg_resolve_0dac8c580ffd4678 = function(arg0) {
|
|
7068
7250
|
const ret = Promise.resolve(arg0);
|
|
7069
7251
|
return ret;
|
|
7070
7252
|
};
|
|
7071
7253
|
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
7072
7254
|
arg0[arg1] = arg2;
|
|
7073
7255
|
};
|
|
7074
|
-
imports.wbg.
|
|
7256
|
+
imports.wbg.__wbg_set_7422acbe992d64ab = function(arg0, arg1, arg2) {
|
|
7075
7257
|
arg0[arg1 >>> 0] = arg2;
|
|
7076
7258
|
};
|
|
7077
|
-
imports.wbg.
|
|
7259
|
+
imports.wbg.__wbg_set_c43293f93a35998a = function() { return handleError(function (arg0, arg1, arg2) {
|
|
7078
7260
|
const ret = Reflect.set(arg0, arg1, arg2);
|
|
7079
7261
|
return ret;
|
|
7080
7262
|
}, arguments) };
|
|
@@ -7085,23 +7267,23 @@ function __wbg_get_imports() {
|
|
|
7085
7267
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
7086
7268
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
7087
7269
|
};
|
|
7088
|
-
imports.wbg.
|
|
7270
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_487c52c58d65314d = function() {
|
|
7089
7271
|
const ret = typeof global === 'undefined' ? null : global;
|
|
7090
7272
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
7091
7273
|
};
|
|
7092
|
-
imports.wbg.
|
|
7274
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_ee9704f328b6b291 = function() {
|
|
7093
7275
|
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
7094
7276
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
7095
7277
|
};
|
|
7096
|
-
imports.wbg.
|
|
7278
|
+
imports.wbg.__wbg_static_accessor_SELF_78c9e3071b912620 = function() {
|
|
7097
7279
|
const ret = typeof self === 'undefined' ? null : self;
|
|
7098
7280
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
7099
7281
|
};
|
|
7100
|
-
imports.wbg.
|
|
7282
|
+
imports.wbg.__wbg_static_accessor_WINDOW_a093d21393777366 = function() {
|
|
7101
7283
|
const ret = typeof window === 'undefined' ? null : window;
|
|
7102
7284
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
7103
7285
|
};
|
|
7104
|
-
imports.wbg.
|
|
7286
|
+
imports.wbg.__wbg_then_db882932c0c714c6 = function(arg0, arg1) {
|
|
7105
7287
|
const ret = arg0.then(arg1);
|
|
7106
7288
|
return ret;
|
|
7107
7289
|
};
|
|
@@ -7121,35 +7303,38 @@ function __wbg_get_imports() {
|
|
|
7121
7303
|
const ret = WasmTropicalNumber.__wrap(arg0);
|
|
7122
7304
|
return ret;
|
|
7123
7305
|
};
|
|
7124
|
-
imports.wbg.
|
|
7125
|
-
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
7126
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
7127
|
-
return ret;
|
|
7128
|
-
};
|
|
7129
|
-
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
7130
|
-
// Cast intrinsic for `U64 -> Externref`.
|
|
7306
|
+
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
7131
7307
|
const ret = BigInt.asUintN(64, arg0);
|
|
7132
7308
|
return ret;
|
|
7133
7309
|
};
|
|
7134
|
-
imports.wbg.
|
|
7135
|
-
|
|
7136
|
-
|
|
7137
|
-
|
|
7138
|
-
|
|
7310
|
+
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
7311
|
+
const obj = arg0.original;
|
|
7312
|
+
if (obj.cnt-- == 1) {
|
|
7313
|
+
obj.a = 0;
|
|
7314
|
+
return true;
|
|
7315
|
+
}
|
|
7316
|
+
const ret = false;
|
|
7139
7317
|
return ret;
|
|
7140
7318
|
};
|
|
7141
|
-
imports.wbg.
|
|
7142
|
-
|
|
7143
|
-
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_e07ba2a7d21574bf___closure__destroy___dyn_core_a2b7f04d45112077___ops__function__FnMut__wasm_bindgen_e07ba2a7d21574bf___JsValue____Output_______, wasm_bindgen_e07ba2a7d21574bf___convert__closures_____invoke___wasm_bindgen_e07ba2a7d21574bf___JsValue_____);
|
|
7319
|
+
imports.wbg.__wbindgen_closure_wrapper1599 = function(arg0, arg1, arg2) {
|
|
7320
|
+
const ret = makeMutClosure(arg0, arg1, 39, __wbg_adapter_28);
|
|
7144
7321
|
return ret;
|
|
7145
7322
|
};
|
|
7146
|
-
imports.wbg.
|
|
7147
|
-
|
|
7148
|
-
const
|
|
7323
|
+
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
7324
|
+
const ret = debugString(arg1);
|
|
7325
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
7326
|
+
const len1 = WASM_VECTOR_LEN;
|
|
7327
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
7328
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
7329
|
+
};
|
|
7330
|
+
imports.wbg.__wbindgen_float64_array_new = function(arg0, arg1) {
|
|
7331
|
+
var v0 = getArrayF64FromWasm0(arg0, arg1).slice();
|
|
7332
|
+
wasm.__wbindgen_free(arg0, arg1 * 8, 8);
|
|
7333
|
+
const ret = v0;
|
|
7149
7334
|
return ret;
|
|
7150
7335
|
};
|
|
7151
7336
|
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
7152
|
-
const table = wasm.
|
|
7337
|
+
const table = wasm.__wbindgen_export_2;
|
|
7153
7338
|
const offset = table.grow(4);
|
|
7154
7339
|
table.set(0, undefined);
|
|
7155
7340
|
table.set(offset + 0, undefined);
|
|
@@ -7158,10 +7343,39 @@ function __wbg_get_imports() {
|
|
|
7158
7343
|
table.set(offset + 3, false);
|
|
7159
7344
|
;
|
|
7160
7345
|
};
|
|
7346
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
7347
|
+
const ret = typeof(arg0) === 'function';
|
|
7348
|
+
return ret;
|
|
7349
|
+
};
|
|
7350
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
7351
|
+
const ret = arg0 === undefined;
|
|
7352
|
+
return ret;
|
|
7353
|
+
};
|
|
7354
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
7355
|
+
const obj = arg1;
|
|
7356
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
7357
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
7358
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
7359
|
+
};
|
|
7360
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
7361
|
+
const ret = arg0;
|
|
7362
|
+
return ret;
|
|
7363
|
+
};
|
|
7364
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
7365
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
7366
|
+
return ret;
|
|
7367
|
+
};
|
|
7368
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
7369
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
7370
|
+
};
|
|
7161
7371
|
|
|
7162
7372
|
return imports;
|
|
7163
7373
|
}
|
|
7164
7374
|
|
|
7375
|
+
function __wbg_init_memory(imports, memory) {
|
|
7376
|
+
|
|
7377
|
+
}
|
|
7378
|
+
|
|
7165
7379
|
function __wbg_finalize_init(instance, module) {
|
|
7166
7380
|
wasm = instance.exports;
|
|
7167
7381
|
__wbg_init.__wbindgen_wasm_module = module;
|
|
@@ -7189,6 +7403,8 @@ function initSync(module) {
|
|
|
7189
7403
|
|
|
7190
7404
|
const imports = __wbg_get_imports();
|
|
7191
7405
|
|
|
7406
|
+
__wbg_init_memory(imports);
|
|
7407
|
+
|
|
7192
7408
|
if (!(module instanceof WebAssembly.Module)) {
|
|
7193
7409
|
module = new WebAssembly.Module(module);
|
|
7194
7410
|
}
|
|
@@ -7219,6 +7435,8 @@ async function __wbg_init(module_or_path) {
|
|
|
7219
7435
|
module_or_path = fetch(module_or_path);
|
|
7220
7436
|
}
|
|
7221
7437
|
|
|
7438
|
+
__wbg_init_memory(imports);
|
|
7439
|
+
|
|
7222
7440
|
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
7223
7441
|
|
|
7224
7442
|
return __wbg_finalize_init(instance, module);
|