@justinelliottcobb/amari-wasm 0.9.5 → 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 +22 -22
- package/amari_wasm_bg.wasm +0 -0
- package/package.json +1 -1
package/amari_wasm.d.ts
CHANGED
|
@@ -4,22 +4,22 @@
|
|
|
4
4
|
* Initialize the enumerative geometry module
|
|
5
5
|
*/
|
|
6
6
|
export function initEnumerative(): void;
|
|
7
|
-
/**
|
|
8
|
-
* Convert Lorentz factor to velocity
|
|
9
|
-
*/
|
|
10
|
-
export function gamma_to_velocity(gamma: number): number;
|
|
11
7
|
/**
|
|
12
8
|
* Convert velocity to Lorentz factor
|
|
13
9
|
*/
|
|
14
10
|
export function velocity_to_gamma(velocity_magnitude: number): number;
|
|
15
|
-
/**
|
|
16
|
-
* Validate that this module loaded correctly
|
|
17
|
-
*/
|
|
18
|
-
export function validate_relativistic_module(): boolean;
|
|
19
11
|
/**
|
|
20
12
|
* Calculate light deflection angle for photon grazing massive object
|
|
21
13
|
*/
|
|
22
14
|
export function light_deflection_angle(impact_parameter: number, mass: number): number;
|
|
15
|
+
/**
|
|
16
|
+
* Convert Lorentz factor to velocity
|
|
17
|
+
*/
|
|
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,12 +231,12 @@ 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
|
}
|
|
@@ -244,12 +244,23 @@ export function gamma_to_velocity(gamma) {
|
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
/**
|
|
247
|
-
*
|
|
248
|
-
* @param {number}
|
|
247
|
+
* Calculate light deflection angle for photon grazing massive object
|
|
248
|
+
* @param {number} impact_parameter
|
|
249
|
+
* @param {number} mass
|
|
249
250
|
* @returns {number}
|
|
250
251
|
*/
|
|
251
|
-
export function
|
|
252
|
-
const ret = wasm.
|
|
252
|
+
export function light_deflection_angle(impact_parameter, mass) {
|
|
253
|
+
const ret = wasm.light_deflection_angle(impact_parameter, mass);
|
|
254
|
+
return ret;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Convert Lorentz factor to velocity
|
|
259
|
+
* @param {number} gamma
|
|
260
|
+
* @returns {number}
|
|
261
|
+
*/
|
|
262
|
+
export function gamma_to_velocity(gamma) {
|
|
263
|
+
const ret = wasm.gamma_to_velocity(gamma);
|
|
253
264
|
if (ret[2]) {
|
|
254
265
|
throw takeFromExternrefTable0(ret[1]);
|
|
255
266
|
}
|
|
@@ -265,17 +276,6 @@ export function validate_relativistic_module() {
|
|
|
265
276
|
return ret !== 0;
|
|
266
277
|
}
|
|
267
278
|
|
|
268
|
-
/**
|
|
269
|
-
* Calculate light deflection angle for photon grazing massive object
|
|
270
|
-
* @param {number} impact_parameter
|
|
271
|
-
* @param {number} mass
|
|
272
|
-
* @returns {number}
|
|
273
|
-
*/
|
|
274
|
-
export function light_deflection_angle(impact_parameter, mass) {
|
|
275
|
-
const ret = wasm.light_deflection_angle(impact_parameter, mass);
|
|
276
|
-
return ret;
|
|
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_0fd8c2928e3d6b1b = 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",
|