Changeset 1bc7201 in git for kernel/ideals.cc


Ignore:
Timestamp:
Oct 19, 2012, 6:38:35 PM (12 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
c879eea1669e963fb4c7287a3963abb287d00a49
Parents:
b37b3984a12e1552c7bafc9fd5a7849240ea79806bbe944402dfca102dcc3e036c4f2f119be41e44
Message:
Merge pull request #192 from mmklee/algExtGCD_sw

Alg ext gcd sw
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/ideals.cc

    r6bbe94 r1bc7201  
    130130}
    131131
    132 
    133 /*3
    134 *multiplies p with t (!cas) or  (t-1)
    135 *the index of t is:1, so we have to shift all variables
    136 *p is NOT in the actual ring, it has no t
    137 */
    138 static poly pMultWithT (poly p,BOOLEAN cas)
    139 {
    140   /*qp is the working pointer in p*/
    141   /*result is the result, qresult is the working pointer*/
    142   /*pp is p in the actual ring(shifted), qpp the working pointer*/
    143   poly result,qp,pp;
    144   poly qresult=NULL;
    145   poly qpp=NULL;
    146   int  i,j,lex;
    147   number n;
    148 
    149   pp = NULL;
    150   result = NULL;
    151   qp = p;
    152   while (qp != NULL)
    153   {
    154     i = 0;
    155     if (result == NULL)
    156     {/*first monomial*/
    157       result = pInit();
    158       qresult = result;
    159     }
    160     else
    161     {
    162       qresult->next = pInit();
    163       pIter(qresult);
    164     }
    165     for (j=(currRing->N)-1; j>0; j--)
    166     {
    167       lex = pGetExp(qp,j);
    168       pSetExp(qresult,j+1,lex);/*copy all variables*/
    169     }
    170     lex = pGetComp(qp);
    171     pSetComp(qresult,lex);
    172     n=nCopy(pGetCoeff(qp));
    173     pSetCoeff0(qresult,n);
    174     qresult->next = NULL;
    175     pSetm(qresult);
    176     /*qresult is now qp brought into the actual ring*/
    177     if (cas)
    178     { /*case: mult with t-1*/
    179       pSetExp(qresult,1,0);
    180       pSetm(qresult);
    181       if (pp == NULL)
    182       { /*first monomial*/
    183         pp = pCopy(qresult);
    184         qpp = pp;
    185       }
    186       else
    187       {
    188         qpp->next = pCopy(qresult);
    189         pIter(qpp);
    190       }
    191       pGetCoeff(qpp)=nNeg(pGetCoeff(qpp));
    192       /*now qpp contains -1*qp*/
    193     }
    194     pSetExp(qresult,1,1);/*this is mult. by t*/
    195     pSetm(qresult);
    196     pIter(qp);
    197   }
    198   /*
    199   *now p is processed:
    200   *result contains t*p
    201   * if cas: pp contains -1*p (in the new ring)
    202   */
    203   if (cas)  qresult->next = pp;
    204   /*  else      qresult->next = NULL;*/
    205   return result;
    206 }
    207132
    208133/*2
     
    850775  }
    851776
    852   BITSET save_verbose=verbose;
     777  BITSET save2;
     778  SI_SAVE_OPT2(save2);
    853779
    854780  k=si_max(1,(int)id_RankFreeModule(h1,currRing));
    855781
    856   if ((k==1) && (!lift3)) verbose |=Sy_bit(V_IDLIFT);
     782  if ((k==1) && (!lift3)) si_opt_2 |=Sy_bit(V_IDLIFT);
    857783
    858784  ring orig_ring = currRing;
     
    974900
    975901  if (syz_ring!=orig_ring) rDelete(syz_ring);
    976   verbose = save_verbose;
     902  SI_RESTORE_OPT2(save2);
    977903  return s_h3;
    978904}
     
    13741300    }
    13751301    h4->m[IDELEMS(h4)-1] = p;
    1376     test |= Sy_bit(OPT_SB_1);
     1302    si_opt_1 |= Sy_bit(OPT_SB_1);
    13771303  }
    13781304  idDelete(&temph1);
     
    13971323    return res;
    13981324  }
    1399   BITSET old_test=test;
     1325  BITSET old_test1;
     1326  SI_SAVE_OPT1(old_test1);
    14001327  int i, kmax;
    14011328  BOOLEAN  addOnlyOne=TRUE;
     
    14311358    s_h3 = kStd(s_h4,currQuotient,hom,&weights1,NULL,kmax-1);
    14321359  }
    1433   test = old_test;
     1360  SI_RESTORE_OPT1(old_test1);
    14341361  #if 0
    14351362  // only together with the above debug stuff
     
    16721599#if 1
    16731600  //rWrite(tmpR);PrintLn();
    1674   BITSET save=test;
    1675   //test |=1;
     1601  //BITSET save1;
     1602  //SI_SAVE_OPT1(save1);
     1603  //si_opt_1 |=1;
    16761604  //Print("h: %d gen, rk=%d\n",IDELEMS(h),h->rank);
    16771605  //extern char * showOption();
    16781606  //Print("%s\n",showOption());
    16791607  hh = kStd(h,NULL,hom,&w,hilb);
    1680   test=save;
     1608  //SI_RESTORE_OPT1(save1);
    16811609  idDelete(&h);
    16821610#else
     
    21942122  {
    21952123    if ((s_temp1->m[i]!=NULL)
    2196     && (pGetComp(s_temp1->m[i])<=length))
     2124    && (((int)pGetComp(s_temp1->m[i]))<=length))
    21972125    {
    21982126      p_Delete(&(s_temp1->m[i]),currRing);
Note: See TracChangeset for help on using the changeset viewer.