Changeset cc6544 in git


Ignore:
Timestamp:
Dec 12, 2013, 1:43:48 PM (10 years ago)
Author:
Christian Eder
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
d11734c14946aacc7d00348d000a1bb22c618823
Parents:
1eba3916d70fdfa610391e2779d72b202c1b7915
git-author:
Christian Eder <ederc@mathematik.uni-kl.de>2013-12-12 13:43:48+01:00
git-committer:
Christian Eder <ederc@mathematik.uni-kl.de>2013-12-12 13:51:29+01:00
Message:
improves sba's syzygy handling for schreyer ordering
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/kstd2.cc

    r1eba39 rcc6544  
    5353#endif
    5454
     55#define SBA_INTERRED_START                  0
    5556#define SBA_TAIL_RED                        1
    5657#define SBA_PRODUCT_CRITERION               0
     
    17151716  for (int i=0; i<sort->length();++i)
    17161717    F->m[i] = F1->m[(*sort)[i]-1];
     1718#if SBA_INTERRED_START
     1719  F = kInterRed(F,NULL);
     1720#endif
    17171721#if F5DEBUG
    17181722  printf("SBA COMPUTATIONS DONE IN THE FOLLOWING RING:\n");
     
    21042108            // the corresponding principal syzygy
    21052109            // => we do not need to compute the "real" syzygy completely
    2106             poly help = pCopy(strat->sig[ps]);
     2110            poly help = p_Copy(strat->sig[ps],currRing);
    21072111            p_ExpVectorAdd (help,strat->P.p,currRing);
    21082112            Q.sig = p_Add_q(Q.sig,help,currRing);
     
    21172121      // deg - idx - lp/rp
    21182122      // => we need to add syzygies with indices > pGetComp(strat->P.sig)
    2119       if(strat->sbaOrder == 3)
     2123      if(strat->sbaOrder == 0 || strat->sbaOrder == 3)
    21202124      {
    21212125        int cmp     = pGetComp(strat->P.sig);
     
    21252129        LObject Q;
    21262130        int pos;
    2127         for (int i=cmp+1; i<=max_cmp; ++i) {
    2128           Q.sig = p_One(currRing);
    2129           p_SetExpV(Q.sig, vv, currRing);
    2130           // F->m[i-1] corresponds to index i
    2131           p_ExpVectorAdd(Q.sig,F->m[i-1],currRing);
    2132           p_SetComp(Q.sig, i, currRing);
    2133           pos = posInSyz(strat, Q.sig);
    2134           enterSyz(Q, strat, pos);
    2135         }
    2136       }
    2137 #if 1
    2138 //#if DEBUGF50
     2131        int idx = p_GetComp(strat->P.sig,currRing);
     2132        //printf("++ -- adding syzygies -- ++\n");
     2133        // if new element is the first one in this index
     2134        if (strat->currIdx < idx) {
     2135          for (int i=0; i<strat->sl; ++i) {
     2136            Q.sig = p_Copy(strat->P.sig,currRing);
     2137            p_ExpVectorAdd(Q.sig,strat->S[i],currRing);
     2138            poly help = p_Copy(strat->sig[i],currRing);
     2139            p_ExpVectorAdd(help,strat->P.p,currRing);
     2140            Q.sig = p_Add_q(Q.sig,help,currRing);
     2141            //pWrite(Q.sig);
     2142            pos = posInSyz(strat, Q.sig);
     2143            enterSyz(Q, strat, pos);
     2144          }
     2145          strat->currIdx = idx;
     2146        } else {
     2147          // if the element is not the first one in the given index we build all
     2148          // possible syzygies with elements of higher index
     2149          for (int i=cmp+1; i<=max_cmp; ++i) {
     2150            pos = -1;
     2151            for (int j=0; j<strat->sl; ++j) {
     2152              if (p_GetComp(strat->sig[j],currRing) == i) {
     2153                pos = j;
     2154                break;
     2155              }
     2156            }
     2157            if (pos != -1) {
     2158              Q.sig = p_One(currRing);
     2159              p_SetExpV(Q.sig, vv, currRing);
     2160              // F->m[i-1] corresponds to index i
     2161              p_ExpVectorAdd(Q.sig,F->m[i-1],currRing);
     2162              p_SetComp(Q.sig, i, currRing);
     2163              poly help = p_Copy(strat->P.sig,currRing);
     2164              p_ExpVectorAdd(help,strat->S[pos],currRing);
     2165              Q.sig = p_Add_q(Q.sig,help,currRing);
     2166              if (p_LmCmp(Q.sig,strat->syz[strat->syzl-1],currRing) == -currRing->OrdSgn) {
     2167                pos = posInSyz(strat, Q.sig);
     2168                enterSyz(Q, strat, pos);
     2169              }
     2170            }
     2171          }
     2172          //printf("++ -- done adding syzygies -- ++\n");
     2173        }
     2174      }
     2175//#if 1
     2176#if DEBUGF50
    21392177    printf("---------------------------\n");
    21402178    Print(" %d. ELEMENT ADDED TO GCURR:\n",strat->sl+1);
     
    21842222        int pos = posInSyz(strat, strat->P.sig);
    21852223        enterSyz(strat->P, strat, pos);
    2186 #if 1
    2187 //#ifdef DEBUGF5
     2224//#if 1
     2225#ifdef DEBUGF5
    21882226        Print("ADDING STUFF TO SYZ :  ");
    21892227        //pWrite(strat->P.p);
Note: See TracChangeset for help on using the changeset viewer.