@justinelliottcobb/amari-wasm 0.13.0 → 0.14.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.d.ts CHANGED
@@ -1260,6 +1260,56 @@ export class WasmGeodesicIntegrator {
1260
1260
  */
1261
1261
  static with_schwarzschild(metric: WasmSchwarzschildMetric): WasmGeodesicIntegrator;
1262
1262
  }
1263
+ /**
1264
+ * WASM wrapper for Geometric Brownian Motion on multivector space
1265
+ *
1266
+ * dX = μX dt + σX dW
1267
+ *
1268
+ * Useful for modeling multiplicative noise processes in geometric algebra.
1269
+ */
1270
+ export class WasmGeometricBrownianMotion {
1271
+ free(): void;
1272
+ /**
1273
+ * Sample a single path of the process
1274
+ *
1275
+ * # Arguments
1276
+ * * `initial` - Initial multivector (8 coefficients)
1277
+ * * `t_end` - End time
1278
+ * * `num_steps` - Number of time steps
1279
+ *
1280
+ * Returns flat array: (num_steps + 1) * 9 values
1281
+ * Each point is [time, coeff0, coeff1, ..., coeff7]
1282
+ */
1283
+ samplePath(initial: Float64Array, t_end: number, num_steps: number): Float64Array;
1284
+ /**
1285
+ * Compute expected value at time t given initial value
1286
+ *
1287
+ * E[X(t)] = X(0) * exp(μt)
1288
+ */
1289
+ expectedValue(initial: Float64Array, t: number): Float64Array;
1290
+ /**
1291
+ * Create a new Geometric Brownian Motion process
1292
+ *
1293
+ * # Arguments
1294
+ * * `mu` - Drift coefficient (expected growth rate)
1295
+ * * `sigma` - Diffusion coefficient (volatility)
1296
+ */
1297
+ constructor(mu: number, sigma: number);
1298
+ /**
1299
+ * Get drift coefficient
1300
+ */
1301
+ getMu(): number;
1302
+ /**
1303
+ * Compute variance at time t given initial value
1304
+ *
1305
+ * Var(X(t)) = X(0)² * exp(2μt) * (exp(σ²t) - 1)
1306
+ */
1307
+ variance(initial: Float64Array, t: number): Float64Array;
1308
+ /**
1309
+ * Get diffusion coefficient
1310
+ */
1311
+ getSigma(): number;
1312
+ }
1263
1313
  /**
1264
1314
  * WASM wrapper for Geometric Cellular Automaton
1265
1315
  */
@@ -1460,6 +1510,50 @@ export class WasmGpuOptimizer {
1460
1510
  */
1461
1511
  constructor();
1462
1512
  }
1513
+ /**
1514
+ * WASM wrapper for grade-projected distribution
1515
+ *
1516
+ * A distribution that only operates on components of a specific grade.
1517
+ */
1518
+ export class WasmGradeProjectedDistribution {
1519
+ free(): void;
1520
+ /**
1521
+ * Sample and embed into full multivector (other grades are zero)
1522
+ *
1523
+ * Returns 8 coefficients
1524
+ */
1525
+ sampleFull(): Float64Array;
1526
+ /**
1527
+ * Get standard deviations
1528
+ */
1529
+ getStdDevs(): Float64Array;
1530
+ /**
1531
+ * Get number of components in this grade
1532
+ */
1533
+ getNumComponents(): number;
1534
+ /**
1535
+ * Create a grade-projected distribution from a Gaussian
1536
+ *
1537
+ * # Arguments
1538
+ * * `gaussian` - Source Gaussian distribution
1539
+ * * `grade` - Grade to project onto (0, 1, 2, or 3 for Cl(3,0,0))
1540
+ */
1541
+ constructor(gaussian: WasmGaussianMultivector, grade: number);
1542
+ /**
1543
+ * Sample from this grade-projected distribution
1544
+ *
1545
+ * Returns components for just this grade
1546
+ */
1547
+ sample(): Float64Array;
1548
+ /**
1549
+ * Get the mean for this grade's components
1550
+ */
1551
+ getMean(): Float64Array;
1552
+ /**
1553
+ * Get the grade
1554
+ */
1555
+ getGrade(): number;
1556
+ }
1463
1557
  /**
1464
1558
  * WASM wrapper for Grassmannian varieties
1465
1559
  */
@@ -1585,6 +1679,77 @@ export class WasmLebesgueMeasure {
1585
1679
  */
1586
1680
  constructor(dimension: number);
1587
1681
  }
1682
+ /**
1683
+ * WASM wrapper for MCMC diagnostics
1684
+ */
1685
+ export class WasmMCMCDiagnostics {
1686
+ private constructor();
1687
+ free(): void;
1688
+ /**
1689
+ * Check if the sampler has converged (R-hat < 1.1)
1690
+ */
1691
+ isConverged(): boolean;
1692
+ /**
1693
+ * Get effective sample size (or -1 if not computed)
1694
+ */
1695
+ getEffectiveSampleSize(): number;
1696
+ /**
1697
+ * Get R-hat statistic (or -1 if not computed)
1698
+ */
1699
+ getRHat(): number;
1700
+ /**
1701
+ * Total number of steps
1702
+ */
1703
+ num_steps: number;
1704
+ /**
1705
+ * Acceptance rate
1706
+ */
1707
+ acceptance_rate: number;
1708
+ }
1709
+ /**
1710
+ * WASM wrapper for Metropolis-Hastings MCMC sampler
1711
+ *
1712
+ * Samples from a target distribution using random-walk proposals.
1713
+ */
1714
+ export class WasmMetropolisHastings {
1715
+ free(): void;
1716
+ /**
1717
+ * Get sampling diagnostics
1718
+ */
1719
+ diagnostics(): WasmMCMCDiagnostics;
1720
+ /**
1721
+ * Get current sample
1722
+ */
1723
+ getCurrent(): Float64Array;
1724
+ /**
1725
+ * Get current acceptance rate
1726
+ */
1727
+ getAcceptanceRate(): number;
1728
+ /**
1729
+ * Create a new Metropolis-Hastings sampler for a Gaussian target
1730
+ *
1731
+ * # Arguments
1732
+ * * `target` - The target Gaussian distribution to sample from
1733
+ * * `proposal_std` - Standard deviation for the proposal distribution
1734
+ */
1735
+ constructor(target: WasmGaussianMultivector, proposal_std: number);
1736
+ /**
1737
+ * Run the sampler for multiple steps
1738
+ *
1739
+ * # Arguments
1740
+ * * `num_samples` - Number of samples to collect
1741
+ * * `burnin` - Number of burn-in steps to discard
1742
+ *
1743
+ * Returns flat array of samples (num_samples * 8)
1744
+ */
1745
+ run(num_samples: number, burnin: number): Float64Array;
1746
+ /**
1747
+ * Take a single MCMC step
1748
+ *
1749
+ * Returns the new sample (8 coefficients)
1750
+ */
1751
+ step(): Float64Array;
1752
+ }
1588
1753
  /**
1589
1754
  * WASM wrapper for moduli spaces (simplified)
1590
1755
  */
@@ -2632,6 +2797,67 @@ export class WasmTropicalViterbi {
2632
2797
  */
2633
2798
  decode(observations: Uint32Array): any;
2634
2799
  }
2800
+ /**
2801
+ * WASM wrapper for uncertain multivector (mean + covariance)
2802
+ *
2803
+ * Represents a multivector with associated uncertainty, useful for
2804
+ * error propagation through geometric operations.
2805
+ */
2806
+ export class WasmUncertainMultivector {
2807
+ free(): void;
2808
+ /**
2809
+ * Get standard deviations
2810
+ */
2811
+ getStdDevs(): Float64Array;
2812
+ /**
2813
+ * Create a deterministic (zero variance) uncertain multivector
2814
+ */
2815
+ static deterministic(value: Float64Array): WasmUncertainMultivector;
2816
+ /**
2817
+ * Get variances (diagonal of covariance)
2818
+ */
2819
+ getVariances(): Float64Array;
2820
+ /**
2821
+ * Get the covariance matrix (64 values, row-major)
2822
+ */
2823
+ getCovariance(): Float64Array;
2824
+ /**
2825
+ * Create with full covariance matrix
2826
+ *
2827
+ * # Arguments
2828
+ * * `mean` - 8 coefficients for the mean
2829
+ * * `covariance` - 64 values for 8x8 covariance matrix (row-major)
2830
+ */
2831
+ static withCovariance(mean: Float64Array, covariance: Float64Array): WasmUncertainMultivector;
2832
+ /**
2833
+ * Get total variance (trace of covariance)
2834
+ */
2835
+ getTotalVariance(): number;
2836
+ /**
2837
+ * Add two uncertain multivectors (assuming independence)
2838
+ *
2839
+ * For Z = X + Y: E[Z] = E[X] + E[Y], Var(Z) = Var(X) + Var(Y)
2840
+ */
2841
+ add(other: WasmUncertainMultivector): WasmUncertainMultivector;
2842
+ /**
2843
+ * Create an uncertain multivector with diagonal covariance
2844
+ *
2845
+ * # Arguments
2846
+ * * `mean` - 8 coefficients for the mean
2847
+ * * `variances` - 8 values for per-coefficient variance
2848
+ */
2849
+ constructor(mean: Float64Array, variances: Float64Array);
2850
+ /**
2851
+ * Linear propagation: scale by a constant
2852
+ *
2853
+ * For Y = aX: E[Y] = aE[X], Var(Y) = a²Var(X)
2854
+ */
2855
+ scale(scalar: number): WasmUncertainMultivector;
2856
+ /**
2857
+ * Get the mean
2858
+ */
2859
+ getMean(): Float64Array;
2860
+ }
2635
2861
  /**
2636
2862
  * WASM wrapper for Uniform distribution on Cl(3,0,0) multivector space
2637
2863
  *
@@ -2690,17 +2916,49 @@ export class WasmUniformMultivector {
2690
2916
  */
2691
2917
  static hypercube(min: number, max: number): WasmUniformMultivector;
2692
2918
  }
2919
+ /**
2920
+ * WASM wrapper for Wiener process (Brownian motion)
2921
+ *
2922
+ * Standard Brownian motion W(t) with W(0) = 0
2923
+ */
2924
+ export class WasmWienerProcess {
2925
+ free(): void;
2926
+ /**
2927
+ * Sample a path of the Wiener process
2928
+ *
2929
+ * # Arguments
2930
+ * * `t_end` - End time
2931
+ * * `num_steps` - Number of time steps
2932
+ *
2933
+ * Returns flat array: (num_steps + 1) * (dim + 1) values
2934
+ * Each point is [time, w0, w1, ...]
2935
+ */
2936
+ samplePath(t_end: number, num_steps: number): Float64Array;
2937
+ /**
2938
+ * Create a new Wiener process
2939
+ *
2940
+ * # Arguments
2941
+ * * `dim` - Dimension of the process (default 8 for multivector space)
2942
+ */
2943
+ constructor(dim?: number | null);
2944
+ /**
2945
+ * Get dimension
2946
+ */
2947
+ getDim(): number;
2948
+ }
2693
2949
 
2694
2950
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
2695
2951
 
2696
2952
  export interface InitOutput {
2697
2953
  readonly memory: WebAssembly.Memory;
2698
2954
  readonly __wbg_autodiff_free: (a: number, b: number) => void;
2699
- readonly __wbg_get_wasmtrajectorypoint_time: (a: number) => number;
2955
+ readonly __wbg_get_wasmmcmcdiagnostics_acceptance_rate: (a: number) => number;
2956
+ readonly __wbg_get_wasmmcmcdiagnostics_num_steps: (a: number) => number;
2700
2957
  readonly __wbg_numericalderivative_free: (a: number, b: number) => void;
2701
2958
  readonly __wbg_riemannianmanifold_free: (a: number, b: number) => void;
2702
2959
  readonly __wbg_scalarfield_free: (a: number, b: number) => void;
2703
- readonly __wbg_set_wasmtrajectorypoint_time: (a: number, b: number) => void;
2960
+ readonly __wbg_set_wasmmcmcdiagnostics_acceptance_rate: (a: number, b: number) => void;
2961
+ readonly __wbg_set_wasmmcmcdiagnostics_num_steps: (a: number, b: number) => void;
2704
2962
  readonly __wbg_wasmchowclass_free: (a: number, b: number) => void;
2705
2963
  readonly __wbg_wasmcommunity_free: (a: number, b: number) => void;
2706
2964
  readonly __wbg_wasmduallyflatmanifold_free: (a: number, b: number) => void;
@@ -2711,10 +2969,13 @@ export interface InitOutput {
2711
2969
  readonly __wbg_wasmgeodesicintegrator_free: (a: number, b: number) => void;
2712
2970
  readonly __wbg_wasmgeometricca_free: (a: number, b: number) => void;
2713
2971
  readonly __wbg_wasmgeometricnetwork_free: (a: number, b: number) => void;
2972
+ readonly __wbg_wasmgradeprojecteddistribution_free: (a: number, b: number) => void;
2714
2973
  readonly __wbg_wasmgrassmannian_free: (a: number, b: number) => void;
2715
2974
  readonly __wbg_wasmholographicmemory_free: (a: number, b: number) => void;
2716
2975
  readonly __wbg_wasminversecadesigner_free: (a: number, b: number) => void;
2717
2976
  readonly __wbg_wasmlebesguemeasure_free: (a: number, b: number) => void;
2977
+ readonly __wbg_wasmmcmcdiagnostics_free: (a: number, b: number) => void;
2978
+ readonly __wbg_wasmmetropolishastings_free: (a: number, b: number) => void;
2718
2979
  readonly __wbg_wasmmodulispace_free: (a: number, b: number) => void;
2719
2980
  readonly __wbg_wasmmultidualnumber_free: (a: number, b: number) => void;
2720
2981
  readonly __wbg_wasmmultivector_free: (a: number, b: number) => void;
@@ -2723,7 +2984,6 @@ export interface InitOutput {
2723
2984
  readonly __wbg_wasmpropagationanalysis_free: (a: number, b: number) => void;
2724
2985
  readonly __wbg_wasmrelativisticparticle_free: (a: number, b: number) => void;
2725
2986
  readonly __wbg_wasmresonator_free: (a: number, b: number) => void;
2726
- readonly __wbg_wasmschwarzschildmetric_free: (a: number, b: number) => void;
2727
2987
  readonly __wbg_wasmselfassembler_free: (a: number, b: number) => void;
2728
2988
  readonly __wbg_wasmsensitivitymap_free: (a: number, b: number) => void;
2729
2989
  readonly __wbg_wasmtrajectorypoint_free: (a: number, b: number) => void;
@@ -2731,6 +2991,7 @@ export interface InitOutput {
2731
2991
  readonly __wbg_wasmtropicalnetwork_free: (a: number, b: number) => void;
2732
2992
  readonly __wbg_wasmtropicalpolynomial_free: (a: number, b: number) => void;
2733
2993
  readonly __wbg_wasmtropicalviterbi_free: (a: number, b: number) => void;
2994
+ readonly __wbg_wasmuncertainmultivector_free: (a: number, b: number) => void;
2734
2995
  readonly __wbg_wasmuniformmultivector_free: (a: number, b: number) => void;
2735
2996
  readonly autodiff_evaluatePolynomial: (a: number, b: number, c: number) => number;
2736
2997
  readonly autodiff_linearLayer: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
@@ -2903,6 +3164,9 @@ export interface InitOutput {
2903
3164
  readonly wasmgaussianmultivector_withParameters: (a: number, b: number, c: number, d: number) => [number, number, number];
2904
3165
  readonly wasmgeodesicintegrator_propagate_particle: (a: number, b: number, c: number, d: number) => [number, number, number];
2905
3166
  readonly wasmgeodesicintegrator_with_schwarzschild: (a: number) => number;
3167
+ readonly wasmgeometricbrownianmotion_expectedValue: (a: number, b: number, c: number, d: number) => [number, number, number, number];
3168
+ readonly wasmgeometricbrownianmotion_samplePath: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
3169
+ readonly wasmgeometricbrownianmotion_variance: (a: number, b: number, c: number, d: number) => [number, number, number, number];
2906
3170
  readonly wasmgeometricca_addGlider: (a: number, b: number, c: number) => [number, number];
2907
3171
  readonly wasmgeometricca_addRandomPattern: (a: number, b: number) => [number, number];
2908
3172
  readonly wasmgeometricca_generation: (a: number) => number;
@@ -2945,6 +3209,12 @@ export interface InitOutput {
2945
3209
  readonly wasmgpuoptimizer_isGpuAvailable: (a: number) => number;
2946
3210
  readonly wasmgpuoptimizer_optimizeBatch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
2947
3211
  readonly wasmgpuoptimizer_optimizeQuadraticGpu: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
3212
+ readonly wasmgradeprojecteddistribution_getMean: (a: number) => [number, number];
3213
+ readonly wasmgradeprojecteddistribution_getNumComponents: (a: number) => number;
3214
+ readonly wasmgradeprojecteddistribution_getStdDevs: (a: number) => [number, number];
3215
+ readonly wasmgradeprojecteddistribution_new: (a: number, b: number) => [number, number, number];
3216
+ readonly wasmgradeprojecteddistribution_sample: (a: number) => [number, number];
3217
+ readonly wasmgradeprojecteddistribution_sampleFull: (a: number) => [number, number];
2948
3218
  readonly wasmgrassmannian_getDimension: (a: number) => number;
2949
3219
  readonly wasmgrassmannian_getParameters: (a: number) => [number, number];
2950
3220
  readonly wasmgrassmannian_new: (a: number, b: number) => [number, number, number];
@@ -2967,6 +3237,15 @@ export interface InitOutput {
2967
3237
  readonly wasmlebesguemeasure_measureBox: (a: number, b: number, c: number) => [number, number, number];
2968
3238
  readonly wasmlebesguemeasure_measureInterval: (a: number, b: number, c: number, d: number, e: number) => [number, number, number];
2969
3239
  readonly wasmlebesguemeasure_new: (a: number) => [number, number, number];
3240
+ readonly wasmmcmcdiagnostics_getEffectiveSampleSize: (a: number) => number;
3241
+ readonly wasmmcmcdiagnostics_getRHat: (a: number) => number;
3242
+ readonly wasmmcmcdiagnostics_isConverged: (a: number) => number;
3243
+ readonly wasmmetropolishastings_diagnostics: (a: number) => number;
3244
+ readonly wasmmetropolishastings_getAcceptanceRate: (a: number) => number;
3245
+ readonly wasmmetropolishastings_getCurrent: (a: number) => [number, number];
3246
+ readonly wasmmetropolishastings_new: (a: number, b: number) => number;
3247
+ readonly wasmmetropolishastings_run: (a: number, b: number, c: number) => [number, number];
3248
+ readonly wasmmetropolishastings_step: (a: number) => [number, number];
2970
3249
  readonly wasmmodulispace_expectedDimension: (a: number) => number;
2971
3250
  readonly wasmmodulispace_getMarkedPoints: (a: number) => number;
2972
3251
  readonly wasmmodulispace_isProper: (a: number) => number;
@@ -3136,6 +3415,16 @@ export interface InitOutput {
3136
3415
  readonly wasmtropicalviterbi_decode: (a: number, b: number, c: number) => [number, number, number];
3137
3416
  readonly wasmtropicalviterbi_forward_probabilities: (a: number, b: number, c: number) => [number, number, number];
3138
3417
  readonly wasmtropicalviterbi_new: (a: any, b: any) => [number, number, number];
3418
+ readonly wasmuncertainmultivector_add: (a: number, b: number) => number;
3419
+ readonly wasmuncertainmultivector_deterministic: (a: number, b: number) => [number, number, number];
3420
+ readonly wasmuncertainmultivector_getCovariance: (a: number) => [number, number];
3421
+ readonly wasmuncertainmultivector_getMean: (a: number) => [number, number];
3422
+ readonly wasmuncertainmultivector_getStdDevs: (a: number) => [number, number];
3423
+ readonly wasmuncertainmultivector_getTotalVariance: (a: number) => number;
3424
+ readonly wasmuncertainmultivector_getVariances: (a: number) => [number, number];
3425
+ readonly wasmuncertainmultivector_new: (a: number, b: number, c: number, d: number) => [number, number, number];
3426
+ readonly wasmuncertainmultivector_scale: (a: number, b: number) => number;
3427
+ readonly wasmuncertainmultivector_withCovariance: (a: number, b: number, c: number, d: number) => [number, number, number];
3139
3428
  readonly wasmuniformmultivector_getLower: (a: number) => [number, number];
3140
3429
  readonly wasmuniformmultivector_getMean: (a: number) => [number, number];
3141
3430
  readonly wasmuniformmultivector_getUpper: (a: number) => [number, number];
@@ -3146,9 +3435,12 @@ export interface InitOutput {
3146
3435
  readonly wasmuniformmultivector_sample: (a: number) => [number, number];
3147
3436
  readonly wasmuniformmultivector_sampleBatch: (a: number, b: number) => [number, number];
3148
3437
  readonly wasmuniformmultivector_withBounds: (a: number, b: number, c: number, d: number) => [number, number, number];
3438
+ readonly wasmwienerprocess_new: (a: number) => number;
3439
+ readonly wasmwienerprocess_samplePath: (a: number, b: number, c: number) => [number, number];
3149
3440
  readonly wasmtropicalnumber_new: (a: number) => number;
3150
3441
  readonly vectorfield_fromFunction2D: (a: any) => number;
3151
3442
  readonly vectorfield_fromFunction3D: (a: any) => number;
3443
+ readonly __wbg_set_wasmtrajectorypoint_time: (a: number, b: number) => void;
3152
3444
  readonly wasmmultivector_norm: (a: number) => number;
3153
3445
  readonly wasmspacetimevector_t: (a: number) => number;
3154
3446
  readonly wasmtropicalnumber_zero: () => number;
@@ -3160,13 +3452,18 @@ export interface InitOutput {
3160
3452
  readonly __wbg_wasmprobabilitymeasure_free: (a: number, b: number) => void;
3161
3453
  readonly __wbg_vectorfield_free: (a: number, b: number) => void;
3162
3454
  readonly vectorfield_new: (a: any, b: number) => number;
3455
+ readonly wasmgeometricbrownianmotion_new: (a: number, b: number) => number;
3163
3456
  readonly wasmtropicalnumber_isZero: (a: number) => number;
3164
3457
  readonly wasmtropicalnumber_tropicalAdd: (a: number, b: number) => number;
3458
+ readonly __wbg_get_wasmtrajectorypoint_time: (a: number) => number;
3165
3459
  readonly wasmcommunity_cohesion_score: (a: number) => number;
3166
3460
  readonly wasmdualnumber_getReal: (a: number) => number;
3167
3461
  readonly wasmevaluationresult_getBestPathScore: (a: number) => number;
3168
3462
  readonly wasmevaluationresult_getGradientNorm: (a: number) => number;
3463
+ readonly wasmgeometricbrownianmotion_getMu: (a: number) => number;
3464
+ readonly wasmgeometricbrownianmotion_getSigma: (a: number) => number;
3169
3465
  readonly wasmgeometricedge_weight: (a: number) => number;
3466
+ readonly wasmgradeprojecteddistribution_getGrade: (a: number) => number;
3170
3467
  readonly wasmmodulispace_getGenus: (a: number) => number;
3171
3468
  readonly wasmmultidualnumber_getReal: (a: number) => number;
3172
3469
  readonly wasmoptimizationresult_iterations: (a: number) => number;
@@ -3180,6 +3477,7 @@ export interface InitOutput {
3180
3477
  readonly wasmtropicalcurve_getGenus: (a: number) => number;
3181
3478
  readonly wasmtropicalnetwork_getSize: (a: number) => number;
3182
3479
  readonly wasmtropicalnumber_getValue: (a: number) => number;
3480
+ readonly wasmwienerprocess_getDim: (a: number) => number;
3183
3481
  readonly __wbg_automatabatchoperations_free: (a: number, b: number) => void;
3184
3482
  readonly __wbg_automatautils_free: (a: number, b: number) => void;
3185
3483
  readonly __wbg_batchoperations_free: (a: number, b: number) => void;
@@ -3199,6 +3497,7 @@ export interface InitOutput {
3199
3497
  readonly __wbg_wasmcountingmeasure_free: (a: number, b: number) => void;
3200
3498
  readonly __wbg_wasmdualnumber_free: (a: number, b: number) => void;
3201
3499
  readonly __wbg_wasmfourvelocity_free: (a: number, b: number) => void;
3500
+ readonly __wbg_wasmgeometricbrownianmotion_free: (a: number, b: number) => void;
3202
3501
  readonly __wbg_wasmgeometricedge_free: (a: number, b: number) => void;
3203
3502
  readonly __wbg_wasmgpuoptimizer_free: (a: number, b: number) => void;
3204
3503
  readonly __wbg_wasmmontecarloestimator_free: (a: number, b: number) => void;
@@ -3206,11 +3505,13 @@ export interface InitOutput {
3206
3505
  readonly __wbg_wasmoptimizationutils_free: (a: number, b: number) => void;
3207
3506
  readonly __wbg_wasmprojectivespace_free: (a: number, b: number) => void;
3208
3507
  readonly __wbg_wasmrelativisticconstants_free: (a: number, b: number) => void;
3508
+ readonly __wbg_wasmschwarzschildmetric_free: (a: number, b: number) => void;
3209
3509
  readonly __wbg_wasmsimpleoptimizer_free: (a: number, b: number) => void;
3210
3510
  readonly __wbg_wasmspacetimevector_free: (a: number, b: number) => void;
3211
3511
  readonly __wbg_wasmtropicalcurve_free: (a: number, b: number) => void;
3212
3512
  readonly __wbg_wasmtropicalmeasure_free: (a: number, b: number) => void;
3213
3513
  readonly __wbg_wasmtropicalnumber_free: (a: number, b: number) => void;
3514
+ readonly __wbg_wasmwienerprocess_free: (a: number, b: number) => void;
3214
3515
  readonly __wbg_wasmmultiobjectiveresult_free: (a: number, b: number) => void;
3215
3516
  readonly wasmrotor_inverse: (a: number) => number;
3216
3517
  readonly __wbg_wasmrotor_free: (a: number, b: number) => void;
package/amari_wasm.js CHANGED
@@ -432,7 +432,7 @@ function __wbg_adapter_28(arg0, arg1, arg2) {
432
432
  wasm.closure41_externref_shim(arg0, arg1, arg2);
433
433
  }
434
434
 
435
- function __wbg_adapter_511(arg0, arg1, arg2, arg3) {
435
+ function __wbg_adapter_550(arg0, arg1, arg2, arg3) {
436
436
  wasm.closure34_externref_shim(arg0, arg1, arg2, arg3);
437
437
  }
438
438
 
@@ -3604,6 +3604,126 @@ export class WasmGeodesicIntegrator {
3604
3604
  }
3605
3605
  }
3606
3606
 
3607
+ const WasmGeometricBrownianMotionFinalization = (typeof FinalizationRegistry === 'undefined')
3608
+ ? { register: () => {}, unregister: () => {} }
3609
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmgeometricbrownianmotion_free(ptr >>> 0, 1));
3610
+ /**
3611
+ * WASM wrapper for Geometric Brownian Motion on multivector space
3612
+ *
3613
+ * dX = μX dt + σX dW
3614
+ *
3615
+ * Useful for modeling multiplicative noise processes in geometric algebra.
3616
+ */
3617
+ export class WasmGeometricBrownianMotion {
3618
+
3619
+ __destroy_into_raw() {
3620
+ const ptr = this.__wbg_ptr;
3621
+ this.__wbg_ptr = 0;
3622
+ WasmGeometricBrownianMotionFinalization.unregister(this);
3623
+ return ptr;
3624
+ }
3625
+
3626
+ free() {
3627
+ const ptr = this.__destroy_into_raw();
3628
+ wasm.__wbg_wasmgeometricbrownianmotion_free(ptr, 0);
3629
+ }
3630
+ /**
3631
+ * Sample a single path of the process
3632
+ *
3633
+ * # Arguments
3634
+ * * `initial` - Initial multivector (8 coefficients)
3635
+ * * `t_end` - End time
3636
+ * * `num_steps` - Number of time steps
3637
+ *
3638
+ * Returns flat array: (num_steps + 1) * 9 values
3639
+ * Each point is [time, coeff0, coeff1, ..., coeff7]
3640
+ * @param {Float64Array} initial
3641
+ * @param {number} t_end
3642
+ * @param {number} num_steps
3643
+ * @returns {Float64Array}
3644
+ */
3645
+ samplePath(initial, t_end, num_steps) {
3646
+ const ptr0 = passArrayF64ToWasm0(initial, wasm.__wbindgen_malloc);
3647
+ const len0 = WASM_VECTOR_LEN;
3648
+ const ret = wasm.wasmgeometricbrownianmotion_samplePath(this.__wbg_ptr, ptr0, len0, t_end, num_steps);
3649
+ if (ret[3]) {
3650
+ throw takeFromExternrefTable0(ret[2]);
3651
+ }
3652
+ var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
3653
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
3654
+ return v2;
3655
+ }
3656
+ /**
3657
+ * Compute expected value at time t given initial value
3658
+ *
3659
+ * E[X(t)] = X(0) * exp(μt)
3660
+ * @param {Float64Array} initial
3661
+ * @param {number} t
3662
+ * @returns {Float64Array}
3663
+ */
3664
+ expectedValue(initial, t) {
3665
+ const ptr0 = passArrayF64ToWasm0(initial, wasm.__wbindgen_malloc);
3666
+ const len0 = WASM_VECTOR_LEN;
3667
+ const ret = wasm.wasmgeometricbrownianmotion_expectedValue(this.__wbg_ptr, ptr0, len0, t);
3668
+ if (ret[3]) {
3669
+ throw takeFromExternrefTable0(ret[2]);
3670
+ }
3671
+ var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
3672
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
3673
+ return v2;
3674
+ }
3675
+ /**
3676
+ * Create a new Geometric Brownian Motion process
3677
+ *
3678
+ * # Arguments
3679
+ * * `mu` - Drift coefficient (expected growth rate)
3680
+ * * `sigma` - Diffusion coefficient (volatility)
3681
+ * @param {number} mu
3682
+ * @param {number} sigma
3683
+ */
3684
+ constructor(mu, sigma) {
3685
+ const ret = wasm.wasmdualnumber_new(mu, sigma);
3686
+ this.__wbg_ptr = ret >>> 0;
3687
+ WasmGeometricBrownianMotionFinalization.register(this, this.__wbg_ptr, this);
3688
+ return this;
3689
+ }
3690
+ /**
3691
+ * Get drift coefficient
3692
+ * @returns {number}
3693
+ */
3694
+ getMu() {
3695
+ const ret = wasm.wasmalphaconnection_getAlpha(this.__wbg_ptr);
3696
+ return ret;
3697
+ }
3698
+ /**
3699
+ * Compute variance at time t given initial value
3700
+ *
3701
+ * Var(X(t)) = X(0)² * exp(2μt) * (exp(σ²t) - 1)
3702
+ * @param {Float64Array} initial
3703
+ * @param {number} t
3704
+ * @returns {Float64Array}
3705
+ */
3706
+ variance(initial, t) {
3707
+ const ptr0 = passArrayF64ToWasm0(initial, wasm.__wbindgen_malloc);
3708
+ const len0 = WASM_VECTOR_LEN;
3709
+ const ret = wasm.wasmgeometricbrownianmotion_variance(this.__wbg_ptr, ptr0, len0, t);
3710
+ if (ret[3]) {
3711
+ throw takeFromExternrefTable0(ret[2]);
3712
+ }
3713
+ var v2 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
3714
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
3715
+ return v2;
3716
+ }
3717
+ /**
3718
+ * Get diffusion coefficient
3719
+ * @returns {number}
3720
+ */
3721
+ getSigma() {
3722
+ const ret = wasm.wasmdualnumber_getDual(this.__wbg_ptr);
3723
+ return ret;
3724
+ }
3725
+ }
3726
+
3607
3727
  const WasmGeometricCAFinalization = (typeof FinalizationRegistry === 'undefined')
3608
3728
  ? { register: () => {}, unregister: () => {} }
3609
3729
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmgeometricca_free(ptr >>> 0, 1));
@@ -4183,6 +4303,108 @@ export class WasmGpuOptimizer {
4183
4303
  }
4184
4304
  }
4185
4305
 
4306
+ const WasmGradeProjectedDistributionFinalization = (typeof FinalizationRegistry === 'undefined')
4307
+ ? { register: () => {}, unregister: () => {} }
4308
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmgradeprojecteddistribution_free(ptr >>> 0, 1));
4309
+ /**
4310
+ * WASM wrapper for grade-projected distribution
4311
+ *
4312
+ * A distribution that only operates on components of a specific grade.
4313
+ */
4314
+ export class WasmGradeProjectedDistribution {
4315
+
4316
+ __destroy_into_raw() {
4317
+ const ptr = this.__wbg_ptr;
4318
+ this.__wbg_ptr = 0;
4319
+ WasmGradeProjectedDistributionFinalization.unregister(this);
4320
+ return ptr;
4321
+ }
4322
+
4323
+ free() {
4324
+ const ptr = this.__destroy_into_raw();
4325
+ wasm.__wbg_wasmgradeprojecteddistribution_free(ptr, 0);
4326
+ }
4327
+ /**
4328
+ * Sample and embed into full multivector (other grades are zero)
4329
+ *
4330
+ * Returns 8 coefficients
4331
+ * @returns {Float64Array}
4332
+ */
4333
+ sampleFull() {
4334
+ const ret = wasm.wasmgradeprojecteddistribution_sampleFull(this.__wbg_ptr);
4335
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
4336
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
4337
+ return v1;
4338
+ }
4339
+ /**
4340
+ * Get standard deviations
4341
+ * @returns {Float64Array}
4342
+ */
4343
+ getStdDevs() {
4344
+ const ret = wasm.wasmgradeprojecteddistribution_getStdDevs(this.__wbg_ptr);
4345
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
4346
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
4347
+ return v1;
4348
+ }
4349
+ /**
4350
+ * Get number of components in this grade
4351
+ * @returns {number}
4352
+ */
4353
+ getNumComponents() {
4354
+ const ret = wasm.wasmgradeprojecteddistribution_getNumComponents(this.__wbg_ptr);
4355
+ return ret >>> 0;
4356
+ }
4357
+ /**
4358
+ * Create a grade-projected distribution from a Gaussian
4359
+ *
4360
+ * # Arguments
4361
+ * * `gaussian` - Source Gaussian distribution
4362
+ * * `grade` - Grade to project onto (0, 1, 2, or 3 for Cl(3,0,0))
4363
+ * @param {WasmGaussianMultivector} gaussian
4364
+ * @param {number} grade
4365
+ */
4366
+ constructor(gaussian, grade) {
4367
+ _assertClass(gaussian, WasmGaussianMultivector);
4368
+ const ret = wasm.wasmgradeprojecteddistribution_new(gaussian.__wbg_ptr, grade);
4369
+ if (ret[2]) {
4370
+ throw takeFromExternrefTable0(ret[1]);
4371
+ }
4372
+ this.__wbg_ptr = ret[0] >>> 0;
4373
+ WasmGradeProjectedDistributionFinalization.register(this, this.__wbg_ptr, this);
4374
+ return this;
4375
+ }
4376
+ /**
4377
+ * Sample from this grade-projected distribution
4378
+ *
4379
+ * Returns components for just this grade
4380
+ * @returns {Float64Array}
4381
+ */
4382
+ sample() {
4383
+ const ret = wasm.wasmgradeprojecteddistribution_sample(this.__wbg_ptr);
4384
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
4385
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
4386
+ return v1;
4387
+ }
4388
+ /**
4389
+ * Get the mean for this grade's components
4390
+ * @returns {Float64Array}
4391
+ */
4392
+ getMean() {
4393
+ const ret = wasm.wasmgradeprojecteddistribution_getMean(this.__wbg_ptr);
4394
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
4395
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
4396
+ return v1;
4397
+ }
4398
+ /**
4399
+ * Get the grade
4400
+ * @returns {number}
4401
+ */
4402
+ getGrade() {
4403
+ const ret = wasm.riemannianmanifold_dimension(this.__wbg_ptr);
4404
+ return ret >>> 0;
4405
+ }
4406
+ }
4407
+
4186
4408
  const WasmGrassmannianFinalization = (typeof FinalizationRegistry === 'undefined')
4187
4409
  ? { register: () => {}, unregister: () => {} }
4188
4410
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmgrassmannian_free(ptr >>> 0, 1));
@@ -4535,6 +4757,184 @@ export class WasmLebesgueMeasure {
4535
4757
  }
4536
4758
  }
4537
4759
 
4760
+ const WasmMCMCDiagnosticsFinalization = (typeof FinalizationRegistry === 'undefined')
4761
+ ? { register: () => {}, unregister: () => {} }
4762
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmmcmcdiagnostics_free(ptr >>> 0, 1));
4763
+ /**
4764
+ * WASM wrapper for MCMC diagnostics
4765
+ */
4766
+ export class WasmMCMCDiagnostics {
4767
+
4768
+ static __wrap(ptr) {
4769
+ ptr = ptr >>> 0;
4770
+ const obj = Object.create(WasmMCMCDiagnostics.prototype);
4771
+ obj.__wbg_ptr = ptr;
4772
+ WasmMCMCDiagnosticsFinalization.register(obj, obj.__wbg_ptr, obj);
4773
+ return obj;
4774
+ }
4775
+
4776
+ __destroy_into_raw() {
4777
+ const ptr = this.__wbg_ptr;
4778
+ this.__wbg_ptr = 0;
4779
+ WasmMCMCDiagnosticsFinalization.unregister(this);
4780
+ return ptr;
4781
+ }
4782
+
4783
+ free() {
4784
+ const ptr = this.__destroy_into_raw();
4785
+ wasm.__wbg_wasmmcmcdiagnostics_free(ptr, 0);
4786
+ }
4787
+ /**
4788
+ * Total number of steps
4789
+ * @returns {number}
4790
+ */
4791
+ get num_steps() {
4792
+ const ret = wasm.__wbg_get_wasmmcmcdiagnostics_num_steps(this.__wbg_ptr);
4793
+ return ret >>> 0;
4794
+ }
4795
+ /**
4796
+ * Total number of steps
4797
+ * @param {number} arg0
4798
+ */
4799
+ set num_steps(arg0) {
4800
+ wasm.__wbg_set_wasmmcmcdiagnostics_num_steps(this.__wbg_ptr, arg0);
4801
+ }
4802
+ /**
4803
+ * Acceptance rate
4804
+ * @returns {number}
4805
+ */
4806
+ get acceptance_rate() {
4807
+ const ret = wasm.__wbg_get_wasmmcmcdiagnostics_acceptance_rate(this.__wbg_ptr);
4808
+ return ret;
4809
+ }
4810
+ /**
4811
+ * Acceptance rate
4812
+ * @param {number} arg0
4813
+ */
4814
+ set acceptance_rate(arg0) {
4815
+ wasm.__wbg_set_wasmmcmcdiagnostics_acceptance_rate(this.__wbg_ptr, arg0);
4816
+ }
4817
+ /**
4818
+ * Check if the sampler has converged (R-hat < 1.1)
4819
+ * @returns {boolean}
4820
+ */
4821
+ isConverged() {
4822
+ const ret = wasm.wasmmcmcdiagnostics_isConverged(this.__wbg_ptr);
4823
+ return ret !== 0;
4824
+ }
4825
+ /**
4826
+ * Get effective sample size (or -1 if not computed)
4827
+ * @returns {number}
4828
+ */
4829
+ getEffectiveSampleSize() {
4830
+ const ret = wasm.wasmmcmcdiagnostics_getEffectiveSampleSize(this.__wbg_ptr);
4831
+ return ret;
4832
+ }
4833
+ /**
4834
+ * Get R-hat statistic (or -1 if not computed)
4835
+ * @returns {number}
4836
+ */
4837
+ getRHat() {
4838
+ const ret = wasm.wasmmcmcdiagnostics_getRHat(this.__wbg_ptr);
4839
+ return ret;
4840
+ }
4841
+ }
4842
+
4843
+ const WasmMetropolisHastingsFinalization = (typeof FinalizationRegistry === 'undefined')
4844
+ ? { register: () => {}, unregister: () => {} }
4845
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmmetropolishastings_free(ptr >>> 0, 1));
4846
+ /**
4847
+ * WASM wrapper for Metropolis-Hastings MCMC sampler
4848
+ *
4849
+ * Samples from a target distribution using random-walk proposals.
4850
+ */
4851
+ export class WasmMetropolisHastings {
4852
+
4853
+ __destroy_into_raw() {
4854
+ const ptr = this.__wbg_ptr;
4855
+ this.__wbg_ptr = 0;
4856
+ WasmMetropolisHastingsFinalization.unregister(this);
4857
+ return ptr;
4858
+ }
4859
+
4860
+ free() {
4861
+ const ptr = this.__destroy_into_raw();
4862
+ wasm.__wbg_wasmmetropolishastings_free(ptr, 0);
4863
+ }
4864
+ /**
4865
+ * Get sampling diagnostics
4866
+ * @returns {WasmMCMCDiagnostics}
4867
+ */
4868
+ diagnostics() {
4869
+ const ret = wasm.wasmmetropolishastings_diagnostics(this.__wbg_ptr);
4870
+ return WasmMCMCDiagnostics.__wrap(ret);
4871
+ }
4872
+ /**
4873
+ * Get current sample
4874
+ * @returns {Float64Array}
4875
+ */
4876
+ getCurrent() {
4877
+ const ret = wasm.wasmmetropolishastings_getCurrent(this.__wbg_ptr);
4878
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
4879
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
4880
+ return v1;
4881
+ }
4882
+ /**
4883
+ * Get current acceptance rate
4884
+ * @returns {number}
4885
+ */
4886
+ getAcceptanceRate() {
4887
+ const ret = wasm.wasmmetropolishastings_getAcceptanceRate(this.__wbg_ptr);
4888
+ return ret;
4889
+ }
4890
+ /**
4891
+ * Create a new Metropolis-Hastings sampler for a Gaussian target
4892
+ *
4893
+ * # Arguments
4894
+ * * `target` - The target Gaussian distribution to sample from
4895
+ * * `proposal_std` - Standard deviation for the proposal distribution
4896
+ * @param {WasmGaussianMultivector} target
4897
+ * @param {number} proposal_std
4898
+ */
4899
+ constructor(target, proposal_std) {
4900
+ _assertClass(target, WasmGaussianMultivector);
4901
+ const ret = wasm.wasmmetropolishastings_new(target.__wbg_ptr, proposal_std);
4902
+ this.__wbg_ptr = ret >>> 0;
4903
+ WasmMetropolisHastingsFinalization.register(this, this.__wbg_ptr, this);
4904
+ return this;
4905
+ }
4906
+ /**
4907
+ * Run the sampler for multiple steps
4908
+ *
4909
+ * # Arguments
4910
+ * * `num_samples` - Number of samples to collect
4911
+ * * `burnin` - Number of burn-in steps to discard
4912
+ *
4913
+ * Returns flat array of samples (num_samples * 8)
4914
+ * @param {number} num_samples
4915
+ * @param {number} burnin
4916
+ * @returns {Float64Array}
4917
+ */
4918
+ run(num_samples, burnin) {
4919
+ const ret = wasm.wasmmetropolishastings_run(this.__wbg_ptr, num_samples, burnin);
4920
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
4921
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
4922
+ return v1;
4923
+ }
4924
+ /**
4925
+ * Take a single MCMC step
4926
+ *
4927
+ * Returns the new sample (8 coefficients)
4928
+ * @returns {Float64Array}
4929
+ */
4930
+ step() {
4931
+ const ret = wasm.wasmmetropolishastings_step(this.__wbg_ptr);
4932
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
4933
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
4934
+ return v1;
4935
+ }
4936
+ }
4937
+
4538
4938
  const WasmModuliSpaceFinalization = (typeof FinalizationRegistry === 'undefined')
4539
4939
  ? { register: () => {}, unregister: () => {} }
4540
4940
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmmodulispace_free(ptr >>> 0, 1));
@@ -6506,7 +6906,7 @@ export class WasmTrajectoryPoint {
6506
6906
  * @returns {number}
6507
6907
  */
6508
6908
  get time() {
6509
- const ret = wasm.__wbg_get_wasmtrajectorypoint_time(this.__wbg_ptr);
6909
+ const ret = wasm.__wbg_get_wasmmcmcdiagnostics_acceptance_rate(this.__wbg_ptr);
6510
6910
  return ret;
6511
6911
  }
6512
6912
  /**
@@ -6514,7 +6914,7 @@ export class WasmTrajectoryPoint {
6514
6914
  * @param {number} arg0
6515
6915
  */
6516
6916
  set time(arg0) {
6517
- wasm.__wbg_set_wasmtrajectorypoint_time(this.__wbg_ptr, arg0);
6917
+ wasm.__wbg_set_wasmmcmcdiagnostics_acceptance_rate(this.__wbg_ptr, arg0);
6518
6918
  }
6519
6919
  /**
6520
6920
  * Get position
@@ -7402,6 +7802,166 @@ export class WasmTropicalViterbi {
7402
7802
  }
7403
7803
  }
7404
7804
 
7805
+ const WasmUncertainMultivectorFinalization = (typeof FinalizationRegistry === 'undefined')
7806
+ ? { register: () => {}, unregister: () => {} }
7807
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmuncertainmultivector_free(ptr >>> 0, 1));
7808
+ /**
7809
+ * WASM wrapper for uncertain multivector (mean + covariance)
7810
+ *
7811
+ * Represents a multivector with associated uncertainty, useful for
7812
+ * error propagation through geometric operations.
7813
+ */
7814
+ export class WasmUncertainMultivector {
7815
+
7816
+ static __wrap(ptr) {
7817
+ ptr = ptr >>> 0;
7818
+ const obj = Object.create(WasmUncertainMultivector.prototype);
7819
+ obj.__wbg_ptr = ptr;
7820
+ WasmUncertainMultivectorFinalization.register(obj, obj.__wbg_ptr, obj);
7821
+ return obj;
7822
+ }
7823
+
7824
+ __destroy_into_raw() {
7825
+ const ptr = this.__wbg_ptr;
7826
+ this.__wbg_ptr = 0;
7827
+ WasmUncertainMultivectorFinalization.unregister(this);
7828
+ return ptr;
7829
+ }
7830
+
7831
+ free() {
7832
+ const ptr = this.__destroy_into_raw();
7833
+ wasm.__wbg_wasmuncertainmultivector_free(ptr, 0);
7834
+ }
7835
+ /**
7836
+ * Get standard deviations
7837
+ * @returns {Float64Array}
7838
+ */
7839
+ getStdDevs() {
7840
+ const ret = wasm.wasmuncertainmultivector_getStdDevs(this.__wbg_ptr);
7841
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
7842
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
7843
+ return v1;
7844
+ }
7845
+ /**
7846
+ * Create a deterministic (zero variance) uncertain multivector
7847
+ * @param {Float64Array} value
7848
+ * @returns {WasmUncertainMultivector}
7849
+ */
7850
+ static deterministic(value) {
7851
+ const ptr0 = passArrayF64ToWasm0(value, wasm.__wbindgen_malloc);
7852
+ const len0 = WASM_VECTOR_LEN;
7853
+ const ret = wasm.wasmuncertainmultivector_deterministic(ptr0, len0);
7854
+ if (ret[2]) {
7855
+ throw takeFromExternrefTable0(ret[1]);
7856
+ }
7857
+ return WasmUncertainMultivector.__wrap(ret[0]);
7858
+ }
7859
+ /**
7860
+ * Get variances (diagonal of covariance)
7861
+ * @returns {Float64Array}
7862
+ */
7863
+ getVariances() {
7864
+ const ret = wasm.wasmuncertainmultivector_getVariances(this.__wbg_ptr);
7865
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
7866
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
7867
+ return v1;
7868
+ }
7869
+ /**
7870
+ * Get the covariance matrix (64 values, row-major)
7871
+ * @returns {Float64Array}
7872
+ */
7873
+ getCovariance() {
7874
+ const ret = wasm.wasmuncertainmultivector_getCovariance(this.__wbg_ptr);
7875
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
7876
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
7877
+ return v1;
7878
+ }
7879
+ /**
7880
+ * Create with full covariance matrix
7881
+ *
7882
+ * # Arguments
7883
+ * * `mean` - 8 coefficients for the mean
7884
+ * * `covariance` - 64 values for 8x8 covariance matrix (row-major)
7885
+ * @param {Float64Array} mean
7886
+ * @param {Float64Array} covariance
7887
+ * @returns {WasmUncertainMultivector}
7888
+ */
7889
+ static withCovariance(mean, covariance) {
7890
+ const ptr0 = passArrayF64ToWasm0(mean, wasm.__wbindgen_malloc);
7891
+ const len0 = WASM_VECTOR_LEN;
7892
+ const ptr1 = passArrayF64ToWasm0(covariance, wasm.__wbindgen_malloc);
7893
+ const len1 = WASM_VECTOR_LEN;
7894
+ const ret = wasm.wasmuncertainmultivector_withCovariance(ptr0, len0, ptr1, len1);
7895
+ if (ret[2]) {
7896
+ throw takeFromExternrefTable0(ret[1]);
7897
+ }
7898
+ return WasmUncertainMultivector.__wrap(ret[0]);
7899
+ }
7900
+ /**
7901
+ * Get total variance (trace of covariance)
7902
+ * @returns {number}
7903
+ */
7904
+ getTotalVariance() {
7905
+ const ret = wasm.wasmuncertainmultivector_getTotalVariance(this.__wbg_ptr);
7906
+ return ret;
7907
+ }
7908
+ /**
7909
+ * Add two uncertain multivectors (assuming independence)
7910
+ *
7911
+ * For Z = X + Y: E[Z] = E[X] + E[Y], Var(Z) = Var(X) + Var(Y)
7912
+ * @param {WasmUncertainMultivector} other
7913
+ * @returns {WasmUncertainMultivector}
7914
+ */
7915
+ add(other) {
7916
+ _assertClass(other, WasmUncertainMultivector);
7917
+ const ret = wasm.wasmuncertainmultivector_add(this.__wbg_ptr, other.__wbg_ptr);
7918
+ return WasmUncertainMultivector.__wrap(ret);
7919
+ }
7920
+ /**
7921
+ * Create an uncertain multivector with diagonal covariance
7922
+ *
7923
+ * # Arguments
7924
+ * * `mean` - 8 coefficients for the mean
7925
+ * * `variances` - 8 values for per-coefficient variance
7926
+ * @param {Float64Array} mean
7927
+ * @param {Float64Array} variances
7928
+ */
7929
+ constructor(mean, variances) {
7930
+ const ptr0 = passArrayF64ToWasm0(mean, wasm.__wbindgen_malloc);
7931
+ const len0 = WASM_VECTOR_LEN;
7932
+ const ptr1 = passArrayF64ToWasm0(variances, wasm.__wbindgen_malloc);
7933
+ const len1 = WASM_VECTOR_LEN;
7934
+ const ret = wasm.wasmuncertainmultivector_new(ptr0, len0, ptr1, len1);
7935
+ if (ret[2]) {
7936
+ throw takeFromExternrefTable0(ret[1]);
7937
+ }
7938
+ this.__wbg_ptr = ret[0] >>> 0;
7939
+ WasmUncertainMultivectorFinalization.register(this, this.__wbg_ptr, this);
7940
+ return this;
7941
+ }
7942
+ /**
7943
+ * Linear propagation: scale by a constant
7944
+ *
7945
+ * For Y = aX: E[Y] = aE[X], Var(Y) = a²Var(X)
7946
+ * @param {number} scalar
7947
+ * @returns {WasmUncertainMultivector}
7948
+ */
7949
+ scale(scalar) {
7950
+ const ret = wasm.wasmuncertainmultivector_scale(this.__wbg_ptr, scalar);
7951
+ return WasmUncertainMultivector.__wrap(ret);
7952
+ }
7953
+ /**
7954
+ * Get the mean
7955
+ * @returns {Float64Array}
7956
+ */
7957
+ getMean() {
7958
+ const ret = wasm.wasmuncertainmultivector_getMean(this.__wbg_ptr);
7959
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
7960
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
7961
+ return v1;
7962
+ }
7963
+ }
7964
+
7405
7965
  const WasmUniformMultivectorFinalization = (typeof FinalizationRegistry === 'undefined')
7406
7966
  ? { register: () => {}, unregister: () => {} }
7407
7967
  : new FinalizationRegistry(ptr => wasm.__wbg_wasmuniformmultivector_free(ptr >>> 0, 1));
@@ -7560,6 +8120,69 @@ export class WasmUniformMultivector {
7560
8120
  }
7561
8121
  }
7562
8122
 
8123
+ const WasmWienerProcessFinalization = (typeof FinalizationRegistry === 'undefined')
8124
+ ? { register: () => {}, unregister: () => {} }
8125
+ : new FinalizationRegistry(ptr => wasm.__wbg_wasmwienerprocess_free(ptr >>> 0, 1));
8126
+ /**
8127
+ * WASM wrapper for Wiener process (Brownian motion)
8128
+ *
8129
+ * Standard Brownian motion W(t) with W(0) = 0
8130
+ */
8131
+ export class WasmWienerProcess {
8132
+
8133
+ __destroy_into_raw() {
8134
+ const ptr = this.__wbg_ptr;
8135
+ this.__wbg_ptr = 0;
8136
+ WasmWienerProcessFinalization.unregister(this);
8137
+ return ptr;
8138
+ }
8139
+
8140
+ free() {
8141
+ const ptr = this.__destroy_into_raw();
8142
+ wasm.__wbg_wasmwienerprocess_free(ptr, 0);
8143
+ }
8144
+ /**
8145
+ * Sample a path of the Wiener process
8146
+ *
8147
+ * # Arguments
8148
+ * * `t_end` - End time
8149
+ * * `num_steps` - Number of time steps
8150
+ *
8151
+ * Returns flat array: (num_steps + 1) * (dim + 1) values
8152
+ * Each point is [time, w0, w1, ...]
8153
+ * @param {number} t_end
8154
+ * @param {number} num_steps
8155
+ * @returns {Float64Array}
8156
+ */
8157
+ samplePath(t_end, num_steps) {
8158
+ const ret = wasm.wasmwienerprocess_samplePath(this.__wbg_ptr, t_end, num_steps);
8159
+ var v1 = getArrayF64FromWasm0(ret[0], ret[1]).slice();
8160
+ wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
8161
+ return v1;
8162
+ }
8163
+ /**
8164
+ * Create a new Wiener process
8165
+ *
8166
+ * # Arguments
8167
+ * * `dim` - Dimension of the process (default 8 for multivector space)
8168
+ * @param {number | null} [dim]
8169
+ */
8170
+ constructor(dim) {
8171
+ const ret = wasm.wasmwienerprocess_new(isLikeNone(dim) ? 0x100000001 : (dim) >>> 0);
8172
+ this.__wbg_ptr = ret >>> 0;
8173
+ WasmWienerProcessFinalization.register(this, this.__wbg_ptr, this);
8174
+ return this;
8175
+ }
8176
+ /**
8177
+ * Get dimension
8178
+ * @returns {number}
8179
+ */
8180
+ getDim() {
8181
+ const ret = wasm.wasmlebesguemeasure_getDimension(this.__wbg_ptr);
8182
+ return ret >>> 0;
8183
+ }
8184
+ }
8185
+
7563
8186
  const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
7564
8187
 
7565
8188
  async function __wbg_load(module, imports) {
@@ -7641,12 +8264,12 @@ function __wbg_get_imports() {
7641
8264
  const ret = arg0.length;
7642
8265
  return ret;
7643
8266
  };
7644
- imports.wbg.__wbg_log_7696259bf4d9d36d = function(arg0, arg1) {
7645
- console.log(getStringFromWasm0(arg0, arg1));
7646
- };
7647
8267
  imports.wbg.__wbg_log_ea240990d83e374e = function(arg0) {
7648
8268
  console.log(arg0);
7649
8269
  };
8270
+ imports.wbg.__wbg_log_fcb816babb5e424a = function(arg0, arg1) {
8271
+ console.log(getStringFromWasm0(arg0, arg1));
8272
+ };
7650
8273
  imports.wbg.__wbg_new_07b483f72211fd66 = function() {
7651
8274
  const ret = new Object();
7652
8275
  return ret;
@@ -7666,7 +8289,7 @@ function __wbg_get_imports() {
7666
8289
  const a = state0.a;
7667
8290
  state0.a = 0;
7668
8291
  try {
7669
- return __wbg_adapter_511(a, state0.b, arg0, arg1);
8292
+ return __wbg_adapter_550(a, state0.b, arg0, arg1);
7670
8293
  } finally {
7671
8294
  state0.a = a;
7672
8295
  }
@@ -7766,7 +8389,7 @@ function __wbg_get_imports() {
7766
8389
  const ret = false;
7767
8390
  return ret;
7768
8391
  };
7769
- imports.wbg.__wbindgen_closure_wrapper1647 = function(arg0, arg1, arg2) {
8392
+ imports.wbg.__wbindgen_closure_wrapper1708 = function(arg0, arg1, arg2) {
7770
8393
  const ret = makeMutClosure(arg0, arg1, 40, __wbg_adapter_28);
7771
8394
  return ret;
7772
8395
  };
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Amari Contributors"
6
6
  ],
7
7
  "description": "WebAssembly bindings for Amari mathematical computing library - geometric algebra, tropical algebra, automatic differentiation, measure theory, fusion systems, and information geometry",
8
- "version": "0.13.0",
8
+ "version": "0.14.0",
9
9
  "license": "MIT OR Apache-2.0",
10
10
  "repository": {
11
11
  "type": "git",