wasm-bhtsne 0.2.1 → 0.3.2

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 CHANGED
@@ -19,7 +19,7 @@ npm i wasm-bhtsne
19
19
  ### Example
20
20
 
21
21
  ```javascript
22
- import {tSNE} from "wasm-bhtsne";
22
+ import { tSNE } from "wasm-bhtsne";
23
23
 
24
24
  function createRandomMatrix(rows, columns) {
25
25
  return Array.from({ length: rows }, () =>
@@ -27,10 +27,15 @@ function createRandomMatrix(rows, columns) {
27
27
  );
28
28
  }
29
29
 
30
- const data = createRandomMatrix(500, 4);
30
+ // create random points and dimensions
31
+ const data = createRandomMatrix(5000, 512);
31
32
 
32
33
  const tsne_encoder = new tSNE(data);
33
- const compressed_vectors = tsne_encoder.barnes_hut(0.5);
34
34
 
35
- console.log(compressed_vectors);
35
+ let compressed_vectors = []
36
+
37
+ // as argument the number of epochs,
38
+ compressed_vectors = tsne_encoder.barnes_hut(1000);
39
+
40
+ console.log("Compressed Vectors:", compressed_vectors);
36
41
  ```
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "lv291 <baiunco291@proton.me>"
5
5
  ],
6
6
  "description": "Exact and Barnes-Hut implementations of t-SNE in wasm",
7
- "version": "0.2.1",
7
+ "version": "0.3.2",
8
8
  "license": "MIT",
9
9
  "repository": {
10
10
  "type": "git",
@@ -13,13 +13,18 @@
13
13
  "files": [
14
14
  "wasm_bhtsne_bg.wasm",
15
15
  "wasm_bhtsne.js",
16
- "wasm_bhtsne_bg.js",
17
16
  "wasm_bhtsne.d.ts"
18
17
  ],
19
18
  "module": "wasm_bhtsne.js",
20
19
  "types": "wasm_bhtsne.d.ts",
21
20
  "sideEffects": [
22
- "./wasm_bhtsne.js",
23
21
  "./snippets/*"
22
+ ],
23
+ "keywords": [
24
+ "tsne",
25
+ "data-visualization",
26
+ "data-analysis",
27
+ "Barnes-Hut",
28
+ "machine-learning"
24
29
  ]
25
30
  }
package/wasm_bhtsne.d.ts CHANGED
@@ -11,20 +11,6 @@ export class tSNE {
11
11
  */
12
12
  constructor(vectors: Array<any>);
13
13
  /**
14
- * Performs a parallel exact version of the t-SNE algorithm. Pairwise distances between samples
15
- * in the input space will be computed accordingly to the supplied function `distance_f`.
16
- *
17
- * # Arguments
18
- *
19
- * `distance_f` - distance function.
20
- *
21
- * **Do note** that such a distance function needs not to be a metric distance, i.e. it is not
22
- * necessary for it so satisfy the triangle inequality. Consequently, the squared euclidean
23
- * distance, and many other, can be used.
24
- * @returns {Array<any>}
25
- */
26
- exact(): Array<any>;
27
- /**
28
14
  * Performs a parallel Barnes-Hut approximation of the t-SNE algorithm.
29
15
  *
30
16
  * # Arguments
@@ -40,84 +26,46 @@ export class tSNE {
40
26
  *
41
27
  * **Do note that** `metric_f` **must be a metric distance**, i.e. it must
42
28
  * satisfy the [triangle inequality](https://en.wikipedia.org/wiki/Triangle_inequality).
43
- * @param {number} theta
29
+ * @param {number} epochs
44
30
  * @returns {Array<any>}
45
31
  */
46
- barnes_hut(theta: number): Array<any>;
47
- /**
48
- * Returns the computed embedding.
49
- * @returns {Array<any>}
50
- */
51
- embedding(): Array<any>;
52
- /**
53
- * Sets a new value for the embedding dimension.
54
- *
55
- * # Arguments
56
- *
57
- * `embedding_dim` - new value for the embedding space dimensionality.
58
- */
59
- embedding_dim: number;
60
- /**
61
- * Sets new epochs, i.e the maximum number of fitting iterations.
62
- *
63
- * # Arguments
64
- *
65
- * `epochs` - new value for the epochs.
66
- */
67
- epochs: number;
68
- /**
69
- * Sets a new final momentum.
70
- *
71
- * # Arguments
72
- *
73
- * `final_momentum` - new value for the final momentum.
74
- */
75
- final_momentum: number;
76
- /**
77
- * Sets a new learning rate.
78
- *
79
- * # Arguments
80
- *
81
- * `learning_rate` - new value for the learning rate.
82
- */
83
- learning_rate: number;
84
- /**
85
- * Sets a new momentum.
86
- *
87
- * # Arguments
88
- *
89
- * `momentum` - new value for the momentum.
90
- */
91
- momentum: number;
32
+ barnes_hut(epochs: number): Array<any>;
92
33
  /**
93
- * Sets a new momentum switch epoch, i.e. the epoch after which the algorithm switches to
94
- * `final_momentum` for the map update.
95
- *
96
- * # Arguments
97
- *
98
- * `momentum_switch_epoch` - new value for the momentum switch epoch.
99
34
  */
100
- momentum_switch_epoch: number;
35
+ theta: number;
36
+ }
37
+
38
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
39
+
40
+ export interface InitOutput {
41
+ readonly memory: WebAssembly.Memory;
42
+ readonly __wbg_tsne_free: (a: number) => void;
43
+ readonly tsne_new: (a: number) => number;
44
+ readonly tsne_barnes_hut: (a: number, b: number) => number;
45
+ readonly tsne_set_theta: (a: number, b: number) => void;
46
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
47
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
48
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
49
+ readonly __wbindgen_exn_store: (a: number) => void;
50
+ }
51
+
52
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
101
53
  /**
102
- * Sets a new perplexity value.
103
- *
104
- * # Arguments
54
+ * Instantiates the given `module`, which can either be bytes or
55
+ * a precompiled `WebAssembly.Module`.
105
56
  *
106
- * `perplexity` - new value for the perplexity. It's used so that the bandwidth of the Gaussian
107
- * kernels, is set in such a way that the perplexity of each the conditional distribution *Pi*
108
- * equals a predefined perplexity *u*.
57
+ * @param {SyncInitInput} module
109
58
  *
110
- * A good value for perplexity lies between 5.0 and 50.0.
59
+ * @returns {InitOutput}
111
60
  */
112
- perplexity: number;
61
+ export function initSync(module: SyncInitInput): InitOutput;
62
+
113
63
  /**
114
- * Sets a new stop lying epoch, i.e. the epoch after which the P distribution values become
115
- * true, as defined in the original implementation. For epochs < `stop_lying_epoch` the values
116
- * of the P distribution are multiplied by a factor equal to `12.0`.
64
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
65
+ * for everything else, calls `WebAssembly.instantiate` directly.
117
66
  *
118
- * # Arguments
67
+ * @param {InitInput | Promise<InitInput>} module_or_path
119
68
  *
120
- * `stop_lying_epoch` - new value for the stop lying epoch.
69
+ * @returns {Promise<InitOutput>}
121
70
  */
122
- stop_lying_epoch: number;
123
- }
71
+ export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
package/wasm_bhtsne.js CHANGED
@@ -1,4 +1,530 @@
1
- import * as wasm from "./wasm_bhtsne_bg.wasm";
2
- import { __wbg_set_wasm } from "./wasm_bhtsne_bg.js";
3
- __wbg_set_wasm(wasm);
4
- export * from "./wasm_bhtsne_bg.js";
1
+ let wasm;
2
+
3
+ const heap = new Array(128).fill(undefined);
4
+
5
+ heap.push(undefined, null, true, false);
6
+
7
+ function getObject(idx) { return heap[idx]; }
8
+
9
+ let heap_next = heap.length;
10
+
11
+ function dropObject(idx) {
12
+ if (idx < 132) return;
13
+ heap[idx] = heap_next;
14
+ heap_next = idx;
15
+ }
16
+
17
+ function takeObject(idx) {
18
+ const ret = getObject(idx);
19
+ dropObject(idx);
20
+ return ret;
21
+ }
22
+
23
+ function isLikeNone(x) {
24
+ return x === undefined || x === null;
25
+ }
26
+
27
+ let cachedFloat64Memory0 = null;
28
+
29
+ function getFloat64Memory0() {
30
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
31
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
32
+ }
33
+ return cachedFloat64Memory0;
34
+ }
35
+
36
+ let cachedInt32Memory0 = null;
37
+
38
+ function getInt32Memory0() {
39
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
40
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
41
+ }
42
+ return cachedInt32Memory0;
43
+ }
44
+
45
+ const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
46
+
47
+ if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
48
+
49
+ let cachedUint8Memory0 = null;
50
+
51
+ function getUint8Memory0() {
52
+ if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
53
+ cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
54
+ }
55
+ return cachedUint8Memory0;
56
+ }
57
+
58
+ function getStringFromWasm0(ptr, len) {
59
+ ptr = ptr >>> 0;
60
+ return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
61
+ }
62
+
63
+ function addHeapObject(obj) {
64
+ if (heap_next === heap.length) heap.push(heap.length + 1);
65
+ const idx = heap_next;
66
+ heap_next = heap[idx];
67
+
68
+ heap[idx] = obj;
69
+ return idx;
70
+ }
71
+
72
+ function debugString(val) {
73
+ // primitive types
74
+ const type = typeof val;
75
+ if (type == 'number' || type == 'boolean' || val == null) {
76
+ return `${val}`;
77
+ }
78
+ if (type == 'string') {
79
+ return `"${val}"`;
80
+ }
81
+ if (type == 'symbol') {
82
+ const description = val.description;
83
+ if (description == null) {
84
+ return 'Symbol';
85
+ } else {
86
+ return `Symbol(${description})`;
87
+ }
88
+ }
89
+ if (type == 'function') {
90
+ const name = val.name;
91
+ if (typeof name == 'string' && name.length > 0) {
92
+ return `Function(${name})`;
93
+ } else {
94
+ return 'Function';
95
+ }
96
+ }
97
+ // objects
98
+ if (Array.isArray(val)) {
99
+ const length = val.length;
100
+ let debug = '[';
101
+ if (length > 0) {
102
+ debug += debugString(val[0]);
103
+ }
104
+ for(let i = 1; i < length; i++) {
105
+ debug += ', ' + debugString(val[i]);
106
+ }
107
+ debug += ']';
108
+ return debug;
109
+ }
110
+ // Test for built-in
111
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
112
+ let className;
113
+ if (builtInMatches.length > 1) {
114
+ className = builtInMatches[1];
115
+ } else {
116
+ // Failed to match the standard '[object ClassName]'
117
+ return toString.call(val);
118
+ }
119
+ if (className == 'Object') {
120
+ // we're a user defined class or Object
121
+ // JSON.stringify avoids problems with cycles, and is generally much
122
+ // easier than looping through ownProperties of `val`.
123
+ try {
124
+ return 'Object(' + JSON.stringify(val) + ')';
125
+ } catch (_) {
126
+ return 'Object';
127
+ }
128
+ }
129
+ // errors
130
+ if (val instanceof Error) {
131
+ return `${val.name}: ${val.message}\n${val.stack}`;
132
+ }
133
+ // TODO we could test for more things here, like `Set`s and `Map`s.
134
+ return className;
135
+ }
136
+
137
+ let WASM_VECTOR_LEN = 0;
138
+
139
+ const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
140
+
141
+ const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
142
+ ? function (arg, view) {
143
+ return cachedTextEncoder.encodeInto(arg, view);
144
+ }
145
+ : function (arg, view) {
146
+ const buf = cachedTextEncoder.encode(arg);
147
+ view.set(buf);
148
+ return {
149
+ read: arg.length,
150
+ written: buf.length
151
+ };
152
+ });
153
+
154
+ function passStringToWasm0(arg, malloc, realloc) {
155
+
156
+ if (realloc === undefined) {
157
+ const buf = cachedTextEncoder.encode(arg);
158
+ const ptr = malloc(buf.length, 1) >>> 0;
159
+ getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
160
+ WASM_VECTOR_LEN = buf.length;
161
+ return ptr;
162
+ }
163
+
164
+ let len = arg.length;
165
+ let ptr = malloc(len, 1) >>> 0;
166
+
167
+ const mem = getUint8Memory0();
168
+
169
+ let offset = 0;
170
+
171
+ for (; offset < len; offset++) {
172
+ const code = arg.charCodeAt(offset);
173
+ if (code > 0x7F) break;
174
+ mem[ptr + offset] = code;
175
+ }
176
+
177
+ if (offset !== len) {
178
+ if (offset !== 0) {
179
+ arg = arg.slice(offset);
180
+ }
181
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
182
+ const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
183
+ const ret = encodeString(arg, view);
184
+
185
+ offset += ret.written;
186
+ }
187
+
188
+ WASM_VECTOR_LEN = offset;
189
+ return ptr;
190
+ }
191
+
192
+ function handleError(f, args) {
193
+ try {
194
+ return f.apply(this, args);
195
+ } catch (e) {
196
+ wasm.__wbindgen_exn_store(addHeapObject(e));
197
+ }
198
+ }
199
+ /**
200
+ * t-distributed stochastic neighbor embedding. Provides a parallel implementation of both the
201
+ * exact version of the algorithm and the tree accelerated one leveraging space partitioning trees.
202
+ */
203
+ export class tSNE {
204
+
205
+ static __wrap(ptr) {
206
+ ptr = ptr >>> 0;
207
+ const obj = Object.create(tSNE.prototype);
208
+ obj.__wbg_ptr = ptr;
209
+
210
+ return obj;
211
+ }
212
+
213
+ __destroy_into_raw() {
214
+ const ptr = this.__wbg_ptr;
215
+ this.__wbg_ptr = 0;
216
+
217
+ return ptr;
218
+ }
219
+
220
+ free() {
221
+ const ptr = this.__destroy_into_raw();
222
+ wasm.__wbg_tsne_free(ptr);
223
+ }
224
+ /**
225
+ * @param {Array<any>} vectors
226
+ */
227
+ constructor(vectors) {
228
+ const ret = wasm.tsne_new(addHeapObject(vectors));
229
+ return tSNE.__wrap(ret);
230
+ }
231
+ /**
232
+ * Performs a parallel Barnes-Hut approximation of the t-SNE algorithm.
233
+ *
234
+ * # Arguments
235
+ *
236
+ * * `theta` - determines the accuracy of the approximation. Must be **strictly greater than
237
+ * 0.0**. Large values for θ increase the speed of the algorithm but decrease its accuracy.
238
+ * For small values of θ it is less probable that a cell in the space partitioning tree will
239
+ * be treated as a single point. For θ equal to 0.0 the method degenerates in the exact
240
+ * version.
241
+ *
242
+ * * `metric_f` - metric function.
243
+ *
244
+ *
245
+ * **Do note that** `metric_f` **must be a metric distance**, i.e. it must
246
+ * satisfy the [triangle inequality](https://en.wikipedia.org/wiki/Triangle_inequality).
247
+ * @param {number} epochs
248
+ * @returns {Array<any>}
249
+ */
250
+ barnes_hut(epochs) {
251
+ const ret = wasm.tsne_barnes_hut(this.__wbg_ptr, epochs);
252
+ return takeObject(ret);
253
+ }
254
+ /**
255
+ * @param {number} theta
256
+ */
257
+ set theta(theta) {
258
+ wasm.tsne_set_theta(this.__wbg_ptr, theta);
259
+ }
260
+ }
261
+
262
+ async function __wbg_load(module, imports) {
263
+ if (typeof Response === 'function' && module instanceof Response) {
264
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
265
+ try {
266
+ return await WebAssembly.instantiateStreaming(module, imports);
267
+
268
+ } catch (e) {
269
+ if (module.headers.get('Content-Type') != 'application/wasm') {
270
+ console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
271
+
272
+ } else {
273
+ throw e;
274
+ }
275
+ }
276
+ }
277
+
278
+ const bytes = await module.arrayBuffer();
279
+ return await WebAssembly.instantiate(bytes, imports);
280
+
281
+ } else {
282
+ const instance = await WebAssembly.instantiate(module, imports);
283
+
284
+ if (instance instanceof WebAssembly.Instance) {
285
+ return { instance, module };
286
+
287
+ } else {
288
+ return instance;
289
+ }
290
+ }
291
+ }
292
+
293
+ function __wbg_get_imports() {
294
+ const imports = {};
295
+ imports.wbg = {};
296
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
297
+ takeObject(arg0);
298
+ };
299
+ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
300
+ const obj = getObject(arg1);
301
+ const ret = typeof(obj) === 'number' ? obj : undefined;
302
+ getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
303
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
304
+ };
305
+ imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
306
+ const ret = new Error();
307
+ return addHeapObject(ret);
308
+ };
309
+ imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
310
+ const ret = getObject(arg1).stack;
311
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
312
+ const len1 = WASM_VECTOR_LEN;
313
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
314
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
315
+ };
316
+ imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
317
+ let deferred0_0;
318
+ let deferred0_1;
319
+ try {
320
+ deferred0_0 = arg0;
321
+ deferred0_1 = arg1;
322
+ console.error(getStringFromWasm0(arg0, arg1));
323
+ } finally {
324
+ wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
325
+ }
326
+ };
327
+ imports.wbg.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) {
328
+ getObject(arg0).randomFillSync(takeObject(arg1));
329
+ }, arguments) };
330
+ imports.wbg.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) {
331
+ getObject(arg0).getRandomValues(getObject(arg1));
332
+ }, arguments) };
333
+ imports.wbg.__wbg_crypto_c48a774b022d20ac = function(arg0) {
334
+ const ret = getObject(arg0).crypto;
335
+ return addHeapObject(ret);
336
+ };
337
+ imports.wbg.__wbindgen_is_object = function(arg0) {
338
+ const val = getObject(arg0);
339
+ const ret = typeof(val) === 'object' && val !== null;
340
+ return ret;
341
+ };
342
+ imports.wbg.__wbg_process_298734cf255a885d = function(arg0) {
343
+ const ret = getObject(arg0).process;
344
+ return addHeapObject(ret);
345
+ };
346
+ imports.wbg.__wbg_versions_e2e78e134e3e5d01 = function(arg0) {
347
+ const ret = getObject(arg0).versions;
348
+ return addHeapObject(ret);
349
+ };
350
+ imports.wbg.__wbg_node_1cd7a5d853dbea79 = function(arg0) {
351
+ const ret = getObject(arg0).node;
352
+ return addHeapObject(ret);
353
+ };
354
+ imports.wbg.__wbindgen_is_string = function(arg0) {
355
+ const ret = typeof(getObject(arg0)) === 'string';
356
+ return ret;
357
+ };
358
+ imports.wbg.__wbg_require_8f08ceecec0f4fee = function() { return handleError(function () {
359
+ const ret = module.require;
360
+ return addHeapObject(ret);
361
+ }, arguments) };
362
+ imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
363
+ const ret = getStringFromWasm0(arg0, arg1);
364
+ return addHeapObject(ret);
365
+ };
366
+ imports.wbg.__wbg_msCrypto_bcb970640f50a1e8 = function(arg0) {
367
+ const ret = getObject(arg0).msCrypto;
368
+ return addHeapObject(ret);
369
+ };
370
+ imports.wbg.__wbg_get_44be0491f933a435 = function(arg0, arg1) {
371
+ const ret = getObject(arg0)[arg1 >>> 0];
372
+ return addHeapObject(ret);
373
+ };
374
+ imports.wbg.__wbg_length_fff51ee6522a1a18 = function(arg0) {
375
+ const ret = getObject(arg0).length;
376
+ return ret;
377
+ };
378
+ imports.wbg.__wbg_new_898a68150f225f2e = function() {
379
+ const ret = new Array();
380
+ return addHeapObject(ret);
381
+ };
382
+ imports.wbg.__wbindgen_is_function = function(arg0) {
383
+ const ret = typeof(getObject(arg0)) === 'function';
384
+ return ret;
385
+ };
386
+ imports.wbg.__wbg_newnoargs_581967eacc0e2604 = function(arg0, arg1) {
387
+ const ret = new Function(getStringFromWasm0(arg0, arg1));
388
+ return addHeapObject(ret);
389
+ };
390
+ imports.wbg.__wbg_call_cb65541d95d71282 = function() { return handleError(function (arg0, arg1) {
391
+ const ret = getObject(arg0).call(getObject(arg1));
392
+ return addHeapObject(ret);
393
+ }, arguments) };
394
+ imports.wbg.__wbg_self_1ff1d729e9aae938 = function() { return handleError(function () {
395
+ const ret = self.self;
396
+ return addHeapObject(ret);
397
+ }, arguments) };
398
+ imports.wbg.__wbg_window_5f4faef6c12b79ec = function() { return handleError(function () {
399
+ const ret = window.window;
400
+ return addHeapObject(ret);
401
+ }, arguments) };
402
+ imports.wbg.__wbg_globalThis_1d39714405582d3c = function() { return handleError(function () {
403
+ const ret = globalThis.globalThis;
404
+ return addHeapObject(ret);
405
+ }, arguments) };
406
+ imports.wbg.__wbg_global_651f05c6a0944d1c = function() { return handleError(function () {
407
+ const ret = global.global;
408
+ return addHeapObject(ret);
409
+ }, arguments) };
410
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
411
+ const ret = getObject(arg0) === undefined;
412
+ return ret;
413
+ };
414
+ imports.wbg.__wbg_isArray_4c24b343cb13cfb1 = function(arg0) {
415
+ const ret = Array.isArray(getObject(arg0));
416
+ return ret;
417
+ };
418
+ imports.wbg.__wbg_push_ca1c26067ef907ac = function(arg0, arg1) {
419
+ const ret = getObject(arg0).push(getObject(arg1));
420
+ return ret;
421
+ };
422
+ imports.wbg.__wbg_call_01734de55d61e11d = function() { return handleError(function (arg0, arg1, arg2) {
423
+ const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
424
+ return addHeapObject(ret);
425
+ }, arguments) };
426
+ imports.wbg.__wbg_buffer_085ec1f694018c4f = function(arg0) {
427
+ const ret = getObject(arg0).buffer;
428
+ return addHeapObject(ret);
429
+ };
430
+ imports.wbg.__wbg_newwithbyteoffsetandlength_6da8e527659b86aa = function(arg0, arg1, arg2) {
431
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
432
+ return addHeapObject(ret);
433
+ };
434
+ imports.wbg.__wbg_new_8125e318e6245eed = function(arg0) {
435
+ const ret = new Uint8Array(getObject(arg0));
436
+ return addHeapObject(ret);
437
+ };
438
+ imports.wbg.__wbg_set_5cf90238115182c3 = function(arg0, arg1, arg2) {
439
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
440
+ };
441
+ imports.wbg.__wbg_newwithbyteoffsetandlength_69193e31c844b792 = function(arg0, arg1, arg2) {
442
+ const ret = new Float32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
443
+ return addHeapObject(ret);
444
+ };
445
+ imports.wbg.__wbg_new_d086a66d1c264b3f = function(arg0) {
446
+ const ret = new Float32Array(getObject(arg0));
447
+ return addHeapObject(ret);
448
+ };
449
+ imports.wbg.__wbg_newwithlength_e5d69174d6984cd7 = function(arg0) {
450
+ const ret = new Uint8Array(arg0 >>> 0);
451
+ return addHeapObject(ret);
452
+ };
453
+ imports.wbg.__wbg_subarray_13db269f57aa838d = function(arg0, arg1, arg2) {
454
+ const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
455
+ return addHeapObject(ret);
456
+ };
457
+ imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
458
+ const ret = getObject(arg0);
459
+ return addHeapObject(ret);
460
+ };
461
+ imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
462
+ const ret = debugString(getObject(arg1));
463
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
464
+ const len1 = WASM_VECTOR_LEN;
465
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
466
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
467
+ };
468
+ imports.wbg.__wbindgen_throw = function(arg0, arg1) {
469
+ throw new Error(getStringFromWasm0(arg0, arg1));
470
+ };
471
+ imports.wbg.__wbindgen_memory = function() {
472
+ const ret = wasm.memory;
473
+ return addHeapObject(ret);
474
+ };
475
+
476
+ return imports;
477
+ }
478
+
479
+ function __wbg_init_memory(imports, maybe_memory) {
480
+
481
+ }
482
+
483
+ function __wbg_finalize_init(instance, module) {
484
+ wasm = instance.exports;
485
+ __wbg_init.__wbindgen_wasm_module = module;
486
+ cachedFloat64Memory0 = null;
487
+ cachedInt32Memory0 = null;
488
+ cachedUint8Memory0 = null;
489
+
490
+
491
+ return wasm;
492
+ }
493
+
494
+ function initSync(module) {
495
+ if (wasm !== undefined) return wasm;
496
+
497
+ const imports = __wbg_get_imports();
498
+
499
+ __wbg_init_memory(imports);
500
+
501
+ if (!(module instanceof WebAssembly.Module)) {
502
+ module = new WebAssembly.Module(module);
503
+ }
504
+
505
+ const instance = new WebAssembly.Instance(module, imports);
506
+
507
+ return __wbg_finalize_init(instance, module);
508
+ }
509
+
510
+ async function __wbg_init(input) {
511
+ if (wasm !== undefined) return wasm;
512
+
513
+ if (typeof input === 'undefined') {
514
+ input = new URL('wasm_bhtsne_bg.wasm', import.meta.url);
515
+ }
516
+ const imports = __wbg_get_imports();
517
+
518
+ if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
519
+ input = fetch(input);
520
+ }
521
+
522
+ __wbg_init_memory(imports);
523
+
524
+ const { instance, module } = await __wbg_load(await input, imports);
525
+
526
+ return __wbg_finalize_init(instance, module);
527
+ }
528
+
529
+ export { initSync }
530
+ export default __wbg_init;
Binary file
package/wasm_bhtsne_bg.js DELETED
@@ -1,604 +0,0 @@
1
- let wasm;
2
- export function __wbg_set_wasm(val) {
3
- wasm = val;
4
- }
5
-
6
-
7
- const heap = new Array(128).fill(undefined);
8
-
9
- heap.push(undefined, null, true, false);
10
-
11
- function getObject(idx) { return heap[idx]; }
12
-
13
- let heap_next = heap.length;
14
-
15
- function dropObject(idx) {
16
- if (idx < 132) return;
17
- heap[idx] = heap_next;
18
- heap_next = idx;
19
- }
20
-
21
- function takeObject(idx) {
22
- const ret = getObject(idx);
23
- dropObject(idx);
24
- return ret;
25
- }
26
-
27
- function isLikeNone(x) {
28
- return x === undefined || x === null;
29
- }
30
-
31
- let cachedFloat64Memory0 = null;
32
-
33
- function getFloat64Memory0() {
34
- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
35
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
36
- }
37
- return cachedFloat64Memory0;
38
- }
39
-
40
- let cachedInt32Memory0 = null;
41
-
42
- function getInt32Memory0() {
43
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
44
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
45
- }
46
- return cachedInt32Memory0;
47
- }
48
-
49
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
50
-
51
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
52
-
53
- cachedTextDecoder.decode();
54
-
55
- let cachedUint8Memory0 = null;
56
-
57
- function getUint8Memory0() {
58
- if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
59
- cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
60
- }
61
- return cachedUint8Memory0;
62
- }
63
-
64
- function getStringFromWasm0(ptr, len) {
65
- ptr = ptr >>> 0;
66
- return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
67
- }
68
-
69
- function addHeapObject(obj) {
70
- if (heap_next === heap.length) heap.push(heap.length + 1);
71
- const idx = heap_next;
72
- heap_next = heap[idx];
73
-
74
- heap[idx] = obj;
75
- return idx;
76
- }
77
-
78
- function debugString(val) {
79
- // primitive types
80
- const type = typeof val;
81
- if (type == 'number' || type == 'boolean' || val == null) {
82
- return `${val}`;
83
- }
84
- if (type == 'string') {
85
- return `"${val}"`;
86
- }
87
- if (type == 'symbol') {
88
- const description = val.description;
89
- if (description == null) {
90
- return 'Symbol';
91
- } else {
92
- return `Symbol(${description})`;
93
- }
94
- }
95
- if (type == 'function') {
96
- const name = val.name;
97
- if (typeof name == 'string' && name.length > 0) {
98
- return `Function(${name})`;
99
- } else {
100
- return 'Function';
101
- }
102
- }
103
- // objects
104
- if (Array.isArray(val)) {
105
- const length = val.length;
106
- let debug = '[';
107
- if (length > 0) {
108
- debug += debugString(val[0]);
109
- }
110
- for(let i = 1; i < length; i++) {
111
- debug += ', ' + debugString(val[i]);
112
- }
113
- debug += ']';
114
- return debug;
115
- }
116
- // Test for built-in
117
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
118
- let className;
119
- if (builtInMatches.length > 1) {
120
- className = builtInMatches[1];
121
- } else {
122
- // Failed to match the standard '[object ClassName]'
123
- return toString.call(val);
124
- }
125
- if (className == 'Object') {
126
- // we're a user defined class or Object
127
- // JSON.stringify avoids problems with cycles, and is generally much
128
- // easier than looping through ownProperties of `val`.
129
- try {
130
- return 'Object(' + JSON.stringify(val) + ')';
131
- } catch (_) {
132
- return 'Object';
133
- }
134
- }
135
- // errors
136
- if (val instanceof Error) {
137
- return `${val.name}: ${val.message}\n${val.stack}`;
138
- }
139
- // TODO we could test for more things here, like `Set`s and `Map`s.
140
- return className;
141
- }
142
-
143
- let WASM_VECTOR_LEN = 0;
144
-
145
- const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
146
-
147
- let cachedTextEncoder = new lTextEncoder('utf-8');
148
-
149
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
150
- ? function (arg, view) {
151
- return cachedTextEncoder.encodeInto(arg, view);
152
- }
153
- : function (arg, view) {
154
- const buf = cachedTextEncoder.encode(arg);
155
- view.set(buf);
156
- return {
157
- read: arg.length,
158
- written: buf.length
159
- };
160
- });
161
-
162
- function passStringToWasm0(arg, malloc, realloc) {
163
-
164
- if (realloc === undefined) {
165
- const buf = cachedTextEncoder.encode(arg);
166
- const ptr = malloc(buf.length, 1) >>> 0;
167
- getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
168
- WASM_VECTOR_LEN = buf.length;
169
- return ptr;
170
- }
171
-
172
- let len = arg.length;
173
- let ptr = malloc(len, 1) >>> 0;
174
-
175
- const mem = getUint8Memory0();
176
-
177
- let offset = 0;
178
-
179
- for (; offset < len; offset++) {
180
- const code = arg.charCodeAt(offset);
181
- if (code > 0x7F) break;
182
- mem[ptr + offset] = code;
183
- }
184
-
185
- if (offset !== len) {
186
- if (offset !== 0) {
187
- arg = arg.slice(offset);
188
- }
189
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
190
- const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
191
- const ret = encodeString(arg, view);
192
-
193
- offset += ret.written;
194
- }
195
-
196
- WASM_VECTOR_LEN = offset;
197
- return ptr;
198
- }
199
-
200
- function handleError(f, args) {
201
- try {
202
- return f.apply(this, args);
203
- } catch (e) {
204
- wasm.__wbindgen_exn_store(addHeapObject(e));
205
- }
206
- }
207
- /**
208
- * t-distributed stochastic neighbor embedding. Provides a parallel implementation of both the
209
- * exact version of the algorithm and the tree accelerated one leveraging space partitioning trees.
210
- */
211
- export class tSNE {
212
-
213
- static __wrap(ptr) {
214
- ptr = ptr >>> 0;
215
- const obj = Object.create(tSNE.prototype);
216
- obj.__wbg_ptr = ptr;
217
-
218
- return obj;
219
- }
220
-
221
- __destroy_into_raw() {
222
- const ptr = this.__wbg_ptr;
223
- this.__wbg_ptr = 0;
224
-
225
- return ptr;
226
- }
227
-
228
- free() {
229
- const ptr = this.__destroy_into_raw();
230
- wasm.__wbg_tsne_free(ptr);
231
- }
232
- /**
233
- * @param {Array<any>} vectors
234
- */
235
- constructor(vectors) {
236
- const ret = wasm.tsne_new(addHeapObject(vectors));
237
- return tSNE.__wrap(ret);
238
- }
239
- /**
240
- * Performs a parallel exact version of the t-SNE algorithm. Pairwise distances between samples
241
- * in the input space will be computed accordingly to the supplied function `distance_f`.
242
- *
243
- * # Arguments
244
- *
245
- * `distance_f` - distance function.
246
- *
247
- * **Do note** that such a distance function needs not to be a metric distance, i.e. it is not
248
- * necessary for it so satisfy the triangle inequality. Consequently, the squared euclidean
249
- * distance, and many other, can be used.
250
- * @returns {Array<any>}
251
- */
252
- exact() {
253
- const ret = wasm.tsne_exact(this.__wbg_ptr);
254
- return takeObject(ret);
255
- }
256
- /**
257
- * Performs a parallel Barnes-Hut approximation of the t-SNE algorithm.
258
- *
259
- * # Arguments
260
- *
261
- * * `theta` - determines the accuracy of the approximation. Must be **strictly greater than
262
- * 0.0**. Large values for θ increase the speed of the algorithm but decrease its accuracy.
263
- * For small values of θ it is less probable that a cell in the space partitioning tree will
264
- * be treated as a single point. For θ equal to 0.0 the method degenerates in the exact
265
- * version.
266
- *
267
- * * `metric_f` - metric function.
268
- *
269
- *
270
- * **Do note that** `metric_f` **must be a metric distance**, i.e. it must
271
- * satisfy the [triangle inequality](https://en.wikipedia.org/wiki/Triangle_inequality).
272
- * @param {number} theta
273
- * @returns {Array<any>}
274
- */
275
- barnes_hut(theta) {
276
- const ret = wasm.tsne_barnes_hut(this.__wbg_ptr, theta);
277
- return takeObject(ret);
278
- }
279
- /**
280
- * Sets a new learning rate.
281
- *
282
- * # Arguments
283
- *
284
- * `learning_rate` - new value for the learning rate.
285
- * @param {number} learning_rate
286
- */
287
- set learning_rate(learning_rate) {
288
- wasm.tsne_set_learning_rate(this.__wbg_ptr, learning_rate);
289
- }
290
- /**
291
- * Sets new epochs, i.e the maximum number of fitting iterations.
292
- *
293
- * # Arguments
294
- *
295
- * `epochs` - new value for the epochs.
296
- * @param {number} epochs
297
- */
298
- set epochs(epochs) {
299
- wasm.tsne_set_epochs(this.__wbg_ptr, epochs);
300
- }
301
- /**
302
- * Sets a new momentum.
303
- *
304
- * # Arguments
305
- *
306
- * `momentum` - new value for the momentum.
307
- * @param {number} momentum
308
- */
309
- set momentum(momentum) {
310
- wasm.tsne_set_momentum(this.__wbg_ptr, momentum);
311
- }
312
- /**
313
- * Sets a new final momentum.
314
- *
315
- * # Arguments
316
- *
317
- * `final_momentum` - new value for the final momentum.
318
- * @param {number} final_momentum
319
- */
320
- set final_momentum(final_momentum) {
321
- wasm.tsne_set_final_momentum(this.__wbg_ptr, final_momentum);
322
- }
323
- /**
324
- * Sets a new momentum switch epoch, i.e. the epoch after which the algorithm switches to
325
- * `final_momentum` for the map update.
326
- *
327
- * # Arguments
328
- *
329
- * `momentum_switch_epoch` - new value for the momentum switch epoch.
330
- * @param {number} momentum_switch_epoch
331
- */
332
- set momentum_switch_epoch(momentum_switch_epoch) {
333
- wasm.tsne_set_momentum_switch_epoch(this.__wbg_ptr, momentum_switch_epoch);
334
- }
335
- /**
336
- * Sets a new stop lying epoch, i.e. the epoch after which the P distribution values become
337
- * true, as defined in the original implementation. For epochs < `stop_lying_epoch` the values
338
- * of the P distribution are multiplied by a factor equal to `12.0`.
339
- *
340
- * # Arguments
341
- *
342
- * `stop_lying_epoch` - new value for the stop lying epoch.
343
- * @param {number} stop_lying_epoch
344
- */
345
- set stop_lying_epoch(stop_lying_epoch) {
346
- wasm.tsne_set_stop_lying_epoch(this.__wbg_ptr, stop_lying_epoch);
347
- }
348
- /**
349
- * Sets a new value for the embedding dimension.
350
- *
351
- * # Arguments
352
- *
353
- * `embedding_dim` - new value for the embedding space dimensionality.
354
- * @param {number} embedding_dim
355
- */
356
- set embedding_dim(embedding_dim) {
357
- wasm.tsne_set_embedding_dim(this.__wbg_ptr, embedding_dim);
358
- }
359
- /**
360
- * Sets a new perplexity value.
361
- *
362
- * # Arguments
363
- *
364
- * `perplexity` - new value for the perplexity. It's used so that the bandwidth of the Gaussian
365
- * kernels, is set in such a way that the perplexity of each the conditional distribution *Pi*
366
- * equals a predefined perplexity *u*.
367
- *
368
- * A good value for perplexity lies between 5.0 and 50.0.
369
- * @param {number} perplexity
370
- */
371
- set perplexity(perplexity) {
372
- wasm.tsne_set_perplexity(this.__wbg_ptr, perplexity);
373
- }
374
- /**
375
- * Returns the computed embedding.
376
- * @returns {Array<any>}
377
- */
378
- embedding() {
379
- const ret = wasm.tsne_embedding(this.__wbg_ptr);
380
- return takeObject(ret);
381
- }
382
- }
383
-
384
- export function __wbindgen_object_drop_ref(arg0) {
385
- takeObject(arg0);
386
- };
387
-
388
- export function __wbindgen_number_get(arg0, arg1) {
389
- const obj = getObject(arg1);
390
- const ret = typeof(obj) === 'number' ? obj : undefined;
391
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
392
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
393
- };
394
-
395
- export function __wbg_new_abda76e883ba8a5f() {
396
- const ret = new Error();
397
- return addHeapObject(ret);
398
- };
399
-
400
- export function __wbg_stack_658279fe44541cf6(arg0, arg1) {
401
- const ret = getObject(arg1).stack;
402
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
403
- const len1 = WASM_VECTOR_LEN;
404
- getInt32Memory0()[arg0 / 4 + 1] = len1;
405
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
406
- };
407
-
408
- export function __wbg_error_f851667af71bcfc6(arg0, arg1) {
409
- let deferred0_0;
410
- let deferred0_1;
411
- try {
412
- deferred0_0 = arg0;
413
- deferred0_1 = arg1;
414
- console.error(getStringFromWasm0(arg0, arg1));
415
- } finally {
416
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
417
- }
418
- };
419
-
420
- export function __wbg_randomFillSync_dc1e9a60c158336d() { return handleError(function (arg0, arg1) {
421
- getObject(arg0).randomFillSync(takeObject(arg1));
422
- }, arguments) };
423
-
424
- export function __wbg_getRandomValues_37fa2ca9e4e07fab() { return handleError(function (arg0, arg1) {
425
- getObject(arg0).getRandomValues(getObject(arg1));
426
- }, arguments) };
427
-
428
- export function __wbg_crypto_c48a774b022d20ac(arg0) {
429
- const ret = getObject(arg0).crypto;
430
- return addHeapObject(ret);
431
- };
432
-
433
- export function __wbindgen_is_object(arg0) {
434
- const val = getObject(arg0);
435
- const ret = typeof(val) === 'object' && val !== null;
436
- return ret;
437
- };
438
-
439
- export function __wbg_process_298734cf255a885d(arg0) {
440
- const ret = getObject(arg0).process;
441
- return addHeapObject(ret);
442
- };
443
-
444
- export function __wbg_versions_e2e78e134e3e5d01(arg0) {
445
- const ret = getObject(arg0).versions;
446
- return addHeapObject(ret);
447
- };
448
-
449
- export function __wbg_node_1cd7a5d853dbea79(arg0) {
450
- const ret = getObject(arg0).node;
451
- return addHeapObject(ret);
452
- };
453
-
454
- export function __wbindgen_is_string(arg0) {
455
- const ret = typeof(getObject(arg0)) === 'string';
456
- return ret;
457
- };
458
-
459
- export function __wbg_require_8f08ceecec0f4fee() { return handleError(function () {
460
- const ret = module.require;
461
- return addHeapObject(ret);
462
- }, arguments) };
463
-
464
- export function __wbindgen_string_new(arg0, arg1) {
465
- const ret = getStringFromWasm0(arg0, arg1);
466
- return addHeapObject(ret);
467
- };
468
-
469
- export function __wbg_msCrypto_bcb970640f50a1e8(arg0) {
470
- const ret = getObject(arg0).msCrypto;
471
- return addHeapObject(ret);
472
- };
473
-
474
- export function __wbg_get_44be0491f933a435(arg0, arg1) {
475
- const ret = getObject(arg0)[arg1 >>> 0];
476
- return addHeapObject(ret);
477
- };
478
-
479
- export function __wbg_length_fff51ee6522a1a18(arg0) {
480
- const ret = getObject(arg0).length;
481
- return ret;
482
- };
483
-
484
- export function __wbg_new_898a68150f225f2e() {
485
- const ret = new Array();
486
- return addHeapObject(ret);
487
- };
488
-
489
- export function __wbindgen_is_function(arg0) {
490
- const ret = typeof(getObject(arg0)) === 'function';
491
- return ret;
492
- };
493
-
494
- export function __wbg_newnoargs_581967eacc0e2604(arg0, arg1) {
495
- const ret = new Function(getStringFromWasm0(arg0, arg1));
496
- return addHeapObject(ret);
497
- };
498
-
499
- export function __wbg_call_cb65541d95d71282() { return handleError(function (arg0, arg1) {
500
- const ret = getObject(arg0).call(getObject(arg1));
501
- return addHeapObject(ret);
502
- }, arguments) };
503
-
504
- export function __wbg_self_1ff1d729e9aae938() { return handleError(function () {
505
- const ret = self.self;
506
- return addHeapObject(ret);
507
- }, arguments) };
508
-
509
- export function __wbg_window_5f4faef6c12b79ec() { return handleError(function () {
510
- const ret = window.window;
511
- return addHeapObject(ret);
512
- }, arguments) };
513
-
514
- export function __wbg_globalThis_1d39714405582d3c() { return handleError(function () {
515
- const ret = globalThis.globalThis;
516
- return addHeapObject(ret);
517
- }, arguments) };
518
-
519
- export function __wbg_global_651f05c6a0944d1c() { return handleError(function () {
520
- const ret = global.global;
521
- return addHeapObject(ret);
522
- }, arguments) };
523
-
524
- export function __wbindgen_is_undefined(arg0) {
525
- const ret = getObject(arg0) === undefined;
526
- return ret;
527
- };
528
-
529
- export function __wbg_isArray_4c24b343cb13cfb1(arg0) {
530
- const ret = Array.isArray(getObject(arg0));
531
- return ret;
532
- };
533
-
534
- export function __wbg_push_ca1c26067ef907ac(arg0, arg1) {
535
- const ret = getObject(arg0).push(getObject(arg1));
536
- return ret;
537
- };
538
-
539
- export function __wbg_call_01734de55d61e11d() { return handleError(function (arg0, arg1, arg2) {
540
- const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
541
- return addHeapObject(ret);
542
- }, arguments) };
543
-
544
- export function __wbg_buffer_085ec1f694018c4f(arg0) {
545
- const ret = getObject(arg0).buffer;
546
- return addHeapObject(ret);
547
- };
548
-
549
- export function __wbg_newwithbyteoffsetandlength_6da8e527659b86aa(arg0, arg1, arg2) {
550
- const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
551
- return addHeapObject(ret);
552
- };
553
-
554
- export function __wbg_new_8125e318e6245eed(arg0) {
555
- const ret = new Uint8Array(getObject(arg0));
556
- return addHeapObject(ret);
557
- };
558
-
559
- export function __wbg_set_5cf90238115182c3(arg0, arg1, arg2) {
560
- getObject(arg0).set(getObject(arg1), arg2 >>> 0);
561
- };
562
-
563
- export function __wbg_newwithbyteoffsetandlength_69193e31c844b792(arg0, arg1, arg2) {
564
- const ret = new Float32Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
565
- return addHeapObject(ret);
566
- };
567
-
568
- export function __wbg_new_d086a66d1c264b3f(arg0) {
569
- const ret = new Float32Array(getObject(arg0));
570
- return addHeapObject(ret);
571
- };
572
-
573
- export function __wbg_newwithlength_e5d69174d6984cd7(arg0) {
574
- const ret = new Uint8Array(arg0 >>> 0);
575
- return addHeapObject(ret);
576
- };
577
-
578
- export function __wbg_subarray_13db269f57aa838d(arg0, arg1, arg2) {
579
- const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
580
- return addHeapObject(ret);
581
- };
582
-
583
- export function __wbindgen_object_clone_ref(arg0) {
584
- const ret = getObject(arg0);
585
- return addHeapObject(ret);
586
- };
587
-
588
- export function __wbindgen_debug_string(arg0, arg1) {
589
- const ret = debugString(getObject(arg1));
590
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
591
- const len1 = WASM_VECTOR_LEN;
592
- getInt32Memory0()[arg0 / 4 + 1] = len1;
593
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
594
- };
595
-
596
- export function __wbindgen_throw(arg0, arg1) {
597
- throw new Error(getStringFromWasm0(arg0, arg1));
598
- };
599
-
600
- export function __wbindgen_memory() {
601
- const ret = wasm.memory;
602
- return addHeapObject(ret);
603
- };
604
-