@justinelliottcobb/amari-wasm 0.19.1 → 0.21.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/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.closure71_externref_shim(arg0, arg1, arg2);
841
+ wasm.closure72_externref_shim(arg0, arg1, arg2);
842
842
  }
843
843
 
844
- function __wbg_adapter_965(arg0, arg1, arg2, arg3) {
845
- wasm.closure65_externref_shim(arg0, arg1, arg2, arg3);
844
+ function __wbg_adapter_1057(arg0, arg1, arg2, arg3) {
845
+ wasm.closure66_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
@@ -4651,6 +4691,28 @@ export class WasmDualNumber {
4651
4691
  const ptr = this.__destroy_into_raw();
4652
4692
  wasm.__wbg_wasmdualnumber_free(ptr, 0);
4653
4693
  }
4694
+ /**
4695
+ * Maximum with explicit derivative tie handling.
4696
+ * @param {WasmDualNumber} other
4697
+ * @param {WasmBranchPolicy} policy
4698
+ * @returns {WasmDualNumber}
4699
+ */
4700
+ maxByPolicy(other, policy) {
4701
+ _assertClass(other, WasmDualNumber);
4702
+ const ret = wasm.wasmdualnumber_maxByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
4703
+ return WasmDualNumber.__wrap(ret);
4704
+ }
4705
+ /**
4706
+ * Minimum with explicit derivative tie handling.
4707
+ * @param {WasmDualNumber} other
4708
+ * @param {WasmBranchPolicy} policy
4709
+ * @returns {WasmDualNumber}
4710
+ */
4711
+ minByPolicy(other, policy) {
4712
+ _assertClass(other, WasmDualNumber);
4713
+ const ret = wasm.wasmdualnumber_minByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
4714
+ return WasmDualNumber.__wrap(ret);
4715
+ }
4654
4716
  /**
4655
4717
  * Natural logarithm
4656
4718
  * @returns {WasmDualNumber}
@@ -8574,6 +8636,34 @@ export class WasmMultiDualNumber {
8574
8636
  const ret = wasm.wasmmultidualnumber_getNumVars(this.__wbg_ptr);
8575
8637
  return ret >>> 0;
8576
8638
  }
8639
+ /**
8640
+ * Maximum with explicit derivative tie handling.
8641
+ * @param {WasmMultiDualNumber} other
8642
+ * @param {WasmBranchPolicy} policy
8643
+ * @returns {WasmMultiDualNumber}
8644
+ */
8645
+ maxByPolicy(other, policy) {
8646
+ _assertClass(other, WasmMultiDualNumber);
8647
+ const ret = wasm.wasmmultidualnumber_maxByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
8648
+ if (ret[2]) {
8649
+ throw takeFromExternrefTable0(ret[1]);
8650
+ }
8651
+ return WasmMultiDualNumber.__wrap(ret[0]);
8652
+ }
8653
+ /**
8654
+ * Minimum with explicit derivative tie handling.
8655
+ * @param {WasmMultiDualNumber} other
8656
+ * @param {WasmBranchPolicy} policy
8657
+ * @returns {WasmMultiDualNumber}
8658
+ */
8659
+ minByPolicy(other, policy) {
8660
+ _assertClass(other, WasmMultiDualNumber);
8661
+ const ret = wasm.wasmmultidualnumber_minByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
8662
+ if (ret[2]) {
8663
+ throw takeFromExternrefTable0(ret[1]);
8664
+ }
8665
+ return WasmMultiDualNumber.__wrap(ret[0]);
8666
+ }
8577
8667
  /**
8578
8668
  * Addition
8579
8669
  * @param {WasmMultiDualNumber} other
@@ -8653,6 +8743,17 @@ export class WasmMultiDualNumber {
8653
8743
  const ret = wasm.wasmmultidualnumber_variable(value, num_vars, var_index);
8654
8744
  return WasmMultiDualNumber.__wrap(ret);
8655
8745
  }
8746
+ /**
8747
+ * Create one basis-seeded variable per input coordinate.
8748
+ * @param {Float64Array} values
8749
+ * @returns {Array<any>}
8750
+ */
8751
+ static variables(values) {
8752
+ const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_malloc);
8753
+ const len0 = WASM_VECTOR_LEN;
8754
+ const ret = wasm.wasmmultidualnumber_variables(ptr0, len0);
8755
+ return ret;
8756
+ }
8656
8757
  }
8657
8758
 
8658
8759
  const WasmMultiObjectiveOptimizerFinalization = (typeof FinalizationRegistry === 'undefined')
@@ -9998,691 +10099,937 @@ export class WasmOptimizationUtils {
9998
10099
  }
9999
10100
  }
10000
10101
 
10001
- const WasmParametricDensityFinalization = (typeof FinalizationRegistry === 'undefined')
10102
+ const WasmOrdinalFinalization = (typeof FinalizationRegistry === 'undefined')
10002
10103
  ? { register: () => {}, unregister: () => {} }
10003
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmparametricdensity_free(ptr >>> 0, 1));
10104
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmordinal_free(ptr >>> 0, 1));
10004
10105
  /**
10005
- * Parametric probability density families
10106
+ * Arena-bound handle for an ordinal below ε₀.
10006
10107
  */
10007
- export class WasmParametricDensity {
10108
+ export class WasmOrdinal {
10008
10109
 
10009
10110
  static __wrap(ptr) {
10010
10111
  ptr = ptr >>> 0;
10011
- const obj = Object.create(WasmParametricDensity.prototype);
10112
+ const obj = Object.create(WasmOrdinal.prototype);
10012
10113
  obj.__wbg_ptr = ptr;
10013
- WasmParametricDensityFinalization.register(obj, obj.__wbg_ptr, obj);
10114
+ WasmOrdinalFinalization.register(obj, obj.__wbg_ptr, obj);
10014
10115
  return obj;
10015
10116
  }
10016
10117
 
10017
10118
  __destroy_into_raw() {
10018
10119
  const ptr = this.__wbg_ptr;
10019
10120
  this.__wbg_ptr = 0;
10020
- WasmParametricDensityFinalization.unregister(this);
10121
+ WasmOrdinalFinalization.unregister(this);
10021
10122
  return ptr;
10022
10123
  }
10023
10124
 
10024
10125
  free() {
10025
10126
  const ptr = this.__destroy_into_raw();
10026
- wasm.__wbg_wasmparametricdensity_free(ptr, 0);
10127
+ wasm.__wbg_wasmordinal_free(ptr, 0);
10027
10128
  }
10028
10129
  /**
10029
- * Create an Exponential density Exp(λ)
10030
- * @returns {WasmParametricDensity}
10130
+ * Raw arena-local ordinal index.
10131
+ * @returns {number}
10031
10132
  */
10032
- static exponential() {
10033
- const ret = wasm.wasmparametricdensity_exponential();
10034
- return WasmParametricDensity.__wrap(ret);
10133
+ getIndex() {
10134
+ const ret = wasm.wasmlebesguemeasure_getDimension(this.__wbg_ptr);
10135
+ return ret >>> 0;
10136
+ }
10137
+ }
10138
+
10139
+ const WasmOrdinalArenaFinalization = (typeof FinalizationRegistry === 'undefined')
10140
+ ? { register: () => {}, unregister: () => {} }
10141
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmordinalarena_free(ptr >>> 0, 1));
10142
+ /**
10143
+ * Arena-backed store for canonical ordinals below ε₀.
10144
+ */
10145
+ export class WasmOrdinalArena {
10146
+
10147
+ __destroy_into_raw() {
10148
+ const ptr = this.__wbg_ptr;
10149
+ this.__wbg_ptr = 0;
10150
+ WasmOrdinalArenaFinalization.unregister(this);
10151
+ return ptr;
10152
+ }
10153
+
10154
+ free() {
10155
+ const ptr = this.__destroy_into_raw();
10156
+ wasm.__wbg_wasmordinalarena_free(ptr, 0);
10035
10157
  }
10036
10158
  /**
10037
- * Compute log-density log p(x|θ)
10038
- * @param {number} x
10039
- * @param {Float64Array} params
10159
+ * Number of interned ordinal nodes.
10040
10160
  * @returns {number}
10041
10161
  */
10042
- logDensity(x, params) {
10043
- const ptr0 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
10044
- const len0 = WASM_VECTOR_LEN;
10045
- const ret = wasm.wasmparametricdensity_logDensity(this.__wbg_ptr, x, ptr0, len0);
10162
+ nodeCount() {
10163
+ const ret = wasm.wasmordinalarena_nodeCount(this.__wbg_ptr);
10164
+ return ret >>> 0;
10165
+ }
10166
+ /**
10167
+ * Number of CNF terms.
10168
+ * @param {WasmOrdinal} ordinal
10169
+ * @returns {number}
10170
+ */
10171
+ termCount(ordinal) {
10172
+ _assertClass(ordinal, WasmOrdinal);
10173
+ const ret = wasm.wasmordinalarena_termCount(this.__wbg_ptr, ordinal.__wbg_ptr);
10046
10174
  if (ret[2]) {
10047
10175
  throw takeFromExternrefTable0(ret[1]);
10048
10176
  }
10049
- return ret[0];
10177
+ return ret[0] >>> 0;
10050
10178
  }
10051
10179
  /**
10052
- * Compute Fisher information matrix from data samples
10053
- * @param {Float64Array} data
10054
- * @param {Float64Array} params
10055
- * @returns {Float64Array}
10180
+ * Select the best of two weights using semiring-style `max`.
10181
+ * @param {WasmOrdinalWeight} left
10182
+ * @param {WasmOrdinalWeight} right
10183
+ * @returns {WasmOrdinalWeight}
10056
10184
  */
10057
- fisherInformation(data, params) {
10058
- const ptr0 = passArrayF64ToWasm0(data, wasm.__wbindgen_malloc);
10059
- const len0 = WASM_VECTOR_LEN;
10060
- const ptr1 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
10061
- const len1 = WASM_VECTOR_LEN;
10062
- const ret = wasm.wasmparametricdensity_fisherInformation(this.__wbg_ptr, ptr0, len0, ptr1, len1);
10063
- if (ret[3]) {
10064
- throw takeFromExternrefTable0(ret[2]);
10185
+ bestWeight2(left, right) {
10186
+ _assertClass(left, WasmOrdinalWeight);
10187
+ _assertClass(right, WasmOrdinalWeight);
10188
+ const ret = wasm.wasmordinalarena_bestWeight2(this.__wbg_ptr, left.__wbg_ptr, right.__wbg_ptr);
10189
+ if (ret[2]) {
10190
+ throw takeFromExternrefTable0(ret[1]);
10065
10191
  }
10066
- var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
10067
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
10068
- return v3;
10192
+ return WasmOrdinalWeight.__wrap(ret[0]);
10069
10193
  }
10070
10194
  /**
10071
- * Create a Cauchy density Cauchy(x₀, γ)
10072
- * @returns {WasmParametricDensity}
10195
+ * Select the best of three weights using semiring-style `max`.
10196
+ * @param {WasmOrdinalWeight} first
10197
+ * @param {WasmOrdinalWeight} second
10198
+ * @param {WasmOrdinalWeight} third
10199
+ * @returns {WasmOrdinalWeight}
10073
10200
  */
10074
- static cauchy() {
10075
- const ret = wasm.wasmparametricdensity_cauchy();
10076
- return WasmParametricDensity.__wrap(ret);
10201
+ bestWeight3(first, second, third) {
10202
+ _assertClass(first, WasmOrdinalWeight);
10203
+ _assertClass(second, WasmOrdinalWeight);
10204
+ _assertClass(third, WasmOrdinalWeight);
10205
+ const ret = wasm.wasmordinalarena_bestWeight3(this.__wbg_ptr, first.__wbg_ptr, second.__wbg_ptr, third.__wbg_ptr);
10206
+ if (ret[2]) {
10207
+ throw takeFromExternrefTable0(ret[1]);
10208
+ }
10209
+ return WasmOrdinalWeight.__wrap(ret[0]);
10077
10210
  }
10078
10211
  /**
10079
- * Create a Laplace density Laplace(μ, b)
10080
- * @returns {WasmParametricDensity}
10212
+ * Finite value when the ordinal is finite.
10213
+ * @param {WasmOrdinal} ordinal
10214
+ * @returns {number | undefined}
10081
10215
  */
10082
- static laplace() {
10083
- const ret = wasm.wasmparametricdensity_laplace();
10084
- return WasmParametricDensity.__wrap(ret);
10216
+ finiteValue(ordinal) {
10217
+ _assertClass(ordinal, WasmOrdinal);
10218
+ const ret = wasm.wasmordinalarena_finiteValue(this.__wbg_ptr, ordinal.__wbg_ptr);
10219
+ if (ret[3]) {
10220
+ throw takeFromExternrefTable0(ret[2]);
10221
+ }
10222
+ return ret[0] === 0 ? undefined : ret[1];
10085
10223
  }
10086
10224
  /**
10087
- * Evaluate density at point x with parameters
10088
- *
10089
- * # Arguments
10090
- * * `x` - Point to evaluate
10091
- * * `params` - Parameters (Gaussian: [μ, σ], Exponential: [λ], etc.)
10092
- * @param {number} x
10093
- * @param {Float64Array} params
10094
- * @returns {number}
10225
+ * Return true if this is a successor ordinal.
10226
+ * @param {WasmOrdinal} ordinal
10227
+ * @returns {boolean}
10095
10228
  */
10096
- evaluate(x, params) {
10097
- const ptr0 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
10098
- const len0 = WASM_VECTOR_LEN;
10099
- const ret = wasm.wasmparametricdensity_evaluate(this.__wbg_ptr, x, ptr0, len0);
10229
+ isSuccessor(ordinal) {
10230
+ _assertClass(ordinal, WasmOrdinal);
10231
+ const ret = wasm.wasmordinalarena_isSuccessor(this.__wbg_ptr, ordinal.__wbg_ptr);
10100
10232
  if (ret[2]) {
10101
10233
  throw takeFromExternrefTable0(ret[1]);
10102
10234
  }
10103
- return ret[0];
10235
+ return ret[0] !== 0;
10104
10236
  }
10105
10237
  /**
10106
- * Create a Gaussian density N(μ, σ²)
10107
- * @returns {WasmParametricDensity}
10238
+ * Semiring-style additive combination (`max`) for ordinal weights.
10239
+ * @param {WasmOrdinalWeight} left
10240
+ * @param {WasmOrdinalWeight} right
10241
+ * @returns {WasmOrdinalWeight}
10108
10242
  */
10109
- static gaussian() {
10110
- const ret = wasm.wasmparametricdensity_gaussian();
10111
- return WasmParametricDensity.__wrap(ret);
10243
+ oplusWeight(left, right) {
10244
+ _assertClass(left, WasmOrdinalWeight);
10245
+ _assertClass(right, WasmOrdinalWeight);
10246
+ const ret = wasm.wasmordinalarena_oplusWeight(this.__wbg_ptr, left.__wbg_ptr, right.__wbg_ptr);
10247
+ if (ret[2]) {
10248
+ throw takeFromExternrefTable0(ret[1]);
10249
+ }
10250
+ return WasmOrdinalWeight.__wrap(ret[0]);
10112
10251
  }
10113
10252
  /**
10114
- * Compute numerical gradient ∇_θ p(x|θ)
10115
- * @param {number} x
10116
- * @param {Float64Array} params
10117
- * @returns {Float64Array}
10253
+ * Format an ordinal weight.
10254
+ * @param {WasmOrdinalWeight} weight
10255
+ * @returns {string}
10118
10256
  */
10119
- gradient(x, params) {
10120
- const ptr0 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
10121
- const len0 = WASM_VECTOR_LEN;
10122
- const ret = wasm.wasmparametricdensity_gradient(this.__wbg_ptr, x, ptr0, len0);
10123
- if (ret[3]) {
10124
- throw takeFromExternrefTable0(ret[2]);
10257
+ formatWeight(weight) {
10258
+ let deferred2_0;
10259
+ let deferred2_1;
10260
+ try {
10261
+ _assertClass(weight, WasmOrdinalWeight);
10262
+ const ret = wasm.wasmordinalarena_formatWeight(this.__wbg_ptr, weight.__wbg_ptr);
10263
+ var ptr1 = ret[0];
10264
+ var len1 = ret[1];
10265
+ if (ret[3]) {
10266
+ ptr1 = 0; len1 = 0;
10267
+ throw takeFromExternrefTable0(ret[2]);
10268
+ }
10269
+ deferred2_0 = ptr1;
10270
+ deferred2_1 = len1;
10271
+ return getStringFromWasm0(ptr1, len1);
10272
+ } finally {
10273
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
10125
10274
  }
10126
- var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
10127
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
10128
- return v2;
10129
10275
  }
10130
- }
10131
-
10132
- const WasmPartitionFinalization = (typeof FinalizationRegistry === 'undefined')
10133
- ? { register: () => {}, unregister: () => {} }
10134
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmpartition_free(ptr >>> 0, 1));
10135
- /**
10136
- * WASM wrapper for partitions used in Schubert calculus and LR coefficients
10137
- */
10138
- export class WasmPartition {
10139
-
10140
- static __unwrap(jsValue) {
10141
- if (!(jsValue instanceof WasmPartition)) {
10142
- return 0;
10276
+ /**
10277
+ * Semiring-style multiplicative composition (ordinal addition) for weights.
10278
+ * @param {WasmOrdinalWeight} left
10279
+ * @param {WasmOrdinalWeight} right
10280
+ * @returns {WasmOrdinalWeight}
10281
+ */
10282
+ otimesWeight(left, right) {
10283
+ _assertClass(left, WasmOrdinalWeight);
10284
+ _assertClass(right, WasmOrdinalWeight);
10285
+ const ret = wasm.wasmordinalarena_otimesWeight(this.__wbg_ptr, left.__wbg_ptr, right.__wbg_ptr);
10286
+ if (ret[2]) {
10287
+ throw takeFromExternrefTable0(ret[1]);
10143
10288
  }
10144
- return jsValue.__destroy_into_raw();
10145
- }
10146
-
10147
- __destroy_into_raw() {
10148
- const ptr = this.__wbg_ptr;
10149
- this.__wbg_ptr = 0;
10150
- WasmPartitionFinalization.unregister(this);
10151
- return ptr;
10152
- }
10153
-
10154
- free() {
10155
- const ptr = this.__destroy_into_raw();
10156
- wasm.__wbg_wasmpartition_free(ptr, 0);
10289
+ return WasmOrdinalWeight.__wrap(ret[0]);
10157
10290
  }
10158
10291
  /**
10159
- * Get the length (number of non-zero parts) of this partition
10292
+ * Compare two weights: -1 for less, 0 for equal, 1 for greater.
10293
+ * @param {WasmOrdinalWeight} left
10294
+ * @param {WasmOrdinalWeight} right
10160
10295
  * @returns {number}
10161
10296
  */
10162
- getLength() {
10163
- const ret = wasm.wasmopticalrotorfield_length(this.__wbg_ptr);
10164
- return ret >>> 0;
10297
+ compareWeight(left, right) {
10298
+ _assertClass(left, WasmOrdinalWeight);
10299
+ _assertClass(right, WasmOrdinalWeight);
10300
+ const ret = wasm.wasmordinalarena_compareWeight(this.__wbg_ptr, left.__wbg_ptr, right.__wbg_ptr);
10301
+ if (ret[2]) {
10302
+ throw takeFromExternrefTable0(ret[1]);
10303
+ }
10304
+ return ret[0];
10165
10305
  }
10166
10306
  /**
10167
- * Check if this partition fits in a k × (n-k) box (for Grassmannian)
10168
- * @param {number} k
10169
- * @param {number} n
10170
- * @returns {boolean}
10307
+ * Format an ordinal in Cantor normal form.
10308
+ * @param {WasmOrdinal} ordinal
10309
+ * @returns {string}
10171
10310
  */
10172
- fitsInBox(k, n) {
10173
- const ret = wasm.wasmpartition_fitsInBox(this.__wbg_ptr, k, n);
10174
- return ret !== 0;
10311
+ formatOrdinal(ordinal) {
10312
+ let deferred2_0;
10313
+ let deferred2_1;
10314
+ try {
10315
+ _assertClass(ordinal, WasmOrdinal);
10316
+ const ret = wasm.wasmordinalarena_formatOrdinal(this.__wbg_ptr, ordinal.__wbg_ptr);
10317
+ var ptr1 = ret[0];
10318
+ var len1 = ret[1];
10319
+ if (ret[3]) {
10320
+ ptr1 = 0; len1 = 0;
10321
+ throw takeFromExternrefTable0(ret[2]);
10322
+ }
10323
+ deferred2_0 = ptr1;
10324
+ deferred2_1 = len1;
10325
+ return getStringFromWasm0(ptr1, len1);
10326
+ } finally {
10327
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
10328
+ }
10175
10329
  }
10176
10330
  /**
10177
- * Create a new partition from an array of parts
10178
- * @param {Uint32Array} parts
10331
+ * Compose two weights using ordinal addition with bottom annihilation.
10332
+ * @param {WasmOrdinalWeight} left
10333
+ * @param {WasmOrdinalWeight} right
10334
+ * @returns {WasmOrdinalWeight}
10179
10335
  */
10180
- constructor(parts) {
10181
- const ptr0 = passArray32ToWasm0(parts, wasm.__wbindgen_malloc);
10182
- const len0 = WASM_VECTOR_LEN;
10183
- const ret = wasm.wasmpartition_new(ptr0, len0);
10184
- this.__wbg_ptr = ret >>> 0;
10185
- WasmPartitionFinalization.register(this, this.__wbg_ptr, this);
10186
- return this;
10336
+ composeWeight2(left, right) {
10337
+ _assertClass(left, WasmOrdinalWeight);
10338
+ _assertClass(right, WasmOrdinalWeight);
10339
+ const ret = wasm.wasmordinalarena_composeWeight2(this.__wbg_ptr, left.__wbg_ptr, right.__wbg_ptr);
10340
+ if (ret[2]) {
10341
+ throw takeFromExternrefTable0(ret[1]);
10342
+ }
10343
+ return WasmOrdinalWeight.__wrap(ret[0]);
10187
10344
  }
10188
10345
  /**
10189
- * Check if this partition contains another (for skew shapes)
10190
- * @param {WasmPartition} other
10191
- * @returns {boolean}
10346
+ * Compose three weights using ordinal addition with bottom annihilation.
10347
+ * @param {WasmOrdinalWeight} first
10348
+ * @param {WasmOrdinalWeight} second
10349
+ * @param {WasmOrdinalWeight} third
10350
+ * @returns {WasmOrdinalWeight}
10192
10351
  */
10193
- contains(other) {
10194
- _assertClass(other, WasmPartition);
10195
- const ret = wasm.wasmpartition_contains(this.__wbg_ptr, other.__wbg_ptr);
10196
- return ret !== 0;
10352
+ composeWeight3(first, second, third) {
10353
+ _assertClass(first, WasmOrdinalWeight);
10354
+ _assertClass(second, WasmOrdinalWeight);
10355
+ _assertClass(third, WasmOrdinalWeight);
10356
+ const ret = wasm.wasmordinalarena_composeWeight3(this.__wbg_ptr, first.__wbg_ptr, second.__wbg_ptr, third.__wbg_ptr);
10357
+ if (ret[2]) {
10358
+ throw takeFromExternrefTable0(ret[1]);
10359
+ }
10360
+ return WasmOrdinalWeight.__wrap(ret[0]);
10197
10361
  }
10198
10362
  /**
10199
- * Get the size (sum of parts) of this partition
10200
- * @returns {number}
10363
+ * Build a JavaScript object with ordinal inspection metadata.
10364
+ * @param {WasmOrdinal} ordinal
10365
+ * @returns {any}
10201
10366
  */
10202
- getSize() {
10203
- const ret = wasm.wasmpartition_getSize(this.__wbg_ptr);
10204
- return ret >>> 0;
10367
+ inspectOrdinal(ordinal) {
10368
+ _assertClass(ordinal, WasmOrdinal);
10369
+ const ret = wasm.wasmordinalarena_inspectOrdinal(this.__wbg_ptr, ordinal.__wbg_ptr);
10370
+ if (ret[2]) {
10371
+ throw takeFromExternrefTable0(ret[1]);
10372
+ }
10373
+ return takeFromExternrefTable0(ret[0]);
10205
10374
  }
10206
10375
  /**
10207
- * Check if this partition is valid (weakly decreasing, positive parts)
10376
+ * Return true if the ordinal is zero.
10377
+ * @param {WasmOrdinal} ordinal
10208
10378
  * @returns {boolean}
10209
10379
  */
10210
- isValid() {
10211
- const ret = wasm.wasmpartition_isValid(this.__wbg_ptr);
10212
- return ret !== 0;
10380
+ isZeroOrdinal(ordinal) {
10381
+ _assertClass(ordinal, WasmOrdinal);
10382
+ const ret = wasm.wasmordinalarena_isZeroOrdinal(this.__wbg_ptr, ordinal.__wbg_ptr);
10383
+ if (ret[2]) {
10384
+ throw takeFromExternrefTable0(ret[1]);
10385
+ }
10386
+ return ret[0] !== 0;
10213
10387
  }
10214
10388
  /**
10215
- * Get the parts of this partition
10216
- * @returns {Uint32Array}
10389
+ * Construct a weight from an ordinal.
10390
+ * @param {WasmOrdinal} ordinal
10391
+ * @returns {WasmOrdinalWeight}
10217
10392
  */
10218
- getParts() {
10219
- const ret = wasm.wasmpartition_getParts(this.__wbg_ptr);
10220
- var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
10221
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
10222
- return v1;
10393
+ weightFromOrdinal(ordinal) {
10394
+ _assertClass(ordinal, WasmOrdinal);
10395
+ const ret = wasm.wasmordinalarena_weightFromOrdinal(this.__wbg_ptr, ordinal.__wbg_ptr);
10396
+ return WasmOrdinalWeight.__wrap(ret);
10223
10397
  }
10224
- }
10225
-
10226
- const WasmPersistentHomologyFinalization = (typeof FinalizationRegistry === 'undefined')
10227
- ? { register: () => {}, unregister: () => {} }
10228
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmpersistenthomology_free(ptr >>> 0, 1));
10229
- /**
10230
- * Result of persistent homology computation.
10231
- */
10232
- export class WasmPersistentHomology {
10233
-
10234
- static __wrap(ptr) {
10235
- ptr = ptr >>> 0;
10236
- const obj = Object.create(WasmPersistentHomology.prototype);
10237
- obj.__wbg_ptr = ptr;
10238
- WasmPersistentHomologyFinalization.register(obj, obj.__wbg_ptr, obj);
10239
- return obj;
10398
+ /**
10399
+ * Ordinal addition.
10400
+ * @param {WasmOrdinal} left
10401
+ * @param {WasmOrdinal} right
10402
+ * @returns {WasmOrdinal}
10403
+ */
10404
+ add(left, right) {
10405
+ _assertClass(left, WasmOrdinal);
10406
+ _assertClass(right, WasmOrdinal);
10407
+ const ret = wasm.wasmordinalarena_add(this.__wbg_ptr, left.__wbg_ptr, right.__wbg_ptr);
10408
+ if (ret[2]) {
10409
+ throw takeFromExternrefTable0(ret[1]);
10410
+ }
10411
+ return WasmOrdinal.__wrap(ret[0]);
10240
10412
  }
10241
-
10242
- __destroy_into_raw() {
10243
- const ptr = this.__wbg_ptr;
10244
- this.__wbg_ptr = 0;
10245
- WasmPersistentHomologyFinalization.unregister(this);
10246
- return ptr;
10413
+ /**
10414
+ * Create an ordinal arena containing zero.
10415
+ */
10416
+ constructor() {
10417
+ const ret = wasm.wasmordinalarena_new();
10418
+ this.__wbg_ptr = ret >>> 0;
10419
+ WasmOrdinalArenaFinalization.register(this, this.__wbg_ptr, this);
10420
+ return this;
10247
10421
  }
10248
-
10249
- free() {
10250
- const ptr = this.__destroy_into_raw();
10251
- wasm.__wbg_wasmpersistenthomology_free(ptr, 0);
10422
+ /**
10423
+ * Finite ordinal one.
10424
+ * @returns {WasmOrdinal}
10425
+ */
10426
+ one() {
10427
+ const ret = wasm.wasmordinalarena_one(this.__wbg_ptr);
10428
+ return WasmOrdinal.__wrap(ret);
10252
10429
  }
10253
10430
  /**
10254
- * Get the persistence diagram as an array of [dimension, birth, death] triples.
10255
- * @returns {Float64Array}
10431
+ * Structural kind: zero, finite, successor, or limit.
10432
+ * @param {WasmOrdinal} ordinal
10433
+ * @returns {string}
10256
10434
  */
10257
- getDiagram() {
10258
- const ret = wasm.wasmpersistenthomology_getDiagram(this.__wbg_ptr);
10259
- var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
10260
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
10261
- return v1;
10435
+ kind(ordinal) {
10436
+ let deferred2_0;
10437
+ let deferred2_1;
10438
+ try {
10439
+ _assertClass(ordinal, WasmOrdinal);
10440
+ const ret = wasm.wasmordinalarena_kind(this.__wbg_ptr, ordinal.__wbg_ptr);
10441
+ var ptr1 = ret[0];
10442
+ var len1 = ret[1];
10443
+ if (ret[3]) {
10444
+ ptr1 = 0; len1 = 0;
10445
+ throw takeFromExternrefTable0(ret[2]);
10446
+ }
10447
+ deferred2_0 = ptr1;
10448
+ deferred2_1 = len1;
10449
+ return getStringFromWasm0(ptr1, len1);
10450
+ } finally {
10451
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
10452
+ }
10262
10453
  }
10263
10454
  /**
10264
- * Get the number of intervals in dimension k.
10265
- * @param {number} dim
10455
+ * Canonical zero ordinal.
10456
+ * @returns {WasmOrdinal}
10457
+ */
10458
+ zero() {
10459
+ const ret = wasm.wasmordinalarena_zero(this.__wbg_ptr);
10460
+ return WasmOrdinal.__wrap(ret);
10461
+ }
10462
+ /**
10463
+ * The ordinal ω.
10464
+ * @returns {WasmOrdinal}
10465
+ */
10466
+ omega() {
10467
+ const ret = wasm.wasmordinalarena_omega(this.__wbg_ptr);
10468
+ return WasmOrdinal.__wrap(ret);
10469
+ }
10470
+ /**
10471
+ * Finite natural ordinal `n`.
10472
+ * @param {number} n
10473
+ * @returns {WasmOrdinal}
10474
+ */
10475
+ finite(n) {
10476
+ const ret = wasm.wasmordinalarena_finite(this.__wbg_ptr, n);
10477
+ return WasmOrdinal.__wrap(ret);
10478
+ }
10479
+ /**
10480
+ * Compare two ordinals: -1 for less, 0 for equal, 1 for greater.
10481
+ * @param {WasmOrdinal} left
10482
+ * @param {WasmOrdinal} right
10266
10483
  * @returns {number}
10267
10484
  */
10268
- intervalCount(dim) {
10269
- const ret = wasm.wasmpersistenthomology_intervalCount(this.__wbg_ptr, dim);
10270
- return ret >>> 0;
10485
+ compare(left, right) {
10486
+ _assertClass(left, WasmOrdinal);
10487
+ _assertClass(right, WasmOrdinal);
10488
+ const ret = wasm.wasmordinalarena_compare(this.__wbg_ptr, left.__wbg_ptr, right.__wbg_ptr);
10489
+ if (ret[2]) {
10490
+ throw takeFromExternrefTable0(ret[1]);
10491
+ }
10492
+ return ret[0];
10271
10493
  }
10272
10494
  /**
10273
- * Compute persistent homology from a filtration.
10274
- * @param {WasmFiltration} filtration
10275
- * @returns {WasmPersistentHomology}
10495
+ * Return true if this is a nonzero limit ordinal.
10496
+ * @param {WasmOrdinal} ordinal
10497
+ * @returns {boolean}
10276
10498
  */
10277
- static compute(filtration) {
10278
- _assertClass(filtration, WasmFiltration);
10279
- const ret = wasm.wasmpersistenthomology_compute(filtration.__wbg_ptr);
10499
+ isLimit(ordinal) {
10500
+ _assertClass(ordinal, WasmOrdinal);
10501
+ const ret = wasm.wasmordinalarena_isLimit(this.__wbg_ptr, ordinal.__wbg_ptr);
10280
10502
  if (ret[2]) {
10281
10503
  throw takeFromExternrefTable0(ret[1]);
10282
10504
  }
10283
- return WasmPersistentHomology.__wrap(ret[0]);
10505
+ return ret[0] !== 0;
10284
10506
  }
10285
10507
  /**
10286
- * Get the Betti numbers at a specific filtration time.
10287
- * @param {number} time
10288
- * @returns {Uint32Array}
10508
+ * Leading-exponent valuation of a weight, if any.
10509
+ * @param {WasmOrdinalWeight} weight
10510
+ * @returns {number | undefined}
10289
10511
  */
10290
- bettiAt(time) {
10291
- const ret = wasm.wasmpersistenthomology_bettiAt(this.__wbg_ptr, time);
10292
- var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
10293
- wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
10294
- return v1;
10512
+ valuation(weight) {
10513
+ _assertClass(weight, WasmOrdinalWeight);
10514
+ const ret = wasm.wasmordinalarena_valuation(this.__wbg_ptr, weight.__wbg_ptr);
10515
+ if (ret[2]) {
10516
+ throw takeFromExternrefTable0(ret[1]);
10517
+ }
10518
+ return ret[0] === 0x100000001 ? undefined : ret[0];
10295
10519
  }
10296
10520
  }
10297
10521
 
10298
- const WasmProbFinalization = (typeof FinalizationRegistry === 'undefined')
10522
+ const WasmOrdinalWeightFinalization = (typeof FinalizationRegistry === 'undefined')
10299
10523
  ? { register: () => {}, unregister: () => {} }
10300
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmprob_free(ptr >>> 0, 1));
10524
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmordinalweight_free(ptr >>> 0, 1));
10301
10525
  /**
10302
- * WASM wrapper for probabilistic values
10303
- *
10304
- * Wraps an f64 value with associated probability metadata.
10305
- * Supports mapping, composition, and probability tracking.
10526
+ * Bottom-extended ordinal optimization weight.
10306
10527
  */
10307
- export class WasmProb {
10528
+ export class WasmOrdinalWeight {
10308
10529
 
10309
10530
  static __wrap(ptr) {
10310
10531
  ptr = ptr >>> 0;
10311
- const obj = Object.create(WasmProb.prototype);
10532
+ const obj = Object.create(WasmOrdinalWeight.prototype);
10312
10533
  obj.__wbg_ptr = ptr;
10313
- WasmProbFinalization.register(obj, obj.__wbg_ptr, obj);
10534
+ WasmOrdinalWeightFinalization.register(obj, obj.__wbg_ptr, obj);
10314
10535
  return obj;
10315
10536
  }
10316
10537
 
10317
10538
  __destroy_into_raw() {
10318
10539
  const ptr = this.__wbg_ptr;
10319
10540
  this.__wbg_ptr = 0;
10320
- WasmProbFinalization.unregister(this);
10541
+ WasmOrdinalWeightFinalization.unregister(this);
10321
10542
  return ptr;
10322
10543
  }
10323
10544
 
10324
10545
  free() {
10325
10546
  const ptr = this.__destroy_into_raw();
10326
- wasm.__wbg_wasmprob_free(ptr, 0);
10327
- }
10328
- /**
10329
- * Get the probability associated with this value
10330
- * @returns {number}
10331
- */
10332
- probability() {
10333
- const ret = wasm.wasmdualnumber_getDual(this.__wbg_ptr);
10334
- return ret;
10335
- }
10336
- /**
10337
- * Create a value with specified probability
10338
- *
10339
- * Probability must be in [0, 1].
10340
- * @param {number} probability
10341
- * @param {number} value
10342
- * @returns {WasmProb}
10343
- */
10344
- static withProbability(probability, value) {
10345
- const ret = wasm.wasmprob_withProbability(probability, value);
10346
- if (ret[2]) {
10347
- throw takeFromExternrefTable0(ret[1]);
10348
- }
10349
- return WasmProb.__wrap(ret[0]);
10547
+ wasm.__wbg_wasmordinalweight_free(ptr, 0);
10350
10548
  }
10351
10549
  /**
10352
- * Map the value by multiplying with a factor, preserving probability
10353
- * @param {number} factor
10354
- * @returns {WasmProb}
10550
+ * Arena-local ordinal index when this weight wraps an ordinal.
10551
+ * @returns {number | undefined}
10355
10552
  */
10356
- map(factor) {
10357
- const ret = wasm.wasmprob_map(this.__wbg_ptr, factor);
10358
- return WasmProb.__wrap(ret);
10553
+ ordinalIndex() {
10554
+ const ret = wasm.wasmordinalweight_ordinalIndex(this.__wbg_ptr);
10555
+ return ret === 0x100000001 ? undefined : ret;
10359
10556
  }
10360
10557
  /**
10361
- * Create a certain value (probability = 1.0)
10362
- * @param {number} value
10558
+ * Construct the semiring one element, i.e. ordinal zero.
10559
+ * @returns {WasmOrdinalWeight}
10363
10560
  */
10364
- constructor(value) {
10365
- const ret = wasm.wasmdualnumber_variable(value);
10366
- this.__wbg_ptr = ret >>> 0;
10367
- WasmProbFinalization.register(this, this.__wbg_ptr, this);
10368
- return this;
10561
+ static one() {
10562
+ const ret = wasm.wasmordinalweight_one();
10563
+ return WasmOrdinalWeight.__wrap(ret);
10369
10564
  }
10370
10565
  /**
10371
- * Get the wrapped value
10372
- * @returns {number}
10566
+ * Alias for the semiring zero element.
10567
+ * @returns {WasmOrdinalWeight}
10373
10568
  */
10374
- value() {
10375
- const ret = wasm.wasmalphaconnection_getAlpha(this.__wbg_ptr);
10376
- return ret;
10569
+ static zero() {
10570
+ const ret = wasm.wasmordinalweight_bottom();
10571
+ return WasmOrdinalWeight.__wrap(ret);
10377
10572
  }
10378
10573
  /**
10379
- * Sample this probabilistic value
10380
- *
10381
- * Returns the value with probability p, or NaN otherwise.
10382
- * @returns {number}
10574
+ * Construct the bottom element.
10575
+ * @returns {WasmOrdinalWeight}
10383
10576
  */
10384
- sample() {
10385
- const ret = wasm.wasmprob_sample(this.__wbg_ptr);
10386
- return ret;
10577
+ static bottom() {
10578
+ const ret = wasm.wasmordinalweight_bottom();
10579
+ return WasmOrdinalWeight.__wrap(ret);
10387
10580
  }
10388
10581
  /**
10389
- * Combine with another probabilistic value (independent)
10390
- *
10391
- * Multiplies probabilities and values together.
10392
- * @param {number} other_probability
10393
- * @param {number} other_value
10394
- * @returns {WasmProb}
10582
+ * Whether this weight is bottom.
10583
+ * @returns {boolean}
10395
10584
  */
10396
- andThen(other_probability, other_value) {
10397
- const ret = wasm.wasmprob_andThen(this.__wbg_ptr, other_probability, other_value);
10398
- if (ret[2]) {
10399
- throw takeFromExternrefTable0(ret[1]);
10400
- }
10401
- return WasmProb.__wrap(ret[0]);
10585
+ isBottom() {
10586
+ const ret = wasm.wasmordinalweight_isBottom(this.__wbg_ptr);
10587
+ return ret !== 0;
10402
10588
  }
10403
10589
  }
10404
10590
 
10405
- const WasmProbabilityMeasureFinalization = (typeof FinalizationRegistry === 'undefined')
10591
+ const WasmParametricDensityFinalization = (typeof FinalizationRegistry === 'undefined')
10406
10592
  ? { register: () => {}, unregister: () => {} }
10407
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmprobabilitymeasure_free(ptr >>> 0, 1));
10593
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmparametricdensity_free(ptr >>> 0, 1));
10408
10594
  /**
10409
- * WASM wrapper for probability measures
10410
- *
10411
- * A probability measure assigns total measure 1 to the entire space.
10595
+ * Parametric probability density families
10412
10596
  */
10413
- export class WasmProbabilityMeasure {
10597
+ export class WasmParametricDensity {
10414
10598
 
10415
10599
  static __wrap(ptr) {
10416
10600
  ptr = ptr >>> 0;
10417
- const obj = Object.create(WasmProbabilityMeasure.prototype);
10601
+ const obj = Object.create(WasmParametricDensity.prototype);
10418
10602
  obj.__wbg_ptr = ptr;
10419
- WasmProbabilityMeasureFinalization.register(obj, obj.__wbg_ptr, obj);
10603
+ WasmParametricDensityFinalization.register(obj, obj.__wbg_ptr, obj);
10420
10604
  return obj;
10421
10605
  }
10422
10606
 
10423
10607
  __destroy_into_raw() {
10424
10608
  const ptr = this.__wbg_ptr;
10425
10609
  this.__wbg_ptr = 0;
10426
- WasmProbabilityMeasureFinalization.unregister(this);
10610
+ WasmParametricDensityFinalization.unregister(this);
10427
10611
  return ptr;
10428
10612
  }
10429
10613
 
10430
10614
  free() {
10431
10615
  const ptr = this.__destroy_into_raw();
10432
- wasm.__wbg_wasmprobabilitymeasure_free(ptr, 0);
10616
+ wasm.__wbg_wasmparametricdensity_free(ptr, 0);
10433
10617
  }
10434
10618
  /**
10435
- * Get a description of this probability measure
10436
- * @returns {string}
10619
+ * Create an Exponential density Exp(λ)
10620
+ * @returns {WasmParametricDensity}
10437
10621
  */
10438
- getDescription() {
10439
- let deferred1_0;
10440
- let deferred1_1;
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
- }
10622
+ static exponential() {
10623
+ const ret = wasm.wasmparametricdensity_exponential();
10624
+ return WasmParametricDensity.__wrap(ret);
10449
10625
  }
10450
10626
  /**
10451
- * Compute P(X [a, b]) for uniform distribution
10452
- * @param {number} a
10453
- * @param {number} b
10454
- * @param {number} lower
10455
- * @param {number} upper
10627
+ * Compute log-density log p(x|θ)
10628
+ * @param {number} x
10629
+ * @param {Float64Array} params
10456
10630
  * @returns {number}
10457
10631
  */
10458
- probabilityInterval(a, b, lower, upper) {
10459
- const ret = wasm.wasmprobabilitymeasure_probabilityInterval(this.__wbg_ptr, a, b, lower, upper);
10460
- return ret;
10632
+ logDensity(x, params) {
10633
+ const ptr0 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
10634
+ const len0 = WASM_VECTOR_LEN;
10635
+ const ret = wasm.wasmparametricdensity_logDensity(this.__wbg_ptr, x, ptr0, len0);
10636
+ if (ret[2]) {
10637
+ throw takeFromExternrefTable0(ret[1]);
10638
+ }
10639
+ return ret[0];
10461
10640
  }
10462
10641
  /**
10463
- * Create a new uniform probability measure on [0, 1]
10642
+ * Compute Fisher information matrix from data samples
10643
+ * @param {Float64Array} data
10644
+ * @param {Float64Array} params
10645
+ * @returns {Float64Array}
10464
10646
  */
10465
- constructor() {
10466
- const ret = wasm.wasmprobabilitymeasure_new();
10467
- this.__wbg_ptr = ret >>> 0;
10468
- WasmProbabilityMeasureFinalization.register(this, this.__wbg_ptr, this);
10469
- return this;
10647
+ fisherInformation(data, params) {
10648
+ const ptr0 = passArrayF64ToWasm0(data, wasm.__wbindgen_malloc);
10649
+ const len0 = WASM_VECTOR_LEN;
10650
+ const ptr1 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
10651
+ const len1 = WASM_VECTOR_LEN;
10652
+ const ret = wasm.wasmparametricdensity_fisherInformation(this.__wbg_ptr, ptr0, len0, ptr1, len1);
10653
+ if (ret[3]) {
10654
+ throw takeFromExternrefTable0(ret[2]);
10655
+ }
10656
+ var v3 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
10657
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
10658
+ return v3;
10470
10659
  }
10471
10660
  /**
10472
- * Create a uniform probability measure on [a, b]
10473
- * @param {number} a
10474
- * @param {number} b
10475
- * @returns {WasmProbabilityMeasure}
10661
+ * Create a Cauchy density Cauchy(x₀, γ)
10662
+ * @returns {WasmParametricDensity}
10476
10663
  */
10477
- static uniform(a, b) {
10478
- const ret = wasm.wasmprobabilitymeasure_uniform(a, b);
10664
+ static cauchy() {
10665
+ const ret = wasm.wasmparametricdensity_cauchy();
10666
+ return WasmParametricDensity.__wrap(ret);
10667
+ }
10668
+ /**
10669
+ * Create a Laplace density Laplace(μ, b)
10670
+ * @returns {WasmParametricDensity}
10671
+ */
10672
+ static laplace() {
10673
+ const ret = wasm.wasmparametricdensity_laplace();
10674
+ return WasmParametricDensity.__wrap(ret);
10675
+ }
10676
+ /**
10677
+ * Evaluate density at point x with parameters
10678
+ *
10679
+ * # Arguments
10680
+ * * `x` - Point to evaluate
10681
+ * * `params` - Parameters (Gaussian: [μ, σ], Exponential: [λ], etc.)
10682
+ * @param {number} x
10683
+ * @param {Float64Array} params
10684
+ * @returns {number}
10685
+ */
10686
+ evaluate(x, params) {
10687
+ const ptr0 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
10688
+ const len0 = WASM_VECTOR_LEN;
10689
+ const ret = wasm.wasmparametricdensity_evaluate(this.__wbg_ptr, x, ptr0, len0);
10479
10690
  if (ret[2]) {
10480
10691
  throw takeFromExternrefTable0(ret[1]);
10481
10692
  }
10482
- return WasmProbabilityMeasure.__wrap(ret[0]);
10693
+ return ret[0];
10694
+ }
10695
+ /**
10696
+ * Create a Gaussian density N(μ, σ²)
10697
+ * @returns {WasmParametricDensity}
10698
+ */
10699
+ static gaussian() {
10700
+ const ret = wasm.wasmparametricdensity_gaussian();
10701
+ return WasmParametricDensity.__wrap(ret);
10702
+ }
10703
+ /**
10704
+ * Compute numerical gradient ∇_θ p(x|θ)
10705
+ * @param {number} x
10706
+ * @param {Float64Array} params
10707
+ * @returns {Float64Array}
10708
+ */
10709
+ gradient(x, params) {
10710
+ const ptr0 = passArrayF64ToWasm0(params, wasm.__wbindgen_malloc);
10711
+ const len0 = WASM_VECTOR_LEN;
10712
+ const ret = wasm.wasmparametricdensity_gradient(this.__wbg_ptr, x, ptr0, len0);
10713
+ if (ret[3]) {
10714
+ throw takeFromExternrefTable0(ret[2]);
10715
+ }
10716
+ var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
10717
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
10718
+ return v2;
10483
10719
  }
10484
10720
  }
10485
10721
 
10486
- const WasmProjectiveSpaceFinalization = (typeof FinalizationRegistry === 'undefined')
10722
+ const WasmPartitionFinalization = (typeof FinalizationRegistry === 'undefined')
10487
10723
  ? { register: () => {}, unregister: () => {} }
10488
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmprojectivespace_free(ptr >>> 0, 1));
10724
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmpartition_free(ptr >>> 0, 1));
10489
10725
  /**
10490
- * WASM wrapper for projective spaces
10726
+ * WASM wrapper for partitions used in Schubert calculus and LR coefficients
10491
10727
  */
10492
- export class WasmProjectiveSpace {
10728
+ export class WasmPartition {
10729
+
10730
+ static __unwrap(jsValue) {
10731
+ if (!(jsValue instanceof WasmPartition)) {
10732
+ return 0;
10733
+ }
10734
+ return jsValue.__destroy_into_raw();
10735
+ }
10493
10736
 
10494
10737
  __destroy_into_raw() {
10495
10738
  const ptr = this.__wbg_ptr;
10496
10739
  this.__wbg_ptr = 0;
10497
- WasmProjectiveSpaceFinalization.unregister(this);
10740
+ WasmPartitionFinalization.unregister(this);
10498
10741
  return ptr;
10499
10742
  }
10500
10743
 
10501
10744
  free() {
10502
10745
  const ptr = this.__destroy_into_raw();
10503
- wasm.__wbg_wasmprojectivespace_free(ptr, 0);
10746
+ wasm.__wbg_wasmpartition_free(ptr, 0);
10504
10747
  }
10505
10748
  /**
10506
- * Get the dimension of this projective space
10749
+ * Get the length (number of non-zero parts) of this partition
10507
10750
  * @returns {number}
10508
10751
  */
10509
- getDimension() {
10510
- const ret = wasm.wasmlebesguemeasure_getDimension(this.__wbg_ptr);
10752
+ getLength() {
10753
+ const ret = wasm.wasmopticalrotorfield_length(this.__wbg_ptr);
10511
10754
  return ret >>> 0;
10512
10755
  }
10513
10756
  /**
10514
- * Check if the projective space has given dimension
10515
- * @param {number} dim
10757
+ * Check if this partition fits in a k × (n-k) box (for Grassmannian)
10758
+ * @param {number} k
10759
+ * @param {number} n
10516
10760
  * @returns {boolean}
10517
10761
  */
10518
- hasDimension(dim) {
10519
- const ret = wasm.wasmprojectivespace_hasDimension(this.__wbg_ptr, dim);
10762
+ fitsInBox(k, n) {
10763
+ const ret = wasm.wasmpartition_fitsInBox(this.__wbg_ptr, k, n);
10520
10764
  return ret !== 0;
10521
10765
  }
10522
10766
  /**
10523
- * Compute Bézout intersection number for two curves
10524
- * @param {number} degree1
10525
- * @param {number} degree2
10767
+ * Create a new partition from an array of parts
10768
+ * @param {Uint32Array} parts
10769
+ */
10770
+ constructor(parts) {
10771
+ const ptr0 = passArray32ToWasm0(parts, wasm.__wbindgen_malloc);
10772
+ const len0 = WASM_VECTOR_LEN;
10773
+ const ret = wasm.wasmpartition_new(ptr0, len0);
10774
+ this.__wbg_ptr = ret >>> 0;
10775
+ WasmPartitionFinalization.register(this, this.__wbg_ptr, this);
10776
+ return this;
10777
+ }
10778
+ /**
10779
+ * Check if this partition contains another (for skew shapes)
10780
+ * @param {WasmPartition} other
10781
+ * @returns {boolean}
10782
+ */
10783
+ contains(other) {
10784
+ _assertClass(other, WasmPartition);
10785
+ const ret = wasm.wasmpartition_contains(this.__wbg_ptr, other.__wbg_ptr);
10786
+ return ret !== 0;
10787
+ }
10788
+ /**
10789
+ * Get the size (sum of parts) of this partition
10526
10790
  * @returns {number}
10527
10791
  */
10528
- bezoutIntersection(degree1, degree2) {
10529
- const ret = wasm.wasmprojectivespace_bezoutIntersection(this.__wbg_ptr, degree1, degree2);
10530
- return ret;
10792
+ getSize() {
10793
+ const ret = wasm.wasmpartition_getSize(this.__wbg_ptr);
10794
+ return ret >>> 0;
10531
10795
  }
10532
10796
  /**
10533
- * Create a new projective space of given dimension
10534
- * @param {number} dimension
10797
+ * Check if this partition is valid (weakly decreasing, positive parts)
10798
+ * @returns {boolean}
10535
10799
  */
10536
- constructor(dimension) {
10537
- const ret = wasm.wasmmontecarloverifier_new(dimension);
10538
- this.__wbg_ptr = ret >>> 0;
10539
- WasmProjectiveSpaceFinalization.register(this, this.__wbg_ptr, this);
10540
- return this;
10800
+ isValid() {
10801
+ const ret = wasm.wasmpartition_isValid(this.__wbg_ptr);
10802
+ return ret !== 0;
10803
+ }
10804
+ /**
10805
+ * Get the parts of this partition
10806
+ * @returns {Uint32Array}
10807
+ */
10808
+ getParts() {
10809
+ const ret = wasm.wasmpartition_getParts(this.__wbg_ptr);
10810
+ var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
10811
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
10812
+ return v1;
10541
10813
  }
10542
10814
  }
10543
10815
 
10544
- const WasmPropagationAnalysisFinalization = (typeof FinalizationRegistry === 'undefined')
10816
+ const WasmPersistentHomologyFinalization = (typeof FinalizationRegistry === 'undefined')
10545
10817
  ? { register: () => {}, unregister: () => {} }
10546
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmpropagationanalysis_free(ptr >>> 0, 1));
10818
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmpersistenthomology_free(ptr >>> 0, 1));
10547
10819
  /**
10548
- * WASM wrapper for propagation analysis
10820
+ * Result of persistent homology computation.
10549
10821
  */
10550
- export class WasmPropagationAnalysis {
10822
+ export class WasmPersistentHomology {
10551
10823
 
10552
10824
  static __wrap(ptr) {
10553
10825
  ptr = ptr >>> 0;
10554
- const obj = Object.create(WasmPropagationAnalysis.prototype);
10826
+ const obj = Object.create(WasmPersistentHomology.prototype);
10555
10827
  obj.__wbg_ptr = ptr;
10556
- WasmPropagationAnalysisFinalization.register(obj, obj.__wbg_ptr, obj);
10828
+ WasmPersistentHomologyFinalization.register(obj, obj.__wbg_ptr, obj);
10557
10829
  return obj;
10558
10830
  }
10559
10831
 
10560
10832
  __destroy_into_raw() {
10561
10833
  const ptr = this.__wbg_ptr;
10562
10834
  this.__wbg_ptr = 0;
10563
- WasmPropagationAnalysisFinalization.unregister(this);
10835
+ WasmPersistentHomologyFinalization.unregister(this);
10564
10836
  return ptr;
10565
10837
  }
10566
10838
 
10567
10839
  free() {
10568
10840
  const ptr = this.__destroy_into_raw();
10569
- wasm.__wbg_wasmpropagationanalysis_free(ptr, 0);
10841
+ wasm.__wbg_wasmpersistenthomology_free(ptr, 0);
10570
10842
  }
10571
10843
  /**
10572
- * Get convergence time
10844
+ * Get the persistence diagram as an array of [dimension, birth, death] triples.
10845
+ * @returns {Float64Array}
10846
+ */
10847
+ getDiagram() {
10848
+ const ret = wasm.wasmpersistenthomology_getDiagram(this.__wbg_ptr);
10849
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
10850
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
10851
+ return v1;
10852
+ }
10853
+ /**
10854
+ * Get the number of intervals in dimension k.
10855
+ * @param {number} dim
10573
10856
  * @returns {number}
10574
10857
  */
10575
- get convergenceTime() {
10576
- const ret = wasm.riemannianmanifold_dimension(this.__wbg_ptr);
10858
+ intervalCount(dim) {
10859
+ const ret = wasm.wasmpersistenthomology_intervalCount(this.__wbg_ptr, dim);
10577
10860
  return ret >>> 0;
10578
10861
  }
10579
10862
  /**
10580
- * Get influence scores for each node
10581
- * @returns {Float64Array}
10863
+ * Compute persistent homology from a filtration.
10864
+ * @param {WasmFiltration} filtration
10865
+ * @returns {WasmPersistentHomology}
10582
10866
  */
10583
- get influenceScores() {
10584
- const ret = wasm.wasmpropagationanalysis_influence_scores(this.__wbg_ptr);
10585
- var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
10586
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
10587
- return v1;
10867
+ static compute(filtration) {
10868
+ _assertClass(filtration, WasmFiltration);
10869
+ const ret = wasm.wasmpersistenthomology_compute(filtration.__wbg_ptr);
10870
+ if (ret[2]) {
10871
+ throw takeFromExternrefTable0(ret[1]);
10872
+ }
10873
+ return WasmPersistentHomology.__wrap(ret[0]);
10588
10874
  }
10589
10875
  /**
10590
- * Get coverage over time
10876
+ * Get the Betti numbers at a specific filtration time.
10877
+ * @param {number} time
10591
10878
  * @returns {Uint32Array}
10592
10879
  */
10593
- get coverage() {
10594
- const ret = wasm.wasmpropagationanalysis_coverage(this.__wbg_ptr);
10880
+ bettiAt(time) {
10881
+ const ret = wasm.wasmpersistenthomology_bettiAt(this.__wbg_ptr, time);
10595
10882
  var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
10596
10883
  wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
10597
10884
  return v1;
10598
10885
  }
10599
10886
  }
10600
10887
 
10601
- const WasmRareEventFinalization = (typeof FinalizationRegistry === 'undefined')
10888
+ const WasmProbFinalization = (typeof FinalizationRegistry === 'undefined')
10602
10889
  ? { register: () => {}, unregister: () => {} }
10603
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmrareevent_free(ptr >>> 0, 1));
10890
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmprob_free(ptr >>> 0, 1));
10604
10891
  /**
10605
- * WASM wrapper for rare event tracking
10892
+ * WASM wrapper for probabilistic values
10606
10893
  *
10607
- * Represents events with low but non-zero probability,
10608
- * distinguished from impossible events (P=0).
10894
+ * Wraps an f64 value with associated probability metadata.
10895
+ * Supports mapping, composition, and probability tracking.
10609
10896
  */
10610
- export class WasmRareEvent {
10897
+ export class WasmProb {
10898
+
10899
+ static __wrap(ptr) {
10900
+ ptr = ptr >>> 0;
10901
+ const obj = Object.create(WasmProb.prototype);
10902
+ obj.__wbg_ptr = ptr;
10903
+ WasmProbFinalization.register(obj, obj.__wbg_ptr, obj);
10904
+ return obj;
10905
+ }
10611
10906
 
10612
10907
  __destroy_into_raw() {
10613
10908
  const ptr = this.__wbg_ptr;
10614
10909
  this.__wbg_ptr = 0;
10615
- WasmRareEventFinalization.unregister(this);
10910
+ WasmProbFinalization.unregister(this);
10616
10911
  return ptr;
10617
10912
  }
10618
10913
 
10619
10914
  free() {
10620
10915
  const ptr = this.__destroy_into_raw();
10621
- wasm.__wbg_wasmrareevent_free(ptr, 0);
10916
+ wasm.__wbg_wasmprob_free(ptr, 0);
10622
10917
  }
10623
10918
  /**
10624
- * Get the event description
10625
- * @returns {string}
10626
- */
10627
- description() {
10628
- let deferred1_0;
10629
- let deferred1_1;
10630
- try {
10631
- const ret = wasm.wasmrareevent_description(this.__wbg_ptr);
10632
- deferred1_0 = ret[0];
10633
- deferred1_1 = ret[1];
10634
- return getStringFromWasm0(ret[0], ret[1]);
10635
- } finally {
10636
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
10637
- }
10638
- }
10639
- /**
10640
- * Get the probability of this rare event
10641
- * @returns {number}
10919
+ * Get the probability associated with this value
10920
+ * @returns {number}
10642
10921
  */
10643
10922
  probability() {
10644
- const ret = wasm.wasmalphaconnection_getAlpha(this.__wbg_ptr);
10923
+ const ret = wasm.wasmdualnumber_getDual(this.__wbg_ptr);
10645
10924
  return ret;
10646
10925
  }
10647
10926
  /**
10648
- * Create a rare event with given probability and description
10927
+ * Create a value with specified probability
10649
10928
  *
10650
- * Probability must be in (0, 1).
10929
+ * Probability must be in [0, 1].
10651
10930
  * @param {number} probability
10652
- * @param {string} description
10931
+ * @param {number} value
10932
+ * @returns {WasmProb}
10653
10933
  */
10654
- constructor(probability, description) {
10655
- const ptr0 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
10656
- const len0 = WASM_VECTOR_LEN;
10657
- const ret = wasm.wasmrareevent_new(probability, ptr0, len0);
10934
+ static withProbability(probability, value) {
10935
+ const ret = wasm.wasmprob_withProbability(probability, value);
10658
10936
  if (ret[2]) {
10659
10937
  throw takeFromExternrefTable0(ret[1]);
10660
10938
  }
10661
- this.__wbg_ptr = ret[0] >>> 0;
10662
- WasmRareEventFinalization.register(this, this.__wbg_ptr, this);
10939
+ return WasmProb.__wrap(ret[0]);
10940
+ }
10941
+ /**
10942
+ * Map the value by multiplying with a factor, preserving probability
10943
+ * @param {number} factor
10944
+ * @returns {WasmProb}
10945
+ */
10946
+ map(factor) {
10947
+ const ret = wasm.wasmprob_map(this.__wbg_ptr, factor);
10948
+ return WasmProb.__wrap(ret);
10949
+ }
10950
+ /**
10951
+ * Create a certain value (probability = 1.0)
10952
+ * @param {number} value
10953
+ */
10954
+ constructor(value) {
10955
+ const ret = wasm.wasmdualnumber_variable(value);
10956
+ this.__wbg_ptr = ret >>> 0;
10957
+ WasmProbFinalization.register(this, this.__wbg_ptr, this);
10663
10958
  return this;
10664
10959
  }
10665
10960
  /**
10666
- * Check if this event is rare (probability < threshold)
10667
- * @param {number} threshold
10668
- * @returns {boolean}
10961
+ * Get the wrapped value
10962
+ * @returns {number}
10669
10963
  */
10670
- isRare(threshold) {
10671
- const ret = wasm.wasmrareevent_isRare(this.__wbg_ptr, threshold);
10672
- return ret !== 0;
10964
+ value() {
10965
+ const ret = wasm.wasmalphaconnection_getAlpha(this.__wbg_ptr);
10966
+ return ret;
10673
10967
  }
10674
10968
  /**
10675
- * Classify event based on probability with the given rare threshold
10969
+ * Sample this probabilistic value
10676
10970
  *
10677
- * Returns "Impossible" (P=0), "Rare" (P < threshold), or "Probable" (P >= threshold)
10678
- * @param {number} rare_threshold
10971
+ * Returns the value with probability p, or NaN otherwise.
10972
+ * @returns {number}
10973
+ */
10974
+ sample() {
10975
+ const ret = wasm.wasmprob_sample(this.__wbg_ptr);
10976
+ return ret;
10977
+ }
10978
+ /**
10979
+ * Combine with another probabilistic value (independent)
10980
+ *
10981
+ * Multiplies probabilities and values together.
10982
+ * @param {number} other_probability
10983
+ * @param {number} other_value
10984
+ * @returns {WasmProb}
10985
+ */
10986
+ andThen(other_probability, other_value) {
10987
+ const ret = wasm.wasmprob_andThen(this.__wbg_ptr, other_probability, other_value);
10988
+ if (ret[2]) {
10989
+ throw takeFromExternrefTable0(ret[1]);
10990
+ }
10991
+ return WasmProb.__wrap(ret[0]);
10992
+ }
10993
+ }
10994
+
10995
+ const WasmProbabilityMeasureFinalization = (typeof FinalizationRegistry === 'undefined')
10996
+ ? { register: () => {}, unregister: () => {} }
10997
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmprobabilitymeasure_free(ptr >>> 0, 1));
10998
+ /**
10999
+ * WASM wrapper for probability measures
11000
+ *
11001
+ * A probability measure assigns total measure 1 to the entire space.
11002
+ */
11003
+ export class WasmProbabilityMeasure {
11004
+
11005
+ static __wrap(ptr) {
11006
+ ptr = ptr >>> 0;
11007
+ const obj = Object.create(WasmProbabilityMeasure.prototype);
11008
+ obj.__wbg_ptr = ptr;
11009
+ WasmProbabilityMeasureFinalization.register(obj, obj.__wbg_ptr, obj);
11010
+ return obj;
11011
+ }
11012
+
11013
+ __destroy_into_raw() {
11014
+ const ptr = this.__wbg_ptr;
11015
+ this.__wbg_ptr = 0;
11016
+ WasmProbabilityMeasureFinalization.unregister(this);
11017
+ return ptr;
11018
+ }
11019
+
11020
+ free() {
11021
+ const ptr = this.__destroy_into_raw();
11022
+ wasm.__wbg_wasmprobabilitymeasure_free(ptr, 0);
11023
+ }
11024
+ /**
11025
+ * Get a description of this probability measure
10679
11026
  * @returns {string}
10680
11027
  */
10681
- classify(rare_threshold) {
11028
+ getDescription() {
10682
11029
  let deferred1_0;
10683
11030
  let deferred1_1;
10684
11031
  try {
10685
- const ret = wasm.wasmrareevent_classify(this.__wbg_ptr, rare_threshold);
11032
+ const ret = wasm.wasmprobabilitymeasure_getDescription(this.__wbg_ptr);
10686
11033
  deferred1_0 = ret[0];
10687
11034
  deferred1_1 = ret[1];
10688
11035
  return getStringFromWasm0(ret[0], ret[1]);
@@ -10690,116 +11037,359 @@ export class WasmRareEvent {
10690
11037
  wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
10691
11038
  }
10692
11039
  }
11040
+ /**
11041
+ * Compute P(X ∈ [a, b]) for uniform distribution
11042
+ * @param {number} a
11043
+ * @param {number} b
11044
+ * @param {number} lower
11045
+ * @param {number} upper
11046
+ * @returns {number}
11047
+ */
11048
+ probabilityInterval(a, b, lower, upper) {
11049
+ const ret = wasm.wasmprobabilitymeasure_probabilityInterval(this.__wbg_ptr, a, b, lower, upper);
11050
+ return ret;
11051
+ }
11052
+ /**
11053
+ * Create a new uniform probability measure on [0, 1]
11054
+ */
11055
+ constructor() {
11056
+ const ret = wasm.wasmprobabilitymeasure_new();
11057
+ this.__wbg_ptr = ret >>> 0;
11058
+ WasmProbabilityMeasureFinalization.register(this, this.__wbg_ptr, this);
11059
+ return this;
11060
+ }
11061
+ /**
11062
+ * Create a uniform probability measure on [a, b]
11063
+ * @param {number} a
11064
+ * @param {number} b
11065
+ * @returns {WasmProbabilityMeasure}
11066
+ */
11067
+ static uniform(a, b) {
11068
+ const ret = wasm.wasmprobabilitymeasure_uniform(a, b);
11069
+ if (ret[2]) {
11070
+ throw takeFromExternrefTable0(ret[1]);
11071
+ }
11072
+ return WasmProbabilityMeasure.__wrap(ret[0]);
11073
+ }
10693
11074
  }
10694
11075
 
10695
- const WasmRelativisticConstantsFinalization = (typeof FinalizationRegistry === 'undefined')
11076
+ const WasmProjectiveSpaceFinalization = (typeof FinalizationRegistry === 'undefined')
10696
11077
  ? { register: () => {}, unregister: () => {} }
10697
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmrelativisticconstants_free(ptr >>> 0, 1));
11078
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmprojectivespace_free(ptr >>> 0, 1));
10698
11079
  /**
10699
- * Physical constants
11080
+ * WASM wrapper for projective spaces
10700
11081
  */
10701
- export class WasmRelativisticConstants {
11082
+ export class WasmProjectiveSpace {
10702
11083
 
10703
11084
  __destroy_into_raw() {
10704
11085
  const ptr = this.__wbg_ptr;
10705
11086
  this.__wbg_ptr = 0;
10706
- WasmRelativisticConstantsFinalization.unregister(this);
11087
+ WasmProjectiveSpaceFinalization.unregister(this);
10707
11088
  return ptr;
10708
11089
  }
10709
11090
 
10710
11091
  free() {
10711
11092
  const ptr = this.__destroy_into_raw();
10712
- wasm.__wbg_wasmrelativisticconstants_free(ptr, 0);
11093
+ wasm.__wbg_wasmprojectivespace_free(ptr, 0);
10713
11094
  }
10714
11095
  /**
10715
- * Earth mass (kg)
11096
+ * Get the dimension of this projective space
10716
11097
  * @returns {number}
10717
11098
  */
10718
- static get earth_mass() {
10719
- const ret = wasm.wasmrelativisticconstants_earth_mass();
10720
- return ret;
11099
+ getDimension() {
11100
+ const ret = wasm.wasmlebesguemeasure_getDimension(this.__wbg_ptr);
11101
+ return ret >>> 0;
10721
11102
  }
10722
11103
  /**
10723
- * Solar mass (kg)
10724
- * @returns {number}
11104
+ * Check if the projective space has given dimension
11105
+ * @param {number} dim
11106
+ * @returns {boolean}
10725
11107
  */
10726
- static get solar_mass() {
10727
- const ret = wasm.wasmrelativisticconstants_solar_mass();
10728
- return ret;
11108
+ hasDimension(dim) {
11109
+ const ret = wasm.wasmprojectivespace_hasDimension(this.__wbg_ptr, dim);
11110
+ return ret !== 0;
10729
11111
  }
10730
11112
  /**
10731
- * Speed of light in vacuum (m/s)
11113
+ * Compute Bézout intersection number for two curves
11114
+ * @param {number} degree1
11115
+ * @param {number} degree2
10732
11116
  * @returns {number}
10733
11117
  */
10734
- static get speed_of_light() {
10735
- const ret = wasm.wasmrelativisticconstants_speed_of_light();
11118
+ bezoutIntersection(degree1, degree2) {
11119
+ const ret = wasm.wasmprojectivespace_bezoutIntersection(this.__wbg_ptr, degree1, degree2);
10736
11120
  return ret;
10737
11121
  }
10738
11122
  /**
10739
- * Gravitational constant (m³/kg·s²)
10740
- * @returns {number}
11123
+ * Create a new projective space of given dimension
11124
+ * @param {number} dimension
10741
11125
  */
10742
- static get gravitational_constant() {
10743
- const ret = wasm.wasmrelativisticconstants_gravitational_constant();
10744
- return ret;
11126
+ constructor(dimension) {
11127
+ const ret = wasm.wasmmontecarloverifier_new(dimension);
11128
+ this.__wbg_ptr = ret >>> 0;
11129
+ WasmProjectiveSpaceFinalization.register(this, this.__wbg_ptr, this);
11130
+ return this;
10745
11131
  }
10746
11132
  }
10747
11133
 
10748
- const WasmRelativisticParticleFinalization = (typeof FinalizationRegistry === 'undefined')
11134
+ const WasmPropagationAnalysisFinalization = (typeof FinalizationRegistry === 'undefined')
10749
11135
  ? { register: () => {}, unregister: () => {} }
10750
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmrelativisticparticle_free(ptr >>> 0, 1));
11136
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmpropagationanalysis_free(ptr >>> 0, 1));
10751
11137
  /**
10752
- * WASM wrapper for relativistic particles
11138
+ * WASM wrapper for propagation analysis
10753
11139
  */
10754
- export class WasmRelativisticParticle {
11140
+ export class WasmPropagationAnalysis {
10755
11141
 
10756
11142
  static __wrap(ptr) {
10757
11143
  ptr = ptr >>> 0;
10758
- const obj = Object.create(WasmRelativisticParticle.prototype);
11144
+ const obj = Object.create(WasmPropagationAnalysis.prototype);
10759
11145
  obj.__wbg_ptr = ptr;
10760
- WasmRelativisticParticleFinalization.register(obj, obj.__wbg_ptr, obj);
11146
+ WasmPropagationAnalysisFinalization.register(obj, obj.__wbg_ptr, obj);
10761
11147
  return obj;
10762
11148
  }
10763
11149
 
10764
11150
  __destroy_into_raw() {
10765
11151
  const ptr = this.__wbg_ptr;
10766
11152
  this.__wbg_ptr = 0;
10767
- WasmRelativisticParticleFinalization.unregister(this);
11153
+ WasmPropagationAnalysisFinalization.unregister(this);
10768
11154
  return ptr;
10769
11155
  }
10770
11156
 
10771
11157
  free() {
10772
11158
  const ptr = this.__destroy_into_raw();
10773
- wasm.__wbg_wasmrelativisticparticle_free(ptr, 0);
11159
+ wasm.__wbg_wasmpropagationanalysis_free(ptr, 0);
10774
11160
  }
10775
11161
  /**
10776
- * Get 3D position components
10777
- * @returns {Array<any>}
11162
+ * Get convergence time
11163
+ * @returns {number}
10778
11164
  */
10779
- position_3d() {
10780
- const ret = wasm.wasmrelativisticparticle_position_3d(this.__wbg_ptr);
10781
- return ret;
11165
+ get convergenceTime() {
11166
+ const ret = wasm.riemannianmanifold_dimension(this.__wbg_ptr);
11167
+ return ret >>> 0;
10782
11168
  }
10783
11169
  /**
10784
- * Get position as spacetime vector
10785
- * @returns {WasmSpacetimeVector}
11170
+ * Get influence scores for each node
11171
+ * @returns {Float64Array}
10786
11172
  */
10787
- position_4d() {
10788
- const ret = wasm.wasmrelativisticparticle_position_4d(this.__wbg_ptr);
10789
- return WasmSpacetimeVector.__wrap(ret);
11173
+ get influenceScores() {
11174
+ const ret = wasm.wasmpropagationanalysis_influence_scores(this.__wbg_ptr);
11175
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
11176
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
11177
+ return v1;
10790
11178
  }
10791
11179
  /**
10792
- * Create particle with specified energy
10793
- * @param {number} x
10794
- * @param {number} y
10795
- * @param {number} z
10796
- * @param {number} direction_x
10797
- * @param {number} direction_y
10798
- * @param {number} direction_z
10799
- * @param {number} kinetic_energy
10800
- * @param {number} mass
10801
- * @param {number} charge
10802
- * @returns {WasmRelativisticParticle}
11180
+ * Get coverage over time
11181
+ * @returns {Uint32Array}
11182
+ */
11183
+ get coverage() {
11184
+ const ret = wasm.wasmpropagationanalysis_coverage(this.__wbg_ptr);
11185
+ var v1 = getArrayU32FromWasm0(ret[0], ret[1]).slice();
11186
+ wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
11187
+ return v1;
11188
+ }
11189
+ }
11190
+
11191
+ const WasmRareEventFinalization = (typeof FinalizationRegistry === 'undefined')
11192
+ ? { register: () => {}, unregister: () => {} }
11193
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmrareevent_free(ptr >>> 0, 1));
11194
+ /**
11195
+ * WASM wrapper for rare event tracking
11196
+ *
11197
+ * Represents events with low but non-zero probability,
11198
+ * distinguished from impossible events (P=0).
11199
+ */
11200
+ export class WasmRareEvent {
11201
+
11202
+ __destroy_into_raw() {
11203
+ const ptr = this.__wbg_ptr;
11204
+ this.__wbg_ptr = 0;
11205
+ WasmRareEventFinalization.unregister(this);
11206
+ return ptr;
11207
+ }
11208
+
11209
+ free() {
11210
+ const ptr = this.__destroy_into_raw();
11211
+ wasm.__wbg_wasmrareevent_free(ptr, 0);
11212
+ }
11213
+ /**
11214
+ * Get the event description
11215
+ * @returns {string}
11216
+ */
11217
+ description() {
11218
+ let deferred1_0;
11219
+ let deferred1_1;
11220
+ try {
11221
+ const ret = wasm.wasmrareevent_description(this.__wbg_ptr);
11222
+ deferred1_0 = ret[0];
11223
+ deferred1_1 = ret[1];
11224
+ return getStringFromWasm0(ret[0], ret[1]);
11225
+ } finally {
11226
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
11227
+ }
11228
+ }
11229
+ /**
11230
+ * Get the probability of this rare event
11231
+ * @returns {number}
11232
+ */
11233
+ probability() {
11234
+ const ret = wasm.wasmalphaconnection_getAlpha(this.__wbg_ptr);
11235
+ return ret;
11236
+ }
11237
+ /**
11238
+ * Create a rare event with given probability and description
11239
+ *
11240
+ * Probability must be in (0, 1).
11241
+ * @param {number} probability
11242
+ * @param {string} description
11243
+ */
11244
+ constructor(probability, description) {
11245
+ const ptr0 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11246
+ const len0 = WASM_VECTOR_LEN;
11247
+ const ret = wasm.wasmrareevent_new(probability, ptr0, len0);
11248
+ if (ret[2]) {
11249
+ throw takeFromExternrefTable0(ret[1]);
11250
+ }
11251
+ this.__wbg_ptr = ret[0] >>> 0;
11252
+ WasmRareEventFinalization.register(this, this.__wbg_ptr, this);
11253
+ return this;
11254
+ }
11255
+ /**
11256
+ * Check if this event is rare (probability < threshold)
11257
+ * @param {number} threshold
11258
+ * @returns {boolean}
11259
+ */
11260
+ isRare(threshold) {
11261
+ const ret = wasm.wasmrareevent_isRare(this.__wbg_ptr, threshold);
11262
+ return ret !== 0;
11263
+ }
11264
+ /**
11265
+ * Classify event based on probability with the given rare threshold
11266
+ *
11267
+ * Returns "Impossible" (P=0), "Rare" (P < threshold), or "Probable" (P >= threshold)
11268
+ * @param {number} rare_threshold
11269
+ * @returns {string}
11270
+ */
11271
+ classify(rare_threshold) {
11272
+ let deferred1_0;
11273
+ let deferred1_1;
11274
+ try {
11275
+ const ret = wasm.wasmrareevent_classify(this.__wbg_ptr, rare_threshold);
11276
+ deferred1_0 = ret[0];
11277
+ deferred1_1 = ret[1];
11278
+ return getStringFromWasm0(ret[0], ret[1]);
11279
+ } finally {
11280
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
11281
+ }
11282
+ }
11283
+ }
11284
+
11285
+ const WasmRelativisticConstantsFinalization = (typeof FinalizationRegistry === 'undefined')
11286
+ ? { register: () => {}, unregister: () => {} }
11287
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmrelativisticconstants_free(ptr >>> 0, 1));
11288
+ /**
11289
+ * Physical constants
11290
+ */
11291
+ export class WasmRelativisticConstants {
11292
+
11293
+ __destroy_into_raw() {
11294
+ const ptr = this.__wbg_ptr;
11295
+ this.__wbg_ptr = 0;
11296
+ WasmRelativisticConstantsFinalization.unregister(this);
11297
+ return ptr;
11298
+ }
11299
+
11300
+ free() {
11301
+ const ptr = this.__destroy_into_raw();
11302
+ wasm.__wbg_wasmrelativisticconstants_free(ptr, 0);
11303
+ }
11304
+ /**
11305
+ * Earth mass (kg)
11306
+ * @returns {number}
11307
+ */
11308
+ static get earth_mass() {
11309
+ const ret = wasm.wasmrelativisticconstants_earth_mass();
11310
+ return ret;
11311
+ }
11312
+ /**
11313
+ * Solar mass (kg)
11314
+ * @returns {number}
11315
+ */
11316
+ static get solar_mass() {
11317
+ const ret = wasm.wasmrelativisticconstants_solar_mass();
11318
+ return ret;
11319
+ }
11320
+ /**
11321
+ * Speed of light in vacuum (m/s)
11322
+ * @returns {number}
11323
+ */
11324
+ static get speed_of_light() {
11325
+ const ret = wasm.wasmrelativisticconstants_speed_of_light();
11326
+ return ret;
11327
+ }
11328
+ /**
11329
+ * Gravitational constant (m³/kg·s²)
11330
+ * @returns {number}
11331
+ */
11332
+ static get gravitational_constant() {
11333
+ const ret = wasm.wasmrelativisticconstants_gravitational_constant();
11334
+ return ret;
11335
+ }
11336
+ }
11337
+
11338
+ const WasmRelativisticParticleFinalization = (typeof FinalizationRegistry === 'undefined')
11339
+ ? { register: () => {}, unregister: () => {} }
11340
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmrelativisticparticle_free(ptr >>> 0, 1));
11341
+ /**
11342
+ * WASM wrapper for relativistic particles
11343
+ */
11344
+ export class WasmRelativisticParticle {
11345
+
11346
+ static __wrap(ptr) {
11347
+ ptr = ptr >>> 0;
11348
+ const obj = Object.create(WasmRelativisticParticle.prototype);
11349
+ obj.__wbg_ptr = ptr;
11350
+ WasmRelativisticParticleFinalization.register(obj, obj.__wbg_ptr, obj);
11351
+ return obj;
11352
+ }
11353
+
11354
+ __destroy_into_raw() {
11355
+ const ptr = this.__wbg_ptr;
11356
+ this.__wbg_ptr = 0;
11357
+ WasmRelativisticParticleFinalization.unregister(this);
11358
+ return ptr;
11359
+ }
11360
+
11361
+ free() {
11362
+ const ptr = this.__destroy_into_raw();
11363
+ wasm.__wbg_wasmrelativisticparticle_free(ptr, 0);
11364
+ }
11365
+ /**
11366
+ * Get 3D position components
11367
+ * @returns {Array<any>}
11368
+ */
11369
+ position_3d() {
11370
+ const ret = wasm.wasmrelativisticparticle_position_3d(this.__wbg_ptr);
11371
+ return ret;
11372
+ }
11373
+ /**
11374
+ * Get position as spacetime vector
11375
+ * @returns {WasmSpacetimeVector}
11376
+ */
11377
+ position_4d() {
11378
+ const ret = wasm.wasmrelativisticparticle_position_4d(this.__wbg_ptr);
11379
+ return WasmSpacetimeVector.__wrap(ret);
11380
+ }
11381
+ /**
11382
+ * Create particle with specified energy
11383
+ * @param {number} x
11384
+ * @param {number} y
11385
+ * @param {number} z
11386
+ * @param {number} direction_x
11387
+ * @param {number} direction_y
11388
+ * @param {number} direction_z
11389
+ * @param {number} kinetic_energy
11390
+ * @param {number} mass
11391
+ * @param {number} charge
11392
+ * @returns {WasmRelativisticParticle}
10803
11393
  */
10804
11394
  static with_energy(x, y, z, direction_x, direction_y, direction_z, kinetic_energy, mass, charge) {
10805
11395
  const ret = wasm.wasmrelativisticparticle_with_energy(x, y, z, direction_x, direction_y, direction_z, kinetic_energy, mass, charge);
@@ -11831,563 +12421,1121 @@ export class WasmSmtProofObligation {
11831
12421
  }
11832
12422
  }
11833
12423
  /**
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
12424
+ * Create a new proof obligation
12425
+ *
12426
+ * # Arguments
12427
+ * * `name` - Obligation name (used in SMT-LIB2 comments)
12428
+ * * `description` - Human-readable description
12429
+ * * `kind` - One of: "precondition", "postcondition", "expected_value", "concentration"
12430
+ * * `param1` - First parameter (probability for pre/post, expected value for EV, samples for concentration)
12431
+ * * `param2` - Second parameter (unused for pre/post, epsilon for EV and concentration)
12432
+ * @param {string} name
12433
+ * @param {string} description
12434
+ * @param {string} kind
12435
+ * @param {number} param1
12436
+ * @param {number} param2
12437
+ */
12438
+ constructor(name, description, kind, param1, param2) {
12439
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
12440
+ const len0 = WASM_VECTOR_LEN;
12441
+ const ptr1 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
12442
+ const len1 = WASM_VECTOR_LEN;
12443
+ const ptr2 = passStringToWasm0(kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
12444
+ const len2 = WASM_VECTOR_LEN;
12445
+ const ret = wasm.wasmsmtproofobligation_new(ptr0, len0, ptr1, len1, ptr2, len2, param1, param2);
12446
+ if (ret[2]) {
12447
+ throw takeFromExternrefTable0(ret[1]);
12448
+ }
12449
+ this.__wbg_ptr = ret[0] >>> 0;
12450
+ WasmSmtProofObligationFinalization.register(this, this.__wbg_ptr, this);
12451
+ return this;
12452
+ }
12453
+ }
12454
+
12455
+ const WasmSobolevSpaceFinalization = (typeof FinalizationRegistry === 'undefined')
12456
+ ? { register: () => {}, unregister: () => {} }
12457
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmsobolevspace_free(ptr >>> 0, 1));
12458
+ /**
12459
+ * WASM wrapper for Sobolev spaces H^k
12460
+ *
12461
+ * Provides function spaces with weak derivatives.
12462
+ */
12463
+ export class WasmSobolevSpace {
12464
+
12465
+ static __wrap(ptr) {
12466
+ ptr = ptr >>> 0;
12467
+ const obj = Object.create(WasmSobolevSpace.prototype);
12468
+ obj.__wbg_ptr = ptr;
12469
+ WasmSobolevSpaceFinalization.register(obj, obj.__wbg_ptr, obj);
12470
+ return obj;
12471
+ }
12472
+
12473
+ __destroy_into_raw() {
12474
+ const ptr = this.__wbg_ptr;
12475
+ this.__wbg_ptr = 0;
12476
+ WasmSobolevSpaceFinalization.unregister(this);
12477
+ return ptr;
12478
+ }
12479
+
12480
+ free() {
12481
+ const ptr = this.__destroy_into_raw();
12482
+ wasm.__wbg_wasmsobolevspace_free(ptr, 0);
12483
+ }
12484
+ /**
12485
+ * Compute the H^1 seminorm |f|_{H^1} = ||f'||_{L^2}
12486
+ * @param {Function} df
12487
+ * @returns {number}
12488
+ */
12489
+ h1Seminorm(df) {
12490
+ const ret = wasm.wasmsobolevspace_h1Seminorm(this.__wbg_ptr, df);
12491
+ if (ret[2]) {
12492
+ throw takeFromExternrefTable0(ret[1]);
12493
+ }
12494
+ return ret[0];
12495
+ }
12496
+ /**
12497
+ * Create H^1 over the unit interval [0, 1]
12498
+ * @returns {WasmSobolevSpace}
12499
+ */
12500
+ static h1UnitInterval() {
12501
+ const ret = wasm.wasmsobolevspace_h1UnitInterval();
12502
+ return WasmSobolevSpace.__wrap(ret);
12503
+ }
12504
+ /**
12505
+ * Create H^2 over the unit interval [0, 1]
12506
+ * @returns {WasmSobolevSpace}
12507
+ */
12508
+ static h2UnitInterval() {
12509
+ const ret = wasm.wasmsobolevspace_h2UnitInterval();
12510
+ return WasmSobolevSpace.__wrap(ret);
12511
+ }
12512
+ /**
12513
+ * Compute L^2 inner product <f, g>
12514
+ * @param {Function} f
12515
+ * @param {Function} g
12516
+ * @returns {number}
12517
+ */
12518
+ l2InnerProduct(f, g) {
12519
+ const ret = wasm.wasmsobolevspace_l2InnerProduct(this.__wbg_ptr, f, g);
12520
+ if (ret[2]) {
12521
+ throw takeFromExternrefTable0(ret[1]);
12522
+ }
12523
+ return ret[0];
12524
+ }
12525
+ /**
12526
+ * Compute the Poincare constant estimate for the domain
12527
+ *
12528
+ * For [a,b], this is (b-a)/π
12529
+ * @returns {number}
12530
+ */
12531
+ poincareConstant() {
12532
+ const ret = wasm.wasmsobolevspace_poincareConstant(this.__wbg_ptr);
12533
+ return ret;
12534
+ }
12535
+ /**
12536
+ * Set the number of quadrature points
12537
+ * @param {number} n
12538
+ */
12539
+ setQuadraturePoints(n) {
12540
+ wasm.wasmsobolevspace_setQuadraturePoints(this.__wbg_ptr, n);
12541
+ }
12542
+ /**
12543
+ * Create a Sobolev space H^k over an interval [a, b]
12544
+ *
12545
+ * # Arguments
12546
+ * * `order` - The Sobolev regularity (1 for H^1, 2 for H^2)
12547
+ * * `lower` - Lower bound of the interval
12548
+ * * `upper` - Upper bound of the interval
12549
+ * @param {number} order
12550
+ * @param {number} lower
12551
+ * @param {number} upper
12552
+ */
12553
+ constructor(order, lower, upper) {
12554
+ const ret = wasm.wasmsobolevspace_new(order, lower, upper);
12555
+ if (ret[2]) {
12556
+ throw takeFromExternrefTable0(ret[1]);
12557
+ }
12558
+ this.__wbg_ptr = ret[0] >>> 0;
12559
+ WasmSobolevSpaceFinalization.register(this, this.__wbg_ptr, this);
12560
+ return this;
12561
+ }
12562
+ /**
12563
+ * Get the domain bounds [lower, upper]
12564
+ * @returns {Float64Array}
12565
+ */
12566
+ bounds() {
12567
+ const ret = wasm.wasmsobolevspace_bounds(this.__wbg_ptr);
12568
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
12569
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
12570
+ return v1;
12571
+ }
12572
+ /**
12573
+ * Compute the H^k norm of a function using numerical integration
12574
+ *
12575
+ * # Arguments
12576
+ * * `f` - JavaScript function f(x) to evaluate
12577
+ * * `df` - JavaScript function f'(x) (first derivative)
12578
+ * @param {Function} f
12579
+ * @param {Function} df
12580
+ * @returns {number}
12581
+ */
12582
+ h1Norm(f, df) {
12583
+ const ret = wasm.wasmsobolevspace_h1Norm(this.__wbg_ptr, f, df);
12584
+ if (ret[2]) {
12585
+ throw takeFromExternrefTable0(ret[1]);
12586
+ }
12587
+ return ret[0];
12588
+ }
12589
+ /**
12590
+ * Compute L^2 norm of a function
12591
+ * @param {Function} f
12592
+ * @returns {number}
12593
+ */
12594
+ l2Norm(f) {
12595
+ const ret = wasm.wasmsobolevspace_l2Norm(this.__wbg_ptr, f);
12596
+ if (ret[2]) {
12597
+ throw takeFromExternrefTable0(ret[1]);
12598
+ }
12599
+ return ret[0];
12600
+ }
12601
+ /**
12602
+ * Get the Sobolev order k
12603
+ * @returns {number}
12604
+ */
12605
+ order() {
12606
+ const ret = wasm.wasmsobolevspace_order(this.__wbg_ptr);
12607
+ return ret >>> 0;
12608
+ }
12609
+ }
12610
+
12611
+ const WasmSpacetimeVectorFinalization = (typeof FinalizationRegistry === 'undefined')
12612
+ ? { register: () => {}, unregister: () => {} }
12613
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmspacetimevector_free(ptr >>> 0, 1));
12614
+ /**
12615
+ * WASM wrapper for spacetime vectors
12616
+ */
12617
+ export class WasmSpacetimeVector {
12618
+
12619
+ static __wrap(ptr) {
12620
+ ptr = ptr >>> 0;
12621
+ const obj = Object.create(WasmSpacetimeVector.prototype);
12622
+ obj.__wbg_ptr = ptr;
12623
+ WasmSpacetimeVectorFinalization.register(obj, obj.__wbg_ptr, obj);
12624
+ return obj;
12625
+ }
12626
+
12627
+ __destroy_into_raw() {
12628
+ const ptr = this.__wbg_ptr;
12629
+ this.__wbg_ptr = 0;
12630
+ WasmSpacetimeVectorFinalization.unregister(this);
12631
+ return ptr;
12632
+ }
12633
+
12634
+ free() {
12635
+ const ptr = this.__destroy_into_raw();
12636
+ wasm.__wbg_wasmspacetimevector_free(ptr, 0);
12637
+ }
12638
+ /**
12639
+ * Check if vector is timelike (massive particle)
12640
+ * @returns {boolean}
12641
+ */
12642
+ is_timelike() {
12643
+ const ret = wasm.wasmspacetimevector_is_timelike(this.__wbg_ptr);
12644
+ return ret !== 0;
12645
+ }
12646
+ /**
12647
+ * Check if vector is spacelike
12648
+ * @returns {boolean}
12649
+ */
12650
+ is_spacelike() {
12651
+ const ret = wasm.wasmspacetimevector_is_spacelike(this.__wbg_ptr);
12652
+ return ret !== 0;
12653
+ }
12654
+ /**
12655
+ * Compute Minkowski norm squared
12656
+ * @returns {number}
12657
+ */
12658
+ norm_squared() {
12659
+ const ret = wasm.wasmspacetimevector_norm_squared(this.__wbg_ptr);
12660
+ return ret;
12661
+ }
12662
+ /**
12663
+ * Compute Minkowski inner product with another spacetime vector
12664
+ * @param {WasmSpacetimeVector} other
12665
+ * @returns {number}
12666
+ */
12667
+ minkowski_dot(other) {
12668
+ _assertClass(other, WasmSpacetimeVector);
12669
+ const ret = wasm.wasmspacetimevector_minkowski_dot(this.__wbg_ptr, other.__wbg_ptr);
12670
+ return ret;
12671
+ }
12672
+ /**
12673
+ * Get temporal component
12674
+ * @returns {number}
12675
+ */
12676
+ get t() {
12677
+ const ret = wasm.wasmfourvelocity_gamma(this.__wbg_ptr);
12678
+ return ret;
12679
+ }
12680
+ /**
12681
+ * Get x component
12682
+ * @returns {number}
12683
+ */
12684
+ get x() {
12685
+ const ret = wasm.wasmdualnumber_getDual(this.__wbg_ptr);
12686
+ return ret;
12687
+ }
12688
+ /**
12689
+ * Get y component
12690
+ * @returns {number}
12691
+ */
12692
+ get y() {
12693
+ const ret = wasm.wasmevaluationresult_getGeometricDistance(this.__wbg_ptr);
12694
+ return ret;
12695
+ }
12696
+ /**
12697
+ * Get z component
12698
+ * @returns {number}
12699
+ */
12700
+ get z() {
12701
+ const ret = wasm.wasmevaluationresult_getCombinedScore(this.__wbg_ptr);
12702
+ return ret;
12703
+ }
12704
+ /**
12705
+ * Create a new spacetime vector with components (ct, x, y, z)
12706
+ * @param {number} t
12707
+ * @param {number} x
12708
+ * @param {number} y
12709
+ * @param {number} z
12710
+ */
12711
+ constructor(t, x, y, z) {
12712
+ const ret = wasm.wasmspacetimevector_new(t, x, y, z);
12713
+ this.__wbg_ptr = ret >>> 0;
12714
+ WasmSpacetimeVectorFinalization.register(this, this.__wbg_ptr, this);
12715
+ return this;
12716
+ }
12717
+ /**
12718
+ * Check if vector is null (lightlike)
12719
+ * @returns {boolean}
12720
+ */
12721
+ is_null() {
12722
+ const ret = wasm.wasmspacetimevector_is_null(this.__wbg_ptr);
12723
+ return ret !== 0;
12724
+ }
12725
+ /**
12726
+ * Create a timelike vector
12727
+ * @param {number} t
12728
+ * @returns {WasmSpacetimeVector}
12729
+ */
12730
+ static timelike(t) {
12731
+ const ret = wasm.wasmspacetimevector_timelike(t);
12732
+ return WasmSpacetimeVector.__wrap(ret);
12733
+ }
12734
+ /**
12735
+ * Create a spacelike vector
12736
+ * @param {number} x
12737
+ * @param {number} y
12738
+ * @param {number} z
12739
+ * @returns {WasmSpacetimeVector}
12740
+ */
12741
+ static spacelike(x, y, z) {
12742
+ const ret = wasm.wasmspacetimevector_spacelike(x, y, z);
12743
+ return WasmSpacetimeVector.__wrap(ret);
12744
+ }
12745
+ /**
12746
+ * Get string representation
12747
+ * @returns {string}
12748
+ */
12749
+ to_string() {
12750
+ let deferred1_0;
12751
+ let deferred1_1;
12752
+ try {
12753
+ const ret = wasm.wasmspacetimevector_to_string(this.__wbg_ptr);
12754
+ deferred1_0 = ret[0];
12755
+ deferred1_1 = ret[1];
12756
+ return getStringFromWasm0(ret[0], ret[1]);
12757
+ } finally {
12758
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
12759
+ }
12760
+ }
12761
+ }
12762
+
12763
+ const WasmSpectralDecompositionFinalization = (typeof FinalizationRegistry === 'undefined')
12764
+ ? { register: () => {}, unregister: () => {} }
12765
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmspectraldecomposition_free(ptr >>> 0, 1));
12766
+ /**
12767
+ * WASM wrapper for spectral decomposition
12768
+ *
12769
+ * Provides eigenvalue decomposition for symmetric matrices.
12770
+ */
12771
+ export class WasmSpectralDecomposition {
12772
+
12773
+ static __wrap(ptr) {
12774
+ ptr = ptr >>> 0;
12775
+ const obj = Object.create(WasmSpectralDecomposition.prototype);
12776
+ obj.__wbg_ptr = ptr;
12777
+ WasmSpectralDecompositionFinalization.register(obj, obj.__wbg_ptr, obj);
12778
+ return obj;
12779
+ }
12780
+
12781
+ __destroy_into_raw() {
12782
+ const ptr = this.__wbg_ptr;
12783
+ this.__wbg_ptr = 0;
12784
+ WasmSpectralDecompositionFinalization.unregister(this);
12785
+ return ptr;
12786
+ }
12787
+
12788
+ free() {
12789
+ const ptr = this.__destroy_into_raw();
12790
+ wasm.__wbg_wasmspectraldecomposition_free(ptr, 0);
12791
+ }
12792
+ /**
12793
+ * Get the eigenvalues
12794
+ * @returns {Float64Array}
12795
+ */
12796
+ eigenvalues() {
12797
+ const ret = wasm.wasmspectraldecomposition_eigenvalues(this.__wbg_ptr);
12798
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
12799
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
12800
+ return v1;
12801
+ }
12802
+ /**
12803
+ * Check if the decomposition is complete
12804
+ * @returns {boolean}
12805
+ */
12806
+ isComplete() {
12807
+ const ret = wasm.wasmspectraldecomposition_isComplete(this.__wbg_ptr);
12808
+ return ret !== 0;
12809
+ }
12810
+ /**
12811
+ * Get the eigenvectors as a flattened array
12812
+ *
12813
+ * Returns 4 eigenvectors of 4 components each (16 total)
12814
+ * @returns {Float64Array}
12815
+ */
12816
+ eigenvectors() {
12817
+ const ret = wasm.wasmspectraldecomposition_eigenvectors(this.__wbg_ptr);
12818
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
12819
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
12820
+ return v1;
12821
+ }
12822
+ /**
12823
+ * Apply f(T) = Σᵢ f(λᵢ) Pᵢ to a vector using functional calculus
12824
+ *
12825
+ * # Arguments
12826
+ * * `f` - JavaScript function to apply to eigenvalues
12827
+ * * `x` - Input vector
12828
+ * @param {Function} f
12829
+ * @param {Float64Array} x
12830
+ * @returns {Float64Array}
12831
+ */
12832
+ applyFunction(f, x) {
12833
+ const ptr0 = passArrayF64ToWasm0(x, wasm.__wbindgen_malloc);
12834
+ const len0 = WASM_VECTOR_LEN;
12835
+ const ret = wasm.wasmspectraldecomposition_applyFunction(this.__wbg_ptr, f, ptr0, len0);
12836
+ if (ret[3]) {
12837
+ throw takeFromExternrefTable0(ret[2]);
12838
+ }
12839
+ var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
12840
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
12841
+ return v2;
12842
+ }
12843
+ /**
12844
+ * Get the spectral radius (largest |eigenvalue|)
12845
+ * @returns {number}
12846
+ */
12847
+ spectralRadius() {
12848
+ const ret = wasm.wasmspectraldecomposition_spectralRadius(this.__wbg_ptr);
12849
+ return ret;
12850
+ }
12851
+ /**
12852
+ * Get the condition number
12853
+ * @returns {number | undefined}
12854
+ */
12855
+ conditionNumber() {
12856
+ const ret = wasm.wasmspectraldecomposition_conditionNumber(this.__wbg_ptr);
12857
+ return ret[0] === 0 ? undefined : ret[1];
12858
+ }
12859
+ /**
12860
+ * Check if the operator is positive definite
12861
+ * @returns {boolean}
12862
+ */
12863
+ isPositiveDefinite() {
12864
+ const ret = wasm.wasmspectraldecomposition_isPositiveDefinite(this.__wbg_ptr);
12865
+ return ret !== 0;
12866
+ }
12867
+ /**
12868
+ * Check if the operator is positive semi-definite
12869
+ * @returns {boolean}
12870
+ */
12871
+ isPositiveSemidefinite() {
12872
+ const ret = wasm.wasmspectraldecomposition_isPositiveSemidefinite(this.__wbg_ptr);
12873
+ return ret !== 0;
12874
+ }
12875
+ /**
12876
+ * Apply the reconstructed operator T = Σᵢ λᵢ Pᵢ to a vector
12877
+ * @param {Float64Array} x
12878
+ * @returns {Float64Array}
12879
+ */
12880
+ apply(x) {
12881
+ const ptr0 = passArrayF64ToWasm0(x, wasm.__wbindgen_malloc);
12882
+ const len0 = WASM_VECTOR_LEN;
12883
+ const ret = wasm.wasmspectraldecomposition_apply(this.__wbg_ptr, ptr0, len0);
12884
+ if (ret[3]) {
12885
+ throw takeFromExternrefTable0(ret[2]);
12886
+ }
12887
+ var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
12888
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
12889
+ return v2;
12890
+ }
12891
+ /**
12892
+ * Compute spectral decomposition of a symmetric matrix
12893
+ *
12894
+ * # Arguments
12895
+ * * `matrix` - The symmetric matrix operator to decompose
12896
+ * * `max_iterations` - Maximum iterations for eigenvalue computation
12897
+ * * `tolerance` - Convergence tolerance
12898
+ * @param {WasmMatrixOperator} matrix
12899
+ * @param {number} max_iterations
12900
+ * @param {number} tolerance
12901
+ * @returns {WasmSpectralDecomposition}
12902
+ */
12903
+ static compute(matrix, max_iterations, tolerance) {
12904
+ _assertClass(matrix, WasmMatrixOperator);
12905
+ const ret = wasm.wasmspectraldecomposition_compute(matrix.__wbg_ptr, max_iterations, tolerance);
12906
+ if (ret[2]) {
12907
+ throw takeFromExternrefTable0(ret[1]);
12908
+ }
12909
+ return WasmSpectralDecomposition.__wrap(ret[0]);
12910
+ }
12911
+ }
12912
+
12913
+ const WasmStabilityConditionFinalization = (typeof FinalizationRegistry === 'undefined')
12914
+ ? { register: () => {}, unregister: () => {} }
12915
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmstabilitycondition_free(ptr >>> 0, 1));
12916
+ /**
12917
+ * WASM wrapper for Bridgeland-style stability conditions
12918
+ */
12919
+ export class WasmStabilityCondition {
12920
+
12921
+ __destroy_into_raw() {
12922
+ const ptr = this.__wbg_ptr;
12923
+ this.__wbg_ptr = 0;
12924
+ WasmStabilityConditionFinalization.unregister(this);
12925
+ return ptr;
12926
+ }
12927
+
12928
+ free() {
12929
+ const ptr = this.__destroy_into_raw();
12930
+ wasm.__wbg_wasmstabilitycondition_free(ptr, 0);
12931
+ }
12932
+ /**
12933
+ * Count stable capabilities in a namespace
12934
+ * @param {WasmNamespace} namespace
12935
+ * @returns {number}
12936
+ */
12937
+ stableCount(namespace) {
12938
+ _assertClass(namespace, WasmNamespace);
12939
+ const ret = wasm.wasmstabilitycondition_stableCount(this.__wbg_ptr, namespace.__wbg_ptr);
12940
+ return ret >>> 0;
12941
+ }
12942
+ /**
12943
+ * Get the trust level
12944
+ * @returns {number}
12945
+ */
12946
+ getTrustLevel() {
12947
+ const ret = wasm.wasmdualnumber_getDual(this.__wbg_ptr);
12948
+ return ret;
12949
+ }
12950
+ /**
12951
+ * Create a stability condition on Gr(k, n) at a given trust level
12952
+ * @param {number} k
12953
+ * @param {number} n
12954
+ * @param {number} trust_level
12955
+ */
12956
+ constructor(k, n, trust_level) {
12957
+ const ret = wasm.wasmstabilitycondition_new(k, n, trust_level);
12958
+ this.__wbg_ptr = ret >>> 0;
12959
+ WasmStabilityConditionFinalization.register(this, this.__wbg_ptr, this);
12960
+ return this;
12961
+ }
12962
+ /**
12963
+ * Compute the phase of a Schubert class under this stability condition
12964
+ * @param {WasmSchubertClass} _class
12965
+ * @returns {number}
11847
12966
  */
11848
- constructor(name, description, kind, param1, param2) {
11849
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11850
- const len0 = WASM_VECTOR_LEN;
11851
- const ptr1 = passStringToWasm0(description, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11852
- const len1 = WASM_VECTOR_LEN;
11853
- const ptr2 = passStringToWasm0(kind, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
11854
- const len2 = WASM_VECTOR_LEN;
11855
- const ret = wasm.wasmsmtproofobligation_new(ptr0, len0, ptr1, len1, ptr2, len2, param1, param2);
11856
- if (ret[2]) {
11857
- throw takeFromExternrefTable0(ret[1]);
11858
- }
11859
- this.__wbg_ptr = ret[0] >>> 0;
11860
- WasmSmtProofObligationFinalization.register(this, this.__wbg_ptr, this);
11861
- return this;
12967
+ phase(_class) {
12968
+ _assertClass(_class, WasmSchubertClass);
12969
+ const ret = wasm.wasmstabilitycondition_phase(this.__wbg_ptr, _class.__wbg_ptr);
12970
+ return ret;
12971
+ }
12972
+ /**
12973
+ * Check if a capability is stable under this condition
12974
+ * @param {WasmCapability} capability
12975
+ * @returns {boolean}
12976
+ */
12977
+ isStable(capability) {
12978
+ _assertClass(capability, WasmCapability);
12979
+ const ret = wasm.wasmstabilitycondition_isStable(this.__wbg_ptr, capability.__wbg_ptr);
12980
+ return ret !== 0;
11862
12981
  }
11863
12982
  }
11864
12983
 
11865
- const WasmSobolevSpaceFinalization = (typeof FinalizationRegistry === 'undefined')
12984
+ const WasmStaticMultiDual2Finalization = (typeof FinalizationRegistry === 'undefined')
11866
12985
  ? { register: () => {}, unregister: () => {} }
11867
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmsobolevspace_free(ptr >>> 0, 1));
11868
- /**
11869
- * WASM wrapper for Sobolev spaces H^k
11870
- *
11871
- * Provides function spaces with weak derivatives.
11872
- */
11873
- export class WasmSobolevSpace {
12986
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmstaticmultidual2_free(ptr >>> 0, 1));
12987
+
12988
+ export class WasmStaticMultiDual2 {
11874
12989
 
11875
12990
  static __wrap(ptr) {
11876
12991
  ptr = ptr >>> 0;
11877
- const obj = Object.create(WasmSobolevSpace.prototype);
12992
+ const obj = Object.create(WasmStaticMultiDual2.prototype);
11878
12993
  obj.__wbg_ptr = ptr;
11879
- WasmSobolevSpaceFinalization.register(obj, obj.__wbg_ptr, obj);
12994
+ WasmStaticMultiDual2Finalization.register(obj, obj.__wbg_ptr, obj);
11880
12995
  return obj;
11881
12996
  }
11882
12997
 
11883
12998
  __destroy_into_raw() {
11884
12999
  const ptr = this.__wbg_ptr;
11885
13000
  this.__wbg_ptr = 0;
11886
- WasmSobolevSpaceFinalization.unregister(this);
13001
+ WasmStaticMultiDual2Finalization.unregister(this);
11887
13002
  return ptr;
11888
13003
  }
11889
13004
 
11890
13005
  free() {
11891
13006
  const ptr = this.__destroy_into_raw();
11892
- wasm.__wbg_wasmsobolevspace_free(ptr, 0);
13007
+ wasm.__wbg_wasmstaticmultidual2_free(ptr, 0);
11893
13008
  }
11894
13009
  /**
11895
- * Compute the H^1 seminorm |f|_{H^1} = ||f'||_{L^2}
11896
- * @param {Function} df
11897
- * @returns {number}
13010
+ * Get the fixed-size gradient as a JavaScript array-compatible vector.
13011
+ * @returns {Float64Array}
11898
13012
  */
11899
- h1Seminorm(df) {
11900
- const ret = wasm.wasmsobolevspace_h1Seminorm(this.__wbg_ptr, df);
11901
- if (ret[2]) {
11902
- throw takeFromExternrefTable0(ret[1]);
11903
- }
11904
- return ret[0];
13013
+ getGradient() {
13014
+ const ret = wasm.wasmstaticmultidual2_getGradient(this.__wbg_ptr);
13015
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
13016
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
13017
+ return v1;
11905
13018
  }
11906
13019
  /**
11907
- * Create H^1 over the unit interval [0, 1]
11908
- * @returns {WasmSobolevSpace}
13020
+ * Maximum with explicit derivative tie handling.
13021
+ * @param {WasmStaticMultiDual2} other
13022
+ * @param {WasmBranchPolicy} policy
13023
+ * @returns {WasmStaticMultiDual2}
11909
13024
  */
11910
- static h1UnitInterval() {
11911
- const ret = wasm.wasmsobolevspace_h1UnitInterval();
11912
- return WasmSobolevSpace.__wrap(ret);
13025
+ maxByPolicy(other, policy) {
13026
+ _assertClass(other, WasmStaticMultiDual2);
13027
+ const ret = wasm.wasmstaticmultidual2_maxByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
13028
+ return WasmStaticMultiDual2.__wrap(ret);
11913
13029
  }
11914
13030
  /**
11915
- * Create H^2 over the unit interval [0, 1]
11916
- * @returns {WasmSobolevSpace}
13031
+ * Minimum with explicit derivative tie handling.
13032
+ * @param {WasmStaticMultiDual2} other
13033
+ * @param {WasmBranchPolicy} policy
13034
+ * @returns {WasmStaticMultiDual2}
11917
13035
  */
11918
- static h2UnitInterval() {
11919
- const ret = wasm.wasmsobolevspace_h2UnitInterval();
11920
- return WasmSobolevSpace.__wrap(ret);
13036
+ minByPolicy(other, policy) {
13037
+ _assertClass(other, WasmStaticMultiDual2);
13038
+ const ret = wasm.wasmstaticmultidual2_minByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
13039
+ return WasmStaticMultiDual2.__wrap(ret);
11921
13040
  }
11922
13041
  /**
11923
- * Compute L^2 inner product <f, g>
11924
- * @param {Function} f
11925
- * @param {Function} g
11926
- * @returns {number}
13042
+ * Convert to the heap-backed multi-dual wrapper.
13043
+ * @returns {WasmMultiDualNumber}
11927
13044
  */
11928
- l2InnerProduct(f, g) {
11929
- const ret = wasm.wasmsobolevspace_l2InnerProduct(this.__wbg_ptr, f, g);
13045
+ toMultiDual() {
13046
+ const ret = wasm.wasmstaticmultidual2_toMultiDual(this.__wbg_ptr);
13047
+ return WasmMultiDualNumber.__wrap(ret);
13048
+ }
13049
+ /**
13050
+ * Addition.
13051
+ * @param {WasmStaticMultiDual2} other
13052
+ * @returns {WasmStaticMultiDual2}
13053
+ */
13054
+ add(other) {
13055
+ _assertClass(other, WasmStaticMultiDual2);
13056
+ const ret = wasm.wasmstaticmultidual2_add(this.__wbg_ptr, other.__wbg_ptr);
13057
+ return WasmStaticMultiDual2.__wrap(ret);
13058
+ }
13059
+ /**
13060
+ * Division.
13061
+ * @param {WasmStaticMultiDual2} other
13062
+ * @returns {WasmStaticMultiDual2}
13063
+ */
13064
+ div(other) {
13065
+ _assertClass(other, WasmStaticMultiDual2);
13066
+ const ret = wasm.wasmstaticmultidual2_div(this.__wbg_ptr, other.__wbg_ptr);
11930
13067
  if (ret[2]) {
11931
13068
  throw takeFromExternrefTable0(ret[1]);
11932
13069
  }
11933
- return ret[0];
13070
+ return WasmStaticMultiDual2.__wrap(ret[0]);
11934
13071
  }
11935
13072
  /**
11936
- * Compute the Poincare constant estimate for the domain
11937
- *
11938
- * For [a,b], this is (b-a)/π
11939
- * @returns {number}
13073
+ * Multiplication.
13074
+ * @param {WasmStaticMultiDual2} other
13075
+ * @returns {WasmStaticMultiDual2}
11940
13076
  */
11941
- poincareConstant() {
11942
- const ret = wasm.wasmsobolevspace_poincareConstant(this.__wbg_ptr);
11943
- return ret;
13077
+ mul(other) {
13078
+ _assertClass(other, WasmStaticMultiDual2);
13079
+ const ret = wasm.wasmstaticmultidual2_mul(this.__wbg_ptr, other.__wbg_ptr);
13080
+ return WasmStaticMultiDual2.__wrap(ret);
11944
13081
  }
11945
13082
  /**
11946
- * Set the number of quadrature points
11947
- * @param {number} n
13083
+ * Negation.
13084
+ * @returns {WasmStaticMultiDual2}
11948
13085
  */
11949
- setQuadraturePoints(n) {
11950
- wasm.wasmsobolevspace_setQuadraturePoints(this.__wbg_ptr, n);
13086
+ neg() {
13087
+ const ret = wasm.wasmstaticmultidual2_neg(this.__wbg_ptr);
13088
+ return WasmStaticMultiDual2.__wrap(ret);
11951
13089
  }
11952
13090
  /**
11953
- * Create a Sobolev space H^k over an interval [a, b]
11954
- *
11955
- * # Arguments
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
13091
+ * Create a fixed-size multi-dual number from a value and gradient.
13092
+ * @param {number} value
13093
+ * @param {Float64Array} gradient
11962
13094
  */
11963
- constructor(order, lower, upper) {
11964
- const ret = wasm.wasmsobolevspace_new(order, lower, upper);
13095
+ constructor(value, gradient) {
13096
+ const ptr0 = passArrayF64ToWasm0(gradient, wasm.__wbindgen_malloc);
13097
+ const len0 = WASM_VECTOR_LEN;
13098
+ const ret = wasm.wasmstaticmultidual2_new(value, ptr0, len0);
11965
13099
  if (ret[2]) {
11966
13100
  throw takeFromExternrefTable0(ret[1]);
11967
13101
  }
11968
13102
  this.__wbg_ptr = ret[0] >>> 0;
11969
- WasmSobolevSpaceFinalization.register(this, this.__wbg_ptr, this);
13103
+ WasmStaticMultiDual2Finalization.register(this, this.__wbg_ptr, this);
11970
13104
  return this;
11971
13105
  }
11972
13106
  /**
11973
- * Get the domain bounds [lower, upper]
11974
- * @returns {Float64Array}
13107
+ * Subtraction.
13108
+ * @param {WasmStaticMultiDual2} other
13109
+ * @returns {WasmStaticMultiDual2}
11975
13110
  */
11976
- bounds() {
11977
- const ret = wasm.wasmsobolevspace_bounds(this.__wbg_ptr);
11978
- var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
11979
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
11980
- return v1;
13111
+ sub(other) {
13112
+ _assertClass(other, WasmStaticMultiDual2);
13113
+ const ret = wasm.wasmstaticmultidual2_sub(this.__wbg_ptr, other.__wbg_ptr);
13114
+ return WasmStaticMultiDual2.__wrap(ret);
11981
13115
  }
11982
13116
  /**
11983
- * Compute the H^k norm of a function using numerical integration
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
13117
+ * Number of derivative variables.
11990
13118
  * @returns {number}
11991
13119
  */
11992
- h1Norm(f, df) {
11993
- const ret = wasm.wasmsobolevspace_h1Norm(this.__wbg_ptr, f, df);
11994
- if (ret[2]) {
11995
- throw takeFromExternrefTable0(ret[1]);
11996
- }
11997
- return ret[0];
13120
+ nVars() {
13121
+ const ret = wasm.wasmstaticmultidual2_nVars(this.__wbg_ptr);
13122
+ return ret >>> 0;
11998
13123
  }
11999
13124
  /**
12000
- * Compute L^2 norm of a function
12001
- * @param {Function} f
12002
- * @returns {number}
13125
+ * Create a constant with zero gradient.
13126
+ * @param {number} value
13127
+ * @returns {WasmStaticMultiDual2}
12003
13128
  */
12004
- l2Norm(f) {
12005
- const ret = wasm.wasmsobolevspace_l2Norm(this.__wbg_ptr, f);
13129
+ static constant(value) {
13130
+ const ret = wasm.wasmstaticmultidual2_constant(value);
13131
+ return WasmStaticMultiDual2.__wrap(ret);
13132
+ }
13133
+ /**
13134
+ * Create a basis-seeded variable.
13135
+ * @param {number} value
13136
+ * @param {number} var_index
13137
+ * @returns {WasmStaticMultiDual2}
13138
+ */
13139
+ static variable(value, var_index) {
13140
+ const ret = wasm.wasmstaticmultidual2_variable(value, var_index);
12006
13141
  if (ret[2]) {
12007
13142
  throw takeFromExternrefTable0(ret[1]);
12008
13143
  }
12009
- return ret[0];
13144
+ return WasmStaticMultiDual2.__wrap(ret[0]);
12010
13145
  }
12011
13146
  /**
12012
- * Get the Sobolev order k
13147
+ * Get the function value.
12013
13148
  * @returns {number}
12014
13149
  */
12015
- order() {
12016
- const ret = wasm.wasmsobolevspace_order(this.__wbg_ptr);
12017
- return ret >>> 0;
13150
+ getValue() {
13151
+ const ret = wasm.wasmevaluationresult_getGeometricDistance(this.__wbg_ptr);
13152
+ return ret;
13153
+ }
13154
+ /**
13155
+ * Create one fixed-size variable per coordinate.
13156
+ * @param {Float64Array} values
13157
+ * @returns {Array<any>}
13158
+ */
13159
+ static variables(values) {
13160
+ const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_malloc);
13161
+ const len0 = WASM_VECTOR_LEN;
13162
+ const ret = wasm.wasmstaticmultidual2_variables(ptr0, len0);
13163
+ if (ret[2]) {
13164
+ throw takeFromExternrefTable0(ret[1]);
13165
+ }
13166
+ return takeFromExternrefTable0(ret[0]);
12018
13167
  }
12019
13168
  }
12020
13169
 
12021
- const WasmSpacetimeVectorFinalization = (typeof FinalizationRegistry === 'undefined')
13170
+ const WasmStaticMultiDual3Finalization = (typeof FinalizationRegistry === 'undefined')
12022
13171
  ? { register: () => {}, unregister: () => {} }
12023
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmspacetimevector_free(ptr >>> 0, 1));
12024
- /**
12025
- * WASM wrapper for spacetime vectors
12026
- */
12027
- export class WasmSpacetimeVector {
13172
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmstaticmultidual3_free(ptr >>> 0, 1));
13173
+
13174
+ export class WasmStaticMultiDual3 {
12028
13175
 
12029
13176
  static __wrap(ptr) {
12030
13177
  ptr = ptr >>> 0;
12031
- const obj = Object.create(WasmSpacetimeVector.prototype);
13178
+ const obj = Object.create(WasmStaticMultiDual3.prototype);
12032
13179
  obj.__wbg_ptr = ptr;
12033
- WasmSpacetimeVectorFinalization.register(obj, obj.__wbg_ptr, obj);
13180
+ WasmStaticMultiDual3Finalization.register(obj, obj.__wbg_ptr, obj);
12034
13181
  return obj;
12035
13182
  }
12036
13183
 
12037
13184
  __destroy_into_raw() {
12038
13185
  const ptr = this.__wbg_ptr;
12039
13186
  this.__wbg_ptr = 0;
12040
- WasmSpacetimeVectorFinalization.unregister(this);
13187
+ WasmStaticMultiDual3Finalization.unregister(this);
12041
13188
  return ptr;
12042
13189
  }
12043
13190
 
12044
13191
  free() {
12045
13192
  const ptr = this.__destroy_into_raw();
12046
- wasm.__wbg_wasmspacetimevector_free(ptr, 0);
13193
+ wasm.__wbg_wasmstaticmultidual3_free(ptr, 0);
12047
13194
  }
12048
13195
  /**
12049
- * Check if vector is timelike (massive particle)
12050
- * @returns {boolean}
13196
+ * Get the fixed-size gradient as a JavaScript array-compatible vector.
13197
+ * @returns {Float64Array}
12051
13198
  */
12052
- is_timelike() {
12053
- const ret = wasm.wasmspacetimevector_is_timelike(this.__wbg_ptr);
12054
- return ret !== 0;
13199
+ getGradient() {
13200
+ const ret = wasm.wasmstaticmultidual3_getGradient(this.__wbg_ptr);
13201
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
13202
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
13203
+ return v1;
12055
13204
  }
12056
13205
  /**
12057
- * Check if vector is spacelike
12058
- * @returns {boolean}
13206
+ * Maximum with explicit derivative tie handling.
13207
+ * @param {WasmStaticMultiDual3} other
13208
+ * @param {WasmBranchPolicy} policy
13209
+ * @returns {WasmStaticMultiDual3}
12059
13210
  */
12060
- is_spacelike() {
12061
- const ret = wasm.wasmspacetimevector_is_spacelike(this.__wbg_ptr);
12062
- return ret !== 0;
13211
+ maxByPolicy(other, policy) {
13212
+ _assertClass(other, WasmStaticMultiDual3);
13213
+ const ret = wasm.wasmstaticmultidual3_maxByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
13214
+ return WasmStaticMultiDual3.__wrap(ret);
12063
13215
  }
12064
13216
  /**
12065
- * Compute Minkowski norm squared
12066
- * @returns {number}
13217
+ * Minimum with explicit derivative tie handling.
13218
+ * @param {WasmStaticMultiDual3} other
13219
+ * @param {WasmBranchPolicy} policy
13220
+ * @returns {WasmStaticMultiDual3}
12067
13221
  */
12068
- norm_squared() {
12069
- const ret = wasm.wasmspacetimevector_norm_squared(this.__wbg_ptr);
12070
- return ret;
13222
+ minByPolicy(other, policy) {
13223
+ _assertClass(other, WasmStaticMultiDual3);
13224
+ const ret = wasm.wasmstaticmultidual3_minByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
13225
+ return WasmStaticMultiDual3.__wrap(ret);
12071
13226
  }
12072
13227
  /**
12073
- * Compute Minkowski inner product with another spacetime vector
12074
- * @param {WasmSpacetimeVector} other
12075
- * @returns {number}
13228
+ * Convert to the heap-backed multi-dual wrapper.
13229
+ * @returns {WasmMultiDualNumber}
12076
13230
  */
12077
- minkowski_dot(other) {
12078
- _assertClass(other, WasmSpacetimeVector);
12079
- const ret = wasm.wasmspacetimevector_minkowski_dot(this.__wbg_ptr, other.__wbg_ptr);
12080
- return ret;
13231
+ toMultiDual() {
13232
+ const ret = wasm.wasmstaticmultidual3_toMultiDual(this.__wbg_ptr);
13233
+ return WasmMultiDualNumber.__wrap(ret);
12081
13234
  }
12082
13235
  /**
12083
- * Get temporal component
12084
- * @returns {number}
13236
+ * Addition.
13237
+ * @param {WasmStaticMultiDual3} other
13238
+ * @returns {WasmStaticMultiDual3}
12085
13239
  */
12086
- get t() {
12087
- const ret = wasm.wasmfourvelocity_gamma(this.__wbg_ptr);
12088
- return ret;
13240
+ add(other) {
13241
+ _assertClass(other, WasmStaticMultiDual3);
13242
+ const ret = wasm.wasmstaticmultidual3_add(this.__wbg_ptr, other.__wbg_ptr);
13243
+ return WasmStaticMultiDual3.__wrap(ret);
12089
13244
  }
12090
13245
  /**
12091
- * Get x component
12092
- * @returns {number}
13246
+ * Division.
13247
+ * @param {WasmStaticMultiDual3} other
13248
+ * @returns {WasmStaticMultiDual3}
12093
13249
  */
12094
- get x() {
12095
- const ret = wasm.wasmdualnumber_getDual(this.__wbg_ptr);
12096
- return ret;
13250
+ div(other) {
13251
+ _assertClass(other, WasmStaticMultiDual3);
13252
+ const ret = wasm.wasmstaticmultidual3_div(this.__wbg_ptr, other.__wbg_ptr);
13253
+ if (ret[2]) {
13254
+ throw takeFromExternrefTable0(ret[1]);
13255
+ }
13256
+ return WasmStaticMultiDual3.__wrap(ret[0]);
12097
13257
  }
12098
13258
  /**
12099
- * Get y component
12100
- * @returns {number}
13259
+ * Multiplication.
13260
+ * @param {WasmStaticMultiDual3} other
13261
+ * @returns {WasmStaticMultiDual3}
12101
13262
  */
12102
- get y() {
12103
- const ret = wasm.wasmevaluationresult_getGeometricDistance(this.__wbg_ptr);
12104
- return ret;
13263
+ mul(other) {
13264
+ _assertClass(other, WasmStaticMultiDual3);
13265
+ const ret = wasm.wasmstaticmultidual3_mul(this.__wbg_ptr, other.__wbg_ptr);
13266
+ return WasmStaticMultiDual3.__wrap(ret);
12105
13267
  }
12106
13268
  /**
12107
- * Get z component
12108
- * @returns {number}
13269
+ * Negation.
13270
+ * @returns {WasmStaticMultiDual3}
13271
+ */
13272
+ neg() {
13273
+ const ret = wasm.wasmstaticmultidual3_neg(this.__wbg_ptr);
13274
+ return WasmStaticMultiDual3.__wrap(ret);
13275
+ }
13276
+ /**
13277
+ * Create a fixed-size multi-dual number from a value and gradient.
13278
+ * @param {number} value
13279
+ * @param {Float64Array} gradient
13280
+ */
13281
+ constructor(value, gradient) {
13282
+ const ptr0 = passArrayF64ToWasm0(gradient, wasm.__wbindgen_malloc);
13283
+ const len0 = WASM_VECTOR_LEN;
13284
+ const ret = wasm.wasmstaticmultidual3_new(value, ptr0, len0);
13285
+ if (ret[2]) {
13286
+ throw takeFromExternrefTable0(ret[1]);
13287
+ }
13288
+ this.__wbg_ptr = ret[0] >>> 0;
13289
+ WasmStaticMultiDual3Finalization.register(this, this.__wbg_ptr, this);
13290
+ return this;
13291
+ }
13292
+ /**
13293
+ * Subtraction.
13294
+ * @param {WasmStaticMultiDual3} other
13295
+ * @returns {WasmStaticMultiDual3}
12109
13296
  */
12110
- get z() {
12111
- const ret = wasm.wasmevaluationresult_getCombinedScore(this.__wbg_ptr);
12112
- return ret;
13297
+ sub(other) {
13298
+ _assertClass(other, WasmStaticMultiDual3);
13299
+ const ret = wasm.wasmstaticmultidual3_sub(this.__wbg_ptr, other.__wbg_ptr);
13300
+ return WasmStaticMultiDual3.__wrap(ret);
12113
13301
  }
12114
13302
  /**
12115
- * Create a new spacetime vector with components (ct, x, y, z)
12116
- * @param {number} t
12117
- * @param {number} x
12118
- * @param {number} y
12119
- * @param {number} z
13303
+ * Number of derivative variables.
13304
+ * @returns {number}
12120
13305
  */
12121
- constructor(t, x, y, z) {
12122
- const ret = wasm.wasmspacetimevector_new(t, x, y, z);
12123
- this.__wbg_ptr = ret >>> 0;
12124
- WasmSpacetimeVectorFinalization.register(this, this.__wbg_ptr, this);
12125
- return this;
13306
+ nVars() {
13307
+ const ret = wasm.wasmstaticmultidual3_nVars(this.__wbg_ptr);
13308
+ return ret >>> 0;
12126
13309
  }
12127
13310
  /**
12128
- * Check if vector is null (lightlike)
12129
- * @returns {boolean}
13311
+ * Create a constant with zero gradient.
13312
+ * @param {number} value
13313
+ * @returns {WasmStaticMultiDual3}
12130
13314
  */
12131
- is_null() {
12132
- const ret = wasm.wasmspacetimevector_is_null(this.__wbg_ptr);
12133
- return ret !== 0;
13315
+ static constant(value) {
13316
+ const ret = wasm.wasmstaticmultidual3_constant(value);
13317
+ return WasmStaticMultiDual3.__wrap(ret);
12134
13318
  }
12135
13319
  /**
12136
- * Create a timelike vector
12137
- * @param {number} t
12138
- * @returns {WasmSpacetimeVector}
13320
+ * Create a basis-seeded variable.
13321
+ * @param {number} value
13322
+ * @param {number} var_index
13323
+ * @returns {WasmStaticMultiDual3}
12139
13324
  */
12140
- static timelike(t) {
12141
- const ret = wasm.wasmspacetimevector_timelike(t);
12142
- return WasmSpacetimeVector.__wrap(ret);
13325
+ static variable(value, var_index) {
13326
+ const ret = wasm.wasmstaticmultidual3_variable(value, var_index);
13327
+ if (ret[2]) {
13328
+ throw takeFromExternrefTable0(ret[1]);
13329
+ }
13330
+ return WasmStaticMultiDual3.__wrap(ret[0]);
12143
13331
  }
12144
13332
  /**
12145
- * Create a spacelike vector
12146
- * @param {number} x
12147
- * @param {number} y
12148
- * @param {number} z
12149
- * @returns {WasmSpacetimeVector}
13333
+ * Get the function value.
13334
+ * @returns {number}
12150
13335
  */
12151
- static spacelike(x, y, z) {
12152
- const ret = wasm.wasmspacetimevector_spacelike(x, y, z);
12153
- return WasmSpacetimeVector.__wrap(ret);
13336
+ getValue() {
13337
+ const ret = wasm.wasmalphaconnection_getAlpha(this.__wbg_ptr);
13338
+ return ret;
12154
13339
  }
12155
13340
  /**
12156
- * Get string representation
12157
- * @returns {string}
13341
+ * Create one fixed-size variable per coordinate.
13342
+ * @param {Float64Array} values
13343
+ * @returns {Array<any>}
12158
13344
  */
12159
- to_string() {
12160
- let deferred1_0;
12161
- let deferred1_1;
12162
- try {
12163
- const ret = wasm.wasmspacetimevector_to_string(this.__wbg_ptr);
12164
- deferred1_0 = ret[0];
12165
- deferred1_1 = ret[1];
12166
- return getStringFromWasm0(ret[0], ret[1]);
12167
- } finally {
12168
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
13345
+ static variables(values) {
13346
+ const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_malloc);
13347
+ const len0 = WASM_VECTOR_LEN;
13348
+ const ret = wasm.wasmstaticmultidual3_variables(ptr0, len0);
13349
+ if (ret[2]) {
13350
+ throw takeFromExternrefTable0(ret[1]);
12169
13351
  }
13352
+ return takeFromExternrefTable0(ret[0]);
12170
13353
  }
12171
13354
  }
12172
13355
 
12173
- const WasmSpectralDecompositionFinalization = (typeof FinalizationRegistry === 'undefined')
13356
+ const WasmStaticMultiDual4Finalization = (typeof FinalizationRegistry === 'undefined')
12174
13357
  ? { register: () => {}, unregister: () => {} }
12175
- : new FinalizationRegistry(ptr => wasm.__wbg_wasmspectraldecomposition_free(ptr >>> 0, 1));
12176
- /**
12177
- * WASM wrapper for spectral decomposition
12178
- *
12179
- * Provides eigenvalue decomposition for symmetric matrices.
12180
- */
12181
- export class WasmSpectralDecomposition {
13358
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmstaticmultidual4_free(ptr >>> 0, 1));
13359
+
13360
+ export class WasmStaticMultiDual4 {
12182
13361
 
12183
13362
  static __wrap(ptr) {
12184
13363
  ptr = ptr >>> 0;
12185
- const obj = Object.create(WasmSpectralDecomposition.prototype);
13364
+ const obj = Object.create(WasmStaticMultiDual4.prototype);
12186
13365
  obj.__wbg_ptr = ptr;
12187
- WasmSpectralDecompositionFinalization.register(obj, obj.__wbg_ptr, obj);
13366
+ WasmStaticMultiDual4Finalization.register(obj, obj.__wbg_ptr, obj);
12188
13367
  return obj;
12189
13368
  }
12190
13369
 
12191
13370
  __destroy_into_raw() {
12192
13371
  const ptr = this.__wbg_ptr;
12193
13372
  this.__wbg_ptr = 0;
12194
- WasmSpectralDecompositionFinalization.unregister(this);
13373
+ WasmStaticMultiDual4Finalization.unregister(this);
12195
13374
  return ptr;
12196
13375
  }
12197
13376
 
12198
13377
  free() {
12199
13378
  const ptr = this.__destroy_into_raw();
12200
- wasm.__wbg_wasmspectraldecomposition_free(ptr, 0);
13379
+ wasm.__wbg_wasmstaticmultidual4_free(ptr, 0);
12201
13380
  }
12202
13381
  /**
12203
- * Get the eigenvalues
13382
+ * Get the fixed-size gradient as a JavaScript array-compatible vector.
12204
13383
  * @returns {Float64Array}
12205
13384
  */
12206
- eigenvalues() {
12207
- const ret = wasm.wasmspectraldecomposition_eigenvalues(this.__wbg_ptr);
13385
+ getGradient() {
13386
+ const ret = wasm.wasmstaticmultidual4_getGradient(this.__wbg_ptr);
12208
13387
  var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
12209
13388
  wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
12210
13389
  return v1;
12211
13390
  }
12212
13391
  /**
12213
- * Check if the decomposition is complete
12214
- * @returns {boolean}
13392
+ * Maximum with explicit derivative tie handling.
13393
+ * @param {WasmStaticMultiDual4} other
13394
+ * @param {WasmBranchPolicy} policy
13395
+ * @returns {WasmStaticMultiDual4}
12215
13396
  */
12216
- isComplete() {
12217
- const ret = wasm.wasmspectraldecomposition_isComplete(this.__wbg_ptr);
12218
- return ret !== 0;
13397
+ maxByPolicy(other, policy) {
13398
+ _assertClass(other, WasmStaticMultiDual4);
13399
+ const ret = wasm.wasmstaticmultidual4_maxByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
13400
+ return WasmStaticMultiDual4.__wrap(ret);
12219
13401
  }
12220
13402
  /**
12221
- * Get the eigenvectors as a flattened array
12222
- *
12223
- * Returns 4 eigenvectors of 4 components each (16 total)
12224
- * @returns {Float64Array}
13403
+ * Minimum with explicit derivative tie handling.
13404
+ * @param {WasmStaticMultiDual4} other
13405
+ * @param {WasmBranchPolicy} policy
13406
+ * @returns {WasmStaticMultiDual4}
12225
13407
  */
12226
- eigenvectors() {
12227
- const ret = wasm.wasmspectraldecomposition_eigenvectors(this.__wbg_ptr);
12228
- var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
12229
- wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
12230
- return v1;
13408
+ minByPolicy(other, policy) {
13409
+ _assertClass(other, WasmStaticMultiDual4);
13410
+ const ret = wasm.wasmstaticmultidual4_minByPolicy(this.__wbg_ptr, other.__wbg_ptr, policy);
13411
+ return WasmStaticMultiDual4.__wrap(ret);
12231
13412
  }
12232
13413
  /**
12233
- * Apply f(T) = Σᵢ f(λᵢ) Pᵢ to a vector using functional calculus
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}
13414
+ * Convert to the heap-backed multi-dual wrapper.
13415
+ * @returns {WasmMultiDualNumber}
12241
13416
  */
12242
- applyFunction(f, x) {
12243
- const ptr0 = passArrayF64ToWasm0(x, wasm.__wbindgen_malloc);
12244
- const len0 = WASM_VECTOR_LEN;
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;
13417
+ toMultiDual() {
13418
+ const ret = wasm.wasmstaticmultidual4_toMultiDual(this.__wbg_ptr);
13419
+ return WasmMultiDualNumber.__wrap(ret);
12252
13420
  }
12253
13421
  /**
12254
- * Get the spectral radius (largest |eigenvalue|)
12255
- * @returns {number}
13422
+ * Addition.
13423
+ * @param {WasmStaticMultiDual4} other
13424
+ * @returns {WasmStaticMultiDual4}
12256
13425
  */
12257
- spectralRadius() {
12258
- const ret = wasm.wasmspectraldecomposition_spectralRadius(this.__wbg_ptr);
12259
- return ret;
13426
+ add(other) {
13427
+ _assertClass(other, WasmStaticMultiDual4);
13428
+ const ret = wasm.wasmstaticmultidual4_add(this.__wbg_ptr, other.__wbg_ptr);
13429
+ return WasmStaticMultiDual4.__wrap(ret);
12260
13430
  }
12261
13431
  /**
12262
- * Get the condition number
12263
- * @returns {number | undefined}
13432
+ * Division.
13433
+ * @param {WasmStaticMultiDual4} other
13434
+ * @returns {WasmStaticMultiDual4}
12264
13435
  */
12265
- conditionNumber() {
12266
- const ret = wasm.wasmspectraldecomposition_conditionNumber(this.__wbg_ptr);
12267
- return ret[0] === 0 ? undefined : ret[1];
13436
+ div(other) {
13437
+ _assertClass(other, WasmStaticMultiDual4);
13438
+ const ret = wasm.wasmstaticmultidual4_div(this.__wbg_ptr, other.__wbg_ptr);
13439
+ if (ret[2]) {
13440
+ throw takeFromExternrefTable0(ret[1]);
13441
+ }
13442
+ return WasmStaticMultiDual4.__wrap(ret[0]);
12268
13443
  }
12269
13444
  /**
12270
- * Check if the operator is positive definite
12271
- * @returns {boolean}
13445
+ * Multiplication.
13446
+ * @param {WasmStaticMultiDual4} other
13447
+ * @returns {WasmStaticMultiDual4}
12272
13448
  */
12273
- isPositiveDefinite() {
12274
- const ret = wasm.wasmspectraldecomposition_isPositiveDefinite(this.__wbg_ptr);
12275
- return ret !== 0;
13449
+ mul(other) {
13450
+ _assertClass(other, WasmStaticMultiDual4);
13451
+ const ret = wasm.wasmstaticmultidual4_mul(this.__wbg_ptr, other.__wbg_ptr);
13452
+ return WasmStaticMultiDual4.__wrap(ret);
12276
13453
  }
12277
13454
  /**
12278
- * Check if the operator is positive semi-definite
12279
- * @returns {boolean}
13455
+ * Negation.
13456
+ * @returns {WasmStaticMultiDual4}
12280
13457
  */
12281
- isPositiveSemidefinite() {
12282
- const ret = wasm.wasmspectraldecomposition_isPositiveSemidefinite(this.__wbg_ptr);
12283
- return ret !== 0;
13458
+ neg() {
13459
+ const ret = wasm.wasmstaticmultidual4_neg(this.__wbg_ptr);
13460
+ return WasmStaticMultiDual4.__wrap(ret);
12284
13461
  }
12285
13462
  /**
12286
- * Apply the reconstructed operator T = Σᵢ λᵢ Pᵢ to a vector
12287
- * @param {Float64Array} x
12288
- * @returns {Float64Array}
13463
+ * Create a fixed-size multi-dual number from a value and gradient.
13464
+ * @param {number} value
13465
+ * @param {Float64Array} gradient
12289
13466
  */
12290
- apply(x) {
12291
- const ptr0 = passArrayF64ToWasm0(x, wasm.__wbindgen_malloc);
13467
+ constructor(value, gradient) {
13468
+ const ptr0 = passArrayF64ToWasm0(gradient, wasm.__wbindgen_malloc);
12292
13469
  const len0 = WASM_VECTOR_LEN;
12293
- const ret = wasm.wasmspectraldecomposition_apply(this.__wbg_ptr, ptr0, len0);
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);
13470
+ const ret = wasm.wasmstaticmultidual4_new(value, ptr0, len0);
12316
13471
  if (ret[2]) {
12317
13472
  throw takeFromExternrefTable0(ret[1]);
12318
13473
  }
12319
- return WasmSpectralDecomposition.__wrap(ret[0]);
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;
13474
+ this.__wbg_ptr = ret[0] >>> 0;
13475
+ WasmStaticMultiDual4Finalization.register(this, this.__wbg_ptr, this);
13476
+ return this;
12336
13477
  }
12337
-
12338
- free() {
12339
- const ptr = this.__destroy_into_raw();
12340
- wasm.__wbg_wasmstabilitycondition_free(ptr, 0);
13478
+ /**
13479
+ * Subtraction.
13480
+ * @param {WasmStaticMultiDual4} other
13481
+ * @returns {WasmStaticMultiDual4}
13482
+ */
13483
+ sub(other) {
13484
+ _assertClass(other, WasmStaticMultiDual4);
13485
+ const ret = wasm.wasmstaticmultidual4_sub(this.__wbg_ptr, other.__wbg_ptr);
13486
+ return WasmStaticMultiDual4.__wrap(ret);
12341
13487
  }
12342
13488
  /**
12343
- * Count stable capabilities in a namespace
12344
- * @param {WasmNamespace} namespace
13489
+ * Number of derivative variables.
12345
13490
  * @returns {number}
12346
13491
  */
12347
- stableCount(namespace) {
12348
- _assertClass(namespace, WasmNamespace);
12349
- const ret = wasm.wasmstabilitycondition_stableCount(this.__wbg_ptr, namespace.__wbg_ptr);
13492
+ nVars() {
13493
+ const ret = wasm.wasmhilbertspace_dimension(this.__wbg_ptr);
12350
13494
  return ret >>> 0;
12351
13495
  }
12352
13496
  /**
12353
- * Get the trust level
12354
- * @returns {number}
13497
+ * Create a constant with zero gradient.
13498
+ * @param {number} value
13499
+ * @returns {WasmStaticMultiDual4}
12355
13500
  */
12356
- getTrustLevel() {
12357
- const ret = wasm.wasmdualnumber_getDual(this.__wbg_ptr);
12358
- return ret;
13501
+ static constant(value) {
13502
+ const ret = wasm.wasmstaticmultidual4_constant(value);
13503
+ return WasmStaticMultiDual4.__wrap(ret);
12359
13504
  }
12360
13505
  /**
12361
- * Create a stability condition on Gr(k, n) at a given trust level
12362
- * @param {number} k
12363
- * @param {number} n
12364
- * @param {number} trust_level
13506
+ * Create a basis-seeded variable.
13507
+ * @param {number} value
13508
+ * @param {number} var_index
13509
+ * @returns {WasmStaticMultiDual4}
12365
13510
  */
12366
- constructor(k, n, trust_level) {
12367
- const ret = wasm.wasmstabilitycondition_new(k, n, trust_level);
12368
- this.__wbg_ptr = ret >>> 0;
12369
- WasmStabilityConditionFinalization.register(this, this.__wbg_ptr, this);
12370
- return this;
13511
+ static variable(value, var_index) {
13512
+ const ret = wasm.wasmstaticmultidual4_variable(value, var_index);
13513
+ if (ret[2]) {
13514
+ throw takeFromExternrefTable0(ret[1]);
13515
+ }
13516
+ return WasmStaticMultiDual4.__wrap(ret[0]);
12371
13517
  }
12372
13518
  /**
12373
- * Compute the phase of a Schubert class under this stability condition
12374
- * @param {WasmSchubertClass} _class
13519
+ * Get the function value.
12375
13520
  * @returns {number}
12376
13521
  */
12377
- phase(_class) {
12378
- _assertClass(_class, WasmSchubertClass);
12379
- const ret = wasm.wasmstabilitycondition_phase(this.__wbg_ptr, _class.__wbg_ptr);
13522
+ getValue() {
13523
+ const ret = wasm.wasmschwarzschildmetric_schwarzschild_radius(this.__wbg_ptr);
12380
13524
  return ret;
12381
13525
  }
12382
13526
  /**
12383
- * Check if a capability is stable under this condition
12384
- * @param {WasmCapability} capability
12385
- * @returns {boolean}
13527
+ * Create one fixed-size variable per coordinate.
13528
+ * @param {Float64Array} values
13529
+ * @returns {Array<any>}
12386
13530
  */
12387
- isStable(capability) {
12388
- _assertClass(capability, WasmCapability);
12389
- const ret = wasm.wasmstabilitycondition_isStable(this.__wbg_ptr, capability.__wbg_ptr);
12390
- return ret !== 0;
13531
+ static variables(values) {
13532
+ const ptr0 = passArrayF64ToWasm0(values, wasm.__wbindgen_malloc);
13533
+ const len0 = WASM_VECTOR_LEN;
13534
+ const ret = wasm.wasmstaticmultidual4_variables(ptr0, len0);
13535
+ if (ret[2]) {
13536
+ throw takeFromExternrefTable0(ret[1]);
13537
+ }
13538
+ return takeFromExternrefTable0(ret[0]);
12391
13539
  }
12392
13540
  }
12393
13541
 
@@ -14175,7 +15323,7 @@ function __wbg_get_imports() {
14175
15323
  const ret = arg0.length;
14176
15324
  return ret;
14177
15325
  };
14178
- imports.wbg.__wbg_log_7c839ead6adae856 = function(arg0, arg1) {
15326
+ imports.wbg.__wbg_log_845eb41485557ffc = function(arg0, arg1) {
14179
15327
  console.log(getStringFromWasm0(arg0, arg1));
14180
15328
  };
14181
15329
  imports.wbg.__wbg_log_ea240990d83e374e = function(arg0) {
@@ -14200,7 +15348,7 @@ function __wbg_get_imports() {
14200
15348
  const a = state0.a;
14201
15349
  state0.a = 0;
14202
15350
  try {
14203
- return __wbg_adapter_965(a, state0.b, arg0, arg1);
15351
+ return __wbg_adapter_1057(a, state0.b, arg0, arg1);
14204
15352
  } finally {
14205
15353
  state0.a = a;
14206
15354
  }
@@ -14291,6 +15439,10 @@ function __wbg_get_imports() {
14291
15439
  const ret = WasmIntersectionResult.__wrap(arg0);
14292
15440
  return ret;
14293
15441
  };
15442
+ imports.wbg.__wbg_wasmmultidualnumber_new = function(arg0) {
15443
+ const ret = WasmMultiDualNumber.__wrap(arg0);
15444
+ return ret;
15445
+ };
14294
15446
  imports.wbg.__wbg_wasmnamespace_unwrap = function(arg0) {
14295
15447
  const ret = WasmNamespace.__unwrap(arg0);
14296
15448
  return ret;
@@ -14319,6 +15471,18 @@ function __wbg_get_imports() {
14319
15471
  const ret = WasmSpacetimeVector.__wrap(arg0);
14320
15472
  return ret;
14321
15473
  };
15474
+ imports.wbg.__wbg_wasmstaticmultidual2_new = function(arg0) {
15475
+ const ret = WasmStaticMultiDual2.__wrap(arg0);
15476
+ return ret;
15477
+ };
15478
+ imports.wbg.__wbg_wasmstaticmultidual3_new = function(arg0) {
15479
+ const ret = WasmStaticMultiDual3.__wrap(arg0);
15480
+ return ret;
15481
+ };
15482
+ imports.wbg.__wbg_wasmstaticmultidual4_new = function(arg0) {
15483
+ const ret = WasmStaticMultiDual4.__wrap(arg0);
15484
+ return ret;
15485
+ };
14322
15486
  imports.wbg.__wbg_wasmtropicalnumber_new = function(arg0) {
14323
15487
  const ret = WasmTropicalNumber.__wrap(arg0);
14324
15488
  return ret;
@@ -14336,8 +15500,8 @@ function __wbg_get_imports() {
14336
15500
  const ret = false;
14337
15501
  return ret;
14338
15502
  };
14339
- imports.wbg.__wbindgen_closure_wrapper2686 = function(arg0, arg1, arg2) {
14340
- const ret = makeMutClosure(arg0, arg1, 70, __wbg_adapter_30);
15503
+ imports.wbg.__wbindgen_closure_wrapper2835 = function(arg0, arg1, arg2) {
15504
+ const ret = makeMutClosure(arg0, arg1, 71, __wbg_adapter_30);
14341
15505
  return ret;
14342
15506
  };
14343
15507
  imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {