Changeset 35c6e2c in git for libpolys


Ignore:
Timestamp:
Jan 22, 2021, 3:55:14 PM (3 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '4188d308699580d975efd0f6cca8dcb41c396f70')
Children:
91bc522a482282a6f454e23d7b56246918b2d9e2
Parents:
bad89c24b3352b9c5651915636ed5f2d7766baf9
Message:
fix: map Z, Zn ->Zp, mpz_z ->Zp
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/modulop.cc

    rbad89c r35c6e2c  
    329329#endif
    330330
     331static number npInitMPZ(mpz_t m, const coeffs r)
     332{
     333  return (number)mpz_fdiv_ui(m, r->ch);
     334}
     335
    331336BOOLEAN npInitChar(coeffs r, void* p)
    332337{
     
    359364  //r->cfSize  = ndSize;
    360365  r->cfInt  = npInt;
     366  r->cfInitMPZ = npInitMPZ;
    361367  #ifdef HAVE_RINGS
    362368  //r->cfDivComp = NULL; // only for ring stuff
     
    567573static number npMapGMP(number from, const coeffs /*src*/, const coeffs dst)
    568574{
    569   mpz_ptr erg = (mpz_ptr) omAlloc(sizeof(mpz_t)); // evtl. spaeter mit bin
    570   mpz_init(erg);
    571 
    572   mpz_mod_ui(erg, (mpz_ptr) from, dst->ch);
    573   number r = (number) mpz_get_si(erg);
    574 
    575   mpz_clear(erg);
    576   omFree((void *) erg);
    577   return (number) r;
     575  return (number)mpz_fdiv_ui((mpz_ptr) from, dst->ch);
    578576}
    579577
Note: See TracChangeset for help on using the changeset viewer.