numeric
numeric copied to clipboard
Object numeric has to be available globally
I am using numeric in a Typescript-Surrounding. If my ts-File looks like this:
import * as numeric from numeric;
...
class abc {
...
function xyz() {
const hessian = [[1,2], [3,4]]; //some matrix here
const eigenValues = numeric.eig(hessian);
}
}
this will fail during runtime. If I add window.numeric = numeric
and then call window.numeric.eig
it will work fine but through errors due to invalid TS.
To find the source of Error I have to step into the toUpperHessenberg-Function
and there on line 1368, a virtual js-File is created (I suspect the clone oder identity-Call) which looks like this:
and in that scope, numeric is
undefined
, if it's as I mentioned, not in the window-Scope for example.
I can't really figure out what happens here exactly with this virtual file and would be glad for any advice it I got it completely wrong this time. Else, this is a bug.