@justinelliottcobb/amari-wasm 0.19.1 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -3
- package/amari_wasm.d.ts +890 -5
- package/amari_wasm.js +2941 -772
- package/amari_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/amari_wasm.js
CHANGED
|
@@ -838,13 +838,31 @@ function getArrayF32FromWasm0(ptr, len) {
|
|
|
838
838
|
return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
839
839
|
}
|
|
840
840
|
function __wbg_adapter_30(arg0, arg1, arg2) {
|
|
841
|
-
wasm.
|
|
841
|
+
wasm.closure77_externref_shim(arg0, arg1, arg2);
|
|
842
842
|
}
|
|
843
843
|
|
|
844
|
-
function
|
|
845
|
-
wasm.
|
|
844
|
+
function __wbg_adapter_1132(arg0, arg1, arg2, arg3) {
|
|
845
|
+
wasm.closure71_externref_shim(arg0, arg1, arg2, arg3);
|
|
846
846
|
}
|
|
847
847
|
|
|
848
|
+
/**
|
|
849
|
+
* Tie-handling policy for branch-sensitive dual-number min/max operations.
|
|
850
|
+
* @enum {0 | 1 | 2}
|
|
851
|
+
*/
|
|
852
|
+
export const WasmBranchPolicy = Object.freeze({
|
|
853
|
+
/**
|
|
854
|
+
* Preserve the left operand derivative on ties.
|
|
855
|
+
*/
|
|
856
|
+
Left: 0, "0": "Left",
|
|
857
|
+
/**
|
|
858
|
+
* Preserve the right operand derivative on ties.
|
|
859
|
+
*/
|
|
860
|
+
Right: 1, "1": "Right",
|
|
861
|
+
/**
|
|
862
|
+
* Average derivatives on ties.
|
|
863
|
+
*/
|
|
864
|
+
Average: 2, "2": "Average",
|
|
865
|
+
});
|
|
848
866
|
/**
|
|
849
867
|
* Integration methods available in WASM
|
|
850
868
|
* @enum {0 | 1 | 2 | 3 | 4}
|
|
@@ -3030,6 +3048,28 @@ export class TropicalBatch {
|
|
|
3030
3048
|
const ptr = this.__destroy_into_raw();
|
|
3031
3049
|
wasm.__wbg_tropicalbatch_free(ptr, 0);
|
|
3032
3050
|
}
|
|
3051
|
+
/**
|
|
3052
|
+
* Fold values with tropical addition (`max`).
|
|
3053
|
+
* @param {Float64Array} values
|
|
3054
|
+
* @returns {number}
|
|
3055
|
+
*/
|
|
3056
|
+
static foldOplus(values) {
|
|
3057
|
+
const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_malloc);
|
|
3058
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3059
|
+
const ret = wasm.tropicalbatch_batchTropicalAdd(ptr0, len0);
|
|
3060
|
+
return ret;
|
|
3061
|
+
}
|
|
3062
|
+
/**
|
|
3063
|
+
* Fold values with tropical multiplication (`+`).
|
|
3064
|
+
* @param {Float64Array} values
|
|
3065
|
+
* @returns {number}
|
|
3066
|
+
*/
|
|
3067
|
+
static foldOtimes(values) {
|
|
3068
|
+
const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_malloc);
|
|
3069
|
+
const len0 = WASM_VECTOR_LEN;
|
|
3070
|
+
const ret = wasm.tropicalbatch_foldOtimes(ptr0, len0);
|
|
3071
|
+
return ret;
|
|
3072
|
+
}
|
|
3033
3073
|
/**
|
|
3034
3074
|
* Convert array of log probabilities to tropical numbers and find maximum
|
|
3035
3075
|
* @param {Float64Array} log_probs
|
|
@@ -4237,6 +4277,372 @@ export class WasmCapability {
|
|
|
4237
4277
|
}
|
|
4238
4278
|
}
|
|
4239
4279
|
|
|
4280
|
+
const WasmCgtArenaFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4281
|
+
? { register: () => {}, unregister: () => {} }
|
|
4282
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmcgtarena_free(ptr >>> 0, 1));
|
|
4283
|
+
/**
|
|
4284
|
+
* Arena-backed short combinatorial game engine for WebAssembly.
|
|
4285
|
+
*/
|
|
4286
|
+
export class WasmCgtArena {
|
|
4287
|
+
|
|
4288
|
+
__destroy_into_raw() {
|
|
4289
|
+
const ptr = this.__wbg_ptr;
|
|
4290
|
+
this.__wbg_ptr = 0;
|
|
4291
|
+
WasmCgtArenaFinalization.unregister(this);
|
|
4292
|
+
return ptr;
|
|
4293
|
+
}
|
|
4294
|
+
|
|
4295
|
+
free() {
|
|
4296
|
+
const ptr = this.__destroy_into_raw();
|
|
4297
|
+
wasm.__wbg_wasmcgtarena_free(ptr, 0);
|
|
4298
|
+
}
|
|
4299
|
+
/**
|
|
4300
|
+
* Return whether two games are equivalent.
|
|
4301
|
+
* @param {WasmGameId} lhs
|
|
4302
|
+
* @param {WasmGameId} rhs
|
|
4303
|
+
* @returns {boolean}
|
|
4304
|
+
*/
|
|
4305
|
+
equivalent(lhs, rhs) {
|
|
4306
|
+
_assertClass(lhs, WasmGameId);
|
|
4307
|
+
_assertClass(rhs, WasmGameId);
|
|
4308
|
+
const ret = wasm.wasmcgtarena_equivalent(this.__wbg_ptr, lhs.__wbg_ptr, rhs.__wbg_ptr);
|
|
4309
|
+
if (ret[2]) {
|
|
4310
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4311
|
+
}
|
|
4312
|
+
return ret[0] !== 0;
|
|
4313
|
+
}
|
|
4314
|
+
/**
|
|
4315
|
+
* Return whether a game is numeric.
|
|
4316
|
+
* @param {WasmGameId} game
|
|
4317
|
+
* @returns {boolean}
|
|
4318
|
+
*/
|
|
4319
|
+
isNumeric(game) {
|
|
4320
|
+
_assertClass(game, WasmGameId);
|
|
4321
|
+
const ret = wasm.wasmcgtarena_isNumeric(this.__wbg_ptr, game.__wbg_ptr);
|
|
4322
|
+
if (ret[2]) {
|
|
4323
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4324
|
+
}
|
|
4325
|
+
return ret[0] !== 0;
|
|
4326
|
+
}
|
|
4327
|
+
/**
|
|
4328
|
+
* Number of interned arena nodes.
|
|
4329
|
+
* @returns {number}
|
|
4330
|
+
*/
|
|
4331
|
+
nodeCount() {
|
|
4332
|
+
const ret = wasm.wasmcgtarena_nodeCount(this.__wbg_ptr);
|
|
4333
|
+
return ret >>> 0;
|
|
4334
|
+
}
|
|
4335
|
+
/**
|
|
4336
|
+
* Format a game as recursive cut notation.
|
|
4337
|
+
* @param {WasmGameId} game
|
|
4338
|
+
* @returns {string}
|
|
4339
|
+
*/
|
|
4340
|
+
formatGame(game) {
|
|
4341
|
+
let deferred2_0;
|
|
4342
|
+
let deferred2_1;
|
|
4343
|
+
try {
|
|
4344
|
+
_assertClass(game, WasmGameId);
|
|
4345
|
+
const ret = wasm.wasmcgtarena_formatGame(this.__wbg_ptr, game.__wbg_ptr);
|
|
4346
|
+
var ptr1 = ret[0];
|
|
4347
|
+
var len1 = ret[1];
|
|
4348
|
+
if (ret[3]) {
|
|
4349
|
+
ptr1 = 0; len1 = 0;
|
|
4350
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
4351
|
+
}
|
|
4352
|
+
deferred2_0 = ptr1;
|
|
4353
|
+
deferred2_1 = len1;
|
|
4354
|
+
return getStringFromWasm0(ptr1, len1);
|
|
4355
|
+
} finally {
|
|
4356
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
4357
|
+
}
|
|
4358
|
+
}
|
|
4359
|
+
/**
|
|
4360
|
+
* Return whether a game is impartial.
|
|
4361
|
+
* @param {WasmGameId} game
|
|
4362
|
+
* @returns {boolean}
|
|
4363
|
+
*/
|
|
4364
|
+
isImpartial(game) {
|
|
4365
|
+
_assertClass(game, WasmGameId);
|
|
4366
|
+
const ret = wasm.wasmcgtarena_isImpartial(this.__wbg_ptr, game.__wbg_ptr);
|
|
4367
|
+
if (ret[2]) {
|
|
4368
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4369
|
+
}
|
|
4370
|
+
return ret[0] !== 0;
|
|
4371
|
+
}
|
|
4372
|
+
/**
|
|
4373
|
+
* Format a game's canonical representative.
|
|
4374
|
+
* @param {WasmGameId} game
|
|
4375
|
+
* @returns {string}
|
|
4376
|
+
*/
|
|
4377
|
+
formatCanonicalGame(game) {
|
|
4378
|
+
let deferred2_0;
|
|
4379
|
+
let deferred2_1;
|
|
4380
|
+
try {
|
|
4381
|
+
_assertClass(game, WasmGameId);
|
|
4382
|
+
const ret = wasm.wasmcgtarena_formatCanonicalGame(this.__wbg_ptr, game.__wbg_ptr);
|
|
4383
|
+
var ptr1 = ret[0];
|
|
4384
|
+
var len1 = ret[1];
|
|
4385
|
+
if (ret[3]) {
|
|
4386
|
+
ptr1 = 0; len1 = 0;
|
|
4387
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
4388
|
+
}
|
|
4389
|
+
deferred2_0 = ptr1;
|
|
4390
|
+
deferred2_1 = len1;
|
|
4391
|
+
return getStringFromWasm0(ptr1, len1);
|
|
4392
|
+
} finally {
|
|
4393
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
4394
|
+
}
|
|
4395
|
+
}
|
|
4396
|
+
/**
|
|
4397
|
+
* Add two short games.
|
|
4398
|
+
* @param {WasmGameId} lhs
|
|
4399
|
+
* @param {WasmGameId} rhs
|
|
4400
|
+
* @returns {WasmGameId}
|
|
4401
|
+
*/
|
|
4402
|
+
add(lhs, rhs) {
|
|
4403
|
+
_assertClass(lhs, WasmGameId);
|
|
4404
|
+
_assertClass(rhs, WasmGameId);
|
|
4405
|
+
const ret = wasm.wasmcgtarena_add(this.__wbg_ptr, lhs.__wbg_ptr, rhs.__wbg_ptr);
|
|
4406
|
+
if (ret[2]) {
|
|
4407
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4408
|
+
}
|
|
4409
|
+
return WasmGameId.__wrap(ret[0]);
|
|
4410
|
+
}
|
|
4411
|
+
/**
|
|
4412
|
+
* Build a one-left, one-right cut `{left | right}`.
|
|
4413
|
+
* @param {WasmGameId} left
|
|
4414
|
+
* @param {WasmGameId} right
|
|
4415
|
+
* @returns {WasmGameId}
|
|
4416
|
+
*/
|
|
4417
|
+
cut(left, right) {
|
|
4418
|
+
_assertClass(left, WasmGameId);
|
|
4419
|
+
_assertClass(right, WasmGameId);
|
|
4420
|
+
const ret = wasm.wasmcgtarena_cut(this.__wbg_ptr, left.__wbg_ptr, right.__wbg_ptr);
|
|
4421
|
+
if (ret[2]) {
|
|
4422
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4423
|
+
}
|
|
4424
|
+
return WasmGameId.__wrap(ret[0]);
|
|
4425
|
+
}
|
|
4426
|
+
/**
|
|
4427
|
+
* Negate a short game.
|
|
4428
|
+
* @param {WasmGameId} game
|
|
4429
|
+
* @returns {WasmGameId}
|
|
4430
|
+
*/
|
|
4431
|
+
neg(game) {
|
|
4432
|
+
_assertClass(game, WasmGameId);
|
|
4433
|
+
const ret = wasm.wasmcgtarena_neg(this.__wbg_ptr, game.__wbg_ptr);
|
|
4434
|
+
if (ret[2]) {
|
|
4435
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4436
|
+
}
|
|
4437
|
+
return WasmGameId.__wrap(ret[0]);
|
|
4438
|
+
}
|
|
4439
|
+
/**
|
|
4440
|
+
* Create an empty arena with the zero game interned lazily.
|
|
4441
|
+
*/
|
|
4442
|
+
constructor() {
|
|
4443
|
+
const ret = wasm.wasmcgtarena_new();
|
|
4444
|
+
this.__wbg_ptr = ret >>> 0;
|
|
4445
|
+
WasmCgtArenaFinalization.register(this, this.__wbg_ptr, this);
|
|
4446
|
+
return this;
|
|
4447
|
+
}
|
|
4448
|
+
/**
|
|
4449
|
+
* Return the game `1 = {0 | }`.
|
|
4450
|
+
* @returns {WasmGameId}
|
|
4451
|
+
*/
|
|
4452
|
+
one() {
|
|
4453
|
+
const ret = wasm.wasmcgtarena_one(this.__wbg_ptr);
|
|
4454
|
+
if (ret[2]) {
|
|
4455
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4456
|
+
}
|
|
4457
|
+
return WasmGameId.__wrap(ret[0]);
|
|
4458
|
+
}
|
|
4459
|
+
/**
|
|
4460
|
+
* Subtract two short games.
|
|
4461
|
+
* @param {WasmGameId} lhs
|
|
4462
|
+
* @param {WasmGameId} rhs
|
|
4463
|
+
* @returns {WasmGameId}
|
|
4464
|
+
*/
|
|
4465
|
+
sub(lhs, rhs) {
|
|
4466
|
+
_assertClass(lhs, WasmGameId);
|
|
4467
|
+
_assertClass(rhs, WasmGameId);
|
|
4468
|
+
const ret = wasm.wasmcgtarena_sub(this.__wbg_ptr, lhs.__wbg_ptr, rhs.__wbg_ptr);
|
|
4469
|
+
if (ret[2]) {
|
|
4470
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4471
|
+
}
|
|
4472
|
+
return WasmGameId.__wrap(ret[0]);
|
|
4473
|
+
}
|
|
4474
|
+
/**
|
|
4475
|
+
* Return the star game `{0 | 0}`.
|
|
4476
|
+
* @returns {WasmGameId}
|
|
4477
|
+
*/
|
|
4478
|
+
star() {
|
|
4479
|
+
const ret = wasm.wasmcgtarena_star(this.__wbg_ptr);
|
|
4480
|
+
if (ret[2]) {
|
|
4481
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4482
|
+
}
|
|
4483
|
+
return WasmGameId.__wrap(ret[0]);
|
|
4484
|
+
}
|
|
4485
|
+
/**
|
|
4486
|
+
* Return the zero game `{ | }`.
|
|
4487
|
+
* @returns {WasmGameId}
|
|
4488
|
+
*/
|
|
4489
|
+
zero() {
|
|
4490
|
+
const ret = wasm.wasmcgtarena_zero(this.__wbg_ptr);
|
|
4491
|
+
return WasmGameId.__wrap(ret);
|
|
4492
|
+
}
|
|
4493
|
+
/**
|
|
4494
|
+
* Compute the Grundy nimber of an impartial game.
|
|
4495
|
+
* @param {WasmGameId} game
|
|
4496
|
+
* @returns {number}
|
|
4497
|
+
*/
|
|
4498
|
+
grundy(game) {
|
|
4499
|
+
_assertClass(game, WasmGameId);
|
|
4500
|
+
const ret = wasm.wasmcgtarena_grundy(this.__wbg_ptr, game.__wbg_ptr);
|
|
4501
|
+
if (ret[2]) {
|
|
4502
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4503
|
+
}
|
|
4504
|
+
return ret[0] >>> 0;
|
|
4505
|
+
}
|
|
4506
|
+
/**
|
|
4507
|
+
* Compare two games in the partizan order.
|
|
4508
|
+
* @param {WasmGameId} lhs
|
|
4509
|
+
* @param {WasmGameId} rhs
|
|
4510
|
+
* @returns {string}
|
|
4511
|
+
*/
|
|
4512
|
+
compare(lhs, rhs) {
|
|
4513
|
+
let deferred2_0;
|
|
4514
|
+
let deferred2_1;
|
|
4515
|
+
try {
|
|
4516
|
+
_assertClass(lhs, WasmGameId);
|
|
4517
|
+
_assertClass(rhs, WasmGameId);
|
|
4518
|
+
const ret = wasm.wasmcgtarena_compare(this.__wbg_ptr, lhs.__wbg_ptr, rhs.__wbg_ptr);
|
|
4519
|
+
var ptr1 = ret[0];
|
|
4520
|
+
var len1 = ret[1];
|
|
4521
|
+
if (ret[3]) {
|
|
4522
|
+
ptr1 = 0; len1 = 0;
|
|
4523
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
4524
|
+
}
|
|
4525
|
+
deferred2_0 = ptr1;
|
|
4526
|
+
deferred2_1 = len1;
|
|
4527
|
+
return getStringFromWasm0(ptr1, len1);
|
|
4528
|
+
} finally {
|
|
4529
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
4530
|
+
}
|
|
4531
|
+
}
|
|
4532
|
+
/**
|
|
4533
|
+
* Inspect canonical, numeric, impartial, outcome, and size metadata.
|
|
4534
|
+
* @param {WasmGameId} game
|
|
4535
|
+
* @returns {WasmGameInspection}
|
|
4536
|
+
*/
|
|
4537
|
+
inspect(game) {
|
|
4538
|
+
_assertClass(game, WasmGameId);
|
|
4539
|
+
const ret = wasm.wasmcgtarena_inspect(this.__wbg_ptr, game.__wbg_ptr);
|
|
4540
|
+
if (ret[2]) {
|
|
4541
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4542
|
+
}
|
|
4543
|
+
return WasmGameInspection.__wrap(ret[0]);
|
|
4544
|
+
}
|
|
4545
|
+
/**
|
|
4546
|
+
* Return the normal-play outcome class.
|
|
4547
|
+
* @param {WasmGameId} game
|
|
4548
|
+
* @returns {string}
|
|
4549
|
+
*/
|
|
4550
|
+
outcome(game) {
|
|
4551
|
+
let deferred2_0;
|
|
4552
|
+
let deferred2_1;
|
|
4553
|
+
try {
|
|
4554
|
+
_assertClass(game, WasmGameId);
|
|
4555
|
+
const ret = wasm.wasmcgtarena_outcome(this.__wbg_ptr, game.__wbg_ptr);
|
|
4556
|
+
var ptr1 = ret[0];
|
|
4557
|
+
var len1 = ret[1];
|
|
4558
|
+
if (ret[3]) {
|
|
4559
|
+
ptr1 = 0; len1 = 0;
|
|
4560
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
4561
|
+
}
|
|
4562
|
+
deferred2_0 = ptr1;
|
|
4563
|
+
deferred2_1 = len1;
|
|
4564
|
+
return getStringFromWasm0(ptr1, len1);
|
|
4565
|
+
} finally {
|
|
4566
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
4567
|
+
}
|
|
4568
|
+
}
|
|
4569
|
+
/**
|
|
4570
|
+
* Return the game's birthday.
|
|
4571
|
+
* @param {WasmGameId} game
|
|
4572
|
+
* @returns {number}
|
|
4573
|
+
*/
|
|
4574
|
+
birthday(game) {
|
|
4575
|
+
_assertClass(game, WasmGameId);
|
|
4576
|
+
const ret = wasm.wasmcgtarena_birthday(this.__wbg_ptr, game.__wbg_ptr);
|
|
4577
|
+
if (ret[2]) {
|
|
4578
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4579
|
+
}
|
|
4580
|
+
return ret[0] >>> 0;
|
|
4581
|
+
}
|
|
4582
|
+
/**
|
|
4583
|
+
* Build a one-left-option game `{left | }`.
|
|
4584
|
+
* @param {WasmGameId} left
|
|
4585
|
+
* @returns {WasmGameId}
|
|
4586
|
+
*/
|
|
4587
|
+
leftCut(left) {
|
|
4588
|
+
_assertClass(left, WasmGameId);
|
|
4589
|
+
const ret = wasm.wasmcgtarena_leftCut(this.__wbg_ptr, left.__wbg_ptr);
|
|
4590
|
+
if (ret[2]) {
|
|
4591
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4592
|
+
}
|
|
4593
|
+
return WasmGameId.__wrap(ret[0]);
|
|
4594
|
+
}
|
|
4595
|
+
/**
|
|
4596
|
+
* Build a Nim heap of the requested size.
|
|
4597
|
+
* @param {number} size
|
|
4598
|
+
* @returns {WasmGameId}
|
|
4599
|
+
*/
|
|
4600
|
+
nimHeap(size) {
|
|
4601
|
+
const ret = wasm.wasmcgtarena_nimHeap(this.__wbg_ptr, size);
|
|
4602
|
+
if (ret[2]) {
|
|
4603
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4604
|
+
}
|
|
4605
|
+
return WasmGameId.__wrap(ret[0]);
|
|
4606
|
+
}
|
|
4607
|
+
/**
|
|
4608
|
+
* Canonicalize a game and return the canonical representative handle.
|
|
4609
|
+
* @param {WasmGameId} game
|
|
4610
|
+
* @returns {WasmGameId}
|
|
4611
|
+
*/
|
|
4612
|
+
canonical(game) {
|
|
4613
|
+
_assertClass(game, WasmGameId);
|
|
4614
|
+
const ret = wasm.wasmcgtarena_canonical(this.__wbg_ptr, game.__wbg_ptr);
|
|
4615
|
+
if (ret[2]) {
|
|
4616
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4617
|
+
}
|
|
4618
|
+
return WasmGameId.__wrap(ret[0]);
|
|
4619
|
+
}
|
|
4620
|
+
/**
|
|
4621
|
+
* Return the game `-1 = {| 0}`.
|
|
4622
|
+
* @returns {WasmGameId}
|
|
4623
|
+
*/
|
|
4624
|
+
minusOne() {
|
|
4625
|
+
const ret = wasm.wasmcgtarena_minusOne(this.__wbg_ptr);
|
|
4626
|
+
if (ret[2]) {
|
|
4627
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4628
|
+
}
|
|
4629
|
+
return WasmGameId.__wrap(ret[0]);
|
|
4630
|
+
}
|
|
4631
|
+
/**
|
|
4632
|
+
* Build a one-right-option game `{ | right}`.
|
|
4633
|
+
* @param {WasmGameId} right
|
|
4634
|
+
* @returns {WasmGameId}
|
|
4635
|
+
*/
|
|
4636
|
+
rightCut(right) {
|
|
4637
|
+
_assertClass(right, WasmGameId);
|
|
4638
|
+
const ret = wasm.wasmcgtarena_rightCut(this.__wbg_ptr, right.__wbg_ptr);
|
|
4639
|
+
if (ret[2]) {
|
|
4640
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
4641
|
+
}
|
|
4642
|
+
return WasmGameId.__wrap(ret[0]);
|
|
4643
|
+
}
|
|
4644
|
+
}
|
|
4645
|
+
|
|
4240
4646
|
const WasmChowClassFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4241
4647
|
? { register: () => {}, unregister: () => {} }
|
|
4242
4648
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmchowclass_free(ptr >>> 0, 1));
|
|
@@ -4651,6 +5057,28 @@ export class WasmDualNumber {
|
|
|
4651
5057
|
const ptr = this.__destroy_into_raw();
|
|
4652
5058
|
wasm.__wbg_wasmdualnumber_free(ptr, 0);
|
|
4653
5059
|
}
|
|
5060
|
+
/**
|
|
5061
|
+
* Maximum with explicit derivative tie handling.
|
|
5062
|
+
* @param {WasmDualNumber} other
|
|
5063
|
+
* @param {WasmBranchPolicy} policy
|
|
5064
|
+
* @returns {WasmDualNumber}
|
|
5065
|
+
*/
|
|
5066
|
+
maxByPolicy(other, policy) {
|
|
5067
|
+
_assertClass(other, WasmDualNumber);
|
|
5068
|
+
const ret = wasm.wasmdualnumber_maxByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
|
|
5069
|
+
return WasmDualNumber.__wrap(ret);
|
|
5070
|
+
}
|
|
5071
|
+
/**
|
|
5072
|
+
* Minimum with explicit derivative tie handling.
|
|
5073
|
+
* @param {WasmDualNumber} other
|
|
5074
|
+
* @param {WasmBranchPolicy} policy
|
|
5075
|
+
* @returns {WasmDualNumber}
|
|
5076
|
+
*/
|
|
5077
|
+
minByPolicy(other, policy) {
|
|
5078
|
+
_assertClass(other, WasmDualNumber);
|
|
5079
|
+
const ret = wasm.wasmdualnumber_minByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
|
|
5080
|
+
return WasmDualNumber.__wrap(ret);
|
|
5081
|
+
}
|
|
4654
5082
|
/**
|
|
4655
5083
|
* Natural logarithm
|
|
4656
5084
|
* @returns {WasmDualNumber}
|
|
@@ -5002,76 +5430,291 @@ export class WasmDuallyFlatManifold {
|
|
|
5002
5430
|
}
|
|
5003
5431
|
}
|
|
5004
5432
|
|
|
5005
|
-
const
|
|
5433
|
+
const WasmDyadicFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5006
5434
|
? { register: () => {}, unregister: () => {} }
|
|
5007
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
5435
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmdyadic_free(ptr >>> 0, 1));
|
|
5008
5436
|
/**
|
|
5009
|
-
*
|
|
5437
|
+
* Exact dyadic rational `numerator / 2^exponent` for short surreal values.
|
|
5010
5438
|
*/
|
|
5011
|
-
export class
|
|
5439
|
+
export class WasmDyadic {
|
|
5012
5440
|
|
|
5013
5441
|
static __wrap(ptr) {
|
|
5014
5442
|
ptr = ptr >>> 0;
|
|
5015
|
-
const obj = Object.create(
|
|
5443
|
+
const obj = Object.create(WasmDyadic.prototype);
|
|
5016
5444
|
obj.__wbg_ptr = ptr;
|
|
5017
|
-
|
|
5445
|
+
WasmDyadicFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
5018
5446
|
return obj;
|
|
5019
5447
|
}
|
|
5020
5448
|
|
|
5021
5449
|
__destroy_into_raw() {
|
|
5022
5450
|
const ptr = this.__wbg_ptr;
|
|
5023
5451
|
this.__wbg_ptr = 0;
|
|
5024
|
-
|
|
5452
|
+
WasmDyadicFinalization.unregister(this);
|
|
5025
5453
|
return ptr;
|
|
5026
5454
|
}
|
|
5027
5455
|
|
|
5028
5456
|
free() {
|
|
5029
5457
|
const ptr = this.__destroy_into_raw();
|
|
5030
|
-
wasm.
|
|
5458
|
+
wasm.__wbg_wasmdyadic_free(ptr, 0);
|
|
5031
5459
|
}
|
|
5032
5460
|
/**
|
|
5033
|
-
*
|
|
5034
|
-
* @param {
|
|
5035
|
-
* @
|
|
5036
|
-
* @param {WasmTorusWeights} weights
|
|
5037
|
-
* @returns {WasmEquivariantLocalizer}
|
|
5461
|
+
* Checked division; fails if the quotient leaves the dyadic layer.
|
|
5462
|
+
* @param {WasmDyadic} rhs
|
|
5463
|
+
* @returns {WasmDyadic}
|
|
5038
5464
|
*/
|
|
5039
|
-
|
|
5040
|
-
_assertClass(
|
|
5041
|
-
const ret = wasm.
|
|
5465
|
+
checkedDiv(rhs) {
|
|
5466
|
+
_assertClass(rhs, WasmDyadic);
|
|
5467
|
+
const ret = wasm.wasmdyadic_checkedDiv(this.__wbg_ptr, rhs.__wbg_ptr);
|
|
5042
5468
|
if (ret[2]) {
|
|
5043
5469
|
throw takeFromExternrefTable0(ret[1]);
|
|
5044
5470
|
}
|
|
5045
|
-
return
|
|
5471
|
+
return WasmDyadic.__wrap(ret[0]);
|
|
5046
5472
|
}
|
|
5047
5473
|
/**
|
|
5048
|
-
*
|
|
5049
|
-
* @returns {
|
|
5474
|
+
* Return whether the dyadic is negative.
|
|
5475
|
+
* @returns {boolean}
|
|
5050
5476
|
*/
|
|
5051
|
-
|
|
5052
|
-
const ret = wasm.
|
|
5053
|
-
return ret
|
|
5477
|
+
isNegative() {
|
|
5478
|
+
const ret = wasm.wasmdyadic_isNegative(this.__wbg_ptr);
|
|
5479
|
+
return ret !== 0;
|
|
5054
5480
|
}
|
|
5055
5481
|
/**
|
|
5056
|
-
*
|
|
5057
|
-
* @
|
|
5058
|
-
* @returns {number}
|
|
5482
|
+
* Return whether the dyadic is positive.
|
|
5483
|
+
* @returns {boolean}
|
|
5059
5484
|
*/
|
|
5060
|
-
|
|
5061
|
-
const
|
|
5062
|
-
|
|
5063
|
-
const ret = wasm.wasmequivariantlocalizer_localizedIntersection(this.__wbg_ptr, ptr0, len0);
|
|
5064
|
-
return ret;
|
|
5485
|
+
isPositive() {
|
|
5486
|
+
const ret = wasm.wasmdyadic_isPositive(this.__wbg_ptr);
|
|
5487
|
+
return ret !== 0;
|
|
5065
5488
|
}
|
|
5066
5489
|
/**
|
|
5067
|
-
* Create a
|
|
5068
|
-
* @param {number}
|
|
5069
|
-
* @
|
|
5490
|
+
* Create a dyadic integer.
|
|
5491
|
+
* @param {number} value
|
|
5492
|
+
* @returns {WasmDyadic}
|
|
5070
5493
|
*/
|
|
5071
|
-
|
|
5072
|
-
const ret = wasm.
|
|
5073
|
-
|
|
5074
|
-
|
|
5494
|
+
static fromInteger(value) {
|
|
5495
|
+
const ret = wasm.wasmdyadic_fromInteger(value);
|
|
5496
|
+
return WasmDyadic.__wrap(ret);
|
|
5497
|
+
}
|
|
5498
|
+
/**
|
|
5499
|
+
* Numerator as a base-10 string.
|
|
5500
|
+
* @returns {string}
|
|
5501
|
+
*/
|
|
5502
|
+
numeratorString() {
|
|
5503
|
+
let deferred1_0;
|
|
5504
|
+
let deferred1_1;
|
|
5505
|
+
try {
|
|
5506
|
+
const ret = wasm.wasmdyadic_numeratorString(this.__wbg_ptr);
|
|
5507
|
+
deferred1_0 = ret[0];
|
|
5508
|
+
deferred1_1 = ret[1];
|
|
5509
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
5510
|
+
} finally {
|
|
5511
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
5512
|
+
}
|
|
5513
|
+
}
|
|
5514
|
+
/**
|
|
5515
|
+
* Checked reciprocal within the dyadic short-surreal layer.
|
|
5516
|
+
* @returns {WasmDyadic}
|
|
5517
|
+
*/
|
|
5518
|
+
checkedReciprocal() {
|
|
5519
|
+
const ret = wasm.wasmdyadic_checkedReciprocal(this.__wbg_ptr);
|
|
5520
|
+
if (ret[2]) {
|
|
5521
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
5522
|
+
}
|
|
5523
|
+
return WasmDyadic.__wrap(ret[0]);
|
|
5524
|
+
}
|
|
5525
|
+
/**
|
|
5526
|
+
* Absolute value.
|
|
5527
|
+
* @returns {WasmDyadic}
|
|
5528
|
+
*/
|
|
5529
|
+
abs() {
|
|
5530
|
+
const ret = wasm.wasmdyadic_abs(this.__wbg_ptr);
|
|
5531
|
+
return WasmDyadic.__wrap(ret);
|
|
5532
|
+
}
|
|
5533
|
+
/**
|
|
5534
|
+
* Add two dyadics exactly.
|
|
5535
|
+
* @param {WasmDyadic} rhs
|
|
5536
|
+
* @returns {WasmDyadic}
|
|
5537
|
+
*/
|
|
5538
|
+
add(rhs) {
|
|
5539
|
+
_assertClass(rhs, WasmDyadic);
|
|
5540
|
+
const ret = wasm.wasmdyadic_add(this.__wbg_ptr, rhs.__wbg_ptr);
|
|
5541
|
+
return WasmDyadic.__wrap(ret);
|
|
5542
|
+
}
|
|
5543
|
+
/**
|
|
5544
|
+
* Multiply two dyadics exactly.
|
|
5545
|
+
* @param {WasmDyadic} rhs
|
|
5546
|
+
* @returns {WasmDyadic}
|
|
5547
|
+
*/
|
|
5548
|
+
mul(rhs) {
|
|
5549
|
+
_assertClass(rhs, WasmDyadic);
|
|
5550
|
+
const ret = wasm.wasmdyadic_mul(this.__wbg_ptr, rhs.__wbg_ptr);
|
|
5551
|
+
return WasmDyadic.__wrap(ret);
|
|
5552
|
+
}
|
|
5553
|
+
/**
|
|
5554
|
+
* Negate the dyadic.
|
|
5555
|
+
* @returns {WasmDyadic}
|
|
5556
|
+
*/
|
|
5557
|
+
neg() {
|
|
5558
|
+
const ret = wasm.wasmdyadic_neg(this.__wbg_ptr);
|
|
5559
|
+
return WasmDyadic.__wrap(ret);
|
|
5560
|
+
}
|
|
5561
|
+
/**
|
|
5562
|
+
* Create and normalize a dyadic rational `numerator / 2^exponent`.
|
|
5563
|
+
* @param {number} numerator
|
|
5564
|
+
* @param {number} exponent
|
|
5565
|
+
*/
|
|
5566
|
+
constructor(numerator, exponent) {
|
|
5567
|
+
const ret = wasm.wasmdyadic_new(numerator, exponent);
|
|
5568
|
+
this.__wbg_ptr = ret >>> 0;
|
|
5569
|
+
WasmDyadicFinalization.register(this, this.__wbg_ptr, this);
|
|
5570
|
+
return this;
|
|
5571
|
+
}
|
|
5572
|
+
/**
|
|
5573
|
+
* Return one.
|
|
5574
|
+
* @returns {WasmDyadic}
|
|
5575
|
+
*/
|
|
5576
|
+
static one() {
|
|
5577
|
+
const ret = wasm.wasmdyadic_one();
|
|
5578
|
+
return WasmDyadic.__wrap(ret);
|
|
5579
|
+
}
|
|
5580
|
+
/**
|
|
5581
|
+
* Subtract two dyadics exactly.
|
|
5582
|
+
* @param {WasmDyadic} rhs
|
|
5583
|
+
* @returns {WasmDyadic}
|
|
5584
|
+
*/
|
|
5585
|
+
sub(rhs) {
|
|
5586
|
+
_assertClass(rhs, WasmDyadic);
|
|
5587
|
+
const ret = wasm.wasmdyadic_sub(this.__wbg_ptr, rhs.__wbg_ptr);
|
|
5588
|
+
return WasmDyadic.__wrap(ret);
|
|
5589
|
+
}
|
|
5590
|
+
/**
|
|
5591
|
+
* Return the sign as `negative`, `zero`, or `positive`.
|
|
5592
|
+
* @returns {string}
|
|
5593
|
+
*/
|
|
5594
|
+
sign() {
|
|
5595
|
+
let deferred1_0;
|
|
5596
|
+
let deferred1_1;
|
|
5597
|
+
try {
|
|
5598
|
+
const ret = wasm.wasmdyadic_sign(this.__wbg_ptr);
|
|
5599
|
+
deferred1_0 = ret[0];
|
|
5600
|
+
deferred1_1 = ret[1];
|
|
5601
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
5602
|
+
} finally {
|
|
5603
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
5604
|
+
}
|
|
5605
|
+
}
|
|
5606
|
+
/**
|
|
5607
|
+
* Return zero.
|
|
5608
|
+
* @returns {WasmDyadic}
|
|
5609
|
+
*/
|
|
5610
|
+
static zero() {
|
|
5611
|
+
const ret = wasm.wasmdyadic_zero();
|
|
5612
|
+
return WasmDyadic.__wrap(ret);
|
|
5613
|
+
}
|
|
5614
|
+
/**
|
|
5615
|
+
* Format as an integer or rational string.
|
|
5616
|
+
* @returns {string}
|
|
5617
|
+
*/
|
|
5618
|
+
format() {
|
|
5619
|
+
let deferred1_0;
|
|
5620
|
+
let deferred1_1;
|
|
5621
|
+
try {
|
|
5622
|
+
const ret = wasm.wasmdyadic_format(this.__wbg_ptr);
|
|
5623
|
+
deferred1_0 = ret[0];
|
|
5624
|
+
deferred1_1 = ret[1];
|
|
5625
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
5626
|
+
} finally {
|
|
5627
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
5628
|
+
}
|
|
5629
|
+
}
|
|
5630
|
+
/**
|
|
5631
|
+
* Return whether the dyadic is zero.
|
|
5632
|
+
* @returns {boolean}
|
|
5633
|
+
*/
|
|
5634
|
+
isZero() {
|
|
5635
|
+
const ret = wasm.wasmdyadic_isZero(this.__wbg_ptr);
|
|
5636
|
+
return ret !== 0;
|
|
5637
|
+
}
|
|
5638
|
+
/**
|
|
5639
|
+
* Power-of-two denominator exponent.
|
|
5640
|
+
* @returns {number}
|
|
5641
|
+
*/
|
|
5642
|
+
exponent() {
|
|
5643
|
+
const ret = wasm.wasmbinaryhologram_height(this.__wbg_ptr);
|
|
5644
|
+
return ret >>> 0;
|
|
5645
|
+
}
|
|
5646
|
+
}
|
|
5647
|
+
|
|
5648
|
+
const WasmEquivariantLocalizerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5649
|
+
? { register: () => {}, unregister: () => {} }
|
|
5650
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmequivariantlocalizer_free(ptr >>> 0, 1));
|
|
5651
|
+
/**
|
|
5652
|
+
* WASM wrapper for equivariant localization on Grassmannians
|
|
5653
|
+
*/
|
|
5654
|
+
export class WasmEquivariantLocalizer {
|
|
5655
|
+
|
|
5656
|
+
static __wrap(ptr) {
|
|
5657
|
+
ptr = ptr >>> 0;
|
|
5658
|
+
const obj = Object.create(WasmEquivariantLocalizer.prototype);
|
|
5659
|
+
obj.__wbg_ptr = ptr;
|
|
5660
|
+
WasmEquivariantLocalizerFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
5661
|
+
return obj;
|
|
5662
|
+
}
|
|
5663
|
+
|
|
5664
|
+
__destroy_into_raw() {
|
|
5665
|
+
const ptr = this.__wbg_ptr;
|
|
5666
|
+
this.__wbg_ptr = 0;
|
|
5667
|
+
WasmEquivariantLocalizerFinalization.unregister(this);
|
|
5668
|
+
return ptr;
|
|
5669
|
+
}
|
|
5670
|
+
|
|
5671
|
+
free() {
|
|
5672
|
+
const ptr = this.__destroy_into_raw();
|
|
5673
|
+
wasm.__wbg_wasmequivariantlocalizer_free(ptr, 0);
|
|
5674
|
+
}
|
|
5675
|
+
/**
|
|
5676
|
+
* Create a localizer with custom torus weights
|
|
5677
|
+
* @param {number} k
|
|
5678
|
+
* @param {number} n
|
|
5679
|
+
* @param {WasmTorusWeights} weights
|
|
5680
|
+
* @returns {WasmEquivariantLocalizer}
|
|
5681
|
+
*/
|
|
5682
|
+
static withWeights(k, n, weights) {
|
|
5683
|
+
_assertClass(weights, WasmTorusWeights);
|
|
5684
|
+
const ret = wasm.wasmequivariantlocalizer_withWeights(k, n, weights.__wbg_ptr);
|
|
5685
|
+
if (ret[2]) {
|
|
5686
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
5687
|
+
}
|
|
5688
|
+
return WasmEquivariantLocalizer.__wrap(ret[0]);
|
|
5689
|
+
}
|
|
5690
|
+
/**
|
|
5691
|
+
* Number of torus fixed points (= C(n, k))
|
|
5692
|
+
* @returns {number}
|
|
5693
|
+
*/
|
|
5694
|
+
fixedPointCount() {
|
|
5695
|
+
const ret = wasm.wasmequivariantlocalizer_fixedPointCount(this.__wbg_ptr);
|
|
5696
|
+
return ret >>> 0;
|
|
5697
|
+
}
|
|
5698
|
+
/**
|
|
5699
|
+
* Compute localized intersection of Schubert classes
|
|
5700
|
+
* @param {WasmSchubertClass[]} classes
|
|
5701
|
+
* @returns {number}
|
|
5702
|
+
*/
|
|
5703
|
+
localizedIntersection(classes) {
|
|
5704
|
+
const ptr0 = passArrayJsValueToWasm0(classes, wasm.__wbindgen_malloc);
|
|
5705
|
+
const len0 = WASM_VECTOR_LEN;
|
|
5706
|
+
const ret = wasm.wasmequivariantlocalizer_localizedIntersection(this.__wbg_ptr, ptr0, len0);
|
|
5707
|
+
return ret;
|
|
5708
|
+
}
|
|
5709
|
+
/**
|
|
5710
|
+
* Create a localizer for Gr(k, n) with standard weights
|
|
5711
|
+
* @param {number} k
|
|
5712
|
+
* @param {number} n
|
|
5713
|
+
*/
|
|
5714
|
+
constructor(k, n) {
|
|
5715
|
+
const ret = wasm.wasmequivariantlocalizer_new(k, n);
|
|
5716
|
+
if (ret[2]) {
|
|
5717
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
5075
5718
|
}
|
|
5076
5719
|
this.__wbg_ptr = ret[0] >>> 0;
|
|
5077
5720
|
WasmEquivariantLocalizerFinalization.register(this, this.__wbg_ptr, this);
|
|
@@ -5902,105 +6545,269 @@ export class WasmGF2Vector {
|
|
|
5902
6545
|
}
|
|
5903
6546
|
}
|
|
5904
6547
|
|
|
5905
|
-
const
|
|
6548
|
+
const WasmGameIdFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5906
6549
|
? { register: () => {}, unregister: () => {} }
|
|
5907
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
6550
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmgameid_free(ptr >>> 0, 1));
|
|
5908
6551
|
/**
|
|
5909
|
-
*
|
|
5910
|
-
*
|
|
5911
|
-
* A Gaussian distribution over 8-dimensional multivector space with
|
|
5912
|
-
* configurable mean and per-component standard deviation.
|
|
6552
|
+
* Opaque handle for a short combinatorial game stored in a `WasmCgtArena`.
|
|
5913
6553
|
*/
|
|
5914
|
-
export class
|
|
6554
|
+
export class WasmGameId {
|
|
5915
6555
|
|
|
5916
6556
|
static __wrap(ptr) {
|
|
5917
6557
|
ptr = ptr >>> 0;
|
|
5918
|
-
const obj = Object.create(
|
|
6558
|
+
const obj = Object.create(WasmGameId.prototype);
|
|
5919
6559
|
obj.__wbg_ptr = ptr;
|
|
5920
|
-
|
|
6560
|
+
WasmGameIdFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
5921
6561
|
return obj;
|
|
5922
6562
|
}
|
|
5923
6563
|
|
|
5924
6564
|
__destroy_into_raw() {
|
|
5925
6565
|
const ptr = this.__wbg_ptr;
|
|
5926
6566
|
this.__wbg_ptr = 0;
|
|
5927
|
-
|
|
6567
|
+
WasmGameIdFinalization.unregister(this);
|
|
5928
6568
|
return ptr;
|
|
5929
6569
|
}
|
|
5930
6570
|
|
|
5931
6571
|
free() {
|
|
5932
6572
|
const ptr = this.__destroy_into_raw();
|
|
5933
|
-
wasm.
|
|
6573
|
+
wasm.__wbg_wasmgameid_free(ptr, 0);
|
|
5934
6574
|
}
|
|
5935
6575
|
/**
|
|
5936
|
-
*
|
|
5937
|
-
*
|
|
5938
|
-
*
|
|
5939
|
-
* @returns {Float64Array}
|
|
6576
|
+
* Returns whether two game handles point at the same arena-local game.
|
|
6577
|
+
* @param {WasmGameId} other
|
|
6578
|
+
* @returns {boolean}
|
|
5940
6579
|
*/
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
return v1;
|
|
6580
|
+
same(other) {
|
|
6581
|
+
_assertClass(other, WasmGameId);
|
|
6582
|
+
const ret = wasm.wasmgameid_same(this.__wbg_ptr, other.__wbg_ptr);
|
|
6583
|
+
return ret !== 0;
|
|
5946
6584
|
}
|
|
5947
|
-
|
|
5948
|
-
|
|
5949
|
-
|
|
5950
|
-
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
6585
|
+
}
|
|
6586
|
+
|
|
6587
|
+
const WasmGameInspectionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6588
|
+
? { register: () => {}, unregister: () => {} }
|
|
6589
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmgameinspection_free(ptr >>> 0, 1));
|
|
6590
|
+
/**
|
|
6591
|
+
* Inspection summary for a short combinatorial game.
|
|
6592
|
+
*/
|
|
6593
|
+
export class WasmGameInspection {
|
|
6594
|
+
|
|
6595
|
+
static __wrap(ptr) {
|
|
6596
|
+
ptr = ptr >>> 0;
|
|
6597
|
+
const obj = Object.create(WasmGameInspection.prototype);
|
|
6598
|
+
obj.__wbg_ptr = ptr;
|
|
6599
|
+
WasmGameInspectionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
6600
|
+
return obj;
|
|
6601
|
+
}
|
|
6602
|
+
|
|
6603
|
+
__destroy_into_raw() {
|
|
6604
|
+
const ptr = this.__wbg_ptr;
|
|
6605
|
+
this.__wbg_ptr = 0;
|
|
6606
|
+
WasmGameInspectionFinalization.unregister(this);
|
|
6607
|
+
return ptr;
|
|
6608
|
+
}
|
|
6609
|
+
|
|
6610
|
+
free() {
|
|
6611
|
+
const ptr = this.__destroy_into_raw();
|
|
6612
|
+
wasm.__wbg_wasmgameinspection_free(ptr, 0);
|
|
5958
6613
|
}
|
|
5959
6614
|
/**
|
|
5960
|
-
*
|
|
5961
|
-
*
|
|
5962
|
-
* Returns flat array of coefficients: num_samples * 8
|
|
5963
|
-
* @param {number} num_samples
|
|
5964
|
-
* @returns {Float64Array}
|
|
6615
|
+
* Whether the game is numeric.
|
|
6616
|
+
* @returns {boolean}
|
|
5965
6617
|
*/
|
|
5966
|
-
|
|
5967
|
-
const ret = wasm.
|
|
5968
|
-
|
|
5969
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
5970
|
-
return v1;
|
|
6618
|
+
isNumeric() {
|
|
6619
|
+
const ret = wasm.wasmgameinspection_isNumeric(this.__wbg_ptr);
|
|
6620
|
+
return ret !== 0;
|
|
5971
6621
|
}
|
|
5972
6622
|
/**
|
|
5973
|
-
*
|
|
5974
|
-
*
|
|
5975
|
-
* Returns 64 values (8x8 matrix)
|
|
5976
|
-
* @returns {Float64Array}
|
|
6623
|
+
* Whether the game is partizan.
|
|
6624
|
+
* @returns {boolean}
|
|
5977
6625
|
*/
|
|
5978
|
-
|
|
5979
|
-
const ret = wasm.
|
|
5980
|
-
|
|
5981
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
5982
|
-
return v1;
|
|
6626
|
+
isPartizan() {
|
|
6627
|
+
const ret = wasm.wasmgameinspection_isPartizan(this.__wbg_ptr);
|
|
6628
|
+
return ret !== 0;
|
|
5983
6629
|
}
|
|
5984
6630
|
/**
|
|
5985
|
-
*
|
|
5986
|
-
*
|
|
5987
|
-
* # Arguments
|
|
5988
|
-
* * `mean` - 8 coefficients for the mean multivector
|
|
5989
|
-
* * `std_dev` - 8 coefficients for per-coefficient standard deviation
|
|
5990
|
-
* @param {Float64Array} mean
|
|
5991
|
-
* @param {Float64Array} std_dev
|
|
5992
|
-
* @returns {WasmGaussianMultivector}
|
|
6631
|
+
* Whether the game already is its canonical representative.
|
|
6632
|
+
* @returns {boolean}
|
|
5993
6633
|
*/
|
|
5994
|
-
|
|
5995
|
-
const
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6634
|
+
isCanonical() {
|
|
6635
|
+
const ret = wasm.wasmgameinspection_isCanonical(this.__wbg_ptr);
|
|
6636
|
+
return ret !== 0;
|
|
6637
|
+
}
|
|
6638
|
+
/**
|
|
6639
|
+
* Whether the game is impartial.
|
|
6640
|
+
* @returns {boolean}
|
|
6641
|
+
*/
|
|
6642
|
+
isImpartial() {
|
|
6643
|
+
const ret = wasm.wasmgameinspection_isImpartial(this.__wbg_ptr);
|
|
6644
|
+
return ret !== 0;
|
|
6645
|
+
}
|
|
6646
|
+
/**
|
|
6647
|
+
* Canonical structural form as recursive cut notation.
|
|
6648
|
+
* @returns {string}
|
|
6649
|
+
*/
|
|
6650
|
+
canonicalForm() {
|
|
6651
|
+
let deferred1_0;
|
|
6652
|
+
let deferred1_1;
|
|
6653
|
+
try {
|
|
6654
|
+
const ret = wasm.wasmgameinspection_canonicalForm(this.__wbg_ptr);
|
|
6655
|
+
deferred1_0 = ret[0];
|
|
6656
|
+
deferred1_1 = ret[1];
|
|
6657
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
6658
|
+
} finally {
|
|
6659
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
6660
|
+
}
|
|
6661
|
+
}
|
|
6662
|
+
/**
|
|
6663
|
+
* Whether the game is non-numeric.
|
|
6664
|
+
* @returns {boolean}
|
|
6665
|
+
*/
|
|
6666
|
+
isNonNumeric() {
|
|
6667
|
+
const ret = wasm.wasmgameinspection_isNonNumeric(this.__wbg_ptr);
|
|
6668
|
+
return ret !== 0;
|
|
6669
|
+
}
|
|
6670
|
+
/**
|
|
6671
|
+
* Number of reachable arena nodes in the game DAG.
|
|
6672
|
+
* @returns {number}
|
|
6673
|
+
*/
|
|
6674
|
+
reachableNodeCount() {
|
|
6675
|
+
const ret = wasm.wasmgameinspection_reachableNodeCount(this.__wbg_ptr);
|
|
6676
|
+
return ret >>> 0;
|
|
6677
|
+
}
|
|
6678
|
+
/**
|
|
6679
|
+
* Normal-play outcome class.
|
|
6680
|
+
* @returns {string}
|
|
6681
|
+
*/
|
|
6682
|
+
outcome() {
|
|
6683
|
+
let deferred1_0;
|
|
6684
|
+
let deferred1_1;
|
|
6685
|
+
try {
|
|
6686
|
+
const ret = wasm.wasmgameinspection_outcome(this.__wbg_ptr);
|
|
6687
|
+
deferred1_0 = ret[0];
|
|
6688
|
+
deferred1_1 = ret[1];
|
|
6689
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
6690
|
+
} finally {
|
|
6691
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
6692
|
+
}
|
|
6693
|
+
}
|
|
6694
|
+
/**
|
|
6695
|
+
* Birthday of the inspected game.
|
|
6696
|
+
* @returns {number}
|
|
6697
|
+
*/
|
|
6698
|
+
birthday() {
|
|
6699
|
+
const ret = wasm.wasmgameinspection_birthday(this.__wbg_ptr);
|
|
6700
|
+
return ret >>> 0;
|
|
6701
|
+
}
|
|
6702
|
+
/**
|
|
6703
|
+
* Canonical representative handle.
|
|
6704
|
+
* @returns {WasmGameId}
|
|
6705
|
+
*/
|
|
6706
|
+
canonical() {
|
|
6707
|
+
const ret = wasm.wasmgameinspection_canonical(this.__wbg_ptr);
|
|
6708
|
+
return WasmGameId.__wrap(ret);
|
|
6709
|
+
}
|
|
6710
|
+
}
|
|
6711
|
+
|
|
6712
|
+
const WasmGaussianMultivectorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6713
|
+
? { register: () => {}, unregister: () => {} }
|
|
6714
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmgaussianmultivector_free(ptr >>> 0, 1));
|
|
6715
|
+
/**
|
|
6716
|
+
* WASM wrapper for Gaussian distribution on Cl(3,0,0) multivector space
|
|
6717
|
+
*
|
|
6718
|
+
* A Gaussian distribution over 8-dimensional multivector space with
|
|
6719
|
+
* configurable mean and per-component standard deviation.
|
|
6720
|
+
*/
|
|
6721
|
+
export class WasmGaussianMultivector {
|
|
6722
|
+
|
|
6723
|
+
static __wrap(ptr) {
|
|
6724
|
+
ptr = ptr >>> 0;
|
|
6725
|
+
const obj = Object.create(WasmGaussianMultivector.prototype);
|
|
6726
|
+
obj.__wbg_ptr = ptr;
|
|
6727
|
+
WasmGaussianMultivectorFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
6728
|
+
return obj;
|
|
6729
|
+
}
|
|
6730
|
+
|
|
6731
|
+
__destroy_into_raw() {
|
|
6732
|
+
const ptr = this.__wbg_ptr;
|
|
6733
|
+
this.__wbg_ptr = 0;
|
|
6734
|
+
WasmGaussianMultivectorFinalization.unregister(this);
|
|
6735
|
+
return ptr;
|
|
6736
|
+
}
|
|
6737
|
+
|
|
6738
|
+
free() {
|
|
6739
|
+
const ptr = this.__destroy_into_raw();
|
|
6740
|
+
wasm.__wbg_wasmgaussianmultivector_free(ptr, 0);
|
|
6741
|
+
}
|
|
6742
|
+
/**
|
|
6743
|
+
* Get the standard deviations
|
|
6744
|
+
*
|
|
6745
|
+
* Returns 8 values
|
|
6746
|
+
* @returns {Float64Array}
|
|
6747
|
+
*/
|
|
6748
|
+
getStdDevs() {
|
|
6749
|
+
const ret = wasm.wasmgaussianmultivector_getStdDevs(this.__wbg_ptr);
|
|
6750
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
6751
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
6752
|
+
return v1;
|
|
6753
|
+
}
|
|
6754
|
+
/**
|
|
6755
|
+
* Get the variance (square of std devs)
|
|
6756
|
+
*
|
|
6757
|
+
* Returns 8 values
|
|
6758
|
+
* @returns {Float64Array}
|
|
6759
|
+
*/
|
|
6760
|
+
getVariance() {
|
|
6761
|
+
const ret = wasm.wasmgaussianmultivector_getVariance(this.__wbg_ptr);
|
|
6762
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
6763
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
6764
|
+
return v1;
|
|
6765
|
+
}
|
|
6766
|
+
/**
|
|
6767
|
+
* Draw multiple samples from this distribution
|
|
6768
|
+
*
|
|
6769
|
+
* Returns flat array of coefficients: num_samples * 8
|
|
6770
|
+
* @param {number} num_samples
|
|
6771
|
+
* @returns {Float64Array}
|
|
6772
|
+
*/
|
|
6773
|
+
sampleBatch(num_samples) {
|
|
6774
|
+
const ret = wasm.wasmgaussianmultivector_sampleBatch(this.__wbg_ptr, num_samples);
|
|
6775
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
6776
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
6777
|
+
return v1;
|
|
6778
|
+
}
|
|
6779
|
+
/**
|
|
6780
|
+
* Get the full covariance matrix (flattened, row-major)
|
|
6781
|
+
*
|
|
6782
|
+
* Returns 64 values (8x8 matrix)
|
|
6783
|
+
* @returns {Float64Array}
|
|
6784
|
+
*/
|
|
6785
|
+
getCovariance() {
|
|
6786
|
+
const ret = wasm.wasmgaussianmultivector_getCovariance(this.__wbg_ptr);
|
|
6787
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
6788
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
6789
|
+
return v1;
|
|
6790
|
+
}
|
|
6791
|
+
/**
|
|
6792
|
+
* Create a Gaussian with specified mean and standard deviation
|
|
6793
|
+
*
|
|
6794
|
+
* # Arguments
|
|
6795
|
+
* * `mean` - 8 coefficients for the mean multivector
|
|
6796
|
+
* * `std_dev` - 8 coefficients for per-coefficient standard deviation
|
|
6797
|
+
* @param {Float64Array} mean
|
|
6798
|
+
* @param {Float64Array} std_dev
|
|
6799
|
+
* @returns {WasmGaussianMultivector}
|
|
6800
|
+
*/
|
|
6801
|
+
static withParameters(mean, std_dev) {
|
|
6802
|
+
const ptr0 = passArrayF64ToWasm0(mean, wasm.__wbindgen_malloc);
|
|
6803
|
+
const len0 = WASM_VECTOR_LEN;
|
|
6804
|
+
const ptr1 = passArrayF64ToWasm0(std_dev, wasm.__wbindgen_malloc);
|
|
6805
|
+
const len1 = WASM_VECTOR_LEN;
|
|
6806
|
+
const ret = wasm.wasmgaussianmultivector_withParameters(ptr0, len0, ptr1, len1);
|
|
6807
|
+
if (ret[2]) {
|
|
6808
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
6809
|
+
}
|
|
6810
|
+
return WasmGaussianMultivector.__wrap(ret[0]);
|
|
6004
6811
|
}
|
|
6005
6812
|
/**
|
|
6006
6813
|
* Create a Gaussian concentrated on a specific grade
|
|
@@ -8574,6 +9381,34 @@ export class WasmMultiDualNumber {
|
|
|
8574
9381
|
const ret = wasm.wasmmultidualnumber_getNumVars(this.__wbg_ptr);
|
|
8575
9382
|
return ret >>> 0;
|
|
8576
9383
|
}
|
|
9384
|
+
/**
|
|
9385
|
+
* Maximum with explicit derivative tie handling.
|
|
9386
|
+
* @param {WasmMultiDualNumber} other
|
|
9387
|
+
* @param {WasmBranchPolicy} policy
|
|
9388
|
+
* @returns {WasmMultiDualNumber}
|
|
9389
|
+
*/
|
|
9390
|
+
maxByPolicy(other, policy) {
|
|
9391
|
+
_assertClass(other, WasmMultiDualNumber);
|
|
9392
|
+
const ret = wasm.wasmmultidualnumber_maxByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
|
|
9393
|
+
if (ret[2]) {
|
|
9394
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
9395
|
+
}
|
|
9396
|
+
return WasmMultiDualNumber.__wrap(ret[0]);
|
|
9397
|
+
}
|
|
9398
|
+
/**
|
|
9399
|
+
* Minimum with explicit derivative tie handling.
|
|
9400
|
+
* @param {WasmMultiDualNumber} other
|
|
9401
|
+
* @param {WasmBranchPolicy} policy
|
|
9402
|
+
* @returns {WasmMultiDualNumber}
|
|
9403
|
+
*/
|
|
9404
|
+
minByPolicy(other, policy) {
|
|
9405
|
+
_assertClass(other, WasmMultiDualNumber);
|
|
9406
|
+
const ret = wasm.wasmmultidualnumber_minByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
|
|
9407
|
+
if (ret[2]) {
|
|
9408
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
9409
|
+
}
|
|
9410
|
+
return WasmMultiDualNumber.__wrap(ret[0]);
|
|
9411
|
+
}
|
|
8577
9412
|
/**
|
|
8578
9413
|
* Addition
|
|
8579
9414
|
* @param {WasmMultiDualNumber} other
|
|
@@ -8653,6 +9488,17 @@ export class WasmMultiDualNumber {
|
|
|
8653
9488
|
const ret = wasm.wasmmultidualnumber_variable(value, num_vars, var_index);
|
|
8654
9489
|
return WasmMultiDualNumber.__wrap(ret);
|
|
8655
9490
|
}
|
|
9491
|
+
/**
|
|
9492
|
+
* Create one basis-seeded variable per input coordinate.
|
|
9493
|
+
* @param {Float64Array} values
|
|
9494
|
+
* @returns {Array<any>}
|
|
9495
|
+
*/
|
|
9496
|
+
static variables(values) {
|
|
9497
|
+
const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_malloc);
|
|
9498
|
+
const len0 = WASM_VECTOR_LEN;
|
|
9499
|
+
const ret = wasm.wasmmultidualnumber_variables(ptr0, len0);
|
|
9500
|
+
return ret;
|
|
9501
|
+
}
|
|
8656
9502
|
}
|
|
8657
9503
|
|
|
8658
9504
|
const WasmMultiObjectiveOptimizerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -9816,7 +10662,7 @@ export class WasmOpticalRotorField {
|
|
|
9816
10662
|
* @returns {number}
|
|
9817
10663
|
*/
|
|
9818
10664
|
get width() {
|
|
9819
|
-
const ret = wasm.
|
|
10665
|
+
const ret = wasm.wasmgameinspection_reachableNodeCount(this.__wbg_ptr);
|
|
9820
10666
|
return ret >>> 0;
|
|
9821
10667
|
}
|
|
9822
10668
|
/**
|
|
@@ -9998,513 +10844,1002 @@ export class WasmOptimizationUtils {
|
|
|
9998
10844
|
}
|
|
9999
10845
|
}
|
|
10000
10846
|
|
|
10001
|
-
const
|
|
10847
|
+
const WasmOrdinalFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
10002
10848
|
? { register: () => {}, unregister: () => {} }
|
|
10003
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
10849
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmordinal_free(ptr >>> 0, 1));
|
|
10004
10850
|
/**
|
|
10005
|
-
*
|
|
10851
|
+
* Arena-bound handle for an ordinal below ε₀.
|
|
10006
10852
|
*/
|
|
10007
|
-
export class
|
|
10853
|
+
export class WasmOrdinal {
|
|
10008
10854
|
|
|
10009
10855
|
static __wrap(ptr) {
|
|
10010
10856
|
ptr = ptr >>> 0;
|
|
10011
|
-
const obj = Object.create(
|
|
10857
|
+
const obj = Object.create(WasmOrdinal.prototype);
|
|
10012
10858
|
obj.__wbg_ptr = ptr;
|
|
10013
|
-
|
|
10859
|
+
WasmOrdinalFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
10014
10860
|
return obj;
|
|
10015
10861
|
}
|
|
10016
10862
|
|
|
10017
10863
|
__destroy_into_raw() {
|
|
10018
10864
|
const ptr = this.__wbg_ptr;
|
|
10019
10865
|
this.__wbg_ptr = 0;
|
|
10020
|
-
|
|
10866
|
+
WasmOrdinalFinalization.unregister(this);
|
|
10021
10867
|
return ptr;
|
|
10022
10868
|
}
|
|
10023
10869
|
|
|
10024
10870
|
free() {
|
|
10025
10871
|
const ptr = this.__destroy_into_raw();
|
|
10026
|
-
wasm.
|
|
10872
|
+
wasm.__wbg_wasmordinal_free(ptr, 0);
|
|
10027
10873
|
}
|
|
10028
10874
|
/**
|
|
10029
|
-
*
|
|
10030
|
-
* @returns {
|
|
10875
|
+
* Raw arena-local ordinal index.
|
|
10876
|
+
* @returns {number}
|
|
10031
10877
|
*/
|
|
10032
|
-
|
|
10033
|
-
const ret = wasm.
|
|
10034
|
-
return
|
|
10878
|
+
getIndex() {
|
|
10879
|
+
const ret = wasm.wasmlebesguemeasure_getDimension(this.__wbg_ptr);
|
|
10880
|
+
return ret >>> 0;
|
|
10881
|
+
}
|
|
10882
|
+
}
|
|
10883
|
+
|
|
10884
|
+
const WasmOrdinalArenaFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
10885
|
+
? { register: () => {}, unregister: () => {} }
|
|
10886
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmordinalarena_free(ptr >>> 0, 1));
|
|
10887
|
+
/**
|
|
10888
|
+
* Arena-backed store for canonical ordinals below ε₀.
|
|
10889
|
+
*/
|
|
10890
|
+
export class WasmOrdinalArena {
|
|
10891
|
+
|
|
10892
|
+
__destroy_into_raw() {
|
|
10893
|
+
const ptr = this.__wbg_ptr;
|
|
10894
|
+
this.__wbg_ptr = 0;
|
|
10895
|
+
WasmOrdinalArenaFinalization.unregister(this);
|
|
10896
|
+
return ptr;
|
|
10897
|
+
}
|
|
10898
|
+
|
|
10899
|
+
free() {
|
|
10900
|
+
const ptr = this.__destroy_into_raw();
|
|
10901
|
+
wasm.__wbg_wasmordinalarena_free(ptr, 0);
|
|
10035
10902
|
}
|
|
10036
10903
|
/**
|
|
10037
|
-
*
|
|
10038
|
-
* @param {number} x
|
|
10039
|
-
* @param {Float64Array} params
|
|
10904
|
+
* Number of interned ordinal nodes.
|
|
10040
10905
|
* @returns {number}
|
|
10041
10906
|
*/
|
|
10042
|
-
|
|
10043
|
-
const
|
|
10044
|
-
|
|
10045
|
-
|
|
10907
|
+
nodeCount() {
|
|
10908
|
+
const ret = wasm.wasmordinalarena_nodeCount(this.__wbg_ptr);
|
|
10909
|
+
return ret >>> 0;
|
|
10910
|
+
}
|
|
10911
|
+
/**
|
|
10912
|
+
* Number of CNF terms.
|
|
10913
|
+
* @param {WasmOrdinal} ordinal
|
|
10914
|
+
* @returns {number}
|
|
10915
|
+
*/
|
|
10916
|
+
termCount(ordinal) {
|
|
10917
|
+
_assertClass(ordinal, WasmOrdinal);
|
|
10918
|
+
const ret = wasm.wasmordinalarena_termCount(this.__wbg_ptr, ordinal.__wbg_ptr);
|
|
10046
10919
|
if (ret[2]) {
|
|
10047
10920
|
throw takeFromExternrefTable0(ret[1]);
|
|
10048
10921
|
}
|
|
10049
|
-
return ret[0];
|
|
10922
|
+
return ret[0] >>> 0;
|
|
10050
10923
|
}
|
|
10051
10924
|
/**
|
|
10052
|
-
*
|
|
10053
|
-
* @param {
|
|
10054
|
-
* @param {
|
|
10055
|
-
* @returns {
|
|
10925
|
+
* Select the best of two weights using semiring-style `max`.
|
|
10926
|
+
* @param {WasmOrdinalWeight} left
|
|
10927
|
+
* @param {WasmOrdinalWeight} right
|
|
10928
|
+
* @returns {WasmOrdinalWeight}
|
|
10056
10929
|
*/
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
const
|
|
10061
|
-
|
|
10062
|
-
|
|
10063
|
-
if (ret[3]) {
|
|
10064
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
10930
|
+
bestWeight2(left, right) {
|
|
10931
|
+
_assertClass(left, WasmOrdinalWeight);
|
|
10932
|
+
_assertClass(right, WasmOrdinalWeight);
|
|
10933
|
+
const ret = wasm.wasmordinalarena_bestWeight2(this.__wbg_ptr, left.__wbg_ptr, right.__wbg_ptr);
|
|
10934
|
+
if (ret[2]) {
|
|
10935
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
10065
10936
|
}
|
|
10066
|
-
|
|
10067
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
10068
|
-
return v3;
|
|
10937
|
+
return WasmOrdinalWeight.__wrap(ret[0]);
|
|
10069
10938
|
}
|
|
10070
10939
|
/**
|
|
10071
|
-
*
|
|
10072
|
-
* @
|
|
10940
|
+
* Select the best of three weights using semiring-style `max`.
|
|
10941
|
+
* @param {WasmOrdinalWeight} first
|
|
10942
|
+
* @param {WasmOrdinalWeight} second
|
|
10943
|
+
* @param {WasmOrdinalWeight} third
|
|
10944
|
+
* @returns {WasmOrdinalWeight}
|
|
10073
10945
|
*/
|
|
10074
|
-
|
|
10075
|
-
|
|
10076
|
-
|
|
10946
|
+
bestWeight3(first, second, third) {
|
|
10947
|
+
_assertClass(first, WasmOrdinalWeight);
|
|
10948
|
+
_assertClass(second, WasmOrdinalWeight);
|
|
10949
|
+
_assertClass(third, WasmOrdinalWeight);
|
|
10950
|
+
const ret = wasm.wasmordinalarena_bestWeight3(this.__wbg_ptr, first.__wbg_ptr, second.__wbg_ptr, third.__wbg_ptr);
|
|
10951
|
+
if (ret[2]) {
|
|
10952
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
10953
|
+
}
|
|
10954
|
+
return WasmOrdinalWeight.__wrap(ret[0]);
|
|
10077
10955
|
}
|
|
10078
10956
|
/**
|
|
10079
|
-
*
|
|
10080
|
-
* @
|
|
10957
|
+
* Finite value when the ordinal is finite.
|
|
10958
|
+
* @param {WasmOrdinal} ordinal
|
|
10959
|
+
* @returns {number | undefined}
|
|
10081
10960
|
*/
|
|
10082
|
-
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10961
|
+
finiteValue(ordinal) {
|
|
10962
|
+
_assertClass(ordinal, WasmOrdinal);
|
|
10963
|
+
const ret = wasm.wasmordinalarena_finiteValue(this.__wbg_ptr, ordinal.__wbg_ptr);
|
|
10964
|
+
if (ret[3]) {
|
|
10965
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
10966
|
+
}
|
|
10967
|
+
return ret[0] === 0 ? undefined : ret[1];
|
|
10968
|
+
}
|
|
10086
10969
|
/**
|
|
10087
|
-
*
|
|
10088
|
-
*
|
|
10089
|
-
*
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10970
|
+
* Return true if this is a successor ordinal.
|
|
10971
|
+
* @param {WasmOrdinal} ordinal
|
|
10972
|
+
* @returns {boolean}
|
|
10973
|
+
*/
|
|
10974
|
+
isSuccessor(ordinal) {
|
|
10975
|
+
_assertClass(ordinal, WasmOrdinal);
|
|
10976
|
+
const ret = wasm.wasmordinalarena_isSuccessor(this.__wbg_ptr, ordinal.__wbg_ptr);
|
|
10977
|
+
if (ret[2]) {
|
|
10978
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
10979
|
+
}
|
|
10980
|
+
return ret[0] !== 0;
|
|
10981
|
+
}
|
|
10982
|
+
/**
|
|
10983
|
+
* Semiring-style additive combination (`max`) for ordinal weights.
|
|
10984
|
+
* @param {WasmOrdinalWeight} left
|
|
10985
|
+
* @param {WasmOrdinalWeight} right
|
|
10986
|
+
* @returns {WasmOrdinalWeight}
|
|
10987
|
+
*/
|
|
10988
|
+
oplusWeight(left, right) {
|
|
10989
|
+
_assertClass(left, WasmOrdinalWeight);
|
|
10990
|
+
_assertClass(right, WasmOrdinalWeight);
|
|
10991
|
+
const ret = wasm.wasmordinalarena_oplusWeight(this.__wbg_ptr, left.__wbg_ptr, right.__wbg_ptr);
|
|
10992
|
+
if (ret[2]) {
|
|
10993
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
10994
|
+
}
|
|
10995
|
+
return WasmOrdinalWeight.__wrap(ret[0]);
|
|
10996
|
+
}
|
|
10997
|
+
/**
|
|
10998
|
+
* Format an ordinal weight.
|
|
10999
|
+
* @param {WasmOrdinalWeight} weight
|
|
11000
|
+
* @returns {string}
|
|
11001
|
+
*/
|
|
11002
|
+
formatWeight(weight) {
|
|
11003
|
+
let deferred2_0;
|
|
11004
|
+
let deferred2_1;
|
|
11005
|
+
try {
|
|
11006
|
+
_assertClass(weight, WasmOrdinalWeight);
|
|
11007
|
+
const ret = wasm.wasmordinalarena_formatWeight(this.__wbg_ptr, weight.__wbg_ptr);
|
|
11008
|
+
var ptr1 = ret[0];
|
|
11009
|
+
var len1 = ret[1];
|
|
11010
|
+
if (ret[3]) {
|
|
11011
|
+
ptr1 = 0; len1 = 0;
|
|
11012
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
11013
|
+
}
|
|
11014
|
+
deferred2_0 = ptr1;
|
|
11015
|
+
deferred2_1 = len1;
|
|
11016
|
+
return getStringFromWasm0(ptr1, len1);
|
|
11017
|
+
} finally {
|
|
11018
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
11019
|
+
}
|
|
11020
|
+
}
|
|
11021
|
+
/**
|
|
11022
|
+
* Semiring-style multiplicative composition (ordinal addition) for weights.
|
|
11023
|
+
* @param {WasmOrdinalWeight} left
|
|
11024
|
+
* @param {WasmOrdinalWeight} right
|
|
11025
|
+
* @returns {WasmOrdinalWeight}
|
|
11026
|
+
*/
|
|
11027
|
+
otimesWeight(left, right) {
|
|
11028
|
+
_assertClass(left, WasmOrdinalWeight);
|
|
11029
|
+
_assertClass(right, WasmOrdinalWeight);
|
|
11030
|
+
const ret = wasm.wasmordinalarena_otimesWeight(this.__wbg_ptr, left.__wbg_ptr, right.__wbg_ptr);
|
|
11031
|
+
if (ret[2]) {
|
|
11032
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
11033
|
+
}
|
|
11034
|
+
return WasmOrdinalWeight.__wrap(ret[0]);
|
|
11035
|
+
}
|
|
11036
|
+
/**
|
|
11037
|
+
* Compare two weights: -1 for less, 0 for equal, 1 for greater.
|
|
11038
|
+
* @param {WasmOrdinalWeight} left
|
|
11039
|
+
* @param {WasmOrdinalWeight} right
|
|
10094
11040
|
* @returns {number}
|
|
10095
11041
|
*/
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
const ret = wasm.
|
|
11042
|
+
compareWeight(left, right) {
|
|
11043
|
+
_assertClass(left, WasmOrdinalWeight);
|
|
11044
|
+
_assertClass(right, WasmOrdinalWeight);
|
|
11045
|
+
const ret = wasm.wasmordinalarena_compareWeight(this.__wbg_ptr, left.__wbg_ptr, right.__wbg_ptr);
|
|
10100
11046
|
if (ret[2]) {
|
|
10101
11047
|
throw takeFromExternrefTable0(ret[1]);
|
|
10102
11048
|
}
|
|
10103
11049
|
return ret[0];
|
|
10104
11050
|
}
|
|
10105
11051
|
/**
|
|
10106
|
-
*
|
|
10107
|
-
* @
|
|
11052
|
+
* Format an ordinal in Cantor normal form.
|
|
11053
|
+
* @param {WasmOrdinal} ordinal
|
|
11054
|
+
* @returns {string}
|
|
10108
11055
|
*/
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
11056
|
+
formatOrdinal(ordinal) {
|
|
11057
|
+
let deferred2_0;
|
|
11058
|
+
let deferred2_1;
|
|
11059
|
+
try {
|
|
11060
|
+
_assertClass(ordinal, WasmOrdinal);
|
|
11061
|
+
const ret = wasm.wasmordinalarena_formatOrdinal(this.__wbg_ptr, ordinal.__wbg_ptr);
|
|
11062
|
+
var ptr1 = ret[0];
|
|
11063
|
+
var len1 = ret[1];
|
|
11064
|
+
if (ret[3]) {
|
|
11065
|
+
ptr1 = 0; len1 = 0;
|
|
11066
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
11067
|
+
}
|
|
11068
|
+
deferred2_0 = ptr1;
|
|
11069
|
+
deferred2_1 = len1;
|
|
11070
|
+
return getStringFromWasm0(ptr1, len1);
|
|
11071
|
+
} finally {
|
|
11072
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
11073
|
+
}
|
|
10112
11074
|
}
|
|
10113
11075
|
/**
|
|
10114
|
-
*
|
|
10115
|
-
* @param {
|
|
10116
|
-
* @param {
|
|
10117
|
-
* @returns {
|
|
11076
|
+
* Compose two weights using ordinal addition with bottom annihilation.
|
|
11077
|
+
* @param {WasmOrdinalWeight} left
|
|
11078
|
+
* @param {WasmOrdinalWeight} right
|
|
11079
|
+
* @returns {WasmOrdinalWeight}
|
|
10118
11080
|
*/
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
const ret = wasm.
|
|
10123
|
-
if (ret[
|
|
10124
|
-
throw takeFromExternrefTable0(ret[
|
|
11081
|
+
composeWeight2(left, right) {
|
|
11082
|
+
_assertClass(left, WasmOrdinalWeight);
|
|
11083
|
+
_assertClass(right, WasmOrdinalWeight);
|
|
11084
|
+
const ret = wasm.wasmordinalarena_composeWeight2(this.__wbg_ptr, left.__wbg_ptr, right.__wbg_ptr);
|
|
11085
|
+
if (ret[2]) {
|
|
11086
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
10125
11087
|
}
|
|
10126
|
-
|
|
10127
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
10128
|
-
return v2;
|
|
11088
|
+
return WasmOrdinalWeight.__wrap(ret[0]);
|
|
10129
11089
|
}
|
|
10130
|
-
|
|
10131
|
-
|
|
10132
|
-
|
|
10133
|
-
|
|
10134
|
-
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
|
|
10141
|
-
|
|
10142
|
-
|
|
11090
|
+
/**
|
|
11091
|
+
* Compose three weights using ordinal addition with bottom annihilation.
|
|
11092
|
+
* @param {WasmOrdinalWeight} first
|
|
11093
|
+
* @param {WasmOrdinalWeight} second
|
|
11094
|
+
* @param {WasmOrdinalWeight} third
|
|
11095
|
+
* @returns {WasmOrdinalWeight}
|
|
11096
|
+
*/
|
|
11097
|
+
composeWeight3(first, second, third) {
|
|
11098
|
+
_assertClass(first, WasmOrdinalWeight);
|
|
11099
|
+
_assertClass(second, WasmOrdinalWeight);
|
|
11100
|
+
_assertClass(third, WasmOrdinalWeight);
|
|
11101
|
+
const ret = wasm.wasmordinalarena_composeWeight3(this.__wbg_ptr, first.__wbg_ptr, second.__wbg_ptr, third.__wbg_ptr);
|
|
11102
|
+
if (ret[2]) {
|
|
11103
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
10143
11104
|
}
|
|
10144
|
-
return
|
|
11105
|
+
return WasmOrdinalWeight.__wrap(ret[0]);
|
|
10145
11106
|
}
|
|
10146
|
-
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
11107
|
+
/**
|
|
11108
|
+
* Build a JavaScript object with ordinal inspection metadata.
|
|
11109
|
+
* @param {WasmOrdinal} ordinal
|
|
11110
|
+
* @returns {any}
|
|
11111
|
+
*/
|
|
11112
|
+
inspectOrdinal(ordinal) {
|
|
11113
|
+
_assertClass(ordinal, WasmOrdinal);
|
|
11114
|
+
const ret = wasm.wasmordinalarena_inspectOrdinal(this.__wbg_ptr, ordinal.__wbg_ptr);
|
|
11115
|
+
if (ret[2]) {
|
|
11116
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
11117
|
+
}
|
|
11118
|
+
return takeFromExternrefTable0(ret[0]);
|
|
10152
11119
|
}
|
|
10153
|
-
|
|
10154
|
-
|
|
10155
|
-
|
|
10156
|
-
|
|
11120
|
+
/**
|
|
11121
|
+
* Return true if the ordinal is zero.
|
|
11122
|
+
* @param {WasmOrdinal} ordinal
|
|
11123
|
+
* @returns {boolean}
|
|
11124
|
+
*/
|
|
11125
|
+
isZeroOrdinal(ordinal) {
|
|
11126
|
+
_assertClass(ordinal, WasmOrdinal);
|
|
11127
|
+
const ret = wasm.wasmordinalarena_isZeroOrdinal(this.__wbg_ptr, ordinal.__wbg_ptr);
|
|
11128
|
+
if (ret[2]) {
|
|
11129
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
11130
|
+
}
|
|
11131
|
+
return ret[0] !== 0;
|
|
10157
11132
|
}
|
|
10158
11133
|
/**
|
|
10159
|
-
*
|
|
10160
|
-
* @
|
|
11134
|
+
* Construct a weight from an ordinal.
|
|
11135
|
+
* @param {WasmOrdinal} ordinal
|
|
11136
|
+
* @returns {WasmOrdinalWeight}
|
|
10161
11137
|
*/
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
11138
|
+
weightFromOrdinal(ordinal) {
|
|
11139
|
+
_assertClass(ordinal, WasmOrdinal);
|
|
11140
|
+
const ret = wasm.wasmordinalarena_weightFromOrdinal(this.__wbg_ptr, ordinal.__wbg_ptr);
|
|
11141
|
+
return WasmOrdinalWeight.__wrap(ret);
|
|
10165
11142
|
}
|
|
10166
11143
|
/**
|
|
10167
|
-
*
|
|
10168
|
-
* @param {
|
|
10169
|
-
* @param {
|
|
10170
|
-
* @returns {
|
|
11144
|
+
* Ordinal addition.
|
|
11145
|
+
* @param {WasmOrdinal} left
|
|
11146
|
+
* @param {WasmOrdinal} right
|
|
11147
|
+
* @returns {WasmOrdinal}
|
|
10171
11148
|
*/
|
|
10172
|
-
|
|
10173
|
-
|
|
10174
|
-
|
|
11149
|
+
add(left, right) {
|
|
11150
|
+
_assertClass(left, WasmOrdinal);
|
|
11151
|
+
_assertClass(right, WasmOrdinal);
|
|
11152
|
+
const ret = wasm.wasmordinalarena_add(this.__wbg_ptr, left.__wbg_ptr, right.__wbg_ptr);
|
|
11153
|
+
if (ret[2]) {
|
|
11154
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
11155
|
+
}
|
|
11156
|
+
return WasmOrdinal.__wrap(ret[0]);
|
|
10175
11157
|
}
|
|
10176
11158
|
/**
|
|
10177
|
-
* Create
|
|
10178
|
-
* @param {Uint32Array} parts
|
|
11159
|
+
* Create an ordinal arena containing zero.
|
|
10179
11160
|
*/
|
|
10180
|
-
constructor(
|
|
10181
|
-
const
|
|
10182
|
-
const len0 = WASM_VECTOR_LEN;
|
|
10183
|
-
const ret = wasm.wasmpartition_new(ptr0, len0);
|
|
11161
|
+
constructor() {
|
|
11162
|
+
const ret = wasm.wasmordinalarena_new();
|
|
10184
11163
|
this.__wbg_ptr = ret >>> 0;
|
|
10185
|
-
|
|
11164
|
+
WasmOrdinalArenaFinalization.register(this, this.__wbg_ptr, this);
|
|
10186
11165
|
return this;
|
|
10187
11166
|
}
|
|
10188
11167
|
/**
|
|
10189
|
-
*
|
|
10190
|
-
* @
|
|
10191
|
-
* @returns {boolean}
|
|
11168
|
+
* Finite ordinal one.
|
|
11169
|
+
* @returns {WasmOrdinal}
|
|
10192
11170
|
*/
|
|
10193
|
-
|
|
10194
|
-
|
|
10195
|
-
|
|
10196
|
-
return ret !== 0;
|
|
11171
|
+
one() {
|
|
11172
|
+
const ret = wasm.wasmordinalarena_one(this.__wbg_ptr);
|
|
11173
|
+
return WasmOrdinal.__wrap(ret);
|
|
10197
11174
|
}
|
|
10198
11175
|
/**
|
|
10199
|
-
*
|
|
11176
|
+
* Structural kind: zero, finite, successor, or limit.
|
|
11177
|
+
* @param {WasmOrdinal} ordinal
|
|
11178
|
+
* @returns {string}
|
|
11179
|
+
*/
|
|
11180
|
+
kind(ordinal) {
|
|
11181
|
+
let deferred2_0;
|
|
11182
|
+
let deferred2_1;
|
|
11183
|
+
try {
|
|
11184
|
+
_assertClass(ordinal, WasmOrdinal);
|
|
11185
|
+
const ret = wasm.wasmordinalarena_kind(this.__wbg_ptr, ordinal.__wbg_ptr);
|
|
11186
|
+
var ptr1 = ret[0];
|
|
11187
|
+
var len1 = ret[1];
|
|
11188
|
+
if (ret[3]) {
|
|
11189
|
+
ptr1 = 0; len1 = 0;
|
|
11190
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
11191
|
+
}
|
|
11192
|
+
deferred2_0 = ptr1;
|
|
11193
|
+
deferred2_1 = len1;
|
|
11194
|
+
return getStringFromWasm0(ptr1, len1);
|
|
11195
|
+
} finally {
|
|
11196
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
11197
|
+
}
|
|
11198
|
+
}
|
|
11199
|
+
/**
|
|
11200
|
+
* Canonical zero ordinal.
|
|
11201
|
+
* @returns {WasmOrdinal}
|
|
11202
|
+
*/
|
|
11203
|
+
zero() {
|
|
11204
|
+
const ret = wasm.wasmordinalarena_zero(this.__wbg_ptr);
|
|
11205
|
+
return WasmOrdinal.__wrap(ret);
|
|
11206
|
+
}
|
|
11207
|
+
/**
|
|
11208
|
+
* The ordinal ω.
|
|
11209
|
+
* @returns {WasmOrdinal}
|
|
11210
|
+
*/
|
|
11211
|
+
omega() {
|
|
11212
|
+
const ret = wasm.wasmordinalarena_omega(this.__wbg_ptr);
|
|
11213
|
+
return WasmOrdinal.__wrap(ret);
|
|
11214
|
+
}
|
|
11215
|
+
/**
|
|
11216
|
+
* Finite natural ordinal `n`.
|
|
11217
|
+
* @param {number} n
|
|
11218
|
+
* @returns {WasmOrdinal}
|
|
11219
|
+
*/
|
|
11220
|
+
finite(n) {
|
|
11221
|
+
const ret = wasm.wasmordinalarena_finite(this.__wbg_ptr, n);
|
|
11222
|
+
return WasmOrdinal.__wrap(ret);
|
|
11223
|
+
}
|
|
11224
|
+
/**
|
|
11225
|
+
* Compare two ordinals: -1 for less, 0 for equal, 1 for greater.
|
|
11226
|
+
* @param {WasmOrdinal} left
|
|
11227
|
+
* @param {WasmOrdinal} right
|
|
10200
11228
|
* @returns {number}
|
|
10201
11229
|
*/
|
|
10202
|
-
|
|
10203
|
-
|
|
10204
|
-
|
|
11230
|
+
compare(left, right) {
|
|
11231
|
+
_assertClass(left, WasmOrdinal);
|
|
11232
|
+
_assertClass(right, WasmOrdinal);
|
|
11233
|
+
const ret = wasm.wasmordinalarena_compare(this.__wbg_ptr, left.__wbg_ptr, right.__wbg_ptr);
|
|
11234
|
+
if (ret[2]) {
|
|
11235
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
11236
|
+
}
|
|
11237
|
+
return ret[0];
|
|
10205
11238
|
}
|
|
10206
11239
|
/**
|
|
10207
|
-
*
|
|
11240
|
+
* Return true if this is a nonzero limit ordinal.
|
|
11241
|
+
* @param {WasmOrdinal} ordinal
|
|
10208
11242
|
* @returns {boolean}
|
|
10209
11243
|
*/
|
|
10210
|
-
|
|
10211
|
-
|
|
10212
|
-
|
|
11244
|
+
isLimit(ordinal) {
|
|
11245
|
+
_assertClass(ordinal, WasmOrdinal);
|
|
11246
|
+
const ret = wasm.wasmordinalarena_isLimit(this.__wbg_ptr, ordinal.__wbg_ptr);
|
|
11247
|
+
if (ret[2]) {
|
|
11248
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
11249
|
+
}
|
|
11250
|
+
return ret[0] !== 0;
|
|
10213
11251
|
}
|
|
10214
11252
|
/**
|
|
10215
|
-
*
|
|
10216
|
-
* @
|
|
11253
|
+
* Leading-exponent valuation of a weight, if any.
|
|
11254
|
+
* @param {WasmOrdinalWeight} weight
|
|
11255
|
+
* @returns {number | undefined}
|
|
10217
11256
|
*/
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
|
|
10221
|
-
|
|
10222
|
-
|
|
11257
|
+
valuation(weight) {
|
|
11258
|
+
_assertClass(weight, WasmOrdinalWeight);
|
|
11259
|
+
const ret = wasm.wasmordinalarena_valuation(this.__wbg_ptr, weight.__wbg_ptr);
|
|
11260
|
+
if (ret[2]) {
|
|
11261
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
11262
|
+
}
|
|
11263
|
+
return ret[0] === 0x100000001 ? undefined : ret[0];
|
|
10223
11264
|
}
|
|
10224
11265
|
}
|
|
10225
11266
|
|
|
10226
|
-
const
|
|
11267
|
+
const WasmOrdinalWeightFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
10227
11268
|
? { register: () => {}, unregister: () => {} }
|
|
10228
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
11269
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmordinalweight_free(ptr >>> 0, 1));
|
|
10229
11270
|
/**
|
|
10230
|
-
*
|
|
11271
|
+
* Bottom-extended ordinal optimization weight.
|
|
10231
11272
|
*/
|
|
10232
|
-
export class
|
|
11273
|
+
export class WasmOrdinalWeight {
|
|
10233
11274
|
|
|
10234
11275
|
static __wrap(ptr) {
|
|
10235
11276
|
ptr = ptr >>> 0;
|
|
10236
|
-
const obj = Object.create(
|
|
11277
|
+
const obj = Object.create(WasmOrdinalWeight.prototype);
|
|
10237
11278
|
obj.__wbg_ptr = ptr;
|
|
10238
|
-
|
|
11279
|
+
WasmOrdinalWeightFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
10239
11280
|
return obj;
|
|
10240
11281
|
}
|
|
10241
11282
|
|
|
10242
11283
|
__destroy_into_raw() {
|
|
10243
11284
|
const ptr = this.__wbg_ptr;
|
|
10244
11285
|
this.__wbg_ptr = 0;
|
|
10245
|
-
|
|
11286
|
+
WasmOrdinalWeightFinalization.unregister(this);
|
|
10246
11287
|
return ptr;
|
|
10247
11288
|
}
|
|
10248
11289
|
|
|
10249
11290
|
free() {
|
|
10250
11291
|
const ptr = this.__destroy_into_raw();
|
|
10251
|
-
wasm.
|
|
11292
|
+
wasm.__wbg_wasmordinalweight_free(ptr, 0);
|
|
10252
11293
|
}
|
|
10253
11294
|
/**
|
|
10254
|
-
*
|
|
10255
|
-
* @returns {
|
|
11295
|
+
* Arena-local ordinal index when this weight wraps an ordinal.
|
|
11296
|
+
* @returns {number | undefined}
|
|
10256
11297
|
*/
|
|
10257
|
-
|
|
10258
|
-
const ret = wasm.
|
|
10259
|
-
|
|
10260
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
10261
|
-
return v1;
|
|
11298
|
+
ordinalIndex() {
|
|
11299
|
+
const ret = wasm.wasmordinalweight_ordinalIndex(this.__wbg_ptr);
|
|
11300
|
+
return ret === 0x100000001 ? undefined : ret;
|
|
10262
11301
|
}
|
|
10263
11302
|
/**
|
|
10264
|
-
*
|
|
10265
|
-
* @
|
|
10266
|
-
* @returns {number}
|
|
11303
|
+
* Construct the semiring one element, i.e. ordinal zero.
|
|
11304
|
+
* @returns {WasmOrdinalWeight}
|
|
10267
11305
|
*/
|
|
10268
|
-
|
|
10269
|
-
const ret = wasm.
|
|
10270
|
-
return ret
|
|
11306
|
+
static one() {
|
|
11307
|
+
const ret = wasm.wasmordinalweight_one();
|
|
11308
|
+
return WasmOrdinalWeight.__wrap(ret);
|
|
10271
11309
|
}
|
|
10272
11310
|
/**
|
|
10273
|
-
*
|
|
10274
|
-
* @
|
|
10275
|
-
* @returns {WasmPersistentHomology}
|
|
11311
|
+
* Alias for the semiring zero element.
|
|
11312
|
+
* @returns {WasmOrdinalWeight}
|
|
10276
11313
|
*/
|
|
10277
|
-
static
|
|
10278
|
-
|
|
10279
|
-
|
|
10280
|
-
if (ret[2]) {
|
|
10281
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
10282
|
-
}
|
|
10283
|
-
return WasmPersistentHomology.__wrap(ret[0]);
|
|
11314
|
+
static zero() {
|
|
11315
|
+
const ret = wasm.wasmordinalweight_bottom();
|
|
11316
|
+
return WasmOrdinalWeight.__wrap(ret);
|
|
10284
11317
|
}
|
|
10285
11318
|
/**
|
|
10286
|
-
*
|
|
10287
|
-
* @
|
|
10288
|
-
* @returns {Uint32Array}
|
|
11319
|
+
* Construct the bottom element.
|
|
11320
|
+
* @returns {WasmOrdinalWeight}
|
|
10289
11321
|
*/
|
|
10290
|
-
|
|
10291
|
-
const ret = wasm.
|
|
10292
|
-
|
|
10293
|
-
|
|
10294
|
-
|
|
11322
|
+
static bottom() {
|
|
11323
|
+
const ret = wasm.wasmordinalweight_bottom();
|
|
11324
|
+
return WasmOrdinalWeight.__wrap(ret);
|
|
11325
|
+
}
|
|
11326
|
+
/**
|
|
11327
|
+
* Whether this weight is bottom.
|
|
11328
|
+
* @returns {boolean}
|
|
11329
|
+
*/
|
|
11330
|
+
isBottom() {
|
|
11331
|
+
const ret = wasm.wasmordinalweight_isBottom(this.__wbg_ptr);
|
|
11332
|
+
return ret !== 0;
|
|
10295
11333
|
}
|
|
10296
11334
|
}
|
|
10297
11335
|
|
|
10298
|
-
const
|
|
11336
|
+
const WasmParametricDensityFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
10299
11337
|
? { register: () => {}, unregister: () => {} }
|
|
10300
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
11338
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmparametricdensity_free(ptr >>> 0, 1));
|
|
10301
11339
|
/**
|
|
10302
|
-
*
|
|
10303
|
-
*
|
|
10304
|
-
* Wraps an f64 value with associated probability metadata.
|
|
10305
|
-
* Supports mapping, composition, and probability tracking.
|
|
11340
|
+
* Parametric probability density families
|
|
10306
11341
|
*/
|
|
10307
|
-
export class
|
|
11342
|
+
export class WasmParametricDensity {
|
|
10308
11343
|
|
|
10309
11344
|
static __wrap(ptr) {
|
|
10310
11345
|
ptr = ptr >>> 0;
|
|
10311
|
-
const obj = Object.create(
|
|
11346
|
+
const obj = Object.create(WasmParametricDensity.prototype);
|
|
10312
11347
|
obj.__wbg_ptr = ptr;
|
|
10313
|
-
|
|
11348
|
+
WasmParametricDensityFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
10314
11349
|
return obj;
|
|
10315
11350
|
}
|
|
10316
11351
|
|
|
10317
11352
|
__destroy_into_raw() {
|
|
10318
11353
|
const ptr = this.__wbg_ptr;
|
|
10319
11354
|
this.__wbg_ptr = 0;
|
|
10320
|
-
|
|
11355
|
+
WasmParametricDensityFinalization.unregister(this);
|
|
10321
11356
|
return ptr;
|
|
10322
11357
|
}
|
|
10323
11358
|
|
|
10324
11359
|
free() {
|
|
10325
11360
|
const ptr = this.__destroy_into_raw();
|
|
10326
|
-
wasm.
|
|
11361
|
+
wasm.__wbg_wasmparametricdensity_free(ptr, 0);
|
|
10327
11362
|
}
|
|
10328
11363
|
/**
|
|
10329
|
-
*
|
|
10330
|
-
* @returns {
|
|
11364
|
+
* Create an Exponential density Exp(λ)
|
|
11365
|
+
* @returns {WasmParametricDensity}
|
|
10331
11366
|
*/
|
|
10332
|
-
|
|
10333
|
-
const ret = wasm.
|
|
10334
|
-
return ret;
|
|
11367
|
+
static exponential() {
|
|
11368
|
+
const ret = wasm.wasmparametricdensity_exponential();
|
|
11369
|
+
return WasmParametricDensity.__wrap(ret);
|
|
10335
11370
|
}
|
|
10336
11371
|
/**
|
|
10337
|
-
*
|
|
10338
|
-
*
|
|
10339
|
-
*
|
|
10340
|
-
* @
|
|
10341
|
-
* @param {number} value
|
|
10342
|
-
* @returns {WasmProb}
|
|
11372
|
+
* Compute log-density log p(x|θ)
|
|
11373
|
+
* @param {number} x
|
|
11374
|
+
* @param {Float64Array} params
|
|
11375
|
+
* @returns {number}
|
|
10343
11376
|
*/
|
|
10344
|
-
|
|
10345
|
-
const
|
|
11377
|
+
logDensity(x, params) {
|
|
11378
|
+
const ptr0 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
|
|
11379
|
+
const len0 = WASM_VECTOR_LEN;
|
|
11380
|
+
const ret = wasm.wasmparametricdensity_logDensity(this.__wbg_ptr, x, ptr0, len0);
|
|
10346
11381
|
if (ret[2]) {
|
|
10347
11382
|
throw takeFromExternrefTable0(ret[1]);
|
|
10348
11383
|
}
|
|
10349
|
-
return
|
|
11384
|
+
return ret[0];
|
|
10350
11385
|
}
|
|
10351
11386
|
/**
|
|
10352
|
-
*
|
|
10353
|
-
* @param {
|
|
10354
|
-
* @
|
|
11387
|
+
* Compute Fisher information matrix from data samples
|
|
11388
|
+
* @param {Float64Array} data
|
|
11389
|
+
* @param {Float64Array} params
|
|
11390
|
+
* @returns {Float64Array}
|
|
10355
11391
|
*/
|
|
10356
|
-
|
|
10357
|
-
const
|
|
10358
|
-
|
|
11392
|
+
fisherInformation(data, params) {
|
|
11393
|
+
const ptr0 = passArrayF64ToWasm0(data, wasm.__wbindgen_malloc);
|
|
11394
|
+
const len0 = WASM_VECTOR_LEN;
|
|
11395
|
+
const ptr1 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
|
|
11396
|
+
const len1 = WASM_VECTOR_LEN;
|
|
11397
|
+
const ret = wasm.wasmparametricdensity_fisherInformation(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
11398
|
+
if (ret[3]) {
|
|
11399
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
11400
|
+
}
|
|
11401
|
+
var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
11402
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
11403
|
+
return v3;
|
|
10359
11404
|
}
|
|
10360
11405
|
/**
|
|
10361
|
-
* Create a
|
|
10362
|
-
* @
|
|
11406
|
+
* Create a Cauchy density Cauchy(x₀, γ)
|
|
11407
|
+
* @returns {WasmParametricDensity}
|
|
10363
11408
|
*/
|
|
10364
|
-
|
|
10365
|
-
const ret = wasm.
|
|
10366
|
-
|
|
10367
|
-
WasmProbFinalization.register(this, this.__wbg_ptr, this);
|
|
10368
|
-
return this;
|
|
11409
|
+
static cauchy() {
|
|
11410
|
+
const ret = wasm.wasmparametricdensity_cauchy();
|
|
11411
|
+
return WasmParametricDensity.__wrap(ret);
|
|
10369
11412
|
}
|
|
10370
11413
|
/**
|
|
10371
|
-
*
|
|
10372
|
-
* @returns {
|
|
11414
|
+
* Create a Laplace density Laplace(μ, b)
|
|
11415
|
+
* @returns {WasmParametricDensity}
|
|
10373
11416
|
*/
|
|
10374
|
-
|
|
10375
|
-
const ret = wasm.
|
|
10376
|
-
return ret;
|
|
11417
|
+
static laplace() {
|
|
11418
|
+
const ret = wasm.wasmparametricdensity_laplace();
|
|
11419
|
+
return WasmParametricDensity.__wrap(ret);
|
|
10377
11420
|
}
|
|
10378
11421
|
/**
|
|
10379
|
-
*
|
|
11422
|
+
* Evaluate density at point x with parameters
|
|
10380
11423
|
*
|
|
10381
|
-
*
|
|
11424
|
+
* # Arguments
|
|
11425
|
+
* * `x` - Point to evaluate
|
|
11426
|
+
* * `params` - Parameters (Gaussian: [μ, σ], Exponential: [λ], etc.)
|
|
11427
|
+
* @param {number} x
|
|
11428
|
+
* @param {Float64Array} params
|
|
10382
11429
|
* @returns {number}
|
|
10383
11430
|
*/
|
|
10384
|
-
|
|
10385
|
-
const
|
|
10386
|
-
|
|
11431
|
+
evaluate(x, params) {
|
|
11432
|
+
const ptr0 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
|
|
11433
|
+
const len0 = WASM_VECTOR_LEN;
|
|
11434
|
+
const ret = wasm.wasmparametricdensity_evaluate(this.__wbg_ptr, x, ptr0, len0);
|
|
11435
|
+
if (ret[2]) {
|
|
11436
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
11437
|
+
}
|
|
11438
|
+
return ret[0];
|
|
10387
11439
|
}
|
|
10388
11440
|
/**
|
|
10389
|
-
*
|
|
10390
|
-
*
|
|
10391
|
-
* Multiplies probabilities and values together.
|
|
10392
|
-
* @param {number} other_probability
|
|
10393
|
-
* @param {number} other_value
|
|
10394
|
-
* @returns {WasmProb}
|
|
11441
|
+
* Create a Gaussian density N(μ, σ²)
|
|
11442
|
+
* @returns {WasmParametricDensity}
|
|
10395
11443
|
*/
|
|
10396
|
-
|
|
10397
|
-
const ret = wasm.
|
|
10398
|
-
|
|
10399
|
-
|
|
11444
|
+
static gaussian() {
|
|
11445
|
+
const ret = wasm.wasmparametricdensity_gaussian();
|
|
11446
|
+
return WasmParametricDensity.__wrap(ret);
|
|
11447
|
+
}
|
|
11448
|
+
/**
|
|
11449
|
+
* Compute numerical gradient ∇_θ p(x|θ)
|
|
11450
|
+
* @param {number} x
|
|
11451
|
+
* @param {Float64Array} params
|
|
11452
|
+
* @returns {Float64Array}
|
|
11453
|
+
*/
|
|
11454
|
+
gradient(x, params) {
|
|
11455
|
+
const ptr0 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
|
|
11456
|
+
const len0 = WASM_VECTOR_LEN;
|
|
11457
|
+
const ret = wasm.wasmparametricdensity_gradient(this.__wbg_ptr, x, ptr0, len0);
|
|
11458
|
+
if (ret[3]) {
|
|
11459
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
10400
11460
|
}
|
|
10401
|
-
|
|
11461
|
+
var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
11462
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
11463
|
+
return v2;
|
|
10402
11464
|
}
|
|
10403
11465
|
}
|
|
10404
11466
|
|
|
10405
|
-
const
|
|
11467
|
+
const WasmPartitionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
10406
11468
|
? { register: () => {}, unregister: () => {} }
|
|
10407
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
11469
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmpartition_free(ptr >>> 0, 1));
|
|
10408
11470
|
/**
|
|
10409
|
-
* WASM wrapper for
|
|
10410
|
-
*
|
|
10411
|
-
* A probability measure assigns total measure 1 to the entire space.
|
|
11471
|
+
* WASM wrapper for partitions used in Schubert calculus and LR coefficients
|
|
10412
11472
|
*/
|
|
10413
|
-
export class
|
|
11473
|
+
export class WasmPartition {
|
|
10414
11474
|
|
|
10415
|
-
static
|
|
10416
|
-
|
|
10417
|
-
|
|
10418
|
-
|
|
10419
|
-
|
|
10420
|
-
return obj;
|
|
11475
|
+
static __unwrap(jsValue) {
|
|
11476
|
+
if (!(jsValue instanceof WasmPartition)) {
|
|
11477
|
+
return 0;
|
|
11478
|
+
}
|
|
11479
|
+
return jsValue.__destroy_into_raw();
|
|
10421
11480
|
}
|
|
10422
11481
|
|
|
10423
11482
|
__destroy_into_raw() {
|
|
10424
11483
|
const ptr = this.__wbg_ptr;
|
|
10425
11484
|
this.__wbg_ptr = 0;
|
|
10426
|
-
|
|
11485
|
+
WasmPartitionFinalization.unregister(this);
|
|
10427
11486
|
return ptr;
|
|
10428
11487
|
}
|
|
10429
11488
|
|
|
10430
11489
|
free() {
|
|
10431
11490
|
const ptr = this.__destroy_into_raw();
|
|
10432
|
-
wasm.
|
|
11491
|
+
wasm.__wbg_wasmpartition_free(ptr, 0);
|
|
10433
11492
|
}
|
|
10434
11493
|
/**
|
|
10435
|
-
* Get
|
|
10436
|
-
* @returns {
|
|
11494
|
+
* Get the length (number of non-zero parts) of this partition
|
|
11495
|
+
* @returns {number}
|
|
10437
11496
|
*/
|
|
10438
|
-
|
|
10439
|
-
|
|
10440
|
-
|
|
10441
|
-
try {
|
|
10442
|
-
const ret = wasm.wasmprobabilitymeasure_getDescription(this.__wbg_ptr);
|
|
10443
|
-
deferred1_0 = ret[0];
|
|
10444
|
-
deferred1_1 = ret[1];
|
|
10445
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
10446
|
-
} finally {
|
|
10447
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
10448
|
-
}
|
|
11497
|
+
getLength() {
|
|
11498
|
+
const ret = wasm.wasmopticalrotorfield_length(this.__wbg_ptr);
|
|
11499
|
+
return ret >>> 0;
|
|
10449
11500
|
}
|
|
10450
11501
|
/**
|
|
10451
|
-
*
|
|
10452
|
-
* @param {number}
|
|
10453
|
-
* @param {number}
|
|
10454
|
-
* @
|
|
10455
|
-
* @param {number} upper
|
|
10456
|
-
* @returns {number}
|
|
11502
|
+
* Check if this partition fits in a k × (n-k) box (for Grassmannian)
|
|
11503
|
+
* @param {number} k
|
|
11504
|
+
* @param {number} n
|
|
11505
|
+
* @returns {boolean}
|
|
10457
11506
|
*/
|
|
10458
|
-
|
|
10459
|
-
const ret = wasm.
|
|
10460
|
-
return ret;
|
|
11507
|
+
fitsInBox(k, n) {
|
|
11508
|
+
const ret = wasm.wasmpartition_fitsInBox(this.__wbg_ptr, k, n);
|
|
11509
|
+
return ret !== 0;
|
|
10461
11510
|
}
|
|
10462
11511
|
/**
|
|
10463
|
-
* Create a new
|
|
11512
|
+
* Create a new partition from an array of parts
|
|
11513
|
+
* @param {Uint32Array} parts
|
|
10464
11514
|
*/
|
|
10465
|
-
constructor() {
|
|
10466
|
-
const
|
|
11515
|
+
constructor(parts) {
|
|
11516
|
+
const ptr0 = passArray32ToWasm0(parts, wasm.__wbindgen_malloc);
|
|
11517
|
+
const len0 = WASM_VECTOR_LEN;
|
|
11518
|
+
const ret = wasm.wasmpartition_new(ptr0, len0);
|
|
10467
11519
|
this.__wbg_ptr = ret >>> 0;
|
|
10468
|
-
|
|
11520
|
+
WasmPartitionFinalization.register(this, this.__wbg_ptr, this);
|
|
10469
11521
|
return this;
|
|
10470
11522
|
}
|
|
10471
11523
|
/**
|
|
10472
|
-
*
|
|
10473
|
-
* @param {
|
|
10474
|
-
* @
|
|
10475
|
-
* @returns {WasmProbabilityMeasure}
|
|
11524
|
+
* Check if this partition contains another (for skew shapes)
|
|
11525
|
+
* @param {WasmPartition} other
|
|
11526
|
+
* @returns {boolean}
|
|
10476
11527
|
*/
|
|
10477
|
-
|
|
10478
|
-
|
|
10479
|
-
|
|
10480
|
-
|
|
10481
|
-
|
|
10482
|
-
|
|
11528
|
+
contains(other) {
|
|
11529
|
+
_assertClass(other, WasmPartition);
|
|
11530
|
+
const ret = wasm.wasmpartition_contains(this.__wbg_ptr, other.__wbg_ptr);
|
|
11531
|
+
return ret !== 0;
|
|
11532
|
+
}
|
|
11533
|
+
/**
|
|
11534
|
+
* Get the size (sum of parts) of this partition
|
|
11535
|
+
* @returns {number}
|
|
11536
|
+
*/
|
|
11537
|
+
getSize() {
|
|
11538
|
+
const ret = wasm.wasmpartition_getSize(this.__wbg_ptr);
|
|
11539
|
+
return ret >>> 0;
|
|
11540
|
+
}
|
|
11541
|
+
/**
|
|
11542
|
+
* Check if this partition is valid (weakly decreasing, positive parts)
|
|
11543
|
+
* @returns {boolean}
|
|
11544
|
+
*/
|
|
11545
|
+
isValid() {
|
|
11546
|
+
const ret = wasm.wasmpartition_isValid(this.__wbg_ptr);
|
|
11547
|
+
return ret !== 0;
|
|
11548
|
+
}
|
|
11549
|
+
/**
|
|
11550
|
+
* Get the parts of this partition
|
|
11551
|
+
* @returns {Uint32Array}
|
|
11552
|
+
*/
|
|
11553
|
+
getParts() {
|
|
11554
|
+
const ret = wasm.wasmpartition_getParts(this.__wbg_ptr);
|
|
11555
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
11556
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
11557
|
+
return v1;
|
|
10483
11558
|
}
|
|
10484
11559
|
}
|
|
10485
11560
|
|
|
10486
|
-
const
|
|
11561
|
+
const WasmPersistentHomologyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
10487
11562
|
? { register: () => {}, unregister: () => {} }
|
|
10488
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
11563
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmpersistenthomology_free(ptr >>> 0, 1));
|
|
10489
11564
|
/**
|
|
10490
|
-
*
|
|
11565
|
+
* Result of persistent homology computation.
|
|
10491
11566
|
*/
|
|
10492
|
-
export class
|
|
11567
|
+
export class WasmPersistentHomology {
|
|
11568
|
+
|
|
11569
|
+
static __wrap(ptr) {
|
|
11570
|
+
ptr = ptr >>> 0;
|
|
11571
|
+
const obj = Object.create(WasmPersistentHomology.prototype);
|
|
11572
|
+
obj.__wbg_ptr = ptr;
|
|
11573
|
+
WasmPersistentHomologyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
11574
|
+
return obj;
|
|
11575
|
+
}
|
|
10493
11576
|
|
|
10494
11577
|
__destroy_into_raw() {
|
|
10495
11578
|
const ptr = this.__wbg_ptr;
|
|
10496
11579
|
this.__wbg_ptr = 0;
|
|
10497
|
-
|
|
11580
|
+
WasmPersistentHomologyFinalization.unregister(this);
|
|
10498
11581
|
return ptr;
|
|
10499
11582
|
}
|
|
10500
11583
|
|
|
10501
11584
|
free() {
|
|
10502
11585
|
const ptr = this.__destroy_into_raw();
|
|
10503
|
-
wasm.
|
|
11586
|
+
wasm.__wbg_wasmpersistenthomology_free(ptr, 0);
|
|
10504
11587
|
}
|
|
10505
11588
|
/**
|
|
10506
|
-
* Get the
|
|
10507
|
-
* @returns {
|
|
11589
|
+
* Get the persistence diagram as an array of [dimension, birth, death] triples.
|
|
11590
|
+
* @returns {Float64Array}
|
|
11591
|
+
*/
|
|
11592
|
+
getDiagram() {
|
|
11593
|
+
const ret = wasm.wasmpersistenthomology_getDiagram(this.__wbg_ptr);
|
|
11594
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
11595
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
11596
|
+
return v1;
|
|
11597
|
+
}
|
|
11598
|
+
/**
|
|
11599
|
+
* Get the number of intervals in dimension k.
|
|
11600
|
+
* @param {number} dim
|
|
11601
|
+
* @returns {number}
|
|
11602
|
+
*/
|
|
11603
|
+
intervalCount(dim) {
|
|
11604
|
+
const ret = wasm.wasmpersistenthomology_intervalCount(this.__wbg_ptr, dim);
|
|
11605
|
+
return ret >>> 0;
|
|
11606
|
+
}
|
|
11607
|
+
/**
|
|
11608
|
+
* Compute persistent homology from a filtration.
|
|
11609
|
+
* @param {WasmFiltration} filtration
|
|
11610
|
+
* @returns {WasmPersistentHomology}
|
|
11611
|
+
*/
|
|
11612
|
+
static compute(filtration) {
|
|
11613
|
+
_assertClass(filtration, WasmFiltration);
|
|
11614
|
+
const ret = wasm.wasmpersistenthomology_compute(filtration.__wbg_ptr);
|
|
11615
|
+
if (ret[2]) {
|
|
11616
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
11617
|
+
}
|
|
11618
|
+
return WasmPersistentHomology.__wrap(ret[0]);
|
|
11619
|
+
}
|
|
11620
|
+
/**
|
|
11621
|
+
* Get the Betti numbers at a specific filtration time.
|
|
11622
|
+
* @param {number} time
|
|
11623
|
+
* @returns {Uint32Array}
|
|
11624
|
+
*/
|
|
11625
|
+
bettiAt(time) {
|
|
11626
|
+
const ret = wasm.wasmpersistenthomology_bettiAt(this.__wbg_ptr, time);
|
|
11627
|
+
var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
|
|
11628
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
11629
|
+
return v1;
|
|
11630
|
+
}
|
|
11631
|
+
}
|
|
11632
|
+
|
|
11633
|
+
const WasmProbFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
11634
|
+
? { register: () => {}, unregister: () => {} }
|
|
11635
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmprob_free(ptr >>> 0, 1));
|
|
11636
|
+
/**
|
|
11637
|
+
* WASM wrapper for probabilistic values
|
|
11638
|
+
*
|
|
11639
|
+
* Wraps an f64 value with associated probability metadata.
|
|
11640
|
+
* Supports mapping, composition, and probability tracking.
|
|
11641
|
+
*/
|
|
11642
|
+
export class WasmProb {
|
|
11643
|
+
|
|
11644
|
+
static __wrap(ptr) {
|
|
11645
|
+
ptr = ptr >>> 0;
|
|
11646
|
+
const obj = Object.create(WasmProb.prototype);
|
|
11647
|
+
obj.__wbg_ptr = ptr;
|
|
11648
|
+
WasmProbFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
11649
|
+
return obj;
|
|
11650
|
+
}
|
|
11651
|
+
|
|
11652
|
+
__destroy_into_raw() {
|
|
11653
|
+
const ptr = this.__wbg_ptr;
|
|
11654
|
+
this.__wbg_ptr = 0;
|
|
11655
|
+
WasmProbFinalization.unregister(this);
|
|
11656
|
+
return ptr;
|
|
11657
|
+
}
|
|
11658
|
+
|
|
11659
|
+
free() {
|
|
11660
|
+
const ptr = this.__destroy_into_raw();
|
|
11661
|
+
wasm.__wbg_wasmprob_free(ptr, 0);
|
|
11662
|
+
}
|
|
11663
|
+
/**
|
|
11664
|
+
* Get the probability associated with this value
|
|
11665
|
+
* @returns {number}
|
|
11666
|
+
*/
|
|
11667
|
+
probability() {
|
|
11668
|
+
const ret = wasm.wasmdualnumber_getDual(this.__wbg_ptr);
|
|
11669
|
+
return ret;
|
|
11670
|
+
}
|
|
11671
|
+
/**
|
|
11672
|
+
* Create a value with specified probability
|
|
11673
|
+
*
|
|
11674
|
+
* Probability must be in [0, 1].
|
|
11675
|
+
* @param {number} probability
|
|
11676
|
+
* @param {number} value
|
|
11677
|
+
* @returns {WasmProb}
|
|
11678
|
+
*/
|
|
11679
|
+
static withProbability(probability, value) {
|
|
11680
|
+
const ret = wasm.wasmprob_withProbability(probability, value);
|
|
11681
|
+
if (ret[2]) {
|
|
11682
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
11683
|
+
}
|
|
11684
|
+
return WasmProb.__wrap(ret[0]);
|
|
11685
|
+
}
|
|
11686
|
+
/**
|
|
11687
|
+
* Map the value by multiplying with a factor, preserving probability
|
|
11688
|
+
* @param {number} factor
|
|
11689
|
+
* @returns {WasmProb}
|
|
11690
|
+
*/
|
|
11691
|
+
map(factor) {
|
|
11692
|
+
const ret = wasm.wasmprob_map(this.__wbg_ptr, factor);
|
|
11693
|
+
return WasmProb.__wrap(ret);
|
|
11694
|
+
}
|
|
11695
|
+
/**
|
|
11696
|
+
* Create a certain value (probability = 1.0)
|
|
11697
|
+
* @param {number} value
|
|
11698
|
+
*/
|
|
11699
|
+
constructor(value) {
|
|
11700
|
+
const ret = wasm.wasmdualnumber_variable(value);
|
|
11701
|
+
this.__wbg_ptr = ret >>> 0;
|
|
11702
|
+
WasmProbFinalization.register(this, this.__wbg_ptr, this);
|
|
11703
|
+
return this;
|
|
11704
|
+
}
|
|
11705
|
+
/**
|
|
11706
|
+
* Get the wrapped value
|
|
11707
|
+
* @returns {number}
|
|
11708
|
+
*/
|
|
11709
|
+
value() {
|
|
11710
|
+
const ret = wasm.wasmalphaconnection_getAlpha(this.__wbg_ptr);
|
|
11711
|
+
return ret;
|
|
11712
|
+
}
|
|
11713
|
+
/**
|
|
11714
|
+
* Sample this probabilistic value
|
|
11715
|
+
*
|
|
11716
|
+
* Returns the value with probability p, or NaN otherwise.
|
|
11717
|
+
* @returns {number}
|
|
11718
|
+
*/
|
|
11719
|
+
sample() {
|
|
11720
|
+
const ret = wasm.wasmprob_sample(this.__wbg_ptr);
|
|
11721
|
+
return ret;
|
|
11722
|
+
}
|
|
11723
|
+
/**
|
|
11724
|
+
* Combine with another probabilistic value (independent)
|
|
11725
|
+
*
|
|
11726
|
+
* Multiplies probabilities and values together.
|
|
11727
|
+
* @param {number} other_probability
|
|
11728
|
+
* @param {number} other_value
|
|
11729
|
+
* @returns {WasmProb}
|
|
11730
|
+
*/
|
|
11731
|
+
andThen(other_probability, other_value) {
|
|
11732
|
+
const ret = wasm.wasmprob_andThen(this.__wbg_ptr, other_probability, other_value);
|
|
11733
|
+
if (ret[2]) {
|
|
11734
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
11735
|
+
}
|
|
11736
|
+
return WasmProb.__wrap(ret[0]);
|
|
11737
|
+
}
|
|
11738
|
+
}
|
|
11739
|
+
|
|
11740
|
+
const WasmProbabilityMeasureFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
11741
|
+
? { register: () => {}, unregister: () => {} }
|
|
11742
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmprobabilitymeasure_free(ptr >>> 0, 1));
|
|
11743
|
+
/**
|
|
11744
|
+
* WASM wrapper for probability measures
|
|
11745
|
+
*
|
|
11746
|
+
* A probability measure assigns total measure 1 to the entire space.
|
|
11747
|
+
*/
|
|
11748
|
+
export class WasmProbabilityMeasure {
|
|
11749
|
+
|
|
11750
|
+
static __wrap(ptr) {
|
|
11751
|
+
ptr = ptr >>> 0;
|
|
11752
|
+
const obj = Object.create(WasmProbabilityMeasure.prototype);
|
|
11753
|
+
obj.__wbg_ptr = ptr;
|
|
11754
|
+
WasmProbabilityMeasureFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
11755
|
+
return obj;
|
|
11756
|
+
}
|
|
11757
|
+
|
|
11758
|
+
__destroy_into_raw() {
|
|
11759
|
+
const ptr = this.__wbg_ptr;
|
|
11760
|
+
this.__wbg_ptr = 0;
|
|
11761
|
+
WasmProbabilityMeasureFinalization.unregister(this);
|
|
11762
|
+
return ptr;
|
|
11763
|
+
}
|
|
11764
|
+
|
|
11765
|
+
free() {
|
|
11766
|
+
const ptr = this.__destroy_into_raw();
|
|
11767
|
+
wasm.__wbg_wasmprobabilitymeasure_free(ptr, 0);
|
|
11768
|
+
}
|
|
11769
|
+
/**
|
|
11770
|
+
* Get a description of this probability measure
|
|
11771
|
+
* @returns {string}
|
|
11772
|
+
*/
|
|
11773
|
+
getDescription() {
|
|
11774
|
+
let deferred1_0;
|
|
11775
|
+
let deferred1_1;
|
|
11776
|
+
try {
|
|
11777
|
+
const ret = wasm.wasmprobabilitymeasure_getDescription(this.__wbg_ptr);
|
|
11778
|
+
deferred1_0 = ret[0];
|
|
11779
|
+
deferred1_1 = ret[1];
|
|
11780
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
11781
|
+
} finally {
|
|
11782
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
11783
|
+
}
|
|
11784
|
+
}
|
|
11785
|
+
/**
|
|
11786
|
+
* Compute P(X ∈ [a, b]) for uniform distribution
|
|
11787
|
+
* @param {number} a
|
|
11788
|
+
* @param {number} b
|
|
11789
|
+
* @param {number} lower
|
|
11790
|
+
* @param {number} upper
|
|
11791
|
+
* @returns {number}
|
|
11792
|
+
*/
|
|
11793
|
+
probabilityInterval(a, b, lower, upper) {
|
|
11794
|
+
const ret = wasm.wasmprobabilitymeasure_probabilityInterval(this.__wbg_ptr, a, b, lower, upper);
|
|
11795
|
+
return ret;
|
|
11796
|
+
}
|
|
11797
|
+
/**
|
|
11798
|
+
* Create a new uniform probability measure on [0, 1]
|
|
11799
|
+
*/
|
|
11800
|
+
constructor() {
|
|
11801
|
+
const ret = wasm.wasmprobabilitymeasure_new();
|
|
11802
|
+
this.__wbg_ptr = ret >>> 0;
|
|
11803
|
+
WasmProbabilityMeasureFinalization.register(this, this.__wbg_ptr, this);
|
|
11804
|
+
return this;
|
|
11805
|
+
}
|
|
11806
|
+
/**
|
|
11807
|
+
* Create a uniform probability measure on [a, b]
|
|
11808
|
+
* @param {number} a
|
|
11809
|
+
* @param {number} b
|
|
11810
|
+
* @returns {WasmProbabilityMeasure}
|
|
11811
|
+
*/
|
|
11812
|
+
static uniform(a, b) {
|
|
11813
|
+
const ret = wasm.wasmprobabilitymeasure_uniform(a, b);
|
|
11814
|
+
if (ret[2]) {
|
|
11815
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
11816
|
+
}
|
|
11817
|
+
return WasmProbabilityMeasure.__wrap(ret[0]);
|
|
11818
|
+
}
|
|
11819
|
+
}
|
|
11820
|
+
|
|
11821
|
+
const WasmProjectiveSpaceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
11822
|
+
? { register: () => {}, unregister: () => {} }
|
|
11823
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmprojectivespace_free(ptr >>> 0, 1));
|
|
11824
|
+
/**
|
|
11825
|
+
* WASM wrapper for projective spaces
|
|
11826
|
+
*/
|
|
11827
|
+
export class WasmProjectiveSpace {
|
|
11828
|
+
|
|
11829
|
+
__destroy_into_raw() {
|
|
11830
|
+
const ptr = this.__wbg_ptr;
|
|
11831
|
+
this.__wbg_ptr = 0;
|
|
11832
|
+
WasmProjectiveSpaceFinalization.unregister(this);
|
|
11833
|
+
return ptr;
|
|
11834
|
+
}
|
|
11835
|
+
|
|
11836
|
+
free() {
|
|
11837
|
+
const ptr = this.__destroy_into_raw();
|
|
11838
|
+
wasm.__wbg_wasmprojectivespace_free(ptr, 0);
|
|
11839
|
+
}
|
|
11840
|
+
/**
|
|
11841
|
+
* Get the dimension of this projective space
|
|
11842
|
+
* @returns {number}
|
|
10508
11843
|
*/
|
|
10509
11844
|
getDimension() {
|
|
10510
11845
|
const ret = wasm.wasmlebesguemeasure_getDimension(this.__wbg_ptr);
|
|
@@ -11405,13 +12740,273 @@ export class WasmSensitivityMap {
|
|
|
11405
12740
|
}
|
|
11406
12741
|
}
|
|
11407
12742
|
|
|
11408
|
-
const
|
|
12743
|
+
const WasmShortSurrealFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
11409
12744
|
? { register: () => {}, unregister: () => {} }
|
|
11410
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
12745
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmshortsurreal_free(ptr >>> 0, 1));
|
|
11411
12746
|
/**
|
|
11412
|
-
*
|
|
12747
|
+
* Exact short surreal value backed by a dyadic rational.
|
|
11413
12748
|
*/
|
|
11414
|
-
export class
|
|
12749
|
+
export class WasmShortSurreal {
|
|
12750
|
+
|
|
12751
|
+
static __wrap(ptr) {
|
|
12752
|
+
ptr = ptr >>> 0;
|
|
12753
|
+
const obj = Object.create(WasmShortSurreal.prototype);
|
|
12754
|
+
obj.__wbg_ptr = ptr;
|
|
12755
|
+
WasmShortSurrealFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
12756
|
+
return obj;
|
|
12757
|
+
}
|
|
12758
|
+
|
|
12759
|
+
__destroy_into_raw() {
|
|
12760
|
+
const ptr = this.__wbg_ptr;
|
|
12761
|
+
this.__wbg_ptr = 0;
|
|
12762
|
+
WasmShortSurrealFinalization.unregister(this);
|
|
12763
|
+
return ptr;
|
|
12764
|
+
}
|
|
12765
|
+
|
|
12766
|
+
free() {
|
|
12767
|
+
const ptr = this.__destroy_into_raw();
|
|
12768
|
+
wasm.__wbg_wasmshortsurreal_free(ptr, 0);
|
|
12769
|
+
}
|
|
12770
|
+
/**
|
|
12771
|
+
* Reconstruct this short surreal as a numeric CGT game in the provided arena.
|
|
12772
|
+
* @param {WasmCgtArena} arena
|
|
12773
|
+
* @returns {WasmGameId}
|
|
12774
|
+
*/
|
|
12775
|
+
toGameIn(arena) {
|
|
12776
|
+
_assertClass(arena, WasmCgtArena);
|
|
12777
|
+
const ret = wasm.wasmshortsurreal_toGameIn(this.__wbg_ptr, arena.__wbg_ptr);
|
|
12778
|
+
if (ret[2]) {
|
|
12779
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
12780
|
+
}
|
|
12781
|
+
return WasmGameId.__wrap(ret[0]);
|
|
12782
|
+
}
|
|
12783
|
+
/**
|
|
12784
|
+
* Checked division; fails if the quotient leaves the dyadic layer.
|
|
12785
|
+
* @param {WasmShortSurreal} rhs
|
|
12786
|
+
* @returns {WasmShortSurreal}
|
|
12787
|
+
*/
|
|
12788
|
+
checkedDiv(rhs) {
|
|
12789
|
+
_assertClass(rhs, WasmShortSurreal);
|
|
12790
|
+
const ret = wasm.wasmshortsurreal_checkedDiv(this.__wbg_ptr, rhs.__wbg_ptr);
|
|
12791
|
+
if (ret[2]) {
|
|
12792
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
12793
|
+
}
|
|
12794
|
+
return WasmShortSurreal.__wrap(ret[0]);
|
|
12795
|
+
}
|
|
12796
|
+
/**
|
|
12797
|
+
* Create a short surreal from an exact dyadic value.
|
|
12798
|
+
* @param {WasmDyadic} value
|
|
12799
|
+
* @returns {WasmShortSurreal}
|
|
12800
|
+
*/
|
|
12801
|
+
static fromDyadic(value) {
|
|
12802
|
+
_assertClass(value, WasmDyadic);
|
|
12803
|
+
const ret = wasm.wasmshortsurreal_fromDyadic(value.__wbg_ptr);
|
|
12804
|
+
return WasmShortSurreal.__wrap(ret);
|
|
12805
|
+
}
|
|
12806
|
+
/**
|
|
12807
|
+
* Return whether the value is negative.
|
|
12808
|
+
* @returns {boolean}
|
|
12809
|
+
*/
|
|
12810
|
+
isNegative() {
|
|
12811
|
+
const ret = wasm.wasmshortsurreal_isNegative(this.__wbg_ptr);
|
|
12812
|
+
return ret !== 0;
|
|
12813
|
+
}
|
|
12814
|
+
/**
|
|
12815
|
+
* Return whether the value is positive.
|
|
12816
|
+
* @returns {boolean}
|
|
12817
|
+
*/
|
|
12818
|
+
isPositive() {
|
|
12819
|
+
const ret = wasm.wasmshortsurreal_isPositive(this.__wbg_ptr);
|
|
12820
|
+
return ret !== 0;
|
|
12821
|
+
}
|
|
12822
|
+
/**
|
|
12823
|
+
* Create a short surreal from an integer.
|
|
12824
|
+
* @param {number} value
|
|
12825
|
+
* @returns {WasmShortSurreal}
|
|
12826
|
+
*/
|
|
12827
|
+
static fromInteger(value) {
|
|
12828
|
+
const ret = wasm.wasmshortsurreal_fromInteger(value);
|
|
12829
|
+
return WasmShortSurreal.__wrap(ret);
|
|
12830
|
+
}
|
|
12831
|
+
/**
|
|
12832
|
+
* Whether the value was converted from a CGT game handle.
|
|
12833
|
+
* @returns {boolean}
|
|
12834
|
+
*/
|
|
12835
|
+
hasProvenance() {
|
|
12836
|
+
const ret = wasm.wasmshortsurreal_hasProvenance(this.__wbg_ptr);
|
|
12837
|
+
return ret !== 0;
|
|
12838
|
+
}
|
|
12839
|
+
/**
|
|
12840
|
+
* Checked reciprocal within the dyadic short-surreal layer.
|
|
12841
|
+
* @returns {WasmShortSurreal}
|
|
12842
|
+
*/
|
|
12843
|
+
checkedReciprocal() {
|
|
12844
|
+
const ret = wasm.wasmshortsurreal_checkedReciprocal(this.__wbg_ptr);
|
|
12845
|
+
if (ret[2]) {
|
|
12846
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
12847
|
+
}
|
|
12848
|
+
return WasmShortSurreal.__wrap(ret[0]);
|
|
12849
|
+
}
|
|
12850
|
+
/**
|
|
12851
|
+
* Absolute value.
|
|
12852
|
+
* @returns {WasmShortSurreal}
|
|
12853
|
+
*/
|
|
12854
|
+
abs() {
|
|
12855
|
+
const ret = wasm.wasmshortsurreal_abs(this.__wbg_ptr);
|
|
12856
|
+
return WasmShortSurreal.__wrap(ret);
|
|
12857
|
+
}
|
|
12858
|
+
/**
|
|
12859
|
+
* Add two short surreals exactly.
|
|
12860
|
+
* @param {WasmShortSurreal} rhs
|
|
12861
|
+
* @returns {WasmShortSurreal}
|
|
12862
|
+
*/
|
|
12863
|
+
add(rhs) {
|
|
12864
|
+
_assertClass(rhs, WasmShortSurreal);
|
|
12865
|
+
const ret = wasm.wasmshortsurreal_add(this.__wbg_ptr, rhs.__wbg_ptr);
|
|
12866
|
+
return WasmShortSurreal.__wrap(ret);
|
|
12867
|
+
}
|
|
12868
|
+
/**
|
|
12869
|
+
* Multiply two short surreals exactly.
|
|
12870
|
+
* @param {WasmShortSurreal} rhs
|
|
12871
|
+
* @returns {WasmShortSurreal}
|
|
12872
|
+
*/
|
|
12873
|
+
mul(rhs) {
|
|
12874
|
+
_assertClass(rhs, WasmShortSurreal);
|
|
12875
|
+
const ret = wasm.wasmshortsurreal_mul(this.__wbg_ptr, rhs.__wbg_ptr);
|
|
12876
|
+
return WasmShortSurreal.__wrap(ret);
|
|
12877
|
+
}
|
|
12878
|
+
/**
|
|
12879
|
+
* Negate the value.
|
|
12880
|
+
* @returns {WasmShortSurreal}
|
|
12881
|
+
*/
|
|
12882
|
+
neg() {
|
|
12883
|
+
const ret = wasm.wasmshortsurreal_neg(this.__wbg_ptr);
|
|
12884
|
+
return WasmShortSurreal.__wrap(ret);
|
|
12885
|
+
}
|
|
12886
|
+
/**
|
|
12887
|
+
* Return one.
|
|
12888
|
+
* @returns {WasmShortSurreal}
|
|
12889
|
+
*/
|
|
12890
|
+
static one() {
|
|
12891
|
+
const ret = wasm.wasmshortsurreal_one();
|
|
12892
|
+
return WasmShortSurreal.__wrap(ret);
|
|
12893
|
+
}
|
|
12894
|
+
/**
|
|
12895
|
+
* Subtract two short surreals exactly.
|
|
12896
|
+
* @param {WasmShortSurreal} rhs
|
|
12897
|
+
* @returns {WasmShortSurreal}
|
|
12898
|
+
*/
|
|
12899
|
+
sub(rhs) {
|
|
12900
|
+
_assertClass(rhs, WasmShortSurreal);
|
|
12901
|
+
const ret = wasm.wasmshortsurreal_sub(this.__wbg_ptr, rhs.__wbg_ptr);
|
|
12902
|
+
return WasmShortSurreal.__wrap(ret);
|
|
12903
|
+
}
|
|
12904
|
+
/**
|
|
12905
|
+
* Return the sign as `negative`, `zero`, or `positive`.
|
|
12906
|
+
* @returns {string}
|
|
12907
|
+
*/
|
|
12908
|
+
sign() {
|
|
12909
|
+
let deferred1_0;
|
|
12910
|
+
let deferred1_1;
|
|
12911
|
+
try {
|
|
12912
|
+
const ret = wasm.wasmshortsurreal_sign(this.__wbg_ptr);
|
|
12913
|
+
deferred1_0 = ret[0];
|
|
12914
|
+
deferred1_1 = ret[1];
|
|
12915
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
12916
|
+
} finally {
|
|
12917
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
12918
|
+
}
|
|
12919
|
+
}
|
|
12920
|
+
/**
|
|
12921
|
+
* Return zero.
|
|
12922
|
+
* @returns {WasmShortSurreal}
|
|
12923
|
+
*/
|
|
12924
|
+
static zero() {
|
|
12925
|
+
const ret = wasm.wasmshortsurreal_zero();
|
|
12926
|
+
return WasmShortSurreal.__wrap(ret);
|
|
12927
|
+
}
|
|
12928
|
+
/**
|
|
12929
|
+
* Format as an integer or dyadic rational string.
|
|
12930
|
+
* @returns {string}
|
|
12931
|
+
*/
|
|
12932
|
+
format() {
|
|
12933
|
+
let deferred1_0;
|
|
12934
|
+
let deferred1_1;
|
|
12935
|
+
try {
|
|
12936
|
+
const ret = wasm.wasmshortsurreal_format(this.__wbg_ptr);
|
|
12937
|
+
deferred1_0 = ret[0];
|
|
12938
|
+
deferred1_1 = ret[1];
|
|
12939
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
12940
|
+
} finally {
|
|
12941
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
12942
|
+
}
|
|
12943
|
+
}
|
|
12944
|
+
/**
|
|
12945
|
+
* Compare two short surreal values.
|
|
12946
|
+
* @param {WasmShortSurreal} rhs
|
|
12947
|
+
* @returns {string}
|
|
12948
|
+
*/
|
|
12949
|
+
compare(rhs) {
|
|
12950
|
+
let deferred1_0;
|
|
12951
|
+
let deferred1_1;
|
|
12952
|
+
try {
|
|
12953
|
+
_assertClass(rhs, WasmShortSurreal);
|
|
12954
|
+
const ret = wasm.wasmshortsurreal_compare(this.__wbg_ptr, rhs.__wbg_ptr);
|
|
12955
|
+
deferred1_0 = ret[0];
|
|
12956
|
+
deferred1_1 = ret[1];
|
|
12957
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
12958
|
+
} finally {
|
|
12959
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
12960
|
+
}
|
|
12961
|
+
}
|
|
12962
|
+
/**
|
|
12963
|
+
* Return whether the value is zero.
|
|
12964
|
+
* @returns {boolean}
|
|
12965
|
+
*/
|
|
12966
|
+
isZero() {
|
|
12967
|
+
const ret = wasm.wasmshortsurreal_isZero(this.__wbg_ptr);
|
|
12968
|
+
return ret !== 0;
|
|
12969
|
+
}
|
|
12970
|
+
/**
|
|
12971
|
+
* Birthday of the short surreal value.
|
|
12972
|
+
* @returns {number}
|
|
12973
|
+
*/
|
|
12974
|
+
birthday() {
|
|
12975
|
+
const ret = wasm.wasmgameinspection_birthday(this.__wbg_ptr);
|
|
12976
|
+
return ret >>> 0;
|
|
12977
|
+
}
|
|
12978
|
+
/**
|
|
12979
|
+
* Convert a numeric CGT game to a short surreal.
|
|
12980
|
+
* @param {WasmCgtArena} arena
|
|
12981
|
+
* @param {WasmGameId} game
|
|
12982
|
+
* @returns {WasmShortSurreal}
|
|
12983
|
+
*/
|
|
12984
|
+
static fromGame(arena, game) {
|
|
12985
|
+
_assertClass(arena, WasmCgtArena);
|
|
12986
|
+
_assertClass(game, WasmGameId);
|
|
12987
|
+
const ret = wasm.wasmshortsurreal_fromGame(arena.__wbg_ptr, game.__wbg_ptr);
|
|
12988
|
+
if (ret[2]) {
|
|
12989
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
12990
|
+
}
|
|
12991
|
+
return WasmShortSurreal.__wrap(ret[0]);
|
|
12992
|
+
}
|
|
12993
|
+
/**
|
|
12994
|
+
* Return the exact dyadic value.
|
|
12995
|
+
* @returns {WasmDyadic}
|
|
12996
|
+
*/
|
|
12997
|
+
toDyadic() {
|
|
12998
|
+
const ret = wasm.wasmshortsurreal_toDyadic(this.__wbg_ptr);
|
|
12999
|
+
return WasmDyadic.__wrap(ret);
|
|
13000
|
+
}
|
|
13001
|
+
}
|
|
13002
|
+
|
|
13003
|
+
const WasmSimpleOptimizerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
13004
|
+
? { register: () => {}, unregister: () => {} }
|
|
13005
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsimpleoptimizer_free(ptr >>> 0, 1));
|
|
13006
|
+
/**
|
|
13007
|
+
* Simple quadratic optimization problem for WASM demonstration
|
|
13008
|
+
*/
|
|
13009
|
+
export class WasmSimpleOptimizer {
|
|
11415
13010
|
|
|
11416
13011
|
__destroy_into_raw() {
|
|
11417
13012
|
const ptr = this.__wbg_ptr;
|
|
@@ -11831,563 +13426,1121 @@ export class WasmSmtProofObligation {
|
|
|
11831
13426
|
}
|
|
11832
13427
|
}
|
|
11833
13428
|
/**
|
|
11834
|
-
* Create a new proof obligation
|
|
11835
|
-
*
|
|
11836
|
-
* # Arguments
|
|
11837
|
-
* * `name` - Obligation name (used in SMT-LIB2 comments)
|
|
11838
|
-
* * `description` - Human-readable description
|
|
11839
|
-
* * `kind` - One of: "precondition", "postcondition", "expected_value", "concentration"
|
|
11840
|
-
* * `param1` - First parameter (probability for pre/post, expected value for EV, samples for concentration)
|
|
11841
|
-
* * `param2` - Second parameter (unused for pre/post, epsilon for EV and concentration)
|
|
11842
|
-
* @param {string} name
|
|
11843
|
-
* @param {string} description
|
|
11844
|
-
* @param {string} kind
|
|
11845
|
-
* @param {number} param1
|
|
11846
|
-
* @param {number} param2
|
|
13429
|
+
* Create a new proof obligation
|
|
13430
|
+
*
|
|
13431
|
+
* # Arguments
|
|
13432
|
+
* * `name` - Obligation name (used in SMT-LIB2 comments)
|
|
13433
|
+
* * `description` - Human-readable description
|
|
13434
|
+
* * `kind` - One of: "precondition", "postcondition", "expected_value", "concentration"
|
|
13435
|
+
* * `param1` - First parameter (probability for pre/post, expected value for EV, samples for concentration)
|
|
13436
|
+
* * `param2` - Second parameter (unused for pre/post, epsilon for EV and concentration)
|
|
13437
|
+
* @param {string} name
|
|
13438
|
+
* @param {string} description
|
|
13439
|
+
* @param {string} kind
|
|
13440
|
+
* @param {number} param1
|
|
13441
|
+
* @param {number} param2
|
|
13442
|
+
*/
|
|
13443
|
+
constructor(name, description, kind, param1, param2) {
|
|
13444
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
13445
|
+
const len0 = WASM_VECTOR_LEN;
|
|
13446
|
+
const ptr1 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
13447
|
+
const len1 = WASM_VECTOR_LEN;
|
|
13448
|
+
const ptr2 = passStringToWasm0(kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
13449
|
+
const len2 = WASM_VECTOR_LEN;
|
|
13450
|
+
const ret = wasm.wasmsmtproofobligation_new(ptr0, len0, ptr1, len1, ptr2, len2, param1, param2);
|
|
13451
|
+
if (ret[2]) {
|
|
13452
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
13453
|
+
}
|
|
13454
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
13455
|
+
WasmSmtProofObligationFinalization.register(this, this.__wbg_ptr, this);
|
|
13456
|
+
return this;
|
|
13457
|
+
}
|
|
13458
|
+
}
|
|
13459
|
+
|
|
13460
|
+
const WasmSobolevSpaceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
13461
|
+
? { register: () => {}, unregister: () => {} }
|
|
13462
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsobolevspace_free(ptr >>> 0, 1));
|
|
13463
|
+
/**
|
|
13464
|
+
* WASM wrapper for Sobolev spaces H^k
|
|
13465
|
+
*
|
|
13466
|
+
* Provides function spaces with weak derivatives.
|
|
13467
|
+
*/
|
|
13468
|
+
export class WasmSobolevSpace {
|
|
13469
|
+
|
|
13470
|
+
static __wrap(ptr) {
|
|
13471
|
+
ptr = ptr >>> 0;
|
|
13472
|
+
const obj = Object.create(WasmSobolevSpace.prototype);
|
|
13473
|
+
obj.__wbg_ptr = ptr;
|
|
13474
|
+
WasmSobolevSpaceFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
13475
|
+
return obj;
|
|
13476
|
+
}
|
|
13477
|
+
|
|
13478
|
+
__destroy_into_raw() {
|
|
13479
|
+
const ptr = this.__wbg_ptr;
|
|
13480
|
+
this.__wbg_ptr = 0;
|
|
13481
|
+
WasmSobolevSpaceFinalization.unregister(this);
|
|
13482
|
+
return ptr;
|
|
13483
|
+
}
|
|
13484
|
+
|
|
13485
|
+
free() {
|
|
13486
|
+
const ptr = this.__destroy_into_raw();
|
|
13487
|
+
wasm.__wbg_wasmsobolevspace_free(ptr, 0);
|
|
13488
|
+
}
|
|
13489
|
+
/**
|
|
13490
|
+
* Compute the H^1 seminorm |f|_{H^1} = ||f'||_{L^2}
|
|
13491
|
+
* @param {Function} df
|
|
13492
|
+
* @returns {number}
|
|
13493
|
+
*/
|
|
13494
|
+
h1Seminorm(df) {
|
|
13495
|
+
const ret = wasm.wasmsobolevspace_h1Seminorm(this.__wbg_ptr, df);
|
|
13496
|
+
if (ret[2]) {
|
|
13497
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
13498
|
+
}
|
|
13499
|
+
return ret[0];
|
|
13500
|
+
}
|
|
13501
|
+
/**
|
|
13502
|
+
* Create H^1 over the unit interval [0, 1]
|
|
13503
|
+
* @returns {WasmSobolevSpace}
|
|
13504
|
+
*/
|
|
13505
|
+
static h1UnitInterval() {
|
|
13506
|
+
const ret = wasm.wasmsobolevspace_h1UnitInterval();
|
|
13507
|
+
return WasmSobolevSpace.__wrap(ret);
|
|
13508
|
+
}
|
|
13509
|
+
/**
|
|
13510
|
+
* Create H^2 over the unit interval [0, 1]
|
|
13511
|
+
* @returns {WasmSobolevSpace}
|
|
13512
|
+
*/
|
|
13513
|
+
static h2UnitInterval() {
|
|
13514
|
+
const ret = wasm.wasmsobolevspace_h2UnitInterval();
|
|
13515
|
+
return WasmSobolevSpace.__wrap(ret);
|
|
13516
|
+
}
|
|
13517
|
+
/**
|
|
13518
|
+
* Compute L^2 inner product <f, g>
|
|
13519
|
+
* @param {Function} f
|
|
13520
|
+
* @param {Function} g
|
|
13521
|
+
* @returns {number}
|
|
13522
|
+
*/
|
|
13523
|
+
l2InnerProduct(f, g) {
|
|
13524
|
+
const ret = wasm.wasmsobolevspace_l2InnerProduct(this.__wbg_ptr, f, g);
|
|
13525
|
+
if (ret[2]) {
|
|
13526
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
13527
|
+
}
|
|
13528
|
+
return ret[0];
|
|
13529
|
+
}
|
|
13530
|
+
/**
|
|
13531
|
+
* Compute the Poincare constant estimate for the domain
|
|
13532
|
+
*
|
|
13533
|
+
* For [a,b], this is (b-a)/π
|
|
13534
|
+
* @returns {number}
|
|
13535
|
+
*/
|
|
13536
|
+
poincareConstant() {
|
|
13537
|
+
const ret = wasm.wasmsobolevspace_poincareConstant(this.__wbg_ptr);
|
|
13538
|
+
return ret;
|
|
13539
|
+
}
|
|
13540
|
+
/**
|
|
13541
|
+
* Set the number of quadrature points
|
|
13542
|
+
* @param {number} n
|
|
13543
|
+
*/
|
|
13544
|
+
setQuadraturePoints(n) {
|
|
13545
|
+
wasm.wasmsobolevspace_setQuadraturePoints(this.__wbg_ptr, n);
|
|
13546
|
+
}
|
|
13547
|
+
/**
|
|
13548
|
+
* Create a Sobolev space H^k over an interval [a, b]
|
|
13549
|
+
*
|
|
13550
|
+
* # Arguments
|
|
13551
|
+
* * `order` - The Sobolev regularity (1 for H^1, 2 for H^2)
|
|
13552
|
+
* * `lower` - Lower bound of the interval
|
|
13553
|
+
* * `upper` - Upper bound of the interval
|
|
13554
|
+
* @param {number} order
|
|
13555
|
+
* @param {number} lower
|
|
13556
|
+
* @param {number} upper
|
|
13557
|
+
*/
|
|
13558
|
+
constructor(order, lower, upper) {
|
|
13559
|
+
const ret = wasm.wasmsobolevspace_new(order, lower, upper);
|
|
13560
|
+
if (ret[2]) {
|
|
13561
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
13562
|
+
}
|
|
13563
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
13564
|
+
WasmSobolevSpaceFinalization.register(this, this.__wbg_ptr, this);
|
|
13565
|
+
return this;
|
|
13566
|
+
}
|
|
13567
|
+
/**
|
|
13568
|
+
* Get the domain bounds [lower, upper]
|
|
13569
|
+
* @returns {Float64Array}
|
|
13570
|
+
*/
|
|
13571
|
+
bounds() {
|
|
13572
|
+
const ret = wasm.wasmsobolevspace_bounds(this.__wbg_ptr);
|
|
13573
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
13574
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
13575
|
+
return v1;
|
|
13576
|
+
}
|
|
13577
|
+
/**
|
|
13578
|
+
* Compute the H^k norm of a function using numerical integration
|
|
13579
|
+
*
|
|
13580
|
+
* # Arguments
|
|
13581
|
+
* * `f` - JavaScript function f(x) to evaluate
|
|
13582
|
+
* * `df` - JavaScript function f'(x) (first derivative)
|
|
13583
|
+
* @param {Function} f
|
|
13584
|
+
* @param {Function} df
|
|
13585
|
+
* @returns {number}
|
|
13586
|
+
*/
|
|
13587
|
+
h1Norm(f, df) {
|
|
13588
|
+
const ret = wasm.wasmsobolevspace_h1Norm(this.__wbg_ptr, f, df);
|
|
13589
|
+
if (ret[2]) {
|
|
13590
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
13591
|
+
}
|
|
13592
|
+
return ret[0];
|
|
13593
|
+
}
|
|
13594
|
+
/**
|
|
13595
|
+
* Compute L^2 norm of a function
|
|
13596
|
+
* @param {Function} f
|
|
13597
|
+
* @returns {number}
|
|
13598
|
+
*/
|
|
13599
|
+
l2Norm(f) {
|
|
13600
|
+
const ret = wasm.wasmsobolevspace_l2Norm(this.__wbg_ptr, f);
|
|
13601
|
+
if (ret[2]) {
|
|
13602
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
13603
|
+
}
|
|
13604
|
+
return ret[0];
|
|
13605
|
+
}
|
|
13606
|
+
/**
|
|
13607
|
+
* Get the Sobolev order k
|
|
13608
|
+
* @returns {number}
|
|
13609
|
+
*/
|
|
13610
|
+
order() {
|
|
13611
|
+
const ret = wasm.wasmsobolevspace_order(this.__wbg_ptr);
|
|
13612
|
+
return ret >>> 0;
|
|
13613
|
+
}
|
|
13614
|
+
}
|
|
13615
|
+
|
|
13616
|
+
const WasmSpacetimeVectorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
13617
|
+
? { register: () => {}, unregister: () => {} }
|
|
13618
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmspacetimevector_free(ptr >>> 0, 1));
|
|
13619
|
+
/**
|
|
13620
|
+
* WASM wrapper for spacetime vectors
|
|
13621
|
+
*/
|
|
13622
|
+
export class WasmSpacetimeVector {
|
|
13623
|
+
|
|
13624
|
+
static __wrap(ptr) {
|
|
13625
|
+
ptr = ptr >>> 0;
|
|
13626
|
+
const obj = Object.create(WasmSpacetimeVector.prototype);
|
|
13627
|
+
obj.__wbg_ptr = ptr;
|
|
13628
|
+
WasmSpacetimeVectorFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
13629
|
+
return obj;
|
|
13630
|
+
}
|
|
13631
|
+
|
|
13632
|
+
__destroy_into_raw() {
|
|
13633
|
+
const ptr = this.__wbg_ptr;
|
|
13634
|
+
this.__wbg_ptr = 0;
|
|
13635
|
+
WasmSpacetimeVectorFinalization.unregister(this);
|
|
13636
|
+
return ptr;
|
|
13637
|
+
}
|
|
13638
|
+
|
|
13639
|
+
free() {
|
|
13640
|
+
const ptr = this.__destroy_into_raw();
|
|
13641
|
+
wasm.__wbg_wasmspacetimevector_free(ptr, 0);
|
|
13642
|
+
}
|
|
13643
|
+
/**
|
|
13644
|
+
* Check if vector is timelike (massive particle)
|
|
13645
|
+
* @returns {boolean}
|
|
13646
|
+
*/
|
|
13647
|
+
is_timelike() {
|
|
13648
|
+
const ret = wasm.wasmspacetimevector_is_timelike(this.__wbg_ptr);
|
|
13649
|
+
return ret !== 0;
|
|
13650
|
+
}
|
|
13651
|
+
/**
|
|
13652
|
+
* Check if vector is spacelike
|
|
13653
|
+
* @returns {boolean}
|
|
13654
|
+
*/
|
|
13655
|
+
is_spacelike() {
|
|
13656
|
+
const ret = wasm.wasmspacetimevector_is_spacelike(this.__wbg_ptr);
|
|
13657
|
+
return ret !== 0;
|
|
13658
|
+
}
|
|
13659
|
+
/**
|
|
13660
|
+
* Compute Minkowski norm squared
|
|
13661
|
+
* @returns {number}
|
|
13662
|
+
*/
|
|
13663
|
+
norm_squared() {
|
|
13664
|
+
const ret = wasm.wasmspacetimevector_norm_squared(this.__wbg_ptr);
|
|
13665
|
+
return ret;
|
|
13666
|
+
}
|
|
13667
|
+
/**
|
|
13668
|
+
* Compute Minkowski inner product with another spacetime vector
|
|
13669
|
+
* @param {WasmSpacetimeVector} other
|
|
13670
|
+
* @returns {number}
|
|
13671
|
+
*/
|
|
13672
|
+
minkowski_dot(other) {
|
|
13673
|
+
_assertClass(other, WasmSpacetimeVector);
|
|
13674
|
+
const ret = wasm.wasmspacetimevector_minkowski_dot(this.__wbg_ptr, other.__wbg_ptr);
|
|
13675
|
+
return ret;
|
|
13676
|
+
}
|
|
13677
|
+
/**
|
|
13678
|
+
* Get temporal component
|
|
13679
|
+
* @returns {number}
|
|
13680
|
+
*/
|
|
13681
|
+
get t() {
|
|
13682
|
+
const ret = wasm.wasmfourvelocity_gamma(this.__wbg_ptr);
|
|
13683
|
+
return ret;
|
|
13684
|
+
}
|
|
13685
|
+
/**
|
|
13686
|
+
* Get x component
|
|
13687
|
+
* @returns {number}
|
|
13688
|
+
*/
|
|
13689
|
+
get x() {
|
|
13690
|
+
const ret = wasm.wasmdualnumber_getDual(this.__wbg_ptr);
|
|
13691
|
+
return ret;
|
|
13692
|
+
}
|
|
13693
|
+
/**
|
|
13694
|
+
* Get y component
|
|
13695
|
+
* @returns {number}
|
|
13696
|
+
*/
|
|
13697
|
+
get y() {
|
|
13698
|
+
const ret = wasm.wasmevaluationresult_getGeometricDistance(this.__wbg_ptr);
|
|
13699
|
+
return ret;
|
|
13700
|
+
}
|
|
13701
|
+
/**
|
|
13702
|
+
* Get z component
|
|
13703
|
+
* @returns {number}
|
|
13704
|
+
*/
|
|
13705
|
+
get z() {
|
|
13706
|
+
const ret = wasm.wasmevaluationresult_getCombinedScore(this.__wbg_ptr);
|
|
13707
|
+
return ret;
|
|
13708
|
+
}
|
|
13709
|
+
/**
|
|
13710
|
+
* Create a new spacetime vector with components (ct, x, y, z)
|
|
13711
|
+
* @param {number} t
|
|
13712
|
+
* @param {number} x
|
|
13713
|
+
* @param {number} y
|
|
13714
|
+
* @param {number} z
|
|
13715
|
+
*/
|
|
13716
|
+
constructor(t, x, y, z) {
|
|
13717
|
+
const ret = wasm.wasmspacetimevector_new(t, x, y, z);
|
|
13718
|
+
this.__wbg_ptr = ret >>> 0;
|
|
13719
|
+
WasmSpacetimeVectorFinalization.register(this, this.__wbg_ptr, this);
|
|
13720
|
+
return this;
|
|
13721
|
+
}
|
|
13722
|
+
/**
|
|
13723
|
+
* Check if vector is null (lightlike)
|
|
13724
|
+
* @returns {boolean}
|
|
13725
|
+
*/
|
|
13726
|
+
is_null() {
|
|
13727
|
+
const ret = wasm.wasmspacetimevector_is_null(this.__wbg_ptr);
|
|
13728
|
+
return ret !== 0;
|
|
13729
|
+
}
|
|
13730
|
+
/**
|
|
13731
|
+
* Create a timelike vector
|
|
13732
|
+
* @param {number} t
|
|
13733
|
+
* @returns {WasmSpacetimeVector}
|
|
13734
|
+
*/
|
|
13735
|
+
static timelike(t) {
|
|
13736
|
+
const ret = wasm.wasmspacetimevector_timelike(t);
|
|
13737
|
+
return WasmSpacetimeVector.__wrap(ret);
|
|
13738
|
+
}
|
|
13739
|
+
/**
|
|
13740
|
+
* Create a spacelike vector
|
|
13741
|
+
* @param {number} x
|
|
13742
|
+
* @param {number} y
|
|
13743
|
+
* @param {number} z
|
|
13744
|
+
* @returns {WasmSpacetimeVector}
|
|
13745
|
+
*/
|
|
13746
|
+
static spacelike(x, y, z) {
|
|
13747
|
+
const ret = wasm.wasmspacetimevector_spacelike(x, y, z);
|
|
13748
|
+
return WasmSpacetimeVector.__wrap(ret);
|
|
13749
|
+
}
|
|
13750
|
+
/**
|
|
13751
|
+
* Get string representation
|
|
13752
|
+
* @returns {string}
|
|
13753
|
+
*/
|
|
13754
|
+
to_string() {
|
|
13755
|
+
let deferred1_0;
|
|
13756
|
+
let deferred1_1;
|
|
13757
|
+
try {
|
|
13758
|
+
const ret = wasm.wasmspacetimevector_to_string(this.__wbg_ptr);
|
|
13759
|
+
deferred1_0 = ret[0];
|
|
13760
|
+
deferred1_1 = ret[1];
|
|
13761
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
13762
|
+
} finally {
|
|
13763
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
13764
|
+
}
|
|
13765
|
+
}
|
|
13766
|
+
}
|
|
13767
|
+
|
|
13768
|
+
const WasmSpectralDecompositionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
13769
|
+
? { register: () => {}, unregister: () => {} }
|
|
13770
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmspectraldecomposition_free(ptr >>> 0, 1));
|
|
13771
|
+
/**
|
|
13772
|
+
* WASM wrapper for spectral decomposition
|
|
13773
|
+
*
|
|
13774
|
+
* Provides eigenvalue decomposition for symmetric matrices.
|
|
13775
|
+
*/
|
|
13776
|
+
export class WasmSpectralDecomposition {
|
|
13777
|
+
|
|
13778
|
+
static __wrap(ptr) {
|
|
13779
|
+
ptr = ptr >>> 0;
|
|
13780
|
+
const obj = Object.create(WasmSpectralDecomposition.prototype);
|
|
13781
|
+
obj.__wbg_ptr = ptr;
|
|
13782
|
+
WasmSpectralDecompositionFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
13783
|
+
return obj;
|
|
13784
|
+
}
|
|
13785
|
+
|
|
13786
|
+
__destroy_into_raw() {
|
|
13787
|
+
const ptr = this.__wbg_ptr;
|
|
13788
|
+
this.__wbg_ptr = 0;
|
|
13789
|
+
WasmSpectralDecompositionFinalization.unregister(this);
|
|
13790
|
+
return ptr;
|
|
13791
|
+
}
|
|
13792
|
+
|
|
13793
|
+
free() {
|
|
13794
|
+
const ptr = this.__destroy_into_raw();
|
|
13795
|
+
wasm.__wbg_wasmspectraldecomposition_free(ptr, 0);
|
|
13796
|
+
}
|
|
13797
|
+
/**
|
|
13798
|
+
* Get the eigenvalues
|
|
13799
|
+
* @returns {Float64Array}
|
|
13800
|
+
*/
|
|
13801
|
+
eigenvalues() {
|
|
13802
|
+
const ret = wasm.wasmspectraldecomposition_eigenvalues(this.__wbg_ptr);
|
|
13803
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
13804
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
13805
|
+
return v1;
|
|
13806
|
+
}
|
|
13807
|
+
/**
|
|
13808
|
+
* Check if the decomposition is complete
|
|
13809
|
+
* @returns {boolean}
|
|
13810
|
+
*/
|
|
13811
|
+
isComplete() {
|
|
13812
|
+
const ret = wasm.wasmspectraldecomposition_isComplete(this.__wbg_ptr);
|
|
13813
|
+
return ret !== 0;
|
|
13814
|
+
}
|
|
13815
|
+
/**
|
|
13816
|
+
* Get the eigenvectors as a flattened array
|
|
13817
|
+
*
|
|
13818
|
+
* Returns 4 eigenvectors of 4 components each (16 total)
|
|
13819
|
+
* @returns {Float64Array}
|
|
13820
|
+
*/
|
|
13821
|
+
eigenvectors() {
|
|
13822
|
+
const ret = wasm.wasmspectraldecomposition_eigenvectors(this.__wbg_ptr);
|
|
13823
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
13824
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
13825
|
+
return v1;
|
|
13826
|
+
}
|
|
13827
|
+
/**
|
|
13828
|
+
* Apply f(T) = Σᵢ f(λᵢ) Pᵢ to a vector using functional calculus
|
|
13829
|
+
*
|
|
13830
|
+
* # Arguments
|
|
13831
|
+
* * `f` - JavaScript function to apply to eigenvalues
|
|
13832
|
+
* * `x` - Input vector
|
|
13833
|
+
* @param {Function} f
|
|
13834
|
+
* @param {Float64Array} x
|
|
13835
|
+
* @returns {Float64Array}
|
|
13836
|
+
*/
|
|
13837
|
+
applyFunction(f, x) {
|
|
13838
|
+
const ptr0 = passArrayF64ToWasm0(x, wasm.__wbindgen_malloc);
|
|
13839
|
+
const len0 = WASM_VECTOR_LEN;
|
|
13840
|
+
const ret = wasm.wasmspectraldecomposition_applyFunction(this.__wbg_ptr, f, ptr0, len0);
|
|
13841
|
+
if (ret[3]) {
|
|
13842
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
13843
|
+
}
|
|
13844
|
+
var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
13845
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
13846
|
+
return v2;
|
|
13847
|
+
}
|
|
13848
|
+
/**
|
|
13849
|
+
* Get the spectral radius (largest |eigenvalue|)
|
|
13850
|
+
* @returns {number}
|
|
13851
|
+
*/
|
|
13852
|
+
spectralRadius() {
|
|
13853
|
+
const ret = wasm.wasmspectraldecomposition_spectralRadius(this.__wbg_ptr);
|
|
13854
|
+
return ret;
|
|
13855
|
+
}
|
|
13856
|
+
/**
|
|
13857
|
+
* Get the condition number
|
|
13858
|
+
* @returns {number | undefined}
|
|
13859
|
+
*/
|
|
13860
|
+
conditionNumber() {
|
|
13861
|
+
const ret = wasm.wasmspectraldecomposition_conditionNumber(this.__wbg_ptr);
|
|
13862
|
+
return ret[0] === 0 ? undefined : ret[1];
|
|
13863
|
+
}
|
|
13864
|
+
/**
|
|
13865
|
+
* Check if the operator is positive definite
|
|
13866
|
+
* @returns {boolean}
|
|
13867
|
+
*/
|
|
13868
|
+
isPositiveDefinite() {
|
|
13869
|
+
const ret = wasm.wasmspectraldecomposition_isPositiveDefinite(this.__wbg_ptr);
|
|
13870
|
+
return ret !== 0;
|
|
13871
|
+
}
|
|
13872
|
+
/**
|
|
13873
|
+
* Check if the operator is positive semi-definite
|
|
13874
|
+
* @returns {boolean}
|
|
13875
|
+
*/
|
|
13876
|
+
isPositiveSemidefinite() {
|
|
13877
|
+
const ret = wasm.wasmspectraldecomposition_isPositiveSemidefinite(this.__wbg_ptr);
|
|
13878
|
+
return ret !== 0;
|
|
13879
|
+
}
|
|
13880
|
+
/**
|
|
13881
|
+
* Apply the reconstructed operator T = Σᵢ λᵢ Pᵢ to a vector
|
|
13882
|
+
* @param {Float64Array} x
|
|
13883
|
+
* @returns {Float64Array}
|
|
13884
|
+
*/
|
|
13885
|
+
apply(x) {
|
|
13886
|
+
const ptr0 = passArrayF64ToWasm0(x, wasm.__wbindgen_malloc);
|
|
13887
|
+
const len0 = WASM_VECTOR_LEN;
|
|
13888
|
+
const ret = wasm.wasmspectraldecomposition_apply(this.__wbg_ptr, ptr0, len0);
|
|
13889
|
+
if (ret[3]) {
|
|
13890
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
13891
|
+
}
|
|
13892
|
+
var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
13893
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
13894
|
+
return v2;
|
|
13895
|
+
}
|
|
13896
|
+
/**
|
|
13897
|
+
* Compute spectral decomposition of a symmetric matrix
|
|
13898
|
+
*
|
|
13899
|
+
* # Arguments
|
|
13900
|
+
* * `matrix` - The symmetric matrix operator to decompose
|
|
13901
|
+
* * `max_iterations` - Maximum iterations for eigenvalue computation
|
|
13902
|
+
* * `tolerance` - Convergence tolerance
|
|
13903
|
+
* @param {WasmMatrixOperator} matrix
|
|
13904
|
+
* @param {number} max_iterations
|
|
13905
|
+
* @param {number} tolerance
|
|
13906
|
+
* @returns {WasmSpectralDecomposition}
|
|
13907
|
+
*/
|
|
13908
|
+
static compute(matrix, max_iterations, tolerance) {
|
|
13909
|
+
_assertClass(matrix, WasmMatrixOperator);
|
|
13910
|
+
const ret = wasm.wasmspectraldecomposition_compute(matrix.__wbg_ptr, max_iterations, tolerance);
|
|
13911
|
+
if (ret[2]) {
|
|
13912
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
13913
|
+
}
|
|
13914
|
+
return WasmSpectralDecomposition.__wrap(ret[0]);
|
|
13915
|
+
}
|
|
13916
|
+
}
|
|
13917
|
+
|
|
13918
|
+
const WasmStabilityConditionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
13919
|
+
? { register: () => {}, unregister: () => {} }
|
|
13920
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmstabilitycondition_free(ptr >>> 0, 1));
|
|
13921
|
+
/**
|
|
13922
|
+
* WASM wrapper for Bridgeland-style stability conditions
|
|
13923
|
+
*/
|
|
13924
|
+
export class WasmStabilityCondition {
|
|
13925
|
+
|
|
13926
|
+
__destroy_into_raw() {
|
|
13927
|
+
const ptr = this.__wbg_ptr;
|
|
13928
|
+
this.__wbg_ptr = 0;
|
|
13929
|
+
WasmStabilityConditionFinalization.unregister(this);
|
|
13930
|
+
return ptr;
|
|
13931
|
+
}
|
|
13932
|
+
|
|
13933
|
+
free() {
|
|
13934
|
+
const ptr = this.__destroy_into_raw();
|
|
13935
|
+
wasm.__wbg_wasmstabilitycondition_free(ptr, 0);
|
|
13936
|
+
}
|
|
13937
|
+
/**
|
|
13938
|
+
* Count stable capabilities in a namespace
|
|
13939
|
+
* @param {WasmNamespace} namespace
|
|
13940
|
+
* @returns {number}
|
|
13941
|
+
*/
|
|
13942
|
+
stableCount(namespace) {
|
|
13943
|
+
_assertClass(namespace, WasmNamespace);
|
|
13944
|
+
const ret = wasm.wasmstabilitycondition_stableCount(this.__wbg_ptr, namespace.__wbg_ptr);
|
|
13945
|
+
return ret >>> 0;
|
|
13946
|
+
}
|
|
13947
|
+
/**
|
|
13948
|
+
* Get the trust level
|
|
13949
|
+
* @returns {number}
|
|
13950
|
+
*/
|
|
13951
|
+
getTrustLevel() {
|
|
13952
|
+
const ret = wasm.wasmdualnumber_getDual(this.__wbg_ptr);
|
|
13953
|
+
return ret;
|
|
13954
|
+
}
|
|
13955
|
+
/**
|
|
13956
|
+
* Create a stability condition on Gr(k, n) at a given trust level
|
|
13957
|
+
* @param {number} k
|
|
13958
|
+
* @param {number} n
|
|
13959
|
+
* @param {number} trust_level
|
|
13960
|
+
*/
|
|
13961
|
+
constructor(k, n, trust_level) {
|
|
13962
|
+
const ret = wasm.wasmstabilitycondition_new(k, n, trust_level);
|
|
13963
|
+
this.__wbg_ptr = ret >>> 0;
|
|
13964
|
+
WasmStabilityConditionFinalization.register(this, this.__wbg_ptr, this);
|
|
13965
|
+
return this;
|
|
13966
|
+
}
|
|
13967
|
+
/**
|
|
13968
|
+
* Compute the phase of a Schubert class under this stability condition
|
|
13969
|
+
* @param {WasmSchubertClass} _class
|
|
13970
|
+
* @returns {number}
|
|
11847
13971
|
*/
|
|
11848
|
-
|
|
11849
|
-
|
|
11850
|
-
const
|
|
11851
|
-
|
|
11852
|
-
|
|
11853
|
-
|
|
11854
|
-
|
|
11855
|
-
|
|
11856
|
-
|
|
11857
|
-
|
|
11858
|
-
|
|
11859
|
-
|
|
11860
|
-
|
|
11861
|
-
return
|
|
13972
|
+
phase(_class) {
|
|
13973
|
+
_assertClass(_class, WasmSchubertClass);
|
|
13974
|
+
const ret = wasm.wasmstabilitycondition_phase(this.__wbg_ptr, _class.__wbg_ptr);
|
|
13975
|
+
return ret;
|
|
13976
|
+
}
|
|
13977
|
+
/**
|
|
13978
|
+
* Check if a capability is stable under this condition
|
|
13979
|
+
* @param {WasmCapability} capability
|
|
13980
|
+
* @returns {boolean}
|
|
13981
|
+
*/
|
|
13982
|
+
isStable(capability) {
|
|
13983
|
+
_assertClass(capability, WasmCapability);
|
|
13984
|
+
const ret = wasm.wasmstabilitycondition_isStable(this.__wbg_ptr, capability.__wbg_ptr);
|
|
13985
|
+
return ret !== 0;
|
|
11862
13986
|
}
|
|
11863
13987
|
}
|
|
11864
13988
|
|
|
11865
|
-
const
|
|
13989
|
+
const WasmStaticMultiDual2Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
11866
13990
|
? { register: () => {}, unregister: () => {} }
|
|
11867
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
11868
|
-
|
|
11869
|
-
|
|
11870
|
-
*
|
|
11871
|
-
* Provides function spaces with weak derivatives.
|
|
11872
|
-
*/
|
|
11873
|
-
export class WasmSobolevSpace {
|
|
13991
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmstaticmultidual2_free(ptr >>> 0, 1));
|
|
13992
|
+
|
|
13993
|
+
export class WasmStaticMultiDual2 {
|
|
11874
13994
|
|
|
11875
13995
|
static __wrap(ptr) {
|
|
11876
13996
|
ptr = ptr >>> 0;
|
|
11877
|
-
const obj = Object.create(
|
|
13997
|
+
const obj = Object.create(WasmStaticMultiDual2.prototype);
|
|
11878
13998
|
obj.__wbg_ptr = ptr;
|
|
11879
|
-
|
|
13999
|
+
WasmStaticMultiDual2Finalization.register(obj, obj.__wbg_ptr, obj);
|
|
11880
14000
|
return obj;
|
|
11881
14001
|
}
|
|
11882
14002
|
|
|
11883
14003
|
__destroy_into_raw() {
|
|
11884
14004
|
const ptr = this.__wbg_ptr;
|
|
11885
14005
|
this.__wbg_ptr = 0;
|
|
11886
|
-
|
|
14006
|
+
WasmStaticMultiDual2Finalization.unregister(this);
|
|
11887
14007
|
return ptr;
|
|
11888
14008
|
}
|
|
11889
14009
|
|
|
11890
14010
|
free() {
|
|
11891
14011
|
const ptr = this.__destroy_into_raw();
|
|
11892
|
-
wasm.
|
|
14012
|
+
wasm.__wbg_wasmstaticmultidual2_free(ptr, 0);
|
|
11893
14013
|
}
|
|
11894
14014
|
/**
|
|
11895
|
-
*
|
|
11896
|
-
* @
|
|
11897
|
-
* @returns {number}
|
|
14015
|
+
* Get the fixed-size gradient as a JavaScript array-compatible vector.
|
|
14016
|
+
* @returns {Float64Array}
|
|
11898
14017
|
*/
|
|
11899
|
-
|
|
11900
|
-
const ret = wasm.
|
|
11901
|
-
|
|
11902
|
-
|
|
11903
|
-
|
|
11904
|
-
return ret[0];
|
|
14018
|
+
getGradient() {
|
|
14019
|
+
const ret = wasm.wasmstaticmultidual2_getGradient(this.__wbg_ptr);
|
|
14020
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
14021
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
14022
|
+
return v1;
|
|
11905
14023
|
}
|
|
11906
14024
|
/**
|
|
11907
|
-
*
|
|
11908
|
-
* @
|
|
14025
|
+
* Maximum with explicit derivative tie handling.
|
|
14026
|
+
* @param {WasmStaticMultiDual2} other
|
|
14027
|
+
* @param {WasmBranchPolicy} policy
|
|
14028
|
+
* @returns {WasmStaticMultiDual2}
|
|
11909
14029
|
*/
|
|
11910
|
-
|
|
11911
|
-
|
|
11912
|
-
|
|
14030
|
+
maxByPolicy(other, policy) {
|
|
14031
|
+
_assertClass(other, WasmStaticMultiDual2);
|
|
14032
|
+
const ret = wasm.wasmstaticmultidual2_maxByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
|
|
14033
|
+
return WasmStaticMultiDual2.__wrap(ret);
|
|
11913
14034
|
}
|
|
11914
14035
|
/**
|
|
11915
|
-
*
|
|
11916
|
-
* @
|
|
14036
|
+
* Minimum with explicit derivative tie handling.
|
|
14037
|
+
* @param {WasmStaticMultiDual2} other
|
|
14038
|
+
* @param {WasmBranchPolicy} policy
|
|
14039
|
+
* @returns {WasmStaticMultiDual2}
|
|
11917
14040
|
*/
|
|
11918
|
-
|
|
11919
|
-
|
|
11920
|
-
|
|
14041
|
+
minByPolicy(other, policy) {
|
|
14042
|
+
_assertClass(other, WasmStaticMultiDual2);
|
|
14043
|
+
const ret = wasm.wasmstaticmultidual2_minByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
|
|
14044
|
+
return WasmStaticMultiDual2.__wrap(ret);
|
|
11921
14045
|
}
|
|
11922
14046
|
/**
|
|
11923
|
-
*
|
|
11924
|
-
* @
|
|
11925
|
-
* @param {Function} g
|
|
11926
|
-
* @returns {number}
|
|
14047
|
+
* Convert to the heap-backed multi-dual wrapper.
|
|
14048
|
+
* @returns {WasmMultiDualNumber}
|
|
11927
14049
|
*/
|
|
11928
|
-
|
|
11929
|
-
const ret = wasm.
|
|
14050
|
+
toMultiDual() {
|
|
14051
|
+
const ret = wasm.wasmstaticmultidual2_toMultiDual(this.__wbg_ptr);
|
|
14052
|
+
return WasmMultiDualNumber.__wrap(ret);
|
|
14053
|
+
}
|
|
14054
|
+
/**
|
|
14055
|
+
* Addition.
|
|
14056
|
+
* @param {WasmStaticMultiDual2} other
|
|
14057
|
+
* @returns {WasmStaticMultiDual2}
|
|
14058
|
+
*/
|
|
14059
|
+
add(other) {
|
|
14060
|
+
_assertClass(other, WasmStaticMultiDual2);
|
|
14061
|
+
const ret = wasm.wasmstaticmultidual2_add(this.__wbg_ptr, other.__wbg_ptr);
|
|
14062
|
+
return WasmStaticMultiDual2.__wrap(ret);
|
|
14063
|
+
}
|
|
14064
|
+
/**
|
|
14065
|
+
* Division.
|
|
14066
|
+
* @param {WasmStaticMultiDual2} other
|
|
14067
|
+
* @returns {WasmStaticMultiDual2}
|
|
14068
|
+
*/
|
|
14069
|
+
div(other) {
|
|
14070
|
+
_assertClass(other, WasmStaticMultiDual2);
|
|
14071
|
+
const ret = wasm.wasmstaticmultidual2_div(this.__wbg_ptr, other.__wbg_ptr);
|
|
11930
14072
|
if (ret[2]) {
|
|
11931
14073
|
throw takeFromExternrefTable0(ret[1]);
|
|
11932
14074
|
}
|
|
11933
|
-
return ret[0];
|
|
14075
|
+
return WasmStaticMultiDual2.__wrap(ret[0]);
|
|
11934
14076
|
}
|
|
11935
14077
|
/**
|
|
11936
|
-
*
|
|
11937
|
-
*
|
|
11938
|
-
*
|
|
11939
|
-
* @returns {number}
|
|
14078
|
+
* Multiplication.
|
|
14079
|
+
* @param {WasmStaticMultiDual2} other
|
|
14080
|
+
* @returns {WasmStaticMultiDual2}
|
|
11940
14081
|
*/
|
|
11941
|
-
|
|
11942
|
-
|
|
11943
|
-
|
|
14082
|
+
mul(other) {
|
|
14083
|
+
_assertClass(other, WasmStaticMultiDual2);
|
|
14084
|
+
const ret = wasm.wasmstaticmultidual2_mul(this.__wbg_ptr, other.__wbg_ptr);
|
|
14085
|
+
return WasmStaticMultiDual2.__wrap(ret);
|
|
11944
14086
|
}
|
|
11945
14087
|
/**
|
|
11946
|
-
*
|
|
11947
|
-
* @
|
|
14088
|
+
* Negation.
|
|
14089
|
+
* @returns {WasmStaticMultiDual2}
|
|
11948
14090
|
*/
|
|
11949
|
-
|
|
11950
|
-
wasm.
|
|
14091
|
+
neg() {
|
|
14092
|
+
const ret = wasm.wasmstaticmultidual2_neg(this.__wbg_ptr);
|
|
14093
|
+
return WasmStaticMultiDual2.__wrap(ret);
|
|
11951
14094
|
}
|
|
11952
14095
|
/**
|
|
11953
|
-
* Create a
|
|
11954
|
-
*
|
|
11955
|
-
*
|
|
11956
|
-
* * `order` - The Sobolev regularity (1 for H^1, 2 for H^2)
|
|
11957
|
-
* * `lower` - Lower bound of the interval
|
|
11958
|
-
* * `upper` - Upper bound of the interval
|
|
11959
|
-
* @param {number} order
|
|
11960
|
-
* @param {number} lower
|
|
11961
|
-
* @param {number} upper
|
|
14096
|
+
* Create a fixed-size multi-dual number from a value and gradient.
|
|
14097
|
+
* @param {number} value
|
|
14098
|
+
* @param {Float64Array} gradient
|
|
11962
14099
|
*/
|
|
11963
|
-
constructor(
|
|
11964
|
-
const
|
|
14100
|
+
constructor(value, gradient) {
|
|
14101
|
+
const ptr0 = passArrayF64ToWasm0(gradient, wasm.__wbindgen_malloc);
|
|
14102
|
+
const len0 = WASM_VECTOR_LEN;
|
|
14103
|
+
const ret = wasm.wasmstaticmultidual2_new(value, ptr0, len0);
|
|
11965
14104
|
if (ret[2]) {
|
|
11966
14105
|
throw takeFromExternrefTable0(ret[1]);
|
|
11967
14106
|
}
|
|
11968
14107
|
this.__wbg_ptr = ret[0] >>> 0;
|
|
11969
|
-
|
|
14108
|
+
WasmStaticMultiDual2Finalization.register(this, this.__wbg_ptr, this);
|
|
11970
14109
|
return this;
|
|
11971
14110
|
}
|
|
11972
14111
|
/**
|
|
11973
|
-
*
|
|
11974
|
-
* @
|
|
14112
|
+
* Subtraction.
|
|
14113
|
+
* @param {WasmStaticMultiDual2} other
|
|
14114
|
+
* @returns {WasmStaticMultiDual2}
|
|
11975
14115
|
*/
|
|
11976
|
-
|
|
11977
|
-
|
|
11978
|
-
|
|
11979
|
-
|
|
11980
|
-
return v1;
|
|
14116
|
+
sub(other) {
|
|
14117
|
+
_assertClass(other, WasmStaticMultiDual2);
|
|
14118
|
+
const ret = wasm.wasmstaticmultidual2_sub(this.__wbg_ptr, other.__wbg_ptr);
|
|
14119
|
+
return WasmStaticMultiDual2.__wrap(ret);
|
|
11981
14120
|
}
|
|
11982
14121
|
/**
|
|
11983
|
-
*
|
|
11984
|
-
*
|
|
11985
|
-
* # Arguments
|
|
11986
|
-
* * `f` - JavaScript function f(x) to evaluate
|
|
11987
|
-
* * `df` - JavaScript function f'(x) (first derivative)
|
|
11988
|
-
* @param {Function} f
|
|
11989
|
-
* @param {Function} df
|
|
14122
|
+
* Number of derivative variables.
|
|
11990
14123
|
* @returns {number}
|
|
11991
14124
|
*/
|
|
11992
|
-
|
|
11993
|
-
const ret = wasm.
|
|
11994
|
-
|
|
11995
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
11996
|
-
}
|
|
11997
|
-
return ret[0];
|
|
14125
|
+
nVars() {
|
|
14126
|
+
const ret = wasm.wasmstaticmultidual2_nVars(this.__wbg_ptr);
|
|
14127
|
+
return ret >>> 0;
|
|
11998
14128
|
}
|
|
11999
14129
|
/**
|
|
12000
|
-
*
|
|
12001
|
-
* @param {
|
|
12002
|
-
* @returns {
|
|
14130
|
+
* Create a constant with zero gradient.
|
|
14131
|
+
* @param {number} value
|
|
14132
|
+
* @returns {WasmStaticMultiDual2}
|
|
12003
14133
|
*/
|
|
12004
|
-
|
|
12005
|
-
const ret = wasm.
|
|
14134
|
+
static constant(value) {
|
|
14135
|
+
const ret = wasm.wasmstaticmultidual2_constant(value);
|
|
14136
|
+
return WasmStaticMultiDual2.__wrap(ret);
|
|
14137
|
+
}
|
|
14138
|
+
/**
|
|
14139
|
+
* Create a basis-seeded variable.
|
|
14140
|
+
* @param {number} value
|
|
14141
|
+
* @param {number} var_index
|
|
14142
|
+
* @returns {WasmStaticMultiDual2}
|
|
14143
|
+
*/
|
|
14144
|
+
static variable(value, var_index) {
|
|
14145
|
+
const ret = wasm.wasmstaticmultidual2_variable(value, var_index);
|
|
12006
14146
|
if (ret[2]) {
|
|
12007
14147
|
throw takeFromExternrefTable0(ret[1]);
|
|
12008
14148
|
}
|
|
12009
|
-
return ret[0];
|
|
14149
|
+
return WasmStaticMultiDual2.__wrap(ret[0]);
|
|
12010
14150
|
}
|
|
12011
14151
|
/**
|
|
12012
|
-
* Get the
|
|
14152
|
+
* Get the function value.
|
|
12013
14153
|
* @returns {number}
|
|
12014
14154
|
*/
|
|
12015
|
-
|
|
12016
|
-
const ret = wasm.
|
|
12017
|
-
return ret
|
|
14155
|
+
getValue() {
|
|
14156
|
+
const ret = wasm.wasmevaluationresult_getGeometricDistance(this.__wbg_ptr);
|
|
14157
|
+
return ret;
|
|
14158
|
+
}
|
|
14159
|
+
/**
|
|
14160
|
+
* Create one fixed-size variable per coordinate.
|
|
14161
|
+
* @param {Float64Array} values
|
|
14162
|
+
* @returns {Array<any>}
|
|
14163
|
+
*/
|
|
14164
|
+
static variables(values) {
|
|
14165
|
+
const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_malloc);
|
|
14166
|
+
const len0 = WASM_VECTOR_LEN;
|
|
14167
|
+
const ret = wasm.wasmstaticmultidual2_variables(ptr0, len0);
|
|
14168
|
+
if (ret[2]) {
|
|
14169
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
14170
|
+
}
|
|
14171
|
+
return takeFromExternrefTable0(ret[0]);
|
|
12018
14172
|
}
|
|
12019
14173
|
}
|
|
12020
14174
|
|
|
12021
|
-
const
|
|
14175
|
+
const WasmStaticMultiDual3Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
12022
14176
|
? { register: () => {}, unregister: () => {} }
|
|
12023
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
12024
|
-
|
|
12025
|
-
|
|
12026
|
-
*/
|
|
12027
|
-
export class WasmSpacetimeVector {
|
|
14177
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmstaticmultidual3_free(ptr >>> 0, 1));
|
|
14178
|
+
|
|
14179
|
+
export class WasmStaticMultiDual3 {
|
|
12028
14180
|
|
|
12029
14181
|
static __wrap(ptr) {
|
|
12030
14182
|
ptr = ptr >>> 0;
|
|
12031
|
-
const obj = Object.create(
|
|
14183
|
+
const obj = Object.create(WasmStaticMultiDual3.prototype);
|
|
12032
14184
|
obj.__wbg_ptr = ptr;
|
|
12033
|
-
|
|
14185
|
+
WasmStaticMultiDual3Finalization.register(obj, obj.__wbg_ptr, obj);
|
|
12034
14186
|
return obj;
|
|
12035
14187
|
}
|
|
12036
14188
|
|
|
12037
14189
|
__destroy_into_raw() {
|
|
12038
14190
|
const ptr = this.__wbg_ptr;
|
|
12039
14191
|
this.__wbg_ptr = 0;
|
|
12040
|
-
|
|
14192
|
+
WasmStaticMultiDual3Finalization.unregister(this);
|
|
12041
14193
|
return ptr;
|
|
12042
14194
|
}
|
|
12043
14195
|
|
|
12044
14196
|
free() {
|
|
12045
14197
|
const ptr = this.__destroy_into_raw();
|
|
12046
|
-
wasm.
|
|
14198
|
+
wasm.__wbg_wasmstaticmultidual3_free(ptr, 0);
|
|
12047
14199
|
}
|
|
12048
14200
|
/**
|
|
12049
|
-
*
|
|
12050
|
-
* @returns {
|
|
14201
|
+
* Get the fixed-size gradient as a JavaScript array-compatible vector.
|
|
14202
|
+
* @returns {Float64Array}
|
|
12051
14203
|
*/
|
|
12052
|
-
|
|
12053
|
-
const ret = wasm.
|
|
12054
|
-
|
|
14204
|
+
getGradient() {
|
|
14205
|
+
const ret = wasm.wasmstaticmultidual3_getGradient(this.__wbg_ptr);
|
|
14206
|
+
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
14207
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
14208
|
+
return v1;
|
|
12055
14209
|
}
|
|
12056
14210
|
/**
|
|
12057
|
-
*
|
|
12058
|
-
* @
|
|
14211
|
+
* Maximum with explicit derivative tie handling.
|
|
14212
|
+
* @param {WasmStaticMultiDual3} other
|
|
14213
|
+
* @param {WasmBranchPolicy} policy
|
|
14214
|
+
* @returns {WasmStaticMultiDual3}
|
|
12059
14215
|
*/
|
|
12060
|
-
|
|
12061
|
-
|
|
12062
|
-
|
|
14216
|
+
maxByPolicy(other, policy) {
|
|
14217
|
+
_assertClass(other, WasmStaticMultiDual3);
|
|
14218
|
+
const ret = wasm.wasmstaticmultidual3_maxByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
|
|
14219
|
+
return WasmStaticMultiDual3.__wrap(ret);
|
|
12063
14220
|
}
|
|
12064
14221
|
/**
|
|
12065
|
-
*
|
|
12066
|
-
* @
|
|
14222
|
+
* Minimum with explicit derivative tie handling.
|
|
14223
|
+
* @param {WasmStaticMultiDual3} other
|
|
14224
|
+
* @param {WasmBranchPolicy} policy
|
|
14225
|
+
* @returns {WasmStaticMultiDual3}
|
|
12067
14226
|
*/
|
|
12068
|
-
|
|
12069
|
-
|
|
12070
|
-
|
|
14227
|
+
minByPolicy(other, policy) {
|
|
14228
|
+
_assertClass(other, WasmStaticMultiDual3);
|
|
14229
|
+
const ret = wasm.wasmstaticmultidual3_minByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
|
|
14230
|
+
return WasmStaticMultiDual3.__wrap(ret);
|
|
12071
14231
|
}
|
|
12072
14232
|
/**
|
|
12073
|
-
*
|
|
12074
|
-
* @
|
|
12075
|
-
* @returns {number}
|
|
14233
|
+
* Convert to the heap-backed multi-dual wrapper.
|
|
14234
|
+
* @returns {WasmMultiDualNumber}
|
|
12076
14235
|
*/
|
|
12077
|
-
|
|
12078
|
-
|
|
12079
|
-
|
|
12080
|
-
return ret;
|
|
14236
|
+
toMultiDual() {
|
|
14237
|
+
const ret = wasm.wasmstaticmultidual3_toMultiDual(this.__wbg_ptr);
|
|
14238
|
+
return WasmMultiDualNumber.__wrap(ret);
|
|
12081
14239
|
}
|
|
12082
14240
|
/**
|
|
12083
|
-
*
|
|
12084
|
-
* @
|
|
14241
|
+
* Addition.
|
|
14242
|
+
* @param {WasmStaticMultiDual3} other
|
|
14243
|
+
* @returns {WasmStaticMultiDual3}
|
|
12085
14244
|
*/
|
|
12086
|
-
|
|
12087
|
-
|
|
12088
|
-
|
|
14245
|
+
add(other) {
|
|
14246
|
+
_assertClass(other, WasmStaticMultiDual3);
|
|
14247
|
+
const ret = wasm.wasmstaticmultidual3_add(this.__wbg_ptr, other.__wbg_ptr);
|
|
14248
|
+
return WasmStaticMultiDual3.__wrap(ret);
|
|
12089
14249
|
}
|
|
12090
14250
|
/**
|
|
12091
|
-
*
|
|
12092
|
-
* @
|
|
14251
|
+
* Division.
|
|
14252
|
+
* @param {WasmStaticMultiDual3} other
|
|
14253
|
+
* @returns {WasmStaticMultiDual3}
|
|
12093
14254
|
*/
|
|
12094
|
-
|
|
12095
|
-
|
|
12096
|
-
|
|
14255
|
+
div(other) {
|
|
14256
|
+
_assertClass(other, WasmStaticMultiDual3);
|
|
14257
|
+
const ret = wasm.wasmstaticmultidual3_div(this.__wbg_ptr, other.__wbg_ptr);
|
|
14258
|
+
if (ret[2]) {
|
|
14259
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
14260
|
+
}
|
|
14261
|
+
return WasmStaticMultiDual3.__wrap(ret[0]);
|
|
12097
14262
|
}
|
|
12098
14263
|
/**
|
|
12099
|
-
*
|
|
12100
|
-
* @
|
|
14264
|
+
* Multiplication.
|
|
14265
|
+
* @param {WasmStaticMultiDual3} other
|
|
14266
|
+
* @returns {WasmStaticMultiDual3}
|
|
12101
14267
|
*/
|
|
12102
|
-
|
|
12103
|
-
|
|
12104
|
-
|
|
14268
|
+
mul(other) {
|
|
14269
|
+
_assertClass(other, WasmStaticMultiDual3);
|
|
14270
|
+
const ret = wasm.wasmstaticmultidual3_mul(this.__wbg_ptr, other.__wbg_ptr);
|
|
14271
|
+
return WasmStaticMultiDual3.__wrap(ret);
|
|
12105
14272
|
}
|
|
12106
14273
|
/**
|
|
12107
|
-
*
|
|
12108
|
-
* @returns {
|
|
14274
|
+
* Negation.
|
|
14275
|
+
* @returns {WasmStaticMultiDual3}
|
|
14276
|
+
*/
|
|
14277
|
+
neg() {
|
|
14278
|
+
const ret = wasm.wasmstaticmultidual3_neg(this.__wbg_ptr);
|
|
14279
|
+
return WasmStaticMultiDual3.__wrap(ret);
|
|
14280
|
+
}
|
|
14281
|
+
/**
|
|
14282
|
+
* Create a fixed-size multi-dual number from a value and gradient.
|
|
14283
|
+
* @param {number} value
|
|
14284
|
+
* @param {Float64Array} gradient
|
|
14285
|
+
*/
|
|
14286
|
+
constructor(value, gradient) {
|
|
14287
|
+
const ptr0 = passArrayF64ToWasm0(gradient, wasm.__wbindgen_malloc);
|
|
14288
|
+
const len0 = WASM_VECTOR_LEN;
|
|
14289
|
+
const ret = wasm.wasmstaticmultidual3_new(value, ptr0, len0);
|
|
14290
|
+
if (ret[2]) {
|
|
14291
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
14292
|
+
}
|
|
14293
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
14294
|
+
WasmStaticMultiDual3Finalization.register(this, this.__wbg_ptr, this);
|
|
14295
|
+
return this;
|
|
14296
|
+
}
|
|
14297
|
+
/**
|
|
14298
|
+
* Subtraction.
|
|
14299
|
+
* @param {WasmStaticMultiDual3} other
|
|
14300
|
+
* @returns {WasmStaticMultiDual3}
|
|
12109
14301
|
*/
|
|
12110
|
-
|
|
12111
|
-
|
|
12112
|
-
|
|
14302
|
+
sub(other) {
|
|
14303
|
+
_assertClass(other, WasmStaticMultiDual3);
|
|
14304
|
+
const ret = wasm.wasmstaticmultidual3_sub(this.__wbg_ptr, other.__wbg_ptr);
|
|
14305
|
+
return WasmStaticMultiDual3.__wrap(ret);
|
|
12113
14306
|
}
|
|
12114
14307
|
/**
|
|
12115
|
-
*
|
|
12116
|
-
* @
|
|
12117
|
-
* @param {number} x
|
|
12118
|
-
* @param {number} y
|
|
12119
|
-
* @param {number} z
|
|
14308
|
+
* Number of derivative variables.
|
|
14309
|
+
* @returns {number}
|
|
12120
14310
|
*/
|
|
12121
|
-
|
|
12122
|
-
const ret = wasm.
|
|
12123
|
-
|
|
12124
|
-
WasmSpacetimeVectorFinalization.register(this, this.__wbg_ptr, this);
|
|
12125
|
-
return this;
|
|
14311
|
+
nVars() {
|
|
14312
|
+
const ret = wasm.wasmstaticmultidual3_nVars(this.__wbg_ptr);
|
|
14313
|
+
return ret >>> 0;
|
|
12126
14314
|
}
|
|
12127
14315
|
/**
|
|
12128
|
-
*
|
|
12129
|
-
* @
|
|
14316
|
+
* Create a constant with zero gradient.
|
|
14317
|
+
* @param {number} value
|
|
14318
|
+
* @returns {WasmStaticMultiDual3}
|
|
12130
14319
|
*/
|
|
12131
|
-
|
|
12132
|
-
const ret = wasm.
|
|
12133
|
-
return ret
|
|
14320
|
+
static constant(value) {
|
|
14321
|
+
const ret = wasm.wasmstaticmultidual3_constant(value);
|
|
14322
|
+
return WasmStaticMultiDual3.__wrap(ret);
|
|
12134
14323
|
}
|
|
12135
14324
|
/**
|
|
12136
|
-
* Create a
|
|
12137
|
-
* @param {number}
|
|
12138
|
-
* @
|
|
14325
|
+
* Create a basis-seeded variable.
|
|
14326
|
+
* @param {number} value
|
|
14327
|
+
* @param {number} var_index
|
|
14328
|
+
* @returns {WasmStaticMultiDual3}
|
|
12139
14329
|
*/
|
|
12140
|
-
static
|
|
12141
|
-
const ret = wasm.
|
|
12142
|
-
|
|
14330
|
+
static variable(value, var_index) {
|
|
14331
|
+
const ret = wasm.wasmstaticmultidual3_variable(value, var_index);
|
|
14332
|
+
if (ret[2]) {
|
|
14333
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
14334
|
+
}
|
|
14335
|
+
return WasmStaticMultiDual3.__wrap(ret[0]);
|
|
12143
14336
|
}
|
|
12144
14337
|
/**
|
|
12145
|
-
*
|
|
12146
|
-
* @
|
|
12147
|
-
* @param {number} y
|
|
12148
|
-
* @param {number} z
|
|
12149
|
-
* @returns {WasmSpacetimeVector}
|
|
14338
|
+
* Get the function value.
|
|
14339
|
+
* @returns {number}
|
|
12150
14340
|
*/
|
|
12151
|
-
|
|
12152
|
-
const ret = wasm.
|
|
12153
|
-
return
|
|
14341
|
+
getValue() {
|
|
14342
|
+
const ret = wasm.wasmalphaconnection_getAlpha(this.__wbg_ptr);
|
|
14343
|
+
return ret;
|
|
12154
14344
|
}
|
|
12155
14345
|
/**
|
|
12156
|
-
*
|
|
12157
|
-
* @
|
|
14346
|
+
* Create one fixed-size variable per coordinate.
|
|
14347
|
+
* @param {Float64Array} values
|
|
14348
|
+
* @returns {Array<any>}
|
|
12158
14349
|
*/
|
|
12159
|
-
|
|
12160
|
-
|
|
12161
|
-
|
|
12162
|
-
|
|
12163
|
-
|
|
12164
|
-
|
|
12165
|
-
deferred1_1 = ret[1];
|
|
12166
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
12167
|
-
} finally {
|
|
12168
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
14350
|
+
static variables(values) {
|
|
14351
|
+
const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_malloc);
|
|
14352
|
+
const len0 = WASM_VECTOR_LEN;
|
|
14353
|
+
const ret = wasm.wasmstaticmultidual3_variables(ptr0, len0);
|
|
14354
|
+
if (ret[2]) {
|
|
14355
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
12169
14356
|
}
|
|
14357
|
+
return takeFromExternrefTable0(ret[0]);
|
|
12170
14358
|
}
|
|
12171
14359
|
}
|
|
12172
14360
|
|
|
12173
|
-
const
|
|
14361
|
+
const WasmStaticMultiDual4Finalization = (typeof FinalizationRegistry === 'undefined')
|
|
12174
14362
|
? { register: () => {}, unregister: () => {} }
|
|
12175
|
-
: new FinalizationRegistry(ptr => wasm.
|
|
12176
|
-
|
|
12177
|
-
|
|
12178
|
-
*
|
|
12179
|
-
* Provides eigenvalue decomposition for symmetric matrices.
|
|
12180
|
-
*/
|
|
12181
|
-
export class WasmSpectralDecomposition {
|
|
14363
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmstaticmultidual4_free(ptr >>> 0, 1));
|
|
14364
|
+
|
|
14365
|
+
export class WasmStaticMultiDual4 {
|
|
12182
14366
|
|
|
12183
14367
|
static __wrap(ptr) {
|
|
12184
14368
|
ptr = ptr >>> 0;
|
|
12185
|
-
const obj = Object.create(
|
|
14369
|
+
const obj = Object.create(WasmStaticMultiDual4.prototype);
|
|
12186
14370
|
obj.__wbg_ptr = ptr;
|
|
12187
|
-
|
|
14371
|
+
WasmStaticMultiDual4Finalization.register(obj, obj.__wbg_ptr, obj);
|
|
12188
14372
|
return obj;
|
|
12189
14373
|
}
|
|
12190
14374
|
|
|
12191
14375
|
__destroy_into_raw() {
|
|
12192
14376
|
const ptr = this.__wbg_ptr;
|
|
12193
14377
|
this.__wbg_ptr = 0;
|
|
12194
|
-
|
|
14378
|
+
WasmStaticMultiDual4Finalization.unregister(this);
|
|
12195
14379
|
return ptr;
|
|
12196
14380
|
}
|
|
12197
14381
|
|
|
12198
14382
|
free() {
|
|
12199
14383
|
const ptr = this.__destroy_into_raw();
|
|
12200
|
-
wasm.
|
|
14384
|
+
wasm.__wbg_wasmstaticmultidual4_free(ptr, 0);
|
|
12201
14385
|
}
|
|
12202
14386
|
/**
|
|
12203
|
-
* Get the
|
|
14387
|
+
* Get the fixed-size gradient as a JavaScript array-compatible vector.
|
|
12204
14388
|
* @returns {Float64Array}
|
|
12205
14389
|
*/
|
|
12206
|
-
|
|
12207
|
-
const ret = wasm.
|
|
14390
|
+
getGradient() {
|
|
14391
|
+
const ret = wasm.wasmstaticmultidual4_getGradient(this.__wbg_ptr);
|
|
12208
14392
|
var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
12209
14393
|
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
12210
14394
|
return v1;
|
|
12211
14395
|
}
|
|
12212
14396
|
/**
|
|
12213
|
-
*
|
|
12214
|
-
* @
|
|
14397
|
+
* Maximum with explicit derivative tie handling.
|
|
14398
|
+
* @param {WasmStaticMultiDual4} other
|
|
14399
|
+
* @param {WasmBranchPolicy} policy
|
|
14400
|
+
* @returns {WasmStaticMultiDual4}
|
|
12215
14401
|
*/
|
|
12216
|
-
|
|
12217
|
-
|
|
12218
|
-
|
|
14402
|
+
maxByPolicy(other, policy) {
|
|
14403
|
+
_assertClass(other, WasmStaticMultiDual4);
|
|
14404
|
+
const ret = wasm.wasmstaticmultidual4_maxByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
|
|
14405
|
+
return WasmStaticMultiDual4.__wrap(ret);
|
|
12219
14406
|
}
|
|
12220
14407
|
/**
|
|
12221
|
-
*
|
|
12222
|
-
*
|
|
12223
|
-
*
|
|
12224
|
-
* @returns {
|
|
14408
|
+
* Minimum with explicit derivative tie handling.
|
|
14409
|
+
* @param {WasmStaticMultiDual4} other
|
|
14410
|
+
* @param {WasmBranchPolicy} policy
|
|
14411
|
+
* @returns {WasmStaticMultiDual4}
|
|
12225
14412
|
*/
|
|
12226
|
-
|
|
12227
|
-
|
|
12228
|
-
|
|
12229
|
-
|
|
12230
|
-
return v1;
|
|
14413
|
+
minByPolicy(other, policy) {
|
|
14414
|
+
_assertClass(other, WasmStaticMultiDual4);
|
|
14415
|
+
const ret = wasm.wasmstaticmultidual4_minByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
|
|
14416
|
+
return WasmStaticMultiDual4.__wrap(ret);
|
|
12231
14417
|
}
|
|
12232
14418
|
/**
|
|
12233
|
-
*
|
|
12234
|
-
*
|
|
12235
|
-
* # Arguments
|
|
12236
|
-
* * `f` - JavaScript function to apply to eigenvalues
|
|
12237
|
-
* * `x` - Input vector
|
|
12238
|
-
* @param {Function} f
|
|
12239
|
-
* @param {Float64Array} x
|
|
12240
|
-
* @returns {Float64Array}
|
|
14419
|
+
* Convert to the heap-backed multi-dual wrapper.
|
|
14420
|
+
* @returns {WasmMultiDualNumber}
|
|
12241
14421
|
*/
|
|
12242
|
-
|
|
12243
|
-
const
|
|
12244
|
-
|
|
12245
|
-
const ret = wasm.wasmspectraldecomposition_applyFunction(this.__wbg_ptr, f, ptr0, len0);
|
|
12246
|
-
if (ret[3]) {
|
|
12247
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
12248
|
-
}
|
|
12249
|
-
var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
12250
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
12251
|
-
return v2;
|
|
14422
|
+
toMultiDual() {
|
|
14423
|
+
const ret = wasm.wasmstaticmultidual4_toMultiDual(this.__wbg_ptr);
|
|
14424
|
+
return WasmMultiDualNumber.__wrap(ret);
|
|
12252
14425
|
}
|
|
12253
14426
|
/**
|
|
12254
|
-
*
|
|
12255
|
-
* @
|
|
14427
|
+
* Addition.
|
|
14428
|
+
* @param {WasmStaticMultiDual4} other
|
|
14429
|
+
* @returns {WasmStaticMultiDual4}
|
|
12256
14430
|
*/
|
|
12257
|
-
|
|
12258
|
-
|
|
12259
|
-
|
|
14431
|
+
add(other) {
|
|
14432
|
+
_assertClass(other, WasmStaticMultiDual4);
|
|
14433
|
+
const ret = wasm.wasmstaticmultidual4_add(this.__wbg_ptr, other.__wbg_ptr);
|
|
14434
|
+
return WasmStaticMultiDual4.__wrap(ret);
|
|
12260
14435
|
}
|
|
12261
14436
|
/**
|
|
12262
|
-
*
|
|
12263
|
-
* @
|
|
14437
|
+
* Division.
|
|
14438
|
+
* @param {WasmStaticMultiDual4} other
|
|
14439
|
+
* @returns {WasmStaticMultiDual4}
|
|
12264
14440
|
*/
|
|
12265
|
-
|
|
12266
|
-
|
|
12267
|
-
|
|
14441
|
+
div(other) {
|
|
14442
|
+
_assertClass(other, WasmStaticMultiDual4);
|
|
14443
|
+
const ret = wasm.wasmstaticmultidual4_div(this.__wbg_ptr, other.__wbg_ptr);
|
|
14444
|
+
if (ret[2]) {
|
|
14445
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
14446
|
+
}
|
|
14447
|
+
return WasmStaticMultiDual4.__wrap(ret[0]);
|
|
12268
14448
|
}
|
|
12269
14449
|
/**
|
|
12270
|
-
*
|
|
12271
|
-
* @
|
|
14450
|
+
* Multiplication.
|
|
14451
|
+
* @param {WasmStaticMultiDual4} other
|
|
14452
|
+
* @returns {WasmStaticMultiDual4}
|
|
12272
14453
|
*/
|
|
12273
|
-
|
|
12274
|
-
|
|
12275
|
-
|
|
14454
|
+
mul(other) {
|
|
14455
|
+
_assertClass(other, WasmStaticMultiDual4);
|
|
14456
|
+
const ret = wasm.wasmstaticmultidual4_mul(this.__wbg_ptr, other.__wbg_ptr);
|
|
14457
|
+
return WasmStaticMultiDual4.__wrap(ret);
|
|
12276
14458
|
}
|
|
12277
14459
|
/**
|
|
12278
|
-
*
|
|
12279
|
-
* @returns {
|
|
14460
|
+
* Negation.
|
|
14461
|
+
* @returns {WasmStaticMultiDual4}
|
|
12280
14462
|
*/
|
|
12281
|
-
|
|
12282
|
-
const ret = wasm.
|
|
12283
|
-
return ret
|
|
14463
|
+
neg() {
|
|
14464
|
+
const ret = wasm.wasmstaticmultidual4_neg(this.__wbg_ptr);
|
|
14465
|
+
return WasmStaticMultiDual4.__wrap(ret);
|
|
12284
14466
|
}
|
|
12285
14467
|
/**
|
|
12286
|
-
*
|
|
12287
|
-
* @param {
|
|
12288
|
-
* @
|
|
14468
|
+
* Create a fixed-size multi-dual number from a value and gradient.
|
|
14469
|
+
* @param {number} value
|
|
14470
|
+
* @param {Float64Array} gradient
|
|
12289
14471
|
*/
|
|
12290
|
-
|
|
12291
|
-
const ptr0 = passArrayF64ToWasm0(
|
|
14472
|
+
constructor(value, gradient) {
|
|
14473
|
+
const ptr0 = passArrayF64ToWasm0(gradient, wasm.__wbindgen_malloc);
|
|
12292
14474
|
const len0 = WASM_VECTOR_LEN;
|
|
12293
|
-
const ret = wasm.
|
|
12294
|
-
if (ret[3]) {
|
|
12295
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
12296
|
-
}
|
|
12297
|
-
var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
|
|
12298
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
|
|
12299
|
-
return v2;
|
|
12300
|
-
}
|
|
12301
|
-
/**
|
|
12302
|
-
* Compute spectral decomposition of a symmetric matrix
|
|
12303
|
-
*
|
|
12304
|
-
* # Arguments
|
|
12305
|
-
* * `matrix` - The symmetric matrix operator to decompose
|
|
12306
|
-
* * `max_iterations` - Maximum iterations for eigenvalue computation
|
|
12307
|
-
* * `tolerance` - Convergence tolerance
|
|
12308
|
-
* @param {WasmMatrixOperator} matrix
|
|
12309
|
-
* @param {number} max_iterations
|
|
12310
|
-
* @param {number} tolerance
|
|
12311
|
-
* @returns {WasmSpectralDecomposition}
|
|
12312
|
-
*/
|
|
12313
|
-
static compute(matrix, max_iterations, tolerance) {
|
|
12314
|
-
_assertClass(matrix, WasmMatrixOperator);
|
|
12315
|
-
const ret = wasm.wasmspectraldecomposition_compute(matrix.__wbg_ptr, max_iterations, tolerance);
|
|
14475
|
+
const ret = wasm.wasmstaticmultidual4_new(value, ptr0, len0);
|
|
12316
14476
|
if (ret[2]) {
|
|
12317
14477
|
throw takeFromExternrefTable0(ret[1]);
|
|
12318
14478
|
}
|
|
12319
|
-
|
|
12320
|
-
|
|
12321
|
-
|
|
12322
|
-
|
|
12323
|
-
const WasmStabilityConditionFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
12324
|
-
? { register: () => {}, unregister: () => {} }
|
|
12325
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_wasmstabilitycondition_free(ptr >>> 0, 1));
|
|
12326
|
-
/**
|
|
12327
|
-
* WASM wrapper for Bridgeland-style stability conditions
|
|
12328
|
-
*/
|
|
12329
|
-
export class WasmStabilityCondition {
|
|
12330
|
-
|
|
12331
|
-
__destroy_into_raw() {
|
|
12332
|
-
const ptr = this.__wbg_ptr;
|
|
12333
|
-
this.__wbg_ptr = 0;
|
|
12334
|
-
WasmStabilityConditionFinalization.unregister(this);
|
|
12335
|
-
return ptr;
|
|
14479
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
14480
|
+
WasmStaticMultiDual4Finalization.register(this, this.__wbg_ptr, this);
|
|
14481
|
+
return this;
|
|
12336
14482
|
}
|
|
12337
|
-
|
|
12338
|
-
|
|
12339
|
-
|
|
12340
|
-
|
|
14483
|
+
/**
|
|
14484
|
+
* Subtraction.
|
|
14485
|
+
* @param {WasmStaticMultiDual4} other
|
|
14486
|
+
* @returns {WasmStaticMultiDual4}
|
|
14487
|
+
*/
|
|
14488
|
+
sub(other) {
|
|
14489
|
+
_assertClass(other, WasmStaticMultiDual4);
|
|
14490
|
+
const ret = wasm.wasmstaticmultidual4_sub(this.__wbg_ptr, other.__wbg_ptr);
|
|
14491
|
+
return WasmStaticMultiDual4.__wrap(ret);
|
|
12341
14492
|
}
|
|
12342
14493
|
/**
|
|
12343
|
-
*
|
|
12344
|
-
* @param {WasmNamespace} namespace
|
|
14494
|
+
* Number of derivative variables.
|
|
12345
14495
|
* @returns {number}
|
|
12346
14496
|
*/
|
|
12347
|
-
|
|
12348
|
-
|
|
12349
|
-
const ret = wasm.wasmstabilitycondition_stableCount(this.__wbg_ptr, namespace.__wbg_ptr);
|
|
14497
|
+
nVars() {
|
|
14498
|
+
const ret = wasm.wasmhilbertspace_dimension(this.__wbg_ptr);
|
|
12350
14499
|
return ret >>> 0;
|
|
12351
14500
|
}
|
|
12352
14501
|
/**
|
|
12353
|
-
*
|
|
12354
|
-
* @
|
|
14502
|
+
* Create a constant with zero gradient.
|
|
14503
|
+
* @param {number} value
|
|
14504
|
+
* @returns {WasmStaticMultiDual4}
|
|
12355
14505
|
*/
|
|
12356
|
-
|
|
12357
|
-
const ret = wasm.
|
|
12358
|
-
return ret;
|
|
14506
|
+
static constant(value) {
|
|
14507
|
+
const ret = wasm.wasmstaticmultidual4_constant(value);
|
|
14508
|
+
return WasmStaticMultiDual4.__wrap(ret);
|
|
12359
14509
|
}
|
|
12360
14510
|
/**
|
|
12361
|
-
* Create a
|
|
12362
|
-
* @param {number}
|
|
12363
|
-
* @param {number}
|
|
12364
|
-
* @
|
|
14511
|
+
* Create a basis-seeded variable.
|
|
14512
|
+
* @param {number} value
|
|
14513
|
+
* @param {number} var_index
|
|
14514
|
+
* @returns {WasmStaticMultiDual4}
|
|
12365
14515
|
*/
|
|
12366
|
-
|
|
12367
|
-
const ret = wasm.
|
|
12368
|
-
|
|
12369
|
-
|
|
12370
|
-
|
|
14516
|
+
static variable(value, var_index) {
|
|
14517
|
+
const ret = wasm.wasmstaticmultidual4_variable(value, var_index);
|
|
14518
|
+
if (ret[2]) {
|
|
14519
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
14520
|
+
}
|
|
14521
|
+
return WasmStaticMultiDual4.__wrap(ret[0]);
|
|
12371
14522
|
}
|
|
12372
14523
|
/**
|
|
12373
|
-
*
|
|
12374
|
-
* @param {WasmSchubertClass} _class
|
|
14524
|
+
* Get the function value.
|
|
12375
14525
|
* @returns {number}
|
|
12376
14526
|
*/
|
|
12377
|
-
|
|
12378
|
-
|
|
12379
|
-
const ret = wasm.wasmstabilitycondition_phase(this.__wbg_ptr, _class.__wbg_ptr);
|
|
14527
|
+
getValue() {
|
|
14528
|
+
const ret = wasm.wasmschwarzschildmetric_schwarzschild_radius(this.__wbg_ptr);
|
|
12380
14529
|
return ret;
|
|
12381
14530
|
}
|
|
12382
14531
|
/**
|
|
12383
|
-
*
|
|
12384
|
-
* @param {
|
|
12385
|
-
* @returns {
|
|
14532
|
+
* Create one fixed-size variable per coordinate.
|
|
14533
|
+
* @param {Float64Array} values
|
|
14534
|
+
* @returns {Array<any>}
|
|
12386
14535
|
*/
|
|
12387
|
-
|
|
12388
|
-
|
|
12389
|
-
const
|
|
12390
|
-
|
|
14536
|
+
static variables(values) {
|
|
14537
|
+
const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_malloc);
|
|
14538
|
+
const len0 = WASM_VECTOR_LEN;
|
|
14539
|
+
const ret = wasm.wasmstaticmultidual4_variables(ptr0, len0);
|
|
14540
|
+
if (ret[2]) {
|
|
14541
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
14542
|
+
}
|
|
14543
|
+
return takeFromExternrefTable0(ret[0]);
|
|
12391
14544
|
}
|
|
12392
14545
|
}
|
|
12393
14546
|
|
|
@@ -14175,7 +16328,7 @@ function __wbg_get_imports() {
|
|
|
14175
16328
|
const ret = arg0.length;
|
|
14176
16329
|
return ret;
|
|
14177
16330
|
};
|
|
14178
|
-
imports.wbg.
|
|
16331
|
+
imports.wbg.__wbg_log_d18f68da6e20cb1e = function(arg0, arg1) {
|
|
14179
16332
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
14180
16333
|
};
|
|
14181
16334
|
imports.wbg.__wbg_log_ea240990d83e374e = function(arg0) {
|
|
@@ -14200,7 +16353,7 @@ function __wbg_get_imports() {
|
|
|
14200
16353
|
const a = state0.a;
|
|
14201
16354
|
state0.a = 0;
|
|
14202
16355
|
try {
|
|
14203
|
-
return
|
|
16356
|
+
return __wbg_adapter_1132(a, state0.b, arg0, arg1);
|
|
14204
16357
|
} finally {
|
|
14205
16358
|
state0.a = a;
|
|
14206
16359
|
}
|
|
@@ -14291,6 +16444,10 @@ function __wbg_get_imports() {
|
|
|
14291
16444
|
const ret = WasmIntersectionResult.__wrap(arg0);
|
|
14292
16445
|
return ret;
|
|
14293
16446
|
};
|
|
16447
|
+
imports.wbg.__wbg_wasmmultidualnumber_new = function(arg0) {
|
|
16448
|
+
const ret = WasmMultiDualNumber.__wrap(arg0);
|
|
16449
|
+
return ret;
|
|
16450
|
+
};
|
|
14294
16451
|
imports.wbg.__wbg_wasmnamespace_unwrap = function(arg0) {
|
|
14295
16452
|
const ret = WasmNamespace.__unwrap(arg0);
|
|
14296
16453
|
return ret;
|
|
@@ -14319,6 +16476,18 @@ function __wbg_get_imports() {
|
|
|
14319
16476
|
const ret = WasmSpacetimeVector.__wrap(arg0);
|
|
14320
16477
|
return ret;
|
|
14321
16478
|
};
|
|
16479
|
+
imports.wbg.__wbg_wasmstaticmultidual2_new = function(arg0) {
|
|
16480
|
+
const ret = WasmStaticMultiDual2.__wrap(arg0);
|
|
16481
|
+
return ret;
|
|
16482
|
+
};
|
|
16483
|
+
imports.wbg.__wbg_wasmstaticmultidual3_new = function(arg0) {
|
|
16484
|
+
const ret = WasmStaticMultiDual3.__wrap(arg0);
|
|
16485
|
+
return ret;
|
|
16486
|
+
};
|
|
16487
|
+
imports.wbg.__wbg_wasmstaticmultidual4_new = function(arg0) {
|
|
16488
|
+
const ret = WasmStaticMultiDual4.__wrap(arg0);
|
|
16489
|
+
return ret;
|
|
16490
|
+
};
|
|
14322
16491
|
imports.wbg.__wbg_wasmtropicalnumber_new = function(arg0) {
|
|
14323
16492
|
const ret = WasmTropicalNumber.__wrap(arg0);
|
|
14324
16493
|
return ret;
|
|
@@ -14336,8 +16505,8 @@ function __wbg_get_imports() {
|
|
|
14336
16505
|
const ret = false;
|
|
14337
16506
|
return ret;
|
|
14338
16507
|
};
|
|
14339
|
-
imports.wbg.
|
|
14340
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
16508
|
+
imports.wbg.__wbindgen_closure_wrapper3089 = function(arg0, arg1, arg2) {
|
|
16509
|
+
const ret = makeMutClosure(arg0, arg1, 76, __wbg_adapter_30);
|
|
14341
16510
|
return ret;
|
|
14342
16511
|
};
|
|
14343
16512
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|