Changeset f489bea in git for libpolys


Ignore:
Timestamp:
Dec 14, 2012, 4:46:09 PM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
0486a3f557b13057ce2046dfee2f6fabc0dad2ac
Parents:
ea25bc7eab91185a4ce3010da5a5cdc016da2dbf
Message:
fix: init of Z/2^m
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/rmodulo2m.cc

    rea25bc rf489bea  
    5151  r->nCoeffIsEqual = nr2mCoeffIsEqual;
    5252
     53  r->modBase = (int_number) omAlloc(sizeof(mpz_t));
     54  mpz_init_set_si (r->modBase, 2L);
    5355  r->ringtype = 1;
    5456
     
    649651    /* we want mod2mMask to be the bit pattern
    650652       '111..1' consisting of m one's: */
     653    r->modExponent= m;
    651654    r->mod2mMask = 1;
    652655    for (int i = 1; i < m; i++) r->mod2mMask = (r->mod2mMask << 1) + 1;
     
    654657  else
    655658  {
     659    r->modExponent= 2;
    656660    /* code unexpectedly called with m = 1; we continue with m = 2: */
    657661    r->mod2mMask = 3; /* i.e., '11' in binary representation */
Note: See TracChangeset for help on using the changeset viewer.