|Subject:||Re: [Axiom-developer] [Axiom-mail] manipulating series not as streams but as sumations|
|Date:||Tue, 21 Oct 2014 15:05:20 -0400|
|User-agent:||Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0|
On 10/21/2014 11:27 AM, Ralf Hemmecke wrote:
I made a mistake :) I have forwarded it.On 10/21/2014 04:39 PM, Raymond Rogers wrote:Let's think about this. I think the question can be interpreted as a formating/display problem for the underlying code.If you believe so... Let me state it a bit differently what datastructure comes out of the series command. Or rather what is stored inside the data structure. Here an example: (1) -> Z==>Integer; Q==>Fraction Z; Type: Void (2) -> f(q:Q):Q == truncate(abs(q*cos(q::Float))+1)*(q/2+1) Function declaration f : Fraction(Integer) -> Fraction(Integer) has been added to workspace. Type: Void (3) -> s: Stream Q := stream(f, 0) Compiling function f with type Fraction(Integer) -> Fraction(Integer ) 3 7 15 31 63 127 255 511 (3) [0,1,-,-,--,--,--,---,---,---,...] 2 4 8 16 32 64 128 256 Type: Stream(Fraction(Integer)) (4) -> p:=series(s)$UnivariateFormalPowerSeries(Q) (4) 3 2 7 3 15 4 31 5 63 6 127 7 255 8 511 9 x + - x + - x + -- x + -- x + -- x + --- x + --- x + --- x 2 4 8 16 32 64 128 256 + 1023 10 11 ---- x + O(x ) 512 Type: UnivariateFormalPowerSeries(Fraction(Integer)) The only thing that s (the Stream) knows is a function object f (if you like you can use f=random). It cannot look inside f except to ask for more values. Remember AXIOM code is compiled. If from that you would somehow be able to extract a pattern, great, but I doubt.Of course I am not that familiar with the Axiom internals.Well, you might come from another CAS. AXIOM *is* different. It is in general *not* dealing with _expression_ trees. So what you have in mind (adding presentation) does not work for Stream of Series. That is not saying that it is impossible, but rather that the Stream and PowerSeries domains are not appropriate for what you have in mind. (And at the moment I don't think there is anything like what you want in Axiom.) Ralf PS: BTW, why didn't you continue on the mailing list?
Everything seems reasonable; stream seems to
have invented an iterator but I guess that's implicit (tacit?) in the 0 of stream(f, 0). And series() seems to have
invented x and the number of terms it is going to display but these things are not real killers.
I will attempt an explicit translation (say something that could be done by awk) later.
-- The primary use of conversation is to satisfy the impulse to talk George Santanyana
|[Prev in Thread]||Current Thread||[Next in Thread]|