Changeset 732d05 in git


Ignore:
Timestamp:
Dec 25, 2016, 4:12:33 PM (6 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '5bec8f88c9ee2573d328cf7c3aff2bcb301d2395')
Children:
179432f06baa042df5efea4f8038b9e905b14a1f
Parents:
94e916463d1aac04a7b0f2dcb7d983b3215f1fc2
Message:
fix: removed wrong ring changes in interpreter for ring_cf rings
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    r94e916 r732d05  
    18711871  if (rField_is_Ring(currRing))
    18721872  {
    1873     //ring origR = currRing;
    1874     //ring tempR = rCopy(origR);
    1875     //coeffs new_cf=nInitChar(n_Q,NULL);
    1876     //nKillChar(tempR->cf);
    1877     //tempR->cf=new_cf;
    1878     //rComplete(tempR);
    18791873    ideal vid = (ideal)v->Data();
    18801874    int i = idPosConstant(vid);
     
    18841878      return FALSE;
    18851879    }
    1886     //rChangeCurrRing(tempR);
    1887     //ideal vv = idrCopyR(vid, origR, currRing);
    18881880    ideal vv = id_Copy(vid, currRing);
    1889     //ideal ww = idrCopyR((ideal)w->Data(), origR, currRing);
    18901881    ideal ww = id_Copy((ideal)w->Data(), currRing);
    18911882    /* drop degree zero generator from vv (if any) */
     
    18951886    res->data = (char *)d;
    18961887    idDelete(&vv); idDelete(&ww);
    1897     //rChangeCurrRing(origR);
    1898     //rDelete(tempR);
    18991888    return FALSE;
    19001889  }
     
    23092298  if (rField_is_Ring_Z(currRing))
    23102299  {
    2311     ring origR = currRing;
    2312     ring tempR = rCopy(origR);
    2313     coeffs new_cf=nInitChar(n_Q,NULL);
    2314     nKillChar(tempR->cf);
    2315     tempR->cf=new_cf;
    2316     rComplete(tempR);
    2317     sleftv uAsLeftv; memset(&uAsLeftv, 0, sizeof(uAsLeftv));
    2318     uAsLeftv.rtyp=u->Typ();
    2319     uAsLeftv.data=u->CopyD();
    2320     rChangeCurrRing(tempR);
    2321     sleftv uuAsLeftv; memset(&uuAsLeftv, 0, sizeof(uuAsLeftv));
    2322     nMapFunc nMap=n_SetMap(origR->cf,tempR->cf);
    2323     maApplyFetch(FETCH_CMD,NULL,&uuAsLeftv,&uAsLeftv,origR,NULL,NULL,0,nMap);
    2324     ideal uu=(ideal)uuAsLeftv.data;
    2325     if (hasFlag(u, FLAG_STD)) setFlag(&uuAsLeftv,FLAG_STD);
    2326     assumeStdFlag(&uuAsLeftv);
    23272300    PrintS("// NOTE: computation of Hilbert series etc. is being\n");
    23282301    PrintS("//       performed for generic fibre, that is, over Q\n");
    2329     intvec *module_w=(intvec*)atGet(&uuAsLeftv,"isHomog",INTVEC_CMD);
    2330     intvec *iv=hFirstSeries(uu,module_w,currRing->qideal);
    2331     int returnWithTrue = 1;
    2332     switch((int)(long)v->Data())
    2333     {
    2334       case 1:
    2335         res->data=(void *)iv;
    2336         returnWithTrue = 0;
    2337       case 2:
    2338         res->data=(void *)hSecondSeries(iv);
    2339         delete iv;
    2340         returnWithTrue = 0;
    2341     }
    2342     if (returnWithTrue)
    2343     {
    2344       WerrorS(feNotImplemented);
    2345       delete iv;
    2346     }
    2347     uuAsLeftv.CleanUp(tempR);
    2348     rChangeCurrRing(origR);
    2349     uAsLeftv.CleanUp(origR);
    2350     rDelete(tempR);
    2351     if (returnWithTrue) return TRUE; else return FALSE;
    23522302  }
    23532303#endif
     
    37713721{
    37723722  SPrintStart();
     3723#ifdef HAVE_RINGS
    37733724  if (rField_is_Ring_Z(currRing))
    37743725  {
    3775     ring origR = currRing;
    3776     ring tempR = rCopy(origR);
    3777     coeffs new_cf=nInitChar(n_Q,NULL);
    3778     nKillChar(tempR->cf);
    3779     tempR->cf=new_cf;
    3780     rComplete(tempR);
    3781     ideal vid = (ideal)v->Data();
    3782     rChangeCurrRing(tempR);
    3783     ideal vv = idrCopyR(vid, origR, currRing);
    3784     sleftv vvAsLeftv; memset(&vvAsLeftv, 0, sizeof(vvAsLeftv));
    3785     vvAsLeftv.rtyp = IDEAL_CMD;
    3786     vvAsLeftv.data = vv; vvAsLeftv.next = NULL;
    3787     if (hasFlag(v, FLAG_STD)) setFlag(&vvAsLeftv,FLAG_STD);
    3788     assumeStdFlag(&vvAsLeftv);
    37893726    PrintS("// NOTE: computation of degree is being performed for\n");
    37903727    PrintS("//       generic fibre, that is, over Q\n");
    3791     intvec *module_w=(intvec*)atGet(&vvAsLeftv,"isHomog",INTVEC_CMD);
    3792     scDegree(vv,module_w,currRing->qideal);
    3793     idDelete(&vv);
    3794     rChangeCurrRing(origR);
    3795     rDelete(tempR);
    3796   }
     3728  }
     3729#endif
    37973730  assumeStdFlag(v);
    37983731  intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
     
    39213854     Warn("dim(%s) may be wrong because the mixed monomial ordering",v->Name());
    39223855  }
     3856#ifdef HAVE_RINGS
    39233857  if (rField_is_Ring(currRing))
    39243858  {
     
    39853919    return FALSE;
    39863920  }
     3921#endif
    39873922  res->data = (char *)(long)scDimInt((ideal)(v->Data()),currRing->qideal);
    39883923  return FALSE;
     
    41494084static BOOLEAN jjHILBERT(leftv, leftv v)
    41504085{
     4086#ifdef HAVE_RINGS
    41514087  if (rField_is_Ring_Z(currRing))
    41524088  {
    4153     ring origR = currRing;
    4154     ring tempR = rCopy(origR);
    4155     coeffs new_cf=nInitChar(n_Q,NULL);
    4156     nKillChar(tempR->cf);
    4157     tempR->cf=new_cf;
    4158     rComplete(tempR);
    4159     ideal vid = (ideal)v->Data();
    4160     rChangeCurrRing(tempR);
    4161     ideal vv = idrCopyR(vid, origR, currRing);
    4162     sleftv vvAsLeftv; memset(&vvAsLeftv, 0, sizeof(vvAsLeftv));
    4163     vvAsLeftv.rtyp = IDEAL_CMD;
    4164     vvAsLeftv.data = vv; vvAsLeftv.next = NULL;
    4165     if (hasFlag(v, FLAG_STD)) setFlag(&vvAsLeftv,FLAG_STD);
    4166     assumeStdFlag(&vvAsLeftv);
    41674089    PrintS("// NOTE: computation of Hilbert series etc. is being\n");
    41684090    PrintS("//       performed for generic fibre, that is, over Q\n");
    4169     intvec *module_w=(intvec*)atGet(&vvAsLeftv,"isHomog",INTVEC_CMD);
    4170     //scHilbertPoly(vv,currRing->qideal);
    4171     hLookSeries(vv,module_w,currRing->qideal);
    4172     idDelete(&vv);
    4173     rChangeCurrRing(origR);
    4174     rDelete(tempR);
    4175     return FALSE;
    4176   }
     4091  }
     4092#endif
    41774093  assumeStdFlag(v);
    41784094  intvec *module_w=(intvec*)atGet(v,"isHomog",INTVEC_CMD);
     
    41834099static BOOLEAN jjHILBERT_IV(leftv res, leftv v)
    41844100{
     4101#ifdef HAVE_RINGS
    41854102  if (rField_is_Ring_Z(currRing))
    41864103  {
     
    41884105    PrintS("//       performed for generic fibre, that is, over Q\n");
    41894106  }
     4107#endif
    41904108  res->data=(void *)hSecondSeries((intvec *)v->Data());
    41914109  return FALSE;
     
    42964214{
    42974215  ideal result=kInterRed((ideal)(v->Data()), currRing->qideal);
     4216#ifdef HAVE_RINGS
    42984217  if(rField_is_Ring(currRing))
    4299     Warn("interred: this command is experimental over the integers");
     4218    WarnS("interred: this command is experimental over the integers");
     4219#endif
    43004220  if (TEST_OPT_PROT) { PrintLn(); mflush(); }
    43014221  res->data = result;
     
    57855705    return TRUE;
    57865706  }
     5707#ifdef HAVE_RINGS
    57875708  if (rField_is_Ring_Z(currRing))
    57885709  {
    5789     ring origR = currRing;
    5790     ring tempR = rCopy(origR);
    5791     coeffs new_cf=nInitChar(n_Q,NULL);
    5792     nKillChar(tempR->cf);
    5793     tempR->cf=new_cf;
    5794     rComplete(tempR);
    5795     sleftv uAsLeftv; memset(&uAsLeftv, 0, sizeof(uAsLeftv));
    5796     uAsLeftv.rtyp=u->Typ();
    5797     uAsLeftv.data=u->CopyD();
    5798     rChangeCurrRing(tempR);
    5799     nMapFunc nMap=n_SetMap(origR->cf,tempR->cf);
    5800     sleftv uuAsLeftv; memset(&uuAsLeftv, 0, sizeof(uuAsLeftv));
    5801     maApplyFetch(FETCH_CMD,NULL,&uuAsLeftv,&uAsLeftv,origR,NULL,NULL,0,nMap);
    5802     ideal uu=(ideal)uuAsLeftv.data;
    5803     if (hasFlag(u, FLAG_STD)) setFlag(&uuAsLeftv,FLAG_STD);
    5804     assumeStdFlag(&uuAsLeftv);
    58055710    PrintS("// NOTE: computation of Hilbert series etc. is being\n");
    58065711    PrintS("//       performed for generic fibre, that is, over Q\n");
    5807     intvec *module_w=(intvec*)atGet(&uuAsLeftv,"isHomog",INTVEC_CMD);
    5808     intvec *iv=hFirstSeries(uu,module_w,currRing->qideal,wdegree);
    5809     int returnWithTrue = 1;
    5810     switch((int)(long)v->Data())
    5811     {
    5812       case 1:
    5813         res->data=(void *)iv;
    5814         returnWithTrue = 0;
    5815       case 2:
    5816         res->data=(void *)hSecondSeries(iv);
    5817         delete iv;
    5818         returnWithTrue = 0;
    5819     }
    5820     if (returnWithTrue)
    5821     {
    5822       WerrorS(feNotImplemented);
    5823       delete iv;
    5824     }
    5825     uuAsLeftv.CleanUp(tempR);
    5826     rChangeCurrRing(origR);
    5827     uAsLeftv.CleanUp(origR);
    5828     rDelete(tempR);
    5829     if (returnWithTrue) return TRUE; else return FALSE;
    5830   }
     5712  }
     5713#endif
    58315714  assumeStdFlag(u);
    58325715  intvec *module_w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
     
    58425725      return FALSE;
    58435726  }
     5727  delete iv;
    58445728  WerrorS(feNotImplemented);
    5845   delete iv;
    58465729  return TRUE;
    58475730}
     
    59295812                               (matrix)v->CopyD());
    59305813  return FALSE;
    5931 }
    5932 static BOOLEAN currRingIsOverIntegralDomain ()
    5933 {
    5934   /* true for fields and Z, false otherwise */
    5935   if (rField_is_Ring_PtoM(currRing)) return FALSE;
    5936   if (rField_is_Ring_2toM(currRing)) return FALSE;
    5937   if (rField_is_Ring_ModN(currRing)) return FALSE;
    5938   return TRUE;
    59395814}
    59405815static BOOLEAN jjMINOR_M(leftv res, leftv v)
     
    61005975  }
    61015976  if ((!noAlgorithm) && (strcmp(algorithm, "Bareiss") == 0)
    6102       && (!currRingIsOverIntegralDomain()))
     5977      && (!rField_is_Domain(currRing)))
    61035978  {
    61045979    Werror("Bareiss algorithm not defined over coefficient rings %s",
     
    91679042  }
    91689043  #endif
     9044#ifdef HAVE_RINGS
    91699045  if (rField_is_Ring(currRing))
    91709046  {
     
    91879063    }
    91889064  }
     9065#endif
    91899066  return FALSE;
    91909067}
Note: See TracChangeset for help on using the changeset viewer.