Skip to content
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

Multiplication action by -2^63 hangs #17844

Closed
jdemeyer opened this issue Feb 23, 2015 · 10 comments
Closed

Multiplication action by -2^63 hangs #17844

jdemeyer opened this issue Feb 23, 2015 · 10 comments

Comments

@jdemeyer
Copy link

sage: E = EllipticCurve(GF(5),[0,1])
sage: P = E.random_element()
sage: (-2^63)*P   # hangs

Component: coercion

Author: Jeroen Demeyer

Branch/Commit: 1c074bb

Reviewer: Vincent Delecroix

Issue created by migration from https://trac.sagemath.org/ticket/17844

@jdemeyer jdemeyer added this to the sage-6.6 milestone Feb 23, 2015
@jdemeyer
Copy link
Author

Branch: u/jdemeyer/ticket/17844

@jdemeyer
Copy link
Author

Commit: b5402b0

@jdemeyer
Copy link
Author

New commits:

b5402b0Fix IntegerMulAction by -2^63, check for interrupts

@videlec
Copy link
Contributor

videlec commented Feb 23, 2015

comment:3

Cleaner and faster option in fast_mul_long that avoid coercions

- return parent_c(a)(0)
+ try:
+     return parent_c(a).zero()
+ except AttributeError:
+     return parent_c(a)(0)

Related note: It would be much better if this code for multiplication was closer to generic_power_c in sage.structure.element. And by the way, it would be cool to have a generic_power_long_c.

Vincent

@videlec
Copy link
Contributor

videlec commented Feb 28, 2015

comment:4

The change is not only important but needed! And it would be cool to have a comment saying why, i.e. -LONG_MIN = LONG_MIN for longs.

Vincent

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 1, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

1c074bbSmall improvement to IntegerMulAction by 0

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 1, 2015

Changed commit from b5402b0 to 1c074bb

@videlec
Copy link
Contributor

videlec commented Mar 1, 2015

Reviewer: Vincent Delecroix

@videlec
Copy link
Contributor

videlec commented Mar 1, 2015

comment:7

The improvement for the 0 case is not an improvement for elliptic curves since the group does not implement the method zero... but this is a different story.

Good to me!

@vbraun
Copy link
Member

vbraun commented Mar 3, 2015

Changed branch from u/jdemeyer/ticket/17844 to 1c074bb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants