Changeset f769fd0 in git


Ignore:
Timestamp:
Feb 20, 2013, 5:48:56 PM (10 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'cbf866d4f8c3861325311c042cb2033c053453b2')
Children:
ef7324f0fe134054c1000413c4d1fa21ccc163b1
Parents:
5602268070a5515f6c8a239a56a190a45699fcfd
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2013-02-20 17:48:56+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2013-02-20 19:04:08+01:00
Message:
Fixed the handling of constant (non-1) denoms
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/maps_ip.cc

    r5602268 rf769fd0  
    234234poly pSubstPar(poly p, int par, poly image)
    235235{
     236  assume( nCoeff_is_transExt(currRing->cf) ); // nCoeff_is_Extension???
     237  const ring R = currRing->cf->extRing;
     238
    236239  ideal theMapI = idInit(rPar(currRing),1);
    237   nMapFunc nMap = n_SetMap(currRing->cf->extRing->cf, currRing->cf);
     240  nMapFunc nMap = n_SetMap(R->cf, currRing->cf);
    238241
    239242  int i;
     
    245248      theMapI->m[i-1] = p_Copy(image, currRing);
    246249  }
    247  
     250
    248251
    249252  map theMap=(map)theMapI;
     
    259262
    260263    number d = n_GetDenom(p_GetCoeff(p, currRing), currRing);
    261     if (!n_IsOne (d, currRing->cf))
     264    assume( p_Test((poly)NUM(d), R) );
     265
     266    if ( n_IsOne (d, currRing->cf) )
     267    {     
     268      n_Delete(&d, currRing); d = NULL;
     269    }     
     270    else if (!p_IsConstant((poly)NUM(d), R))
     271    {   
    262272      WarnS("ignoring denominators of coefficients...");
    263     n_Delete(&d, currRing);
    264 
    265     number num = n_GetNumerator(p_GetCoeff(p, currRing), currRing);
     273      n_Delete(&d, currRing); d = NULL;
     274    }     
     275
     276    number num = n_GetNumerator(p_GetCoeff(p, currRing), currRing);
     277    assume( p_Test((poly)NUM(num), R) );
    266278
    267279    memset(&tmpW,0,sizeof(sleftv));
    268280    tmpW.rtyp = POLY_CMD;
    269281    tmpW.data = NUM (num); // a copy of this poly will be used
    270      
    271     if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,currRing->cf->extRing,NULL,NULL,0,nMap))
     282
     283    if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,R,NULL,NULL,0,nMap))
    272284    {
    273285      WerrorS("map failed");
     
    279291    poly pp = pHead(p);
    280292    //PrintS("map:");pWrite(pp);
    281     pSetCoeff(pp, nInit(1));
     293    if( d != NULL )
     294    {
     295      pSetCoeff(pp, n_Invers(d, currRing->cf));
     296      n_Delete(&d, currRing); // d = NULL;
     297    } else
     298      pSetCoeff(pp, nInit(1));
     299
    282300    //PrintS("->");pWrite((poly)(v->data));
    283301    poly ppp = pMult((poly)(v->data),pp);
Note: See TracChangeset for help on using the changeset viewer.