Changeset 8c6bd4d in git


Ignore:
Timestamp:
Dec 14, 2012, 9:47:04 PM (10 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '2234726c50d679d6664181a5c72f75a6fd64a787')
Children:
4880569a037a922b03f2231fda984a5263af7b86
Parents:
6bb9d98190052a76f6d3e74e821b63ea531d8124
Message:
fix: init Z/* from bigint's
Location:
libpolys/coeffs
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/rintegers.cc

    r6bb9d9 r8c6bd4d  
    403403  r->cfExtGcd = nrzExtGcd; // only for ring stuff
    404404  r->cfDivBy = nrzDivBy; // only for ring stuff
     405  r->cfInit_bigint = nrzMapQ;
    405406  //#endif
    406407  r->cfNeg   = nrzNeg;
  • libpolys/coeffs/rintegers.h

    r6bb9d9 r8c6bd4d  
    5353void    nrzDelete(number *a, const coeffs r);
    5454
    55 number nrzMapQ(number from);
     55number nrzMapQ(number from, const coeffs src, const coeffs dst);
    5656#endif
    5757#endif
  • libpolys/coeffs/rmodulo2m.cc

    r6bb9d9 r8c6bd4d  
    9090  r->cfName        = ndName;
    9191  r->cfCoeffWrite  = nr2mCoeffWrite;
     92  r->cfInit_bigint = nr2mMapQ;
    9293#ifdef LDEBUG
    9394  r->cfDBTest      = nr2mDBTest;
     
    559560}
    560561
    561 number nr2mMapQ(number from, const coeffs /*src*/, const coeffs dst)
     562number nr2mMapQ(number from, const coeffs src, const coeffs dst)
    562563{
    563564  int_number erg = (int_number)omAllocBin(gmp_nrz_bin);
     
    566567  mpz_init_set_ui(k, dst->mod2mMask);
    567568
    568   nlGMP(from, (number)erg, dst);
     569  nlGMP(from, (number)erg, src);
    569570  mpz_and(erg, erg, k);
    570571  number res = (number)mpz_get_ui(erg);
  • libpolys/coeffs/rmodulo2m.h

    r6bb9d9 r8c6bd4d  
    5454void    nr2mInitExp(int c, const coeffs r);
    5555
     56number nr2mMapQ(number from, const coeffs src, const coeffs dst);
    5657
    5758static inline number nr2mMultM(number a, number b, const coeffs r)
     
    7778#define nr2mEqualM(A,B)  ((A)==(B))
    7879
     80
    7981#endif
    8082#endif
  • libpolys/coeffs/rmodulon.cc

    r6bb9d9 r8c6bd4d  
    9999  r->cfCoeffWrite  = nrnCoeffWrite;
    100100  r->nCoeffIsEqual = nrnCoeffsEqual;
     101  r->cfInit_bigint = nrnMapQ;
     102
    101103#ifdef LDEBUG
    102104  r->cfDBTest      = nrnDBTest;
     
    483485}
    484486
    485 number nrnMapQ(number from, const coeffs src, const coeffs /*dst*/)
     487number nrnMapQ(number from, const coeffs src, const coeffs dst)
    486488{
    487489  int_number erg = (int_number)omAllocBin(gmp_nrz_bin);
    488490  mpz_init(erg);
    489491  nlGMP(from, (number)erg, src);
    490   mpz_mod(erg, erg, src->modNumber);
     492  mpz_mod(erg, erg, dst->modNumber);
    491493  return (number)erg;
    492494}
  • libpolys/coeffs/rmodulon.h

    r6bb9d9 r8c6bd4d  
    5555void    nrnInitExp(unsigned long c, const coeffs r);
    5656
     57number nrnMapQ(number from, const coeffs src, const coeffs dst);
    5758#endif
    5859#endif
Note: See TracChangeset for help on using the changeset viewer.