Re: [Pharo-users] Is lazy evaluation of infinite series possible?

2016-06-06 Thread Werner Kassens
Hi Erisa, one solution, using your notation, could eg be * aPowerSeries ^ PowerSeries on: [ :generator | |a b| a:=OrderedCollection new. b:=OrderedCollection new. [ a add: self next. b add: aPowerSeries

Re: [Pharo-users] Is lazy evaluation of infinite series possible?

2016-06-01 Thread rausm
Hi, > will the recursion in the definition of * blow up rapidly Wouldn't memoization wrapper help (in case of re-evaluation) ? -- View this message in context: http://forum.world.st/Is-lazy-evaluation-of-infinite-series-possible-tp4897956p4898731.html Sent from the Pharo Smalltalk Users

Re: [Pharo-users] Is lazy evaluation of infinite series possible?

2016-05-31 Thread Hilaire
Multiplication of power series looks tricky as for the term k of the resulting power series you need to access terms where sum index value to k. (ps1 next: i) and (ps2 next: k - i). Somehow the bloc of code defining the multiplicated serie needs to know about its current rank k. You should not

Re: [Pharo-users] Is lazy evaluation of infinite series possible?

2016-05-31 Thread Cédrick Béler
I have no idea of the solution… but what I just read brought to me « Continuation » . I wonder if it may help here. My 0.2 cents, Cédrik

Re: [Pharo-users] Is lazy evaluation of infinite series possible?

2016-05-30 Thread Erisa
The fibonacciSequence example was really helpful. I made a new class PowerSeries, a subclass of Generator. Then I defined a binary operation + as follows: + aPowerSeries ^ PowerSeries on: [ :ps | | a b | [ a := self next. b := aPowerSeries next. ps yield: (a + b) ]

Re: [Pharo-users] Is lazy evaluation of infinite series possible?

2016-05-30 Thread Hilaire
Did you take a look at Nicolai suggestion regarding the Generator class. There is a fibonacci example in its test case. fibo := GeneratorTest new fibonacciSequence then to access the sequence term: fibo next. Hilaire -- Dr. Geo http://drgeo.eu

Re: [Pharo-users] Is lazy evaluation of infinite series possible?

2016-05-29 Thread Evan Donahue
Hello, Other people are probably better qualified to weigh in on the best ways to manage packages in a Pharo image, but this is what I do: 1) Left click on the "desktop" to bring up the "world menu" and select "Monticello Browser." 2) Click the "+Repository" button and select "smalltalkhub.com"

Re: [Pharo-users] Is lazy evaluation of infinite series possible?

2016-05-29 Thread Erisa
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

Re: [Pharo-users] Is lazy evaluation of infinite series possible?

2016-05-29 Thread stepharo
Hello Erisa I am just learning Pharo (taking the MOOC actually!) :) and am wondering whether it is possible to model formal power series. I have done this in Haskell quite easily and efficiently, but struggled to do it in Python without real success. It requires one to perform operations

Re: [Pharo-users] Is lazy evaluation of infinite series possible?

2016-05-29 Thread Evan Donahue
Hello, I know infinite series are mentioned in the numerical methods book, although I haven't worked with those classes specifically. http://files.pharo.org/books/numerical-methods/2016-04-NumericalMethods.pdf You could also use a LazyList, depending on what you were doing, from

Re: [Pharo-users] Is lazy evaluation of infinite series possible?

2016-05-28 Thread Nicolai Hess
2016-05-28 20:57 GMT+02:00 Erisa : > I am just learning Pharo (taking the MOOC actually!) and am wondering > whether > it is possible to model formal power series. I have done this in Haskell > quite easily and efficiently, but struggled to do it in Python without real >

[Pharo-users] Is lazy evaluation of infinite series possible?

2016-05-28 Thread Erisa
I am just learning Pharo (taking the MOOC actually!) and am wondering whether it is possible to model formal power series. I have done this in Haskell quite easily and efficiently, but struggled to do it in Python without real success. It requires one to perform operations on an infinite stream