Changeset 79020f in git for libpolys/polys


Ignore:
Timestamp:
Jan 6, 2012, 9:28:16 PM (12 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
40e88db63c509564c2b00b7142b39ef6b846f72e
Parents:
1cbb1f452324cf72b33ef5a1cb6256d97bcbcbd0
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-01-06 21:28:16+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-01-06 21:59:37+01:00
Message:
fixed arithmetic overflow by rewriting nlModP

CHG: nlModP (longrat) was rewritten in order to simplify and generalize it
CHG/FIX: nlModP _works_ again as in the old Singular (uses n_Div)
Location:
libpolys/polys/ext_fields
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/ext_fields/algext.cc

    r1cbb1f4 r79020f  
    650650  if (n_IsZero(a, src)) return NULL;
    651651  int p = rChar(dst->extRing);
    652   int n = nlModP(a, p, src);
    653   number q = n_Init(n, dst->extRing->cf);
    654   poly result = p_One(dst->extRing);
    655   p_SetCoeff(result, q, dst->extRing);
     652
     653  number q = nlModP(a, src, dst->extRing->cf);
     654
     655  poly result = p_NSet(q, dst->extRing);
     656 
    656657  return (number)result;
    657658}
  • libpolys/polys/ext_fields/transext.cc

    r1cbb1f4 r79020f  
    11191119  if (n_IsZero(a, src)) return NULL;
    11201120  int p = rChar(dst->extRing);
    1121   int n = nlModP(a, p, src);
    1122   number q = n_Init(n, dst->extRing->cf);
    1123   poly g;
     1121  number q = nlModP(a, src, dst->extRing->cf);
     1122
    11241123  if (n_IsZero(q, dst->extRing->cf))
    11251124  {
     
    11271126    return NULL;
    11281127  }
    1129   g = p_One(dst->extRing);
    1130   p_SetCoeff(g, q, dst->extRing);
     1128 
     1129  poly g = p_NSet(q, dst->extRing);
     1130
    11311131  fraction f = (fraction)omAlloc0Bin(fractionObjectBin);
    11321132  NUM(f) = g; // DEN(f) = NULL; COM(f) = 0;
Note: See TracChangeset for help on using the changeset viewer.