Changeset e78cce in git for Singular/ideals.cc


Ignore:
Timestamp:
Dec 15, 1997, 11:46:43 PM (26 years ago)
Author:
Olaf Bachmann <obachman@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
74eea4ee278a222b9c9e93f5041d06fdec86d467
Parents:
3bc8cd5aedd9efcc75f287571cd2f05f49911c72
Message:
Mon Dec 15 23:31:56 1997  Olaf Bachmann
<obachman@mathematik.uni-kl.de>

	* polys-impl.h: Various small bug - fixes and changes in
	  preparation of COMP_FAST merge: hilbert series, maps are
	  ok; sres and syz are still buggy; small things still need to
	  be checked;


git-svn-id: file:///usr/local/Singular/svn/trunk@978 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/ideals.cc

    r3bc8cd re78cce  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ideals.cc,v 1.14 1997-12-12 16:55:21 Singular Exp $ */
     4/* $Id: ideals.cc,v 1.15 1997-12-15 22:46:26 obachman Exp $ */
    55/*
    66* ABSTRACT - all basic methods to manipulate ideals
     
    707707    if (result == NULL)
    708708    {/*first monomial*/
    709       result = pNew();
     709      result = pInit();
    710710      qresult = result;
    711711    }
    712712    else
    713713    {
    714       qresult->next = pNew();
     714      qresult->next = pInit();
    715715      pIter(qresult);
    716716    }
     
    775775    if (result == NULL)
    776776    {/*the first monomial*/
    777       result = pNew();
     777      result = pInit();
    778778      resultp = result;
    779779      resultp->next = NULL;
     
    781781    else
    782782    {
    783       resultp->next = pNew();
     783      resultp->next = pInit();
    784784      pIter(resultp);
    785785      resultp->next = NULL;
     
    14311431        pIter(p);
    14321432      }
    1433       e->m[i-1] = pOrdPolySchreyer(e->m[i-1]);
     1433      e->m[i-1] = pOrdPolyMerge(e->m[i-1]);
    14341434    }
    14351435  }
     
    21022102  tHomog hom;
    21032103  intvec * w;
     2104  sip_sring tmpR;
    21042105
    21052106  if (delVar==NULL)
     
    21362137  block0[0] = 1;
    21372138  block1[0] = pVariables;
    2138   wv=(short**) Alloc(ordersize*sizeof(short**));
     2139  wv=(short**) Alloc0(ordersize*sizeof(short**));
    21392140  memcpy4(wv+1,currRing->wvhdl,(ordersize-1)*sizeof(short**));
    21402141  wv[0]=(short*)Alloc0((pVariables+1)*sizeof(short));
    2141   for (j=0;j<=pVariables;j++)
     2142  for (j=0;j<pVariables;j++)
    21422143    if (pGetExp(delVar,j+1)!=0) wv[0][j]=1;
    21432144  ord[0] = ringorder_a;
     2145
     2146  // fill in tmp ring to get back the data later on
     2147  memset(&tmpR, 0, sizeof(sip_sring));
     2148  tmpR.N = pVariables;
     2149  tmpR.OrdSgn = currRing->OrdSgn;
     2150  tmpR.order = ord;
     2151  tmpR.block0 = block0;
     2152  tmpR.block1 = block1;
     2153  tmpR.wvhdl = wv;
     2154  rComplete(&tmpR);
     2155
     2156  // change into the new ring
    21442157  pChangeRing(pVariables,currRing->OrdSgn,ord,block0,block1,wv);
    21452158  h = idInit(IDELEMS(h1),1);
    2146   for (k=0;k<IDELEMS(h1);k++) h->m[k] = pOrdPoly(pCopy(h1->m[k]));
     2159  // fetch data from the old ring
     2160  for (k=0;k<IDELEMS(h1);k++) h->m[k] = pFetchCopy(currRing, pCopy(h1->m[k]));
     2161  // compute std
    21472162  hh = std(h,NULL,hom,&w,hilb);
    21482163  idDelete(&h);
     2164
     2165  // go back to the original ring
    21492166  pChangeRing(pVariables,currRing->OrdSgn,currRing->order,
    21502167    currRing->block0,currRing->block1,currRing->wvhdl);
     
    21522169  while ((i >= 0) && (hh->m[i] == NULL)) i--;
    21532170  j = -1;
     2171  // fetch data from temp ring
    21542172  for (k=0; k<=i; k++)
    21552173  {
    21562174    l=pVariables;
    2157     while ((l>0) && (pGetExp(hh->m[k],l)*pGetExp(delVar,l)==0)) l--;
     2175    while ((l>0) && (pRingGetExp(&tmpR, hh->m[k],l)*pGetExp(delVar,l)==0)) l--;
    21582176    if (l==0)
    21592177    {
     
    21652183      }
    21662184//pWrite(hh->m[k]);
    2167       h3->m[j] = pOrdPoly(hh->m[k]);
    2168       hh->m[k] = NULL;
     2185      h3->m[j] = pFetchCopy(&tmpR, hh->m[k]);
    21692186//pWrite(h3->m[j]);
    21702187//PrintLn();
     
    22612278BOOLEAN pIsUnit(poly p)
    22622279{
    2263   poly q=p;
    2264   int i,j;
    2265   BOOLEAN b;
     2280  int i;
    22662281
    22672282  if (p == NULL) return FALSE;
    2268   if (currRing->OrdSgn == 1)
    2269   {
    2270     for (i=1;i<=pVariables;i++)
    2271     {
    2272       j = pGetExp(p,i);
    2273       if (j != 0) return FALSE;
    2274     }
    2275     if (pGetComp(p) != 0) return FALSE;
    2276     if (pNext(p) !=NULL) return FALSE;
    2277   }
    2278   else
    2279   {
    2280     b = FALSE;
    2281     while ((! b) && (q != NULL))
    2282     {
    2283       if (pGetComp(p) == 0)
    2284       {
    2285         i = 0;
    2286         do
    2287         {
    2288           i++;
    2289           j = pGetExp(p,i);
    2290         }
    2291         while ((i<=pVariables) && (j == 0));
    2292         if (i>pVariables) b = TRUE;
    2293       }
    2294       q = pNext(q);
    2295     }
    2296     return b;
    2297   }
    2298   return TRUE;
     2283  i = 1;
     2284  while (i<=pVariables && pGetExp(p,i) == 0) i++;
     2285  if (i > pVariables && (pGetComp(p) == 0))
     2286  {
     2287    if (currRing->OrdSgn == 1 && pNext(p) !=NULL) return FALSE;
     2288    return TRUE;
     2289  }
     2290  return FALSE;
    22992291}
    23002292
Note: See TracChangeset for help on using the changeset viewer.