Hacker News new | ask | show | jobs
by kragen 949 days ago
> there is always one way to break up the units that leads to matrices and vectors with a consistent unit.

maybe i don't understand what you're saying but it sounds like you don't understand the problem

it's not that the units are inconsistent in the sense of adding kilograms to kilojoules; they're just inhomogeneous

you have a potentially large matrix in which potentially every cell has different units. so type systems that require the matrix cells to all be of the same type aren't helpful unless that type is something machine-oriented like `real*8`

moreover this is intrinsic to the problem, or at least the decision to use linear algebra on the problem

an additional difficulty for things like *gemm or lu factorization is that you want them to be applicable to matrices of any size with any type of units of measurement, as long as they're consistent; so they're parametrically polymorphic over units of measurement