Coder Social home page Coder Social logo

Comments (2)

fredrik-johansson avatar fredrik-johansson commented on August 17, 2024 1

I think I found the cause. In fq_nmod_mpolyu_gcds_zippel, the polynomial f is a deliberately non-canonicalised "form" polynomial containing the sought exponents but with zero coefficients.

The following code

        FLINT_ASSERT((f->coeffs + 0)->length == 1);
        fq_nmod_mpolyu_set(G, f, ctx);
        _n_fq_one((G->coeffs + 0)->coeffs + d*0, d);

sets G to a valid the length-1 polynomial with form f and coefficient 1 instead of 0, but the assert in fq_nmod_mpolyu_set triggers before the coefficient is assigned.

I believe replacing fq_nmod_mpolyu_set by fq_nmod_mpolyu_setform solves the problem.

Not a serious bug, because fq_nmod_mpolyu_set happens to do the thing when the input is non-canonical, but ought to be fixed for cleanliness.

@tthsqe12 does that look correct?

It looks like we have the same issue in src/nmod_mpoly/mpolyu_gcdp_zippel.c, but that case isn't reached by tests: https://app.codecov.io/gh/flintlib/flint/blob/main/src%2Fnmod_mpoly%2Fmpolyu_gcdp_zippel.c#L231

While we're at it, it would be nice to improve the test code in nmod_mpoly so that we have coverage there.

The GCD code for fmpz_mod_mpoly looks a different; not sure if it has the same problem.

from flint.

fredrik-johansson avatar fredrik-johansson commented on August 17, 2024

I've tried to tweak the nmod_mpoly_gcd_zippel test code (generating polynomials with fewer variables and terms) to hit that branch in nmod_mpolyu_gcds_zippel, but I've been unable to reach it. I wonder if it's actually reachable? Perhaps one has to test nmod_mpolyu_gcds_zippel directly.

from flint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.