Changeset 9d68fd in git for libpolys/polys


Ignore:
Timestamp:
Feb 25, 2013, 3:35:27 PM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
1c94e44b6b2645f28d5bc81b7b3facc71b2b582d
Parents:
27c79fcbc083eb57ec1345d22a6892cf162f017b
Message:
fix: better tests and normalization for subst
Location:
libpolys/polys
Files:
3 edited

Legend:

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

    r27c79f r9d68fd  
    278278{
    279279  ntTest(a);
     280  if (IS0(a)) return NULL;
     281
    280282  definiteGcdCancellation(a, cf, FALSE);
    281 
    282   if (IS0(a)) return NULL;
    283283
    284284  fraction f = (fraction)a;
     
    14881488  assume(src == dst->extRing->cf);
    14891489  if ((SR_HDL(a) & SR_INT) || (a->s==3))
    1490     return ntInit(p_NSet(n_Copy(a, src), dst->extRing), dst);
     1490  {
     1491    number res=ntInit(p_NSet(n_Copy(a, src), dst->extRing), dst);
     1492    n_Test(res,dst);
     1493    return res;
     1494  }
    14911495  number nn=nlGetDenom(a,src);
    14921496  number zz=nlGetNumerator(a,src);
    14931497  number res=ntInit(p_NSet(zz,dst->extRing), dst);
    14941498  fraction ff=(fraction)res;
    1495   DEN(ff)=p_NSet(nn,dst->extRing);
     1499  if (n_IsOne(nn,src)) DEN(ff)=NULL;
     1500  else                 DEN(ff)=p_NSet(nn,dst->extRing);
     1501  n_Test((number)ff,dst);
    14961502  return (number)ff;
    14971503}
     
    17461752
    17471753  poly p = p_One(R); p_SetExp(p, iParameter, 1, R); p_Setm(p, R);
    1748 
    1749 //  return (number) p;
     1754  p_Test(p,R);
    17501755
    17511756  fraction f = (fraction)omAlloc0Bin(fractionObjectBin);
  • libpolys/polys/monomials/maps.cc

    r27c79f r9d68fd  
    8787           nMapFunc nMap, const ring dst_r)
    8888{
     89    p_Test(p,preimage_r);
    8990    poly q=p_NSet(nMap(pGetCoeff(p),preimage_r->cf,dst_r->cf),dst_r);
    9091
  • libpolys/polys/pDebug.cc

    r27c79f r9d68fd  
    248248    _pPolyAssumeReturnMsg(p->coef != NULL || (n_GetChar(r->cf) >= 2), "NULL coef",p,r);
    249249    #ifdef LDEBUG
    250     r->cf->cfDBTest(p->coef,__FILE__,__LINE__,r->cf);
     250    _pPolyAssumeReturnMsg(r->cf->cfDBTest(p->coef,__FILE__,__LINE__,r->cf),"coeff err",p,r);
    251251    #endif
    252252    _pPolyAssumeReturnMsg(!n_IsZero(p->coef, r->cf), "Zero coef",p,r);
Note: See TracChangeset for help on using the changeset viewer.