[Pharo-users] Is lazy evaluation of infinite series possible?
Erisa
bawolk at ucdavis.edu
Sun May 29 16:33:43 EDT 2016
I took a look at the numerical methods book, but it seems oriented to
actually evaluating an infinite series up to a certain accuracy. With
formal power series all we want are the coefficients. For example, consider
the series
S = 1 + x + x^2 + x^3 + ...
The coefficients are an infinite list [1, 1, ...]. What I need is a class
for S that would allow me to perform operations such as addition,
multiplication, etc. Thus I would like to able to do S * S and get the
infinite list of the coefficients [1, 2, 3, 4, ...] and view say the first
10 or perhaps the nth coefficient.
Your LazyList looks promising. To create the series this seems like it
would work.
s := LazyList wholes collect: [ :n | 1 ]
But defining the operations is the difficult part. I would like to look at
your package, but I need some help. How can I download your package from
smalltalk hub so that I can examine it, play with it, but eventually easily
remove it if I want. As you can tell, I have just started learning Pharo.
--
View this message in context: http://forum.world.st/Is-lazy-evaluation-of-infinite-series-possible-tp4897956p4898028.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
More information about the Pharo-users
mailing list