FLINT3.7.0-dev

nmod_berlekamp_massey_reduce

Synopsis#include <flint/nmod_poly.h>
int nmod_berlekamp_massey_reduce(nmod_berlekamp_massey_t B)source

Brings VV and RR up to date with all points added and returns 1 if VV changed, 0 otherwise.

The new points are absorbed into RR and the remainder sequence is continued with Euclidean steps, or with nmod_poly_hgcd when at least 10 more degrees have to be removed, until deg⁡R<m/2\deg R < m/2; the algorithm and its correctness are described in Berlekamp–Massey as a partial Euclidean algorithm. For example, after adding 1,1,2,31, 1, 2, 3 the function returns 1 with V=x2−x−1V = x^2 - x - 1 (up to a constant factor) and deg⁡R<deg⁡V\deg R < \deg V; adding 5,85, 8 and reducing again returns 0.

Cite this page

The FLINT team, “nmod_berlekamp_massey_reduce (nmod_poly.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/nmod_poly/nmod_berlekamp_massey_reduce.html (generated 2026-11-02).