[Haskell-cafe] How to use roots package?
mokus at deepbondi.net
Thu Mar 24 01:49:16 CET 2011
On Mar 23, 2011, at 6:57 PM, Henning Thielemann wrote:
> James Cook schrieb:
>> Those are both options, as is to simply restart findRoot if it
>> a 'Left' vaule. I personally would incline toward a custom driver
>> function (findRoot). I should probably add one to the library that
>> accepts a step limit and/or one that just iterates until convergence.
> I thought that the mosts Haskellish way to do numerical iterations
> is to
> generate a list of successive approximations (by List.iterate, of
> course) and then let the user choose where and why he wants to abort
> list, and thus the iteration.
That's probably true, and the same module exports a function that does
so. But sometimes you just want to ask "what is the root?", and get
an answer without taking (possibly literally) forever.
Overall, the code is relatively un-Haskellish to begin with though.
It was assembled in a short period of time in order to simply have
code that performs the task, and hasn't really been touched since.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe