@justinelliottcobb/amari-wasm 0.9.4 → 0.9.6
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 +8 -8
- package/amari_wasm.js +20 -20
- package/amari_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/amari_wasm.d.ts
CHANGED
|
@@ -5,21 +5,21 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export function initEnumerative(): void;
|
|
7
7
|
/**
|
|
8
|
-
* Convert Lorentz factor
|
|
9
|
-
*/
|
|
10
|
-
export function gamma_to_velocity(gamma: number): number;
|
|
11
|
-
/**
|
|
12
|
-
* Validate that this module loaded correctly
|
|
8
|
+
* Convert velocity to Lorentz factor
|
|
13
9
|
*/
|
|
14
|
-
export function
|
|
10
|
+
export function velocity_to_gamma(velocity_magnitude: number): number;
|
|
15
11
|
/**
|
|
16
12
|
* Calculate light deflection angle for photon grazing massive object
|
|
17
13
|
*/
|
|
18
14
|
export function light_deflection_angle(impact_parameter: number, mass: number): number;
|
|
19
15
|
/**
|
|
20
|
-
* Convert
|
|
16
|
+
* Convert Lorentz factor to velocity
|
|
21
17
|
*/
|
|
22
|
-
export function
|
|
18
|
+
export function gamma_to_velocity(gamma: number): number;
|
|
19
|
+
/**
|
|
20
|
+
* Validate that this module loaded correctly
|
|
21
|
+
*/
|
|
22
|
+
export function validate_relativistic_module(): boolean;
|
|
23
23
|
/**
|
|
24
24
|
* Initialize the WASM module
|
|
25
25
|
*/
|
package/amari_wasm.js
CHANGED
|
@@ -231,27 +231,18 @@ export function initEnumerative() {
|
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
/**
|
|
234
|
-
* Convert Lorentz factor
|
|
235
|
-
* @param {number}
|
|
234
|
+
* Convert velocity to Lorentz factor
|
|
235
|
+
* @param {number} velocity_magnitude
|
|
236
236
|
* @returns {number}
|
|
237
237
|
*/
|
|
238
|
-
export function
|
|
239
|
-
const ret = wasm.
|
|
238
|
+
export function velocity_to_gamma(velocity_magnitude) {
|
|
239
|
+
const ret = wasm.velocity_to_gamma(velocity_magnitude);
|
|
240
240
|
if (ret[2]) {
|
|
241
241
|
throw takeFromExternrefTable0(ret[1]);
|
|
242
242
|
}
|
|
243
243
|
return ret[0];
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
-
/**
|
|
247
|
-
* Validate that this module loaded correctly
|
|
248
|
-
* @returns {boolean}
|
|
249
|
-
*/
|
|
250
|
-
export function validate_relativistic_module() {
|
|
251
|
-
const ret = wasm.validate_relativistic_module();
|
|
252
|
-
return ret !== 0;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
246
|
/**
|
|
256
247
|
* Calculate light deflection angle for photon grazing massive object
|
|
257
248
|
* @param {number} impact_parameter
|
|
@@ -264,18 +255,27 @@ export function light_deflection_angle(impact_parameter, mass) {
|
|
|
264
255
|
}
|
|
265
256
|
|
|
266
257
|
/**
|
|
267
|
-
* Convert
|
|
268
|
-
* @param {number}
|
|
258
|
+
* Convert Lorentz factor to velocity
|
|
259
|
+
* @param {number} gamma
|
|
269
260
|
* @returns {number}
|
|
270
261
|
*/
|
|
271
|
-
export function
|
|
272
|
-
const ret = wasm.
|
|
262
|
+
export function gamma_to_velocity(gamma) {
|
|
263
|
+
const ret = wasm.gamma_to_velocity(gamma);
|
|
273
264
|
if (ret[2]) {
|
|
274
265
|
throw takeFromExternrefTable0(ret[1]);
|
|
275
266
|
}
|
|
276
267
|
return ret[0];
|
|
277
268
|
}
|
|
278
269
|
|
|
270
|
+
/**
|
|
271
|
+
* Validate that this module loaded correctly
|
|
272
|
+
* @returns {boolean}
|
|
273
|
+
*/
|
|
274
|
+
export function validate_relativistic_module() {
|
|
275
|
+
const ret = wasm.validate_relativistic_module();
|
|
276
|
+
return ret !== 0;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
279
|
function passArrayF64ToWasm0(arg, malloc) {
|
|
280
280
|
const ptr = malloc(arg.length * 8, 8) >>> 0;
|
|
281
281
|
getFloat64ArrayMemory0().set(arg, ptr / 8);
|
|
@@ -5258,12 +5258,12 @@ function __wbg_get_imports() {
|
|
|
5258
5258
|
const ret = arg0.length;
|
|
5259
5259
|
return ret;
|
|
5260
5260
|
};
|
|
5261
|
-
imports.wbg.__wbg_log_381c340237020d5a = function(arg0, arg1) {
|
|
5262
|
-
console.log(getStringFromWasm0(arg0, arg1));
|
|
5263
|
-
};
|
|
5264
5261
|
imports.wbg.__wbg_log_6c7b5f4f00b8ce3f = function(arg0) {
|
|
5265
5262
|
console.log(arg0);
|
|
5266
5263
|
};
|
|
5264
|
+
imports.wbg.__wbg_log_ebffc6906074deb0 = function(arg0, arg1) {
|
|
5265
|
+
console.log(getStringFromWasm0(arg0, arg1));
|
|
5266
|
+
};
|
|
5267
5267
|
imports.wbg.__wbg_new_19c25a3f2fa63a02 = function() {
|
|
5268
5268
|
const ret = new Object();
|
|
5269
5269
|
return ret;
|
package/amari_wasm_bg.wasm
CHANGED
|
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, fusion systems, and information geometry",
|
|
8
|
-
"version": "0.9.
|
|
8
|
+
"version": "0.9.6",
|
|
9
9
|
"license": "MIT OR Apache-2.0",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|