-
-
Notifications
You must be signed in to change notification settings - Fork 527
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
Bad behavior of is_square_free for Words #8490
Comments
This comment has been minimized.
This comment has been minimized.
Reviewer: Mike Hansen |
Changed author from vdelecroix to Vincent Delecroix |
comment:3
Looks good to me. |
another one-line correction that applies after #8429 |
Attachment: trac_8490-square_free-vd.2.patch.gz another one-line correction that applies after #8429 |
Attachment: trac_8490-square_free-vd.3.patch.gz Apply only this |
comment:5
Attachment: trac_8490-square_free-vd.patch.gz The same bug was occuring with
I just applied a patch which fixes this problem. I changed some doctests of both BEFORE:
AFTER:
|
Applies over the precedent patch |
comment:6
Attachment: trac_8490_review-sl.patch.gz |
Changed author from Vincent Delecroix to Vincent Delecroix, Sébastien Labbé |
comment:7
Hello !! This patch is finem except for a small unimportant thing which bothered me :
Why go up to L+1 when the last letter is L-1 ? The algorithm is still correct as
raises no exception, but as there is no reason to.... So I give a positive review to the patches above, and trac_8490_review-ncohen.patch is left to be reviewed by anyone other than me (quoting Minh) :-) Thank you for this patch !! Nathann |
comment:8
The patches are to be applied in this order :
Nathann |
comment:9
Replying to @nathanncohen:
First, xrange returns a left-closed and right-open interval. Hence, one needs to write something like
Second, the variable
Hence, your patch is strange in the sense that doctests should not pass!
We made the choice of following the Python behavior for slices that goes too far:
Sébastien |
comment:10
Replying to @nathanncohen:
The patch
Sébastien |
comment:11
Perfectly right !! sorryyyyyyyyyyy !!! :-) Nathann |
comment:12
Well, then short of this, which was my mistake, I noticed nothing wrong with these two patches ! :-) Nathann |
Changed reviewer from Mike Hansen to Mike Hansen, Nathann Cohen |
Merged: sage-4.4.4.alpha0 |
The method is_square_free of sage.combinat.words.word.Word returns the wrong value in special cases (including squares !)
CC: @sagetrac-sage-combinat
Component: combinatorics
Keywords: word
Author: Vincent Delecroix, Sébastien Labbé
Reviewer: Mike Hansen, Nathann Cohen
Merged: sage-4.4.4.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/8490
The text was updated successfully, but these errors were encountered: