@justinelliottcobb/amari-wasm 0.21.0 → 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 +14 -1
- package/amari_wasm.d.ts +417 -4
- package/amari_wasm.js +1013 -8
- package/amari_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/amari_wasm.js
CHANGED
|
@@ -838,11 +838,11 @@ 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
848
|
/**
|
|
@@ -4277,6 +4277,372 @@ export class WasmCapability {
|
|
|
4277
4277
|
}
|
|
4278
4278
|
}
|
|
4279
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
|
+
|
|
4280
4646
|
const WasmChowClassFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
4281
4647
|
? { register: () => {}, unregister: () => {} }
|
|
4282
4648
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmchowclass_free(ptr >>> 0, 1));
|
|
@@ -5064,6 +5430,221 @@ export class WasmDuallyFlatManifold {
|
|
|
5064
5430
|
}
|
|
5065
5431
|
}
|
|
5066
5432
|
|
|
5433
|
+
const WasmDyadicFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5434
|
+
? { register: () => {}, unregister: () => {} }
|
|
5435
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmdyadic_free(ptr >>> 0, 1));
|
|
5436
|
+
/**
|
|
5437
|
+
* Exact dyadic rational `numerator / 2^exponent` for short surreal values.
|
|
5438
|
+
*/
|
|
5439
|
+
export class WasmDyadic {
|
|
5440
|
+
|
|
5441
|
+
static __wrap(ptr) {
|
|
5442
|
+
ptr = ptr >>> 0;
|
|
5443
|
+
const obj = Object.create(WasmDyadic.prototype);
|
|
5444
|
+
obj.__wbg_ptr = ptr;
|
|
5445
|
+
WasmDyadicFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
5446
|
+
return obj;
|
|
5447
|
+
}
|
|
5448
|
+
|
|
5449
|
+
__destroy_into_raw() {
|
|
5450
|
+
const ptr = this.__wbg_ptr;
|
|
5451
|
+
this.__wbg_ptr = 0;
|
|
5452
|
+
WasmDyadicFinalization.unregister(this);
|
|
5453
|
+
return ptr;
|
|
5454
|
+
}
|
|
5455
|
+
|
|
5456
|
+
free() {
|
|
5457
|
+
const ptr = this.__destroy_into_raw();
|
|
5458
|
+
wasm.__wbg_wasmdyadic_free(ptr, 0);
|
|
5459
|
+
}
|
|
5460
|
+
/**
|
|
5461
|
+
* Checked division; fails if the quotient leaves the dyadic layer.
|
|
5462
|
+
* @param {WasmDyadic} rhs
|
|
5463
|
+
* @returns {WasmDyadic}
|
|
5464
|
+
*/
|
|
5465
|
+
checkedDiv(rhs) {
|
|
5466
|
+
_assertClass(rhs, WasmDyadic);
|
|
5467
|
+
const ret = wasm.wasmdyadic_checkedDiv(this.__wbg_ptr, rhs.__wbg_ptr);
|
|
5468
|
+
if (ret[2]) {
|
|
5469
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
5470
|
+
}
|
|
5471
|
+
return WasmDyadic.__wrap(ret[0]);
|
|
5472
|
+
}
|
|
5473
|
+
/**
|
|
5474
|
+
* Return whether the dyadic is negative.
|
|
5475
|
+
* @returns {boolean}
|
|
5476
|
+
*/
|
|
5477
|
+
isNegative() {
|
|
5478
|
+
const ret = wasm.wasmdyadic_isNegative(this.__wbg_ptr);
|
|
5479
|
+
return ret !== 0;
|
|
5480
|
+
}
|
|
5481
|
+
/**
|
|
5482
|
+
* Return whether the dyadic is positive.
|
|
5483
|
+
* @returns {boolean}
|
|
5484
|
+
*/
|
|
5485
|
+
isPositive() {
|
|
5486
|
+
const ret = wasm.wasmdyadic_isPositive(this.__wbg_ptr);
|
|
5487
|
+
return ret !== 0;
|
|
5488
|
+
}
|
|
5489
|
+
/**
|
|
5490
|
+
* Create a dyadic integer.
|
|
5491
|
+
* @param {number} value
|
|
5492
|
+
* @returns {WasmDyadic}
|
|
5493
|
+
*/
|
|
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
|
+
|
|
5067
5648
|
const WasmEquivariantLocalizerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5068
5649
|
? { register: () => {}, unregister: () => {} }
|
|
5069
5650
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmequivariantlocalizer_free(ptr >>> 0, 1));
|
|
@@ -5964,6 +6545,170 @@ export class WasmGF2Vector {
|
|
|
5964
6545
|
}
|
|
5965
6546
|
}
|
|
5966
6547
|
|
|
6548
|
+
const WasmGameIdFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
6549
|
+
? { register: () => {}, unregister: () => {} }
|
|
6550
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmgameid_free(ptr >>> 0, 1));
|
|
6551
|
+
/**
|
|
6552
|
+
* Opaque handle for a short combinatorial game stored in a `WasmCgtArena`.
|
|
6553
|
+
*/
|
|
6554
|
+
export class WasmGameId {
|
|
6555
|
+
|
|
6556
|
+
static __wrap(ptr) {
|
|
6557
|
+
ptr = ptr >>> 0;
|
|
6558
|
+
const obj = Object.create(WasmGameId.prototype);
|
|
6559
|
+
obj.__wbg_ptr = ptr;
|
|
6560
|
+
WasmGameIdFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
6561
|
+
return obj;
|
|
6562
|
+
}
|
|
6563
|
+
|
|
6564
|
+
__destroy_into_raw() {
|
|
6565
|
+
const ptr = this.__wbg_ptr;
|
|
6566
|
+
this.__wbg_ptr = 0;
|
|
6567
|
+
WasmGameIdFinalization.unregister(this);
|
|
6568
|
+
return ptr;
|
|
6569
|
+
}
|
|
6570
|
+
|
|
6571
|
+
free() {
|
|
6572
|
+
const ptr = this.__destroy_into_raw();
|
|
6573
|
+
wasm.__wbg_wasmgameid_free(ptr, 0);
|
|
6574
|
+
}
|
|
6575
|
+
/**
|
|
6576
|
+
* Returns whether two game handles point at the same arena-local game.
|
|
6577
|
+
* @param {WasmGameId} other
|
|
6578
|
+
* @returns {boolean}
|
|
6579
|
+
*/
|
|
6580
|
+
same(other) {
|
|
6581
|
+
_assertClass(other, WasmGameId);
|
|
6582
|
+
const ret = wasm.wasmgameid_same(this.__wbg_ptr, other.__wbg_ptr);
|
|
6583
|
+
return ret !== 0;
|
|
6584
|
+
}
|
|
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);
|
|
6613
|
+
}
|
|
6614
|
+
/**
|
|
6615
|
+
* Whether the game is numeric.
|
|
6616
|
+
* @returns {boolean}
|
|
6617
|
+
*/
|
|
6618
|
+
isNumeric() {
|
|
6619
|
+
const ret = wasm.wasmgameinspection_isNumeric(this.__wbg_ptr);
|
|
6620
|
+
return ret !== 0;
|
|
6621
|
+
}
|
|
6622
|
+
/**
|
|
6623
|
+
* Whether the game is partizan.
|
|
6624
|
+
* @returns {boolean}
|
|
6625
|
+
*/
|
|
6626
|
+
isPartizan() {
|
|
6627
|
+
const ret = wasm.wasmgameinspection_isPartizan(this.__wbg_ptr);
|
|
6628
|
+
return ret !== 0;
|
|
6629
|
+
}
|
|
6630
|
+
/**
|
|
6631
|
+
* Whether the game already is its canonical representative.
|
|
6632
|
+
* @returns {boolean}
|
|
6633
|
+
*/
|
|
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
|
+
|
|
5967
6712
|
const WasmGaussianMultivectorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
5968
6713
|
? { register: () => {}, unregister: () => {} }
|
|
5969
6714
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmgaussianmultivector_free(ptr >>> 0, 1));
|
|
@@ -9917,7 +10662,7 @@ export class WasmOpticalRotorField {
|
|
|
9917
10662
|
* @returns {number}
|
|
9918
10663
|
*/
|
|
9919
10664
|
get width() {
|
|
9920
|
-
const ret = wasm.
|
|
10665
|
+
const ret = wasm.wasmgameinspection_reachableNodeCount(this.__wbg_ptr);
|
|
9921
10666
|
return ret >>> 0;
|
|
9922
10667
|
}
|
|
9923
10668
|
/**
|
|
@@ -11995,6 +12740,266 @@ export class WasmSensitivityMap {
|
|
|
11995
12740
|
}
|
|
11996
12741
|
}
|
|
11997
12742
|
|
|
12743
|
+
const WasmShortSurrealFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
12744
|
+
? { register: () => {}, unregister: () => {} }
|
|
12745
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_wasmshortsurreal_free(ptr >>> 0, 1));
|
|
12746
|
+
/**
|
|
12747
|
+
* Exact short surreal value backed by a dyadic rational.
|
|
12748
|
+
*/
|
|
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
|
+
|
|
11998
13003
|
const WasmSimpleOptimizerFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
11999
13004
|
? { register: () => {}, unregister: () => {} }
|
|
12000
13005
|
: new FinalizationRegistry(ptr => wasm.__wbg_wasmsimpleoptimizer_free(ptr >>> 0, 1));
|
|
@@ -15323,7 +16328,7 @@ function __wbg_get_imports() {
|
|
|
15323
16328
|
const ret = arg0.length;
|
|
15324
16329
|
return ret;
|
|
15325
16330
|
};
|
|
15326
|
-
imports.wbg.
|
|
16331
|
+
imports.wbg.__wbg_log_d18f68da6e20cb1e = function(arg0, arg1) {
|
|
15327
16332
|
console.log(getStringFromWasm0(arg0, arg1));
|
|
15328
16333
|
};
|
|
15329
16334
|
imports.wbg.__wbg_log_ea240990d83e374e = function(arg0) {
|
|
@@ -15348,7 +16353,7 @@ function __wbg_get_imports() {
|
|
|
15348
16353
|
const a = state0.a;
|
|
15349
16354
|
state0.a = 0;
|
|
15350
16355
|
try {
|
|
15351
|
-
return
|
|
16356
|
+
return __wbg_adapter_1132(a, state0.b, arg0, arg1);
|
|
15352
16357
|
} finally {
|
|
15353
16358
|
state0.a = a;
|
|
15354
16359
|
}
|
|
@@ -15500,8 +16505,8 @@ function __wbg_get_imports() {
|
|
|
15500
16505
|
const ret = false;
|
|
15501
16506
|
return ret;
|
|
15502
16507
|
};
|
|
15503
|
-
imports.wbg.
|
|
15504
|
-
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);
|
|
15505
16510
|
return ret;
|
|
15506
16511
|
};
|
|
15507
16512
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|