On 06/18/2015 02:52 AM, Waldek Hebisch wrote:
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.
Is the current code fine?
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.
Um, not exactly. If the denominator of the slope ~= 1, then the li -
v.Qt (ri - v.Rt) is a sum of the l_extra (r_extra) i.e. li - v.Qt or ri
- v.Rt will include the extra terms from all iterations instead of just
the last one.
Here's the [1] I missed in my previous post:
https://github.com/fandango-/fricas/commit/cf5981ea3fe17fa9067f9b588d7c8ab7d3432225
--
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.