I happened to meet a overflow error, I install sage 6.2 both on a 64-bit macbook running MacOS 10.9 and 32-bit Dell Desktop running Ubuntu 12.04.
The error message goes like this:
OverflowError Traceback (most recent call last)
<ipython-input-7-8d411648858e> in <module>()
----> 1 get_ipython().magic(u'runfile DataCollecctionScript.py')
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
2163 magic_name, _, magic_arg_s = arg_s.partition(' ')
2164 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2165 return self.run_line_magic(magic_name, magic_arg_s)
2166
2167 #-------------------------------------------------------------------------
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
2084 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2085 with self.builtin_trap:
-> 2086 result = fn(*args,**kwargs)
2087 return result
2088
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/repl/ipython_extension.pyc in runfile(self, s)
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
189 # but it's overkill for just that one bit of state.
190 def magic_deco(arg):
--> 191 call = lambda f, *a, **k: f(*a, **k)
192
193 if callable(arg):
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/repl/ipython_extension.pyc in runfile(self, s)
108 2
109 """
--> 110 return self.shell.ex(preparser.load_wrap(s, attach=False))
111
112 @line_magic
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in ex(self, cmd)
2437 """Execute a normal python statement in user namespace."""
2438 with self.builtin_trap:
-> 2439 exec cmd in self.user_global_ns, self.user_ns
2440
2441 def ev(self, expr):
<string> in <module>()
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/misc/preparser.pyc in load(filename, globals, attach)
1757 if fpath.endswith('.py'):
1758 exec_file_is(fpath)
-> 1759 execfile(fpath, globals)
1760 elif fpath.endswith('.sage'):
1761 from sage.misc.attached_files import load_attach_mode
/Users/David/Desktop/src/DataCollecctionScript.py in <module>()
95
96 elif option == 'NiedereiterCryptosystem':
---> 97 crypto = NiederreiterCryptosystem(n,m,irr_poly);
98 #Encrypt & Decrypt
99 #Get m*t-bits random message weighing at most t and encrypt it.
<string> in __init__(self, n, m, g)
<string> in __init__(self, n, m, g)
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/matrix/matrix0.so in sage.matrix.matrix0.Matrix.__getitem__ (sage/matrix/matrix0.c:5871)()
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/matrix/matrix_mod2e_dense.so in sage.matrix.matrix_mod2e_dense.Matrix_mod2e_dense.get_unsafe (sage/matrix/matrix_mod2e_dense.c:4199)()
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/matrix/matrix_mod2e_dense.so in sage.matrix.matrix_mod2e_dense.word_to_poly (sage/matrix/matrix_mod2e_dense.c:3090)()
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/rings/finite_rings/finite_field_ntl_gf2e.pyc in fetch_int(self, number)
277 [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
278 """
--> 279 return self._cache.fetch_int(number)
280
281 def polynomial(self, name=None):
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/rings/finite_rings/element_ntl_gf2e.so in sage.rings.finite_rings.element_ntl_gf2e.Cache_ntl_gf2e.fetch_int (sage/rings/finite_rings/element_ntl_gf2e.cpp:6011)()
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/rings/finite_rings/element_ntl_gf2e.so in sage.rings.finite_rings.element_ntl_gf2e.Cache_ntl_gf2e.fetch_int (sage/rings/finite_rings/element_ntl_gf2e.cpp:5808)()
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/rings/real_double.so in sage.rings.real_double.RealDoubleElement.__int__ (sage/rings/real_double.c:13090)()
OverflowError: cannot convert float infinity to integer
It appears I collect this error because I am using very large matrices. In my case, I used a matrix with 144*10^16 of size and then I met this error. However, when I shrink it to be 144*10^15, everything just goes fine!
I have attached my codes and hopefully, someone here could help me with this problem. Thanks in advance.
Some more details for debugging:
1. DataCollecctionScript.py is the main function, in this script, I set at line 46-48: m=16, n=2^16 and t=9. With these parameters I would encounter an error in CopaCode.sage, line 59: H_check_poly is a (m*t) * n matrix with GF(2^m) element as its entry. But if I set n to be 2^15 or smaller, there would be no error any more. This is why I doubt it is a potential bug here.
I happened to meet a overflow error, I install sage 6.2 both on a 64-bit macbook running MacOS 10.9 and 32-bit Dell Desktop running Ubuntu 12.04.
The error message goes like this:
OverflowError Traceback (most recent call last)
<ipython-input-7-8d411648858e> in <module>()
----> 1 get_ipython().magic(u'runfile DataCollecctionScript.py')
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in magic(self, arg_s)
2163 magic_name, _, magic_arg_s = arg_s.partition(' ')
2164 magic_name = magic_name.lstrip(prefilter.ESC_MAGIC)
-> 2165 return self.run_line_magic(magic_name, magic_arg_s)
2166
2167 #-------------------------------------------------------------------------
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/IPython/core/interactiveshell.pyc in run_line_magic(self, magic_name, line)
2084 kwargs['local_ns'] = sys._getframe(stack_depth).f_locals
2085 with self.builtin_trap:
-> 2086 result = fn(*args,**kwargs)
2087 return result
2088
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/sage/repl/ipython_extension.pyc in runfile(self, s)
/Applications/Sage-6.2.app/Contents/Resources/sage/local/lib/python2.7/site-packages/IPython/core/magic.pyc in <lambda>(f, *a, **k)
189 # but it's overkill for just that one bit of state.
190 def magic_deco(arg):
--> 191 call = lambda f, *a, **k: f(*a, **k)
...<span style="font-size:14.0pt; font-family:"
sage: M = matrix(F, [[1],[0]])
sage: type(M)
<type 'sage.matrix.matrix_mod2e_dense.Matrix_mod2e_dense'>
sage: M
<repr(<sage.matrix.matrix_mod2e_dense.Matrix_mod2e_dense at 0x7fbcf6f65e20>) failed: OverflowError: cannot convert float infinity to integer>
sage: F = GF(2**17, 'a')
sage: M = matrix(F, [[1],[0]])
sage: type(M)
<type 'sage.matrix.matrix_generic_dense.Matrix_generic_dense'>