[Haskell-cafe] numeric minimization in Haskell

Dan Weston westondan at imageworks.com
Wed Feb 28 17:54:06 EST 2007

GSL is written in C, and I don't know any language more portable than 
that! gsl_vector and gsl_matrix use a continuous block of doubles, so 
you can use the FFI to marshall this however you want for efficiency.

I'd stick with GSLHaskell until you're ready to optimize the data 
marshalling though.

I like spending my time on interesting things, not reinventing 
pre-debugged and efficient libraries. I use GSLHaskell in my work and 
have never had a problem.


Chad Scherrer wrote:
> Does anyone know of any Haskell code for numeric minimization? I was
> thinking conjugate gradient would be good, but at this point I'd be
> happy with anything.
> I've found some code written by Tomasz Cholewo at
> http://ci.uofl.edu/tom/software/Haskell/
> but it requires importing his "Arr.lhs" library, which is not publicly
> available.
> The only other thing I've been able to dig up is this
> www.st.cs.ru.nl/papers/1997/serp97-cgfunctional.ps.gz
> which suggests Haskell is slow for such problems. I suspect this was
> an implementation issue, so I don't think their code would be very
> helpful (though it would be nice to tidy it up and demonstrate the
> improvement - could it beat the Clean implementation they give?)
> The other possibility I was considering was using Alberto Ruiz's
> wrapper for the GSL library
> http://dis.um.es/~alberto/GSLHaskell/
> The only problems with this are (1) requires having GSL available, so
> it's not as portable, and (2) does everything in terms of lists, which
> requires a lot of translations to and from lists (I'm using mutable
> arrays).
> If there's nothing already written that works together, one of these
> should give me a start, but I'd like to avoid reinventing the wheel if
> possible.
> Thanks!

More information about the Haskell-Cafe mailing list