Changeset 9d68fd in git


Ignore:
Timestamp:
Feb 25, 2013, 3:35:27 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '5a0dde71de01068fad5736a17555c993ecbbf495')
Children:
1c94e44b6b2645f28d5bc81b7b3facc71b2b582d
Parents:
27c79fcbc083eb57ec1345d22a6892cf162f017b
Message:
fix: better tests and normalization for subst
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • Singular/maps_ip.cc

    r27c79f r9d68fd  
    8282        if (nCoeff_is_Extension(currRing->cf))
    8383          res->data=(void *)p_MinPolyNormalize((poly)res->data, currRing);
    84         pTest((poly) res->data);       
     84        pTest((poly) res->data);
    8585      }
    8686      else
    8787      {
    88         assume( nMap != NULL );
    89          
    90         number a = nMap((number)data, preimage_r->cf, currRing->cf);
    91        
    92  
     88        assume( nMap != NULL );
     89
     90        number a = nMap((number)data, preimage_r->cf, currRing->cf);
     91
     92
    9393        if (nCoeff_is_Extension(currRing->cf))
    9494        {
     
    9696/*
    9797          number a = (number)res->data;
    98           number one = nInit(1);
     98          number one = nInit(1);
    9999          number product = nMult(a, one );
    100           nDelete(&one);
    101           nDelete(&a);
     100          nDelete(&one);
     101          nDelete(&a);
    102102          res->data=(void *)product;
    103103 */
     
    119119      else /*if (what==MAP_CMD)*/
    120120      {
     121        p_Test((poly)data,preimage_r);
    121122        matrix s=mpNew(N,maMaxDeg_P((poly)data, preimage_r));
    122123        res->data=(void *)maEval(theMap, (poly)data, preimage_r, nMap, (ideal)s, currRing);
     
    157158        {
    158159          m->m[i]=p_PermPoly(((ideal)data)->m[i],perm,preimage_r,currRing,
    159                           nMap,par_perm,P);
     160                          nMap,par_perm,P);
    160161          pTest(m->m[i]);
    161162        }
     
    247248    else
    248249      theMapI->m[i-1] = p_Copy(image, currRing);
    249   }
    250 
     250    p_Test(theMapI->m[i-1],currRing);
     251  }
     252  //iiWriteMatrix((matrix)theMapI,"map:",1,currRing,0);
    251253
    252254  map theMap=(map)theMapI;
     
    257259  poly res=NULL;
    258260
     261  p_Normalize(p,currRing);
    259262  while (p!=NULL)
    260263  {
     
    265268
    266269    if ( n_IsOne (d, currRing->cf) )
    267     {     
     270    {
    268271      n_Delete(&d, currRing); d = NULL;
    269     }     
     272    }
    270273    else if (!p_IsConstant((poly)NUM(d), R))
    271     {   
     274    {
    272275      WarnS("ignoring denominators of coefficients...");
    273276      n_Delete(&d, currRing); d = NULL;
    274     }     
     277    }
    275278
    276279    number num = n_GetNumerator(p_GetCoeff(p, currRing), currRing);
     
    281284    tmpW.data = NUM (num); // a copy of this poly will be used
    282285
     286    p_Normalize(NUM(num),R);
    283287    if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,R,NULL,NULL,0,nMap))
    284288    {
     
    364368    leftv v=(leftv)omAlloc0Bin(sleftv_bin);
    365369    if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,currRing,NULL,NULL,0,
    366                             n_SetMap(currRing->cf, currRing->cf)))
     370                            n_SetMap(currRing->cf, currRing->cf)))
    367371    {
    368372      WerrorS("map failed");
     
    407411  tmpW.data=id;
    408412  if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,currRing,NULL,NULL,0,
    409                           n_SetMap(currRing->cf, currRing->cf)))
     413                          n_SetMap(currRing->cf, currRing->cf)))
    410414  {
    411415    WerrorS("map failed");
  • libpolys/coeffs/longrat.cc

    r27c79f r9d68fd  
    213213  if (a->s<2)
    214214  {
     215    if (a->n[0]._mp_d[0]==0)
     216    {
     217      Print("!!longrat: n==0 in %s:%d\n",f,l);
     218      return FALSE;
     219    }
    215220    /* TODO: If next line is active, then computations in algebraic field
    216221             extensions over Q will throw a lot of assume violations although
  • 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.