Skip to content

Floating point exception for linearly dependent matrix #272

Description

@grhkm21

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)```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions