Changeset b7cfaf in git


Ignore:
Timestamp:
Jul 26, 2011, 11:34:05 AM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
86152998894ac968561dfca4ba268464c73e7b74
Parents:
1558d57b639351ad0ad10d1e5e337419bfcf21fb
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-07-26 11:34:05+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:53:34+01:00
Message:
fix: pSeries
moved pShift to p_polys::p_Shift
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/ideals.cc

    r1558d5 rb7cfaf  
    6969
    7070  homog = idHomModule(h1,currQuotient,&wth);
    71   if (rHasGlobalOrdering_currRing())
     71  if (rHasGlobalOrdering(currRing))
    7272  {
    7373    if(!homog)
     
    9292  IDELEMS(e) = 16;
    9393  h2 = kStd(h1,currQuotient,isNotHomog,NULL);
    94   h3 = idMaxIdeal();
     94  h3 = idMaxIdeal(1);
    9595  h4=idMult(h2,h3);
    9696  idDelete(&h3);
     
    235235  /*  else      qresult->next = NULL;*/
    236236  return result;
    237 }
    238 
    239 /*2
    240 * verschiebt die Indizees der Modulerzeugenden um i
    241 */
    242 void pShift (poly * p,int i)
    243 {
    244   poly qp1 = *p,qp2 = *p;/*working pointers*/
    245   int     j = pMaxComp(*p),k = pMinComp(*p);
    246 
    247   if (j+i < 0) return ;
    248   while (qp1 != NULL)
    249   {
    250     if ((pGetComp(qp1)+i > 0) || ((j == -i) && (j == k)))
    251     {
    252       pAddComp(qp1,i);
    253       pSetmComp(qp1);
    254       qp2 = qp1;
    255       pIter(qp1);
    256     }
    257     else
    258     {
    259       if (qp2 == *p)
    260       {
    261         pIter(*p);
    262         pLmDelete(&qp2);
    263         qp2 = *p;
    264         qp1 = *p;
    265       }
    266       else
    267       {
    268         qp2->next = qp1->next;
    269         if (qp1!=NULL) pLmDelete(&qp1);
    270         qp1 = qp2->next;
    271       }
    272     }
    273   }
    274237}
    275238
     
    385348  ring orig_ring=currRing;
    386349  ring syz_ring=rCurrRingAssure_SyzComp();
    387   rSetSyzComp(length);
     350  rSetSyzComp(length, syz_ring);
    388351
    389352  while ((j>0) && (first->m[j-1]==NULL)) j--;
     
    440403      else
    441404      {
    442         p = prMoveR(temp1->m[i], syz_ring);
     405        p = prMoveR(temp1->m[i], syz_ring,orig_ring);
    443406      }
    444407      temp1->m[i]=NULL;
     
    524487  ring orig_ring=currRing;
    525488  ring syz_ring=rCurrRingAssure_SyzComp();
    526   rSetSyzComp(syzComp);
     489  rSetSyzComp(syzComp, syz_ring);
    527490
    528491  bigmat = idInit(j,(k+1)*maxrk);
     
    622585    Warn("syzcomp too low, should be %d instead of %d",k,syzcomp);
    623586    syzcomp = k;
    624     rSetSyzComp(k);
     587    rSetSyzComp(k,currRing);
    625588  }
    626589  h2->rank = syzcomp+i+1;
     
    732695
    733696  if (setSyzComp)
    734     rSetSyzComp(k);
     697    rSetSyzComp(k,syz_ring);
    735698
    736699  if (orig_ring != syz_ring)
     
    768731    s_h3->rank -= k;
    769732    rChangeCurrRing(orig_ring);
    770     s_h3 = idrMoveR_NoSort(s_h3, syz_ring);
     733    s_h3 = idrMoveR_NoSort(s_h3, syz_ring, orig_ring);
    771734    rKill(syz_ring);
    772735    #ifdef HAVE_PLURAL
     
    810773    ring dp_C_ring = rCurrRingAssure_dp_C();
    811774    if (dp_C_ring != syz_ring)
    812       e = idrMoveR_NoSort(e, syz_ring);
     775      e = idrMoveR_NoSort(e, syz_ring, dp_C_ring);
    813776    resolvente res = sySchreyerResolvente(e,-1,&length,TRUE, TRUE);
    814777    intvec * dummy = syBetti(res,length,&reg, *w);
     
    853816  ring syz_ring=rCurrRingAssure_SyzComp();
    854817
    855   rSetSyzComp(k);
     818  rSetSyzComp(k,syz_ring);
    856819
    857820  if (orig_ring != syz_ring)
     
    876839    idSkipZeroes(s_h3);
    877840    rChangeCurrRing(orig_ring);
    878     s_h3 = idrMoveR_NoSort(s_h3, syz_ring);
     841    s_h3 = idrMoveR_NoSort(s_h3, syz_ring, orig_ring);
    879842    rKill(syz_ring);
    880843    idTest(s_h3);
     
    925888  ring orig_ring = currRing;
    926889  ring syz_ring = rCurrRingAssure_SyzComp();
    927   rSetSyzComp(k);
     890  rSetSyzComp(k,syz_ring);
    928891
    929892  ideal s_h1=h1;
     
    1010973    if (s_h2->m[j] != NULL)
    1011974    {
    1012       q = prMoveR( s_h2->m[j], syz_ring);
     975      q = prMoveR( s_h2->m[j], syz_ring,orig_ring);
    1013976      s_h2->m[j] = NULL;
    1014977
     
    1030993  for (i=0; i<IDELEMS(s_h3); i++)
    1031994  {
    1032     s_h3->m[i] = prMoveR_NoSort(s_h3->m[i], syz_ring);
     995    s_h3->m[i] = prMoveR_NoSort(s_h3->m[i], syz_ring,orig_ring);
    1033996  }
    1034997  if (lift3)
     
    1036999    for (i=0; i<IDELEMS(*syz); i++)
    10371000    {
    1038       (*syz)->m[i] = prMoveR_NoSort((*syz)->m[i], syz_ring);
     1001      (*syz)->m[i] = prMoveR_NoSort((*syz)->m[i], syz_ring,orig_ring);
    10391002    }
    10401003  }
     
    11321095  ring orig_ring=currRing;
    11331096  ring syz_ring=rCurrRingAssure_SyzComp();
    1134   rSetSyzComp(k);
     1097  rSetSyzComp(k,syz_ring);
    11351098
    11361099  ideal s_mod, s_temp;
     
    12411204    idDelete(&s_mod);
    12421205    rChangeCurrRing(orig_ring);
    1243     s_result = idrMoveR_NoSort(s_result, syz_ring);
    1244     s_rest = idrMoveR_NoSort(s_rest, syz_ring);
     1206    s_result = idrMoveR_NoSort(s_result, syz_ring, orig_ring);
     1207    s_rest = idrMoveR_NoSort(s_rest, syz_ring, orig_ring);
    12451208    rKill(syz_ring);
    12461209  }
     
    14921455  ring orig_ring=currRing;
    14931456  ring syz_ring=rCurrRingAssure_SyzComp();
    1494   rSetSyzComp(kmax-1);
     1457  rSetSyzComp(kmax-1,syz_ring);
    14951458  if (orig_ring!=syz_ring)
    1496   //  s_h4 = idrMoveR_NoSort(s_h4,orig_ring);
    1497     s_h4 = idrMoveR(s_h4,orig_ring);
     1459  //  s_h4 = idrMoveR_NoSort(s_h4,orig_ring, syz_ring);
     1460    s_h4 = idrMoveR(s_h4,orig_ring, syz_ring);
    14981461  idTest(s_h4);
    14991462  #if 0
     
    15461509  {
    15471510    rChangeCurrRing(orig_ring);
    1548     s_h3 = idrMoveR_NoSort(s_h3, syz_ring);
     1511    s_h3 = idrMoveR_NoSort(s_h3, syz_ring, orig_ring);
    15491512    rKill(syz_ring);
    15501513  }
     
    17851748        IDELEMS(h3) += 16;
    17861749      }
    1787       h3->m[j] = prMoveR( hh->m[k], tmpR);
     1750      h3->m[j] = prMoveR( hh->m[k], tmpR,origR);
    17881751      hh->m[k] = NULL;
    17891752    }
     
    20522015    if (p!=NULL)
    20532016    {
    2054       int d=pFDeg(p,currRing);
     2017      int d=currRing->pFDeg(p,currRing);
    20552018      loop
    20562019      {
    20572020        pIter(p);
    20582021        if (p==NULL) break;
    2059         if (d!=pFDeg(p,currRing))
     2022        if (d!=currRing->pFDeg(p,currRing))
    20602023        {
    20612024          //pWrite(q); wrp(p); Print(" -> %d - %d\n",d,pFDeg(p,currRing));
     
    21382101  ring orig_ring=currRing;
    21392102  ring syz_ring=rCurrRingAssure_SyzComp();
    2140   rSetSyzComp(length);
     2103  rSetSyzComp(length,syz_ring);
    21412104
    21422105  ideal s_temp;
    21432106  if (orig_ring!=syz_ring)
    2144     s_temp=idrMoveR_NoSort(arg,orig_ring);
     2107    s_temp=idrMoveR_NoSort(arg,orig_ring, syz_ring);
    21452108  else
    21462109    s_temp=arg;
     
    22622225  ring orig_ring=currRing;
    22632226  ring syz_ring=rCurrRingAssure_SyzComp();
    2264   rSetSyzComp(length);
     2227  rSetSyzComp(length, syz_ring);
    22652228  ideal s_temp;
    22662229
    22672230  if (syz_ring != orig_ring)
    22682231  {
    2269     s_temp = idrMoveR_NoSort(temp, orig_ring);
     2232    s_temp = idrMoveR_NoSort(temp, orig_ring, syz_ring);
    22702233  }
    22712234  else
     
    23052268  {
    23062269    rChangeCurrRing(orig_ring);
    2307     s_temp1 = idrMoveR_NoSort(s_temp1, syz_ring);
     2270    s_temp1 = idrMoveR_NoSort(s_temp1, syz_ring, orig_ring);
    23082271    rKill(syz_ring);
    23092272    // Hmm ... here seems to be a memory leak
     
    23422305  while (i>0)
    23432306  {
    2344     (*result)[i]=pFDeg(mod->m[i],currRing)+(*weights)[pGetComp(mod->m[i])];
     2307    (*result)[i]=currRing->pFDeg(mod->m[i],currRing)+(*weights)[pGetComp(mod->m[i])];
    23452308  }
    23462309  return result;
     
    25542517  poly gg=pTakeOutComp(&(S->m[0]),2);
    25552518  idDelete(&S);
    2556   poly gcd_p=singclap_pdivide(f,gg);
     2519  poly gcd_p=singclap_pdivide(f,gg,r);
    25572520  pDelete(&gg);
    25582521  rChangeCurrRing(save_r);
  • libpolys/polys/monomials/p_polys.cc

    r1558d5 rb7cfaf  
    37983798}
    37993799
     3800/*2
     3801* verschiebt die Indizees der Modulerzeugenden um i
     3802*/
     3803void p_Shift (poly * p,int i, const ring r)
     3804{
     3805  poly qp1 = *p,qp2 = *p;/*working pointers*/
     3806  int     j = p_MaxComp(*p,r),k = p_MinComp(*p,r);
     3807
     3808  if (j+i < 0) return ;
     3809  while (qp1 != NULL)
     3810  {
     3811    if ((p_GetComp(qp1,r)+i > 0) || ((j == -i) && (j == k)))
     3812    {
     3813      p_AddComp(qp1,i,r);
     3814      p_SetmComp(qp1,r);
     3815      qp2 = qp1;
     3816      pIter(qp1);
     3817    }
     3818    else
     3819    {
     3820      if (qp2 == *p)
     3821      {
     3822        pIter(*p);
     3823        p_LmDelete(&qp2,r);
     3824        qp2 = *p;
     3825        qp1 = *p;
     3826      }
     3827      else
     3828      {
     3829        qp2->next = qp1->next;
     3830        if (qp1!=NULL) p_LmDelete(&qp1,r);
     3831        qp1 = qp2->next;
     3832      }
     3833    }
     3834  }
     3835}
    38003836/***************************************************************
    38013837 *
  • libpolys/polys/monomials/p_polys.h

    r1558d5 rb7cfaf  
    19251925// respect syzComp
    19261926poly p_Last(poly a, int &l, const ring r);
     1927
     1928/// shifts components of the vector p by i
     1929void p_Shift (poly * p,int i, const ring r);
    19271930#endif // P_POLYS_H
    19281931
  • libpolys/polys/polys.h

    r1558d5 rb7cfaf  
    332332#define   pJetW(p,m,iv) p_JetW(p,m,iv,currRing)
    333333#define   pMinDeg(p,w) p_MinDeg(p,w,currRing)
    334 #define   pSeries(n,p,u,w) p_series(n,p,u,w,currRing)
     334#define   pSeries(n,p,u,w) p_Series(n,p,u,w,currRing)
    335335#define   pInvers(n,p,w) p_Invers(n,p,w,currRing)
    336336// maximum weigthed degree of all monomials of p, w is indexed from
Note: See TracChangeset for help on using the changeset viewer.