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

Floating point exception for linearly dependent matrix #272

Open
grhkm21 opened this issue Mar 27, 2024 · 0 comments
Open

Floating point exception for linearly dependent matrix #272

grhkm21 opened this issue Mar 27, 2024 · 0 comments

Comments

@grhkm21
Copy link

grhkm21 commented Mar 27, 2024

The first example fails, but works again with mpfr float_type. Is this "intended"/normal?

In [1]: from fpylll import GSO, IntegerMatrix

In [2]: M = IntegerMatrix.from_matrix([[1, 0], [0, 1], [1, 1]])

In [3]: G = GSO.Mat(M); _ = G.update_gso()

In [4]: G.babai([0, 0])
---------------------------------------------------------------------------
FloatingPointError                        Traceback (most recent call last)
Cell In[4], line 1
----> 1 G.babai([0, 0])

File /private/tmp/fpylll/src/fpylll/fplll/gso.pyx:2378, in fpylll.fplll.gso.MatGSO.babai()
   2376 vector_fp_nr_barf(cv, v, FT_DOUBLE)
   2377 sig_on()
-> 2378 (<MatGSO_c[Z_NR[mpz_t],FP_NR[d_t]]*>self._core.mpz_d).babai(cw.mpz, cv.d, start, dimension, gso)
   2379 sig_off()
   2380 return vector_z_nr_slurp(cw, ZT_MPZ)

FloatingPointError: Floating point exception

In [5]: G = GSO.Mat(M, float_type="mpfr"); _ = G.update_gso()

In [6]: G.babai([0, 0])
Out[6]: (0, 0, 0)```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant