Skip to content

Conversation

@user202729
Copy link
Contributor

@user202729 user202729 commented Dec 19, 2025

  1. in refuse to compare two ideals that we don't know how to compare #41040, it was decided that ideal comparison should compare them by set inclusion. Ideals of ZZ[x]'s comparison becomes unimplemented.

    This pull request implements it by delegating to Singular. This is similar to how inverse_mod currently delegate to Singular, see Make inverse_mod use Singular in a few cases #39743

  2. Similarly, .divides() of polynomials over ℤ delegate to Singular.

  3. Previously, RDF[] and CDF[] can be represented by Singular command-line interface. This represents these polynomial rings in libsingular too for feature parity.

    The magic constant 15 is just to match what you get using the singular interface.


The correctness of the code can be verified by comparing with singular's source code. For example shortfl.h contains

#if SIZEOF_DOUBLE == SIZEOF_LONG
#define SI_FLOAT double
#else
#define SI_FLOAT float
#endif

and later shortfl.cc:

union nf
{
  SI_FLOAT _f;
  number _n;

  nf(SI_FLOAT f): _f(f){};

  nf(number n): _n(n){};

  inline SI_FLOAT F() const {return _f;}
  inline number N() const {return _n;}
};

SI_FLOAT nrFloat(number n)
{
  return nf(n).F();
}

For n_long_C type, gnumpc.cc has e.g.

static long ngcInt(number &i, const coeffs r)
{
  assume( getCoeffType(r) == n_long_C );

  return ((gmp_complex*)i)->real();
}

indicating the correct thing to do with the number pointer is to cast them to gmp_complex*.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

@github-actions
Copy link

github-actions bot commented Dec 19, 2025

Documentation preview for this PR (built with commit d245ceb; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@user202729 user202729 marked this pull request as ready for review December 19, 2025 18:44
@user202729 user202729 changed the title RDF[] for libsingular, delegate ideal comparison to singular RDF[] for libsingular, delegate ideal comparison and .divides() to singular Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant