When working with Laurent series it would be useful to turn a stream of
coefficients into a Laurent series. For example, in

  Foo(K: Field, L: UnivariateLaurentSeriesCategory K): ...

when I have constructed a stream of coefficients, I would like to say

  laurent(n, somestream_in_K)

and get something like

  laurent(n, series(somestream_in_K))

But in order to do this, I would need the variable and the center of L
in order to construct the type UnivariateTaylorSeries(K, var, cen).
Well, I could get the data via

  var := variable(0$L)
  cen := center(0$L)

But that's cumbersome and I'd bet the type wouldn't agree with the

   UTS ==> UnivariateTaylorSeries(Coef, var, cen)

that is explicitly mentioned in the definition of
UnivariateLaurentSeries(Coef, var, cen).

I'd like to get something like the attached patch into FriCAS.

Testing this patch seems to have discovered a bug. See separate mail.

Ralf

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.
From c6b6877547b6dafc6b04773cd67b0be77f2bc078 Mon Sep 17 00:00:00 2001
From: Ralf Hemmecke <[email protected]>
Date: Tue, 10 Feb 2015 00:16:03 +0100
Subject: laurent stream

---
 src/algebra/laurent.spad | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/algebra/laurent.spad b/src/algebra/laurent.spad
index 2096967..9ccdc27 100644
--- a/src/algebra/laurent.spad
+++ b/src/algebra/laurent.spad
@@ -25,6 +25,9 @@ UnivariateLaurentSeriesConstructorCategory(Coef, UTS) : _
                       RetractableTo UTS) with
     laurent : (I, UTS) -> %
       ++ \spad{laurent(n, f(x))} returns \spad{x^n * f(x)}.
+    laurent : (I, Stream Coef) -> %
+      ++ \spad{laurent(n, st)} returns \spad{x^n * series(st)$UTS)} where
+      ++ \spad{x = monomial(1, 1)}.
     degree : % -> I
       ++ \spad{degree(f(x))} returns the degree of the lowest order term of
       ++ \spad{f(x)}, which may have zero as a coefficient.
@@ -69,6 +72,7 @@ UnivariateLaurentSeriesConstructorCategory(Coef, UTS) : _
     zero? x == zero? taylorRep x
     retract(x : %) : UTS == taylor x
     retractIfCan(x:%):Union(UTS,"failed") == taylorIfCan x
+    laurent(n: I, st: Stream Coef): % == laurent(n, series(st)$UTS)
 
 )abbrev domain ULSCONS UnivariateLaurentSeriesConstructor
 ++ Authors: Bill Burge, Clifton J. Williamson
@@ -122,7 +126,7 @@ UnivariateLaurentSeriesConstructor(Coef, UTS) : _
 
 --% creation and destruction
 
-    laurent(n, psr) == [n, psr]
+    laurent(n: I, psr: UTS): % == [n, psr]
     taylorRep x    == getUTS x
     degree x       == getExpon x
 
-- 
2.1.0

Reply via email to