Abhinav Baid wrote:
> 
> Okay, I've been fiddling around a lot with the listream_coefsop function 
> lately and I think I have a version which shows exactly where the 
> problem arises:
> 
> https://github.com/fandango-/spad/commit/cb0a8342c88f43a92dee263c13a069ef519b9c4e
> 
> I've removed the functions my_mapp and my_map in this file. Now, look at 
> line 310. Suppose the Laurent series was an exact zero (again, this is 
> an assumption). Then, the input for concat will be a stream of empty 
> streams, and this is what concat is unable to handle. This is unrelated 
> to whether I want to print the concatenated result or not (because the 
> resultant stream is required for constructing the Laurent series in 
> list_laurent). So, the main problem here seems to be that concat given a 
> stream of empty streams doesn't return an empty stream but continues 
> forever. Of course, this may be to be expected but I'm not sure about 
> how I can get around this problem which arises for the 2 cases mentioned 
> in a previous post.

First, concat behaves as expected: concat can return empty stream
only when it knows that there are no more elements.  But when
you have stream of empty streams you need to look at _all_
of them to be sure that all are empty.

To avoid such problems the simplest way is to include 0 terms.
In other words, your immediate problem is due to line 304.
You should always produce a term, regardless of if coefficient
is zero or not.  For this you need to compute expected degree.
Once you know degree you simply do

   cx := coefficient(x, i) -- extract coefficent of op
   coefficient(cx, deg)

to extract needed coefficient.  Note that 'removeZeroes',
'taylorRep' is not needed.  Also, since each step gives
you a term 'concat' is not needed.  More precisely, you
will get a term every 'd' steps where 'd' is denominator
of the slope.

Extra remark: in 'lift_newton' you return

  [li - v.Qt, ri - v.Rt]

but this is the same as

  [l_extra, r_extra]

only the second is clearer and more efficient.

-- 
                              Waldek Hebisch
hebi...@math.uni.wroc.pl 

-- 
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 fricas-devel+unsubscr...@googlegroups.com.
To post to this group, send email to fricas-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to