Skip to content

Commit

Permalink
fix issue fricas#142
Browse files Browse the repository at this point in the history
The problem is independent of ")set stream calc 1".
It just happened to be hidden.

Before this commit the code below resulted in the values 0, 5, 3
for the last 3 commands.

ZZ ==> Integer
SULS ==> SparseUnivariateLaurentSeries(ZZ, 'q, 0)
Rec ==> Record(k: ZZ, c: ZZ)
S ==> Stream Rec
st := cons([0,3]$Rec, cons([1,5]$Rec, cons([2,7]$Rec,empty()$S)))$S
s := series(st)$SULS;
i x ==> x pretend InnerSparseUnivariatePowerSeries ZZ
explicitEntries?(getStream i s)
getRef i s
coefficient(s,0)
coefficient(s,1)
coefficient(s,0)
  • Loading branch information
hemmecke committed Dec 8, 2023
1 parent a17e451 commit a800044
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/algebra/sups.spad
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ InnerSparseUnivariatePowerSeries(Coef) : Exports == Implementation where

series(x : ST) ==
empty? x => 0
n := getExpon frst x; refer := ref(n :: COM)
n := getExpon frst x; refer := ref((n-1) :: COM)
makeSeries(refer, iSeries(x, refer))

--% values
Expand Down
4 changes: 4 additions & 0 deletions src/input/bugs2023.input
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,8 @@ testcase "polynomial roots"

testEquals("rootSimp((4*a^6)^(1/4))", "a*sqrt(2*a)")

testcase "initial coefficients of sparse univariate power series"

testEquals("st:=[[n,n+42]@Record(k:INT,c:INT) for n in 0..];s:=series(st)$InnerSparseUnivariatePowerSeries(INT);coefficient(s,0)", "42")

statistics()

0 comments on commit a800044

Please sign in to comment.