@descix/egpt-math-sdk 0.1.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.
Files changed (114) hide show
  1. package/README.md +224 -0
  2. package/dist/egpt-math-sdk.browser.js +5 -0
  3. package/dist/index.d.ts +100 -0
  4. package/dist/index.js +985 -0
  5. package/dist/notebooks/arithmetic-basics.html +166 -0
  6. package/dist/notebooks/complex-twiddle.html +148 -0
  7. package/dist/notebooks/double-slit-rosetta-qft.html +154 -0
  8. package/dist/notebooks/egpt-fft-test.html +202 -0
  9. package/dist/notebooks/egpt-matrix-test.html +241 -0
  10. package/dist/notebooks/egpt-polynomial-test.html +703 -0
  11. package/dist/notebooks/egpt-prime-composite-test.html +561 -0
  12. package/dist/notebooks/egpt-test-suite.html +1387 -0
  13. package/dist/notebooks/egpt-topology-test.html +410 -0
  14. package/dist/notebooks/factorization-basics.html +131 -0
  15. package/dist/notebooks/fft.html +155 -0
  16. package/dist/notebooks/frqtl-qft-benchmark.html +207 -0
  17. package/dist/notebooks/gallery-atomic-model.html +51 -0
  18. package/dist/notebooks/gallery-big-bang.html +62 -0
  19. package/dist/notebooks/gallery-blackbody.html +52 -0
  20. package/dist/notebooks/gallery-circuit-sat.html +104 -0
  21. package/dist/notebooks/gallery-collision-matrix-3d.html +51 -0
  22. package/dist/notebooks/gallery-double-slit.html +53 -0
  23. package/dist/notebooks/gallery-gun-chamber.html +62 -0
  24. package/dist/notebooks/gallery-particle-walk-3d.html +53 -0
  25. package/dist/notebooks/gallery-wave-interference.html +52 -0
  26. package/dist/notebooks/getting-started-hello-frqtl.html +53 -0
  27. package/dist/notebooks/iso-canonical-chain.html +203 -0
  28. package/dist/notebooks/iso-entropy-log.html +127 -0
  29. package/dist/notebooks/iso-fft-polynomial.html +136 -0
  30. package/dist/notebooks/iso-matrix-four-views.html +131 -0
  31. package/dist/notebooks/iso-number-theory-four-views.html +99 -0
  32. package/dist/notebooks/iso-pi-log-fraction-loop.html +140 -0
  33. package/dist/notebooks/matrix.html +202 -0
  34. package/dist/notebooks/notebooks.json +240 -0
  35. package/dist/notebooks/polynomials.html +201 -0
  36. package/dist/notebooks/prime-composite.html +268 -0
  37. package/dist/notebooks/rational-core.html +179 -0
  38. package/dist/notebooks/reference-egpt-fft-test.html +187 -0
  39. package/dist/notebooks/reference-order-finder-test.html +196 -0
  40. package/dist/notebooks/reference-prime-atom-polynomial-test.html +542 -0
  41. package/dist/notebooks/reference-solve-polynomial-system-test.html +471 -0
  42. package/dist/notebooks/scaled-vectors.html +112 -0
  43. package/dist/notebooks/stats.html +206 -0
  44. package/dist/notebooks/transcendentals.html +195 -0
  45. package/dist/notebooks/view-vendored-d3.html +78 -0
  46. package/dist/vendor/d3-array/src/array.js +4 -0
  47. package/dist/vendor/d3-array/src/ascending.js +3 -0
  48. package/dist/vendor/d3-array/src/bin.js +125 -0
  49. package/dist/vendor/d3-array/src/bisect.js +9 -0
  50. package/dist/vendor/d3-array/src/bisector.js +56 -0
  51. package/dist/vendor/d3-array/src/blur.js +115 -0
  52. package/dist/vendor/d3-array/src/constant.js +3 -0
  53. package/dist/vendor/d3-array/src/count.js +18 -0
  54. package/dist/vendor/d3-array/src/cross.js +33 -0
  55. package/dist/vendor/d3-array/src/cumsum.js +6 -0
  56. package/dist/vendor/d3-array/src/descending.js +7 -0
  57. package/dist/vendor/d3-array/src/deviation.js +6 -0
  58. package/dist/vendor/d3-array/src/difference.js +11 -0
  59. package/dist/vendor/d3-array/src/disjoint.js +15 -0
  60. package/dist/vendor/d3-array/src/every.js +10 -0
  61. package/dist/vendor/d3-array/src/extent.js +29 -0
  62. package/dist/vendor/d3-array/src/filter.js +11 -0
  63. package/dist/vendor/d3-array/src/fsum.js +69 -0
  64. package/dist/vendor/d3-array/src/greatest.js +29 -0
  65. package/dist/vendor/d3-array/src/greatestIndex.js +19 -0
  66. package/dist/vendor/d3-array/src/group.js +65 -0
  67. package/dist/vendor/d3-array/src/groupSort.js +10 -0
  68. package/dist/vendor/d3-array/src/identity.js +3 -0
  69. package/dist/vendor/d3-array/src/index.js +57 -0
  70. package/dist/vendor/d3-array/src/intersection.js +19 -0
  71. package/dist/vendor/d3-array/src/least.js +29 -0
  72. package/dist/vendor/d3-array/src/leastIndex.js +19 -0
  73. package/dist/vendor/d3-array/src/map.js +5 -0
  74. package/dist/vendor/d3-array/src/max.js +20 -0
  75. package/dist/vendor/d3-array/src/maxIndex.js +22 -0
  76. package/dist/vendor/d3-array/src/mean.js +19 -0
  77. package/dist/vendor/d3-array/src/median.js +9 -0
  78. package/dist/vendor/d3-array/src/merge.js +9 -0
  79. package/dist/vendor/d3-array/src/min.js +20 -0
  80. package/dist/vendor/d3-array/src/minIndex.js +22 -0
  81. package/dist/vendor/d3-array/src/mode.js +28 -0
  82. package/dist/vendor/d3-array/src/nice.js +18 -0
  83. package/dist/vendor/d3-array/src/number.js +20 -0
  84. package/dist/vendor/d3-array/src/pairs.js +15 -0
  85. package/dist/vendor/d3-array/src/permute.js +3 -0
  86. package/dist/vendor/d3-array/src/quantile.js +47 -0
  87. package/dist/vendor/d3-array/src/quickselect.js +53 -0
  88. package/dist/vendor/d3-array/src/range.js +13 -0
  89. package/dist/vendor/d3-array/src/rank.js +24 -0
  90. package/dist/vendor/d3-array/src/reduce.js +14 -0
  91. package/dist/vendor/d3-array/src/reverse.js +4 -0
  92. package/dist/vendor/d3-array/src/scan.js +6 -0
  93. package/dist/vendor/d3-array/src/shuffle.js +13 -0
  94. package/dist/vendor/d3-array/src/some.js +10 -0
  95. package/dist/vendor/d3-array/src/sort.js +39 -0
  96. package/dist/vendor/d3-array/src/subset.js +5 -0
  97. package/dist/vendor/d3-array/src/sum.js +18 -0
  98. package/dist/vendor/d3-array/src/superset.js +19 -0
  99. package/dist/vendor/d3-array/src/threshold/freedmanDiaconis.js +7 -0
  100. package/dist/vendor/d3-array/src/threshold/scott.js +7 -0
  101. package/dist/vendor/d3-array/src/threshold/sturges.js +5 -0
  102. package/dist/vendor/d3-array/src/ticks.js +55 -0
  103. package/dist/vendor/d3-array/src/transpose.js +15 -0
  104. package/dist/vendor/d3-array/src/union.js +11 -0
  105. package/dist/vendor/d3-array/src/variance.js +25 -0
  106. package/dist/vendor/d3-array/src/zip.js +5 -0
  107. package/dist/vendor/internmap/src/index.js +61 -0
  108. package/dist/vendor/manifest.json +11 -0
  109. package/dist/wasm/egpt_math_sdk_wasm.d.ts +214 -0
  110. package/dist/wasm/egpt_math_sdk_wasm.js +1120 -0
  111. package/dist/wasm/egpt_math_sdk_wasm_bg.wasm +0 -0
  112. package/dist/wasm/egpt_math_sdk_wasm_bg.wasm.d.ts +66 -0
  113. package/dist/wasm/manifest.json +5 -0
  114. package/package.json +53 -0
@@ -0,0 +1,11 @@
1
+ {
2
+ "version": 1,
3
+ "libs": {
4
+ "d3-array": {
5
+ "entry": "d3-array/src/index.js"
6
+ },
7
+ "internmap": {
8
+ "entry": "internmap/src/index.js"
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,214 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export function arenaAdd(a: bigint, b: bigint): bigint;
5
+
6
+ export function arenaBreakToBigint(n: bigint): string;
7
+
8
+ export function arenaBreakToJsNumber(n: bigint): string;
9
+
10
+ export function arenaBreakToString(n: bigint): string;
11
+
12
+ export function arenaCmp(a: bigint, b: bigint): number;
13
+
14
+ export function arenaDiv(a: bigint, b: bigint): bigint;
15
+
16
+ export function arenaExp2(a: bigint): bigint;
17
+
18
+ export function arenaFromAtomRoot(json: string): bigint;
19
+
20
+ export function arenaFromAtomVec(json: string): bigint;
21
+
22
+ export function arenaFromPpfJson(json: string): bigint;
23
+
24
+ export function arenaGcd(a: bigint, b: bigint): string;
25
+
26
+ export function arenaGetBitLength(n: bigint): string;
27
+
28
+ export function arenaLcm(a: bigint, b: bigint): string;
29
+
30
+ export function arenaLog2(a: bigint): bigint;
31
+
32
+ export function arenaMod(a: bigint, b: bigint): bigint;
33
+
34
+ export function arenaModPow(base: bigint, exp: bigint, modulus: bigint): bigint;
35
+
36
+ export function arenaMul(a: bigint, b: bigint): bigint;
37
+
38
+ export function arenaPolyAdd(a_json: string, b_json: string): string;
39
+
40
+ export function arenaPolyDiv(dividend_json: string, divisor_json: string): string;
41
+
42
+ export function arenaPolyEval(poly_json: string, x: bigint): bigint;
43
+
44
+ export function arenaPolyFwd(coeffs_json: string, n: number): string;
45
+
46
+ export function arenaPolyGcd(a_json: string, b_json: string): string;
47
+
48
+ export function arenaPolyInv(samples_json: string, n: number): string;
49
+
50
+ export function arenaPolyMul(a_json: string, b_json: string): string;
51
+
52
+ export function arenaPow(base: bigint, exp_num: number, exp_den: number): bigint;
53
+
54
+ export function arenaPpfDecode(json: string): bigint;
55
+
56
+ export function arenaPpfEncode(n: bigint): string;
57
+
58
+ export function arenaSqrt(a: bigint): bigint;
59
+
60
+ /**
61
+ * Returns arena stats as JSON: {"len": N, "capacity": N, "epoch": N}
62
+ * DEBUG ONLY — audience-gated if surfaced to UI.
63
+ */
64
+ export function arenaStats(): string;
65
+
66
+ export function arenaSub(a: bigint, b: bigint): bigint;
67
+
68
+ export function arenaToAtomRoot(n: bigint): string;
69
+
70
+ export function arenaToPrimeAtoms(n: bigint): string;
71
+
72
+ export function bridge_version(): string;
73
+
74
+ /**
75
+ * Intern a canonical string ("num" or "num/den") into the arena.
76
+ * Returns a packed u64 handle (high 32 = epoch, low 32 = index).
77
+ */
78
+ export function internStr(canonical_str: string): bigint;
79
+
80
+ /**
81
+ * Intern a V2 binary integer ([sign_byte, ...le_magnitude]) into the arena.
82
+ * Stores the value as an integer (denominator = 1).
83
+ * Returns a packed u64 handle.
84
+ */
85
+ export function internV2(bytes: Uint8Array): bigint;
86
+
87
+ /**
88
+ * Materialize the value at `handle` as a canonical string ("num" or "num/den").
89
+ * FAIL-LOUD on stale epoch or out-of-range index.
90
+ */
91
+ export function materializeStr(handle: bigint): string;
92
+
93
+ /**
94
+ * Materialize the value at `handle` as a V2 binary of the numerator integer.
95
+ * FAIL-LOUD on stale epoch, out-of-range, or non-integer (denominator != 1).
96
+ */
97
+ export function materializeV2(handle: bigint): Uint8Array;
98
+
99
+ export function poly_add_wasm(a_json: string, b_json: string): string;
100
+
101
+ export function poly_div_wasm(a_json: string, b_json: string): string;
102
+
103
+ export function poly_evaluate_at_wasm(poly_json: string, x_json: string): string;
104
+
105
+ export function poly_forward_transform_wasm(coeffs_json: string, n: number): string;
106
+
107
+ export function poly_gcd_wasm(a_json: string, b_json: string): string;
108
+
109
+ export function poly_inverse_transform_wasm(samples_json: string, n: number): string;
110
+
111
+ export function poly_mul_wasm(a_json: string, b_json: string): string;
112
+
113
+ /**
114
+ * Mark the slot at `handle` as None (free memory).
115
+ * FAIL-LOUD on stale epoch only; out-of-range is ignored (idempotent).
116
+ */
117
+ export function releaseHandle(handle: bigint): void;
118
+
119
+ /**
120
+ * Clear the entire arena and increment epoch.
121
+ * After this call, all prior handles are stale.
122
+ */
123
+ export function resetScope(): void;
124
+
125
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
126
+
127
+ export interface InitOutput {
128
+ readonly memory: WebAssembly.Memory;
129
+ readonly arenaAdd: (a: bigint, b: bigint) => [bigint, number, number];
130
+ readonly arenaBreakToBigint: (a: bigint) => [number, number, number, number];
131
+ readonly arenaBreakToJsNumber: (a: bigint) => [number, number, number, number];
132
+ readonly arenaBreakToString: (a: bigint) => [number, number, number, number];
133
+ readonly arenaCmp: (a: bigint, b: bigint) => [number, number, number];
134
+ readonly arenaDiv: (a: bigint, b: bigint) => [bigint, number, number];
135
+ readonly arenaExp2: (a: bigint) => [bigint, number, number];
136
+ readonly arenaFromAtomRoot: (a: number, b: number) => [bigint, number, number];
137
+ readonly arenaFromAtomVec: (a: number, b: number) => [bigint, number, number];
138
+ readonly arenaFromPpfJson: (a: number, b: number) => [bigint, number, number];
139
+ readonly arenaGcd: (a: bigint, b: bigint) => [number, number, number, number];
140
+ readonly arenaGetBitLength: (a: bigint) => [number, number, number, number];
141
+ readonly arenaLcm: (a: bigint, b: bigint) => [number, number, number, number];
142
+ readonly arenaLog2: (a: bigint) => [bigint, number, number];
143
+ readonly arenaMod: (a: bigint, b: bigint) => [bigint, number, number];
144
+ readonly arenaModPow: (a: bigint, b: bigint, c: bigint) => [bigint, number, number];
145
+ readonly arenaMul: (a: bigint, b: bigint) => [bigint, number, number];
146
+ readonly arenaPolyAdd: (a: number, b: number, c: number, d: number) => [number, number, number, number];
147
+ readonly arenaPolyDiv: (a: number, b: number, c: number, d: number) => [number, number, number, number];
148
+ readonly arenaPolyEval: (a: number, b: number, c: bigint) => [bigint, number, number];
149
+ readonly arenaPolyFwd: (a: number, b: number, c: number) => [number, number, number, number];
150
+ readonly arenaPolyGcd: (a: number, b: number, c: number, d: number) => [number, number, number, number];
151
+ readonly arenaPolyInv: (a: number, b: number, c: number) => [number, number, number, number];
152
+ readonly arenaPolyMul: (a: number, b: number, c: number, d: number) => [number, number, number, number];
153
+ readonly arenaPow: (a: bigint, b: number, c: number) => [bigint, number, number];
154
+ readonly arenaPpfDecode: (a: number, b: number) => [bigint, number, number];
155
+ readonly arenaPpfEncode: (a: bigint) => [number, number, number, number];
156
+ readonly arenaSqrt: (a: bigint) => [bigint, number, number];
157
+ readonly arenaStats: () => [number, number];
158
+ readonly arenaSub: (a: bigint, b: bigint) => [bigint, number, number];
159
+ readonly arenaToAtomRoot: (a: bigint) => [number, number, number, number];
160
+ readonly arenaToPrimeAtoms: (a: bigint) => [number, number, number, number];
161
+ readonly internStr: (a: number, b: number) => [bigint, number, number];
162
+ readonly internV2: (a: number, b: number) => [bigint, number, number];
163
+ readonly materializeV2: (a: bigint) => [number, number, number, number];
164
+ readonly releaseHandle: (a: bigint) => [number, number];
165
+ readonly resetScope: () => void;
166
+ readonly materializeStr: (a: bigint) => [number, number, number, number];
167
+ readonly bridge_version: () => [number, number];
168
+ readonly poly_add_wasm: (a: number, b: number, c: number, d: number) => [number, number, number, number];
169
+ readonly poly_div_wasm: (a: number, b: number, c: number, d: number) => [number, number, number, number];
170
+ readonly poly_evaluate_at_wasm: (a: number, b: number, c: number, d: number) => [number, number, number, number];
171
+ readonly poly_forward_transform_wasm: (a: number, b: number, c: number) => [number, number, number, number];
172
+ readonly poly_gcd_wasm: (a: number, b: number, c: number, d: number) => [number, number, number, number];
173
+ readonly poly_inverse_transform_wasm: (a: number, b: number, c: number) => [number, number, number, number];
174
+ readonly poly_mul_wasm: (a: number, b: number, c: number, d: number) => [number, number, number, number];
175
+ readonly egpt_add: (a: number, b: number) => number;
176
+ readonly egpt_cmp: (a: number, b: number) => number;
177
+ readonly egpt_div: (a: number, b: number) => number;
178
+ readonly egpt_free: (a: number) => void;
179
+ readonly egpt_from_i64: (a: bigint) => number;
180
+ readonly egpt_from_rational_i64: (a: bigint, b: bigint) => number;
181
+ readonly egpt_mul: (a: number, b: number) => number;
182
+ readonly egpt_print: (a: number) => void;
183
+ readonly egpt_string_free: (a: number) => void;
184
+ readonly egpt_sub: (a: number, b: number) => number;
185
+ readonly egpt_to_cstring: (a: number) => number;
186
+ readonly __wbindgen_externrefs: WebAssembly.Table;
187
+ readonly __externref_table_dealloc: (a: number) => void;
188
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
189
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
190
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
191
+ readonly __wbindgen_start: () => void;
192
+ }
193
+
194
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
195
+
196
+ /**
197
+ * Instantiates the given `module`, which can either be bytes or
198
+ * a precompiled `WebAssembly.Module`.
199
+ *
200
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
201
+ *
202
+ * @returns {InitOutput}
203
+ */
204
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
205
+
206
+ /**
207
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
208
+ * for everything else, calls `WebAssembly.instantiate` directly.
209
+ *
210
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
211
+ *
212
+ * @returns {Promise<InitOutput>}
213
+ */
214
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;