RobbeK
17-03-2014, 11:49
Hi all,
While memoization in principle remembers one result, stores it in case to be used again (avoided calculations) it is easely extended into a table.
I wrote this first in Lisp (where the list (array) is built anyway).
At first sight it looks very memory consuming , however a table can be built storing every tenth result or so. Most functions can be interpolated (Lin/parabolic etc...) with accurate results.
(maybe JITtable is the more correct word here ;-)
IMHO an aspect of dynamic programming that's very interesting !
best Rob
It does the sum of the Harmonic series - it crawls very slow to infinity (the sum of 1/p where p is prime also does so - even slower )
While memoization in principle remembers one result, stores it in case to be used again (avoided calculations) it is easely extended into a table.
I wrote this first in Lisp (where the list (array) is built anyway).
At first sight it looks very memory consuming , however a table can be built storing every tenth result or so. Most functions can be interpolated (Lin/parabolic etc...) with accurate results.
(maybe JITtable is the more correct word here ;-)
IMHO an aspect of dynamic programming that's very interesting !
best Rob
It does the sum of the Harmonic series - it crawls very slow to infinity (the sum of 1/p where p is prime also does so - even slower )