Changeset 37a4c3 in git for kernel/shiftgb.cc


Ignore:
Timestamp:
Feb 15, 2008, 6:14:23 PM (15 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
7d0cbb00ebc403b3845a38cbf3185e95e99cc015
Parents:
8cf4f3f04ec8ee4482f27f11b0444a3edf84fd3c
Message:
*levandov: major changes in shift free gb


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

Legend:

Unmodified
Added
Removed
  • kernel/shiftgb.cc

    r8cf4f3f r37a4c3  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: shiftgb.cc,v 1.3 2007-11-06 12:58:35 Singular Exp $ */
     4/* $Id: shiftgb.cc,v 1.4 2008-02-15 17:14:23 levandov Exp $ */
    55/*
    66* ABSTRACT: kernel: utils for shift GB and free GB
     
    4343  /* assume shift takes place */
    4444  /* shifts the poly p by sh */
     45  /* deletes p */
    4546
    4647  /* assume sh and uptodeg agree */
     
    4950
    5051  poly q  = NULL;
    51   poly pp = pCopy(p);
     52  poly pp = p; // pCopy(p);
    5253  while (pp!=NULL)
    5354  {
     
    9798  pSetExpV(m,s);
    9899  /*  pSetm(m); */ /* done in the pSetExpV */
     100  /* think on the component */
    99101  pSetCoeff0(m,c);
    100102  freeT(e, currRing->N);
     
    107109  /* returns the number of maximal block */
    108110  /* appearing among the monomials of p */
    109   poly q = pCopy(p); /* need it ? */
     111  /* the 0th block is the 1st one */
     112  poly q = p_Copy(p,currRing); /* need it ? */
    110113  int ans = 0;
    111114  int ansnew = 0;
     
    132135  {
    133136#ifdef PDEBUG
    134     Print("pmLastVblock: unexpected zero exponent");
     137    Print("pmLastVblock: unexpected zero exponent vector");
     138    PrintLn();
    135139#endif   
    136140    return(j);
     
    161165  }
    162166  j = b;
    163   while ( (!B[j]) && (j>=1)) j--;
     167  //  while ( (!B[j]) && (j>=1)) j--;
     168  for (j=b; j>=1; j--)
     169  {
     170    if (B[j]!=0) break;
     171  }
     172
    164173  if (j==0)
    165174  {
     
    180189/* shiftgb stuff */
    181190
    182 void initBbaShift(ideal F,kStrategy strat)
    183 {
    184   int i;
    185   idhdl h;
    186  /* setting global variables ------------------- */
    187   strat->enterS = enterSBba;
    188191
    189   strat->red = redFirstShift;
     192/* remarks: cleanT : just deletion
     193enlargeT: just reallocation */
    190194
    191   /* perhaps the following?
    192    *    strat->LazyPass *=4;
    193    *    strat->red = redHomogShift;
    194    */
    195 
    196   /*    strat->red = redHoney;
    197    *  if (strat->honey)
    198    *    strat->red = redHoney;
    199    *  else if (pLexOrder && !strat->homog)
    200    *    strat->red = redLazy;
    201    *  else
    202    *  {
    203    *    strat->LazyPass *=4;
    204    *    strat->red = redHomog;
    205    *  }
    206    *#ifdef HAVE_RINGS  //TODO Oliver
    207    *  if (rField_is_Ring(currRing)) {
    208    *    strat->red = redRing2toM;
    209    *  }
    210    *#endif
    211   */
    212 
    213   if (pLexOrder && strat->honey)
    214     strat->initEcart = initEcartNormal;
    215   else
    216     strat->initEcart = initEcartBBA;
    217   if (strat->honey)
    218     strat->initEcartPair = initEcartPairMora;
    219   else
    220     strat->initEcartPair = initEcartPairBba;
    221   strat->kIdeal = NULL;
    222   //if (strat->ak==0) strat->kIdeal->rtyp=IDEAL_CMD;
    223   //else              strat->kIdeal->rtyp=MODUL_CMD;
    224   //strat->kIdeal->data=(void *)strat->Shdl;
    225   if ((TEST_OPT_WEIGHTM)&&(F!=NULL))
    226   {
    227     //interred  machen   Aenderung
    228     pFDegOld=pFDeg;
    229     pLDegOld=pLDeg;
    230     //h=ggetid("ecart");
    231     //if ((h!=NULL) /*&& (IDTYP(h)==INTVEC_CMD)*/)
    232     //{
    233     //  ecartWeights=iv2array(IDINTVEC(h));
    234     //}
    235     //else
    236     {
    237       ecartWeights=(short *)omAlloc((pVariables+1)*sizeof(short));
    238       /*uses automatic computation of the ecartWeights to set them*/
    239       kEcartWeights(F->m,IDELEMS(F)-1,ecartWeights);
    240     }
    241     pRestoreDegProcs(totaldegreeWecart, maxdegreeWecart);
    242     if (TEST_OPT_PROT)
    243     {
    244       for(i=1; i<=pVariables; i++)
    245         Print(" %d",ecartWeights[i]);
    246       PrintLn();
    247       mflush();
    248     }
    249   }
    250 }
    251195#endif
Note: See TracChangeset for help on using the changeset viewer.