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

Fix overflow error in conversion to PARI finite field element #21186

Closed
pjbruin opened this issue Aug 8, 2016 · 6 comments
Closed

Fix overflow error in conversion to PARI finite field element #21186

pjbruin opened this issue Aug 8, 2016 · 6 comments

Comments

@pjbruin
Copy link
Contributor

pjbruin commented Aug 8, 2016

From John Jones on sage-devel:

p=13189065031705623239
Fq = FiniteField(p ** 3, "a") 
Fq_X = PolynomialRing(Fq, "x")
pol=Fq_X("x^9 + 13189065031705622723*x^7 + 13189065031705622723*x^6 + 9288*x^5 + 18576*x^4 + 13189065031705590731*x^3 + 13189065031705497851*x^2 + 13189065031705497851*x + 13189065031705581443")
pol.roots()
Traceback (most recent call last):
...
OverflowError: Python int too large to convert to C long

This arises because GEN is by definition a (signed) long *. It can be fixed by adding a function set_uel(GEN x, long n, ulong z) to the PARI interface, implemented as uel(x, n) = z in C (uel is an existing PARI macro, similar to gel).

Component: interfaces

Keywords: pari finite field

Author: Peter Bruin

Branch/Commit: a02efbb

Reviewer: Jeroen Demeyer

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

@pjbruin pjbruin added this to the sage-7.4 milestone Aug 8, 2016
@jdemeyer
Copy link

jdemeyer commented Aug 8, 2016

Reviewer: Jeroen Demeyer

@pjbruin
Copy link
Contributor Author

pjbruin commented Aug 8, 2016

Branch: u/pbruin/21186-pari_set_uel

@pjbruin
Copy link
Contributor Author

pjbruin commented Aug 8, 2016

Commit: a02efbb

@vbraun
Copy link
Member

vbraun commented Aug 12, 2016

comment:4

Fails on OSX, Linux 32-bit

[sagelib-7.4.beta0] [141/445] gcc -fno-strict-aliasing -I/Users/buildslave-sage/slave/sage_git/build/local/var/tmp/sage/build/python2-2.7.10.p2/include -DNDEBUG -g -fwrapv -O3 -Wall -Wno-unused -I/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/cysignals -I/Users/buildslave-sage/slave/sage_git/build/local/include -I/Users/buildslave-sage/slave/sage_git/build/local/include/python2.7 -I/Users/buildslave-sage/slave/sage_git/build/local/lib/python2.7/site-packages/numpy/core/include -I/Users/buildslave-sage/slave/sage_git/build/src -I/Users/buildslave-sage/slave/sage_git/build/src/sage/ext -I/Users/buildslave-sage/slave/sage_git/build/src/build/cythonized -I/Users/buildslave-sage/slave/sage_git/build/src/build/cythonized/sage/ext -I/Users/buildslave-sage/slave/sage_git/build/local/include/python2.7 -c /Users/buildslave-sage/slave/sage_git/build/src/build/cythonized/sage/libs/pari/gen.c -o build/temp.macosx-10.9-x86_64-2.7/Users/buildslave-sage/slave/sage_git/build/src/build/cythonized/sage/libs/pari/gen.o -fno-strict-aliasing
[sagelib-7.4.beta0] In file included from /Users/buildslave-sage/slave/sage_git/build/src/build/cythonized/sage/libs/pari/gen.c:341:0:
[sagelib-7.4.beta0] /Users/buildslave-sage/slave/sage_git/build/local/include/pari/paripriv.h:16:48: error: unknown type name 'ulong'
[sagelib-7.4.beta0]  hashtable *hashstr_import_static(hashentry *e, ulong size);
[sagelib-7.4.beta0]                                                 ^

@jdemeyer
Copy link

comment:6

It seems unlikely to be caused by this ticket. Are you merging any other PARI-related tickets?

@vbraun
Copy link
Member

vbraun commented Aug 14, 2016

Changed branch from u/pbruin/21186-pari_set_uel to a02efbb

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