-
-
Notifications
You must be signed in to change notification settings - Fork 490
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
error in the computing of the approximate order in LazyPowerSeries #14685
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
Bienvenue à bord ! Your patch does not looks good: it contains three times the same thing. It is necessary to make it again in a more clean way. It is not clear to me what the expected result should be in the example given above. Which answer is correct and which one is not ? Apart from that, it would be good to add a test to check that the error is corrected. Something like
and then the appropriate example. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:6
Hello, the corrected behaviour should be added to the code, in the documentation at the start of the function. Your patch still looks strange. How do you make it ? You should
|
comment:7
Hi! Thanks for working on the lazy power series code; it needs some love. Just one thing to be careful with; I haven't looked in detail in your code, so maybe it takes care of this already: The method might be passed as argument a lazy power series implemented by a function f(n) which returns always 0; or some non zero coefficient but only for n very large. In such a case we don't want to run forever: this is about computing an approximation of the order, and often, knowing that the order is at least 1 or at least 2 is sufficient for the purpose (initializing the recurrence for computing series defined recursively). Of course, there are case where we do want the exact order, even at the price of running for a long time. Its possible that the interface needs a bit of cleaning up so that the distinction between approximate order and order would be well exposed (and by the way maybe this should really be called valuation rather than order). |
comment:8
for chapoton : I made the patch with a **diff -Naur ** but I will fix this. for nthiery : I am not sure to understand what you said : The patch keeps this behavior. Moreover, the current version do not compute the right order too :
|
This comment has been minimized.
This comment has been minimized.
comment:10
I posted a version of the patch which fixes the commit message. This looks good to me, and I agree with Matthieu's assessment of the amortized costs. |
Author: Matthieu Dien |
Reviewer: Mike Hansen |
comment:12
Replying to @mwhansen: |
comment:13
Attachment: trac_14685_bug_aorder_lazypowerseries.patch.gz The new patch should apply. |
comment:14
Apply trac_14685_bug_aorder_lazypowerseries.patch |
comment:15
What's going wrong?
Series file:
|
comment:16
This doesn't apply to sage-5.11.beta3:
|
Alternative version of the patch, which applies on my system |
comment:22
A fix is in #15673 |
comment:26
Needs a working git branch |
Stopgaps: wrongAnswerMarker |
Changed stopgaps from wrongAnswerMarker to none |
Changed author from Matthieu Dien to none |
Changed reviewer from Mike Hansen to Travis Scrimshaw |
comment:28
I propose closing this as invalid since this is only meant to be the approximate order, not the actual order. So as long as This is also set to be replaced soon; see #31651. |
comment:29
This is no longer relevant, there is an entirely new implementation of |
Changed reviewer from Travis Scrimshaw to Travis Scrimshaw, Martin Rubey |
Hi,
I found a bug in the LazyPowerSeries class of package combinat. There is mistake in the computing of the approximate order of a serie. A demonstration of the bug :
The good result should be 3 and not 1 (the order of the series B = x3 is 3 not 1 )
The bug is that the aorder is computed one time and never updated. This is because the order was assigned the first time then the condition self.order != unk becomes false and the update never comes.
After the patch, we obtain :
What we expected.
PS : Thanks you for the commments, I tried to answer them.
PS 2 : I modified the patch as you asked
CC: @mantepse
Component: combinatorics
Keywords: LazyPowerSeries aorder approximate order
Reviewer: Travis Scrimshaw, Martin Rubey
Issue created by migration from https://trac.sagemath.org/ticket/14685
The text was updated successfully, but these errors were encountered: