These are chat archives for non/algebra

Jan 2016
Ben Hutchison
Jan 10 2016 02:23

A question about (first time) use of algebra library.

I have a situation where I'd like to treat a number tuple as 2D Vector ietype Vec2d = (Double, Double). Only need to support Addition and Subtraction operations. Whats the smallest typeclass I can implement (or better, import..) that will give me element-wise +& - over(Double, Double)?

Ben Hutchison
Jan 10 2016 06:20

@antonkulaga I was interested by your comment:

What I really lack in scala right now is a collection of good ODE solvers (esp. for stiff problems) or maybe binding to Fortran/C++ packages like lsode.

..because if you're at the level where you need solvers for stiff ODEs, then you're already way past linear algebra. And I would say the situation WRT linear algebra is a bit of a mess in Scala, let alone worrying about solvers.

The only Scala linear alg packages I know of are Breeze & Spark. Do you use them? They're currently not at all integrated with the Algebra or the Typelevel Stack (:P). I dont reckon Breeze will be unless there's a major change in design thinking, away from the "kitchen sink" approach (everything and anything in one big library). And Spark is even bigger, distributed, and multi-platform..

If you haven't guessed, what I'd like is linear algebra done in the same lightweight, modular, fine-grained way that Algebra, Cats & Spire are proceeding..

PS: Also, there are probably less than 100 people in the world who can write a decent stiff ODE solver. Not sure if any of those 100 are scala programmers? You might be waiting a while..

Anton Kulaga
Jan 10 2016 12:56
@benhutchison I have to reproduce computation biology papers from time to time and there often authors explicitly recommend to use ode15s matlab solver that seems to be adopted for stiff ODEs.
I personally would not mind having scala (or even java) interfaces to call something like fortran-based lsode (that is Octave alternative of matlab's ODEs) but seems like nobody wrote it yet