ocramz / sparse-linear-algebra

Numerical computation in native Haskell
GNU General Public License v3.0
88 stars 10 forks source link

Either Floats are valid elements or they aren't. #65

Open gilgamec opened 6 years ago

gilgamec commented 6 years ago

The Elt class includes Floats, while they PrintDense class works only for things over Doubles. This means that some functions, like lu, which requires only Elts, work for matrices of Floats, while e.g. qr (needing PrintDense) works only for matrices of Doubles. Some of the constructors, e.g. vr and vc, also only work with Doubles.

Could you either allow Floats as elements everywhere, or disallow them completely? Or at the very least, more cleanly delineate exactly what operations (exact solvers / iterative solvers / other stuff) they will be allowed in?

ocramz commented 6 years ago

@gilgamec Hi, good catch; this is inconsistent. The API has been in need of attention for quite some time now. If you have an idea on how to fix this I'll happily merge a PR.