Changeset c7aad0 in git for libpolys/polys/nc


Ignore:
Timestamp:
Sep 27, 2011, 6:04:08 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '17f1d200f27c5bd38f5dfc6e8a0879242279d1d8')
Children:
c14846c48e3ff9e4167bc71fd6c4c4cf2f7d6e03
Parents:
a0a9f0d6ddf91bf97a108e81a1b1415c0ad58615
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-09-27 18:04:08+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:13:38+01:00
Message:
FIX: non-commutative (left) GB should now work.
NOTE: SCA was disabled with this!
Location:
libpolys/polys/nc
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/nc/nc.h

    ra0a9f0 rc7aad0  
    1616class ip_smatrix;
    1717typedef ip_smatrix *       matrix;
    18 
    19 class skStrategy;
    20 typedef skStrategy * kStrategy;
    2118
    2219
     
    6259
    6360
    64 typedef ideal (*GB_Proc_Ptr)(const ideal F, const ideal Q, const intvec *w, const intvec *hilb, kStrategy strat, const ring r);
    65 
    6661typedef poly (*SPoly_Proc_Ptr)(const poly p1, const poly p2, const ring r);
    6762typedef poly (*SPolyReduce_Proc_Ptr)(const poly p1, poly p2, const ring r);
     
    8075  SPoly_Proc_Ptr                        SPoly;
    8176  SPolyReduce_Proc_Ptr                  ReduceSPoly;
    82 
    83   GB_Proc_Ptr                           GB;
    84 //                                         GlobalGB, // BBA
    85 //                                         LocalGB;  // MORA
    8677};
    8778
     
    321312}
    322313
    323 static inline ideal nc_GB(const ideal F, const ideal Q, const intvec *w, const intvec *hilb, kStrategy strat, const ring r)
    324 {
    325   assume(rIsPluralRing(r));
    326 
    327   assume(r->GetNC()->p_Procs.GB!=NULL);
    328   return r->GetNC()->p_Procs.GB(F, Q, w, hilb, strat, r);
    329 }
    330 
    331 
    332314
    333315/* subst: */
  • libpolys/polys/nc/old.gring.cc

    ra0a9f0 rc7aad0  
    6969poly nc_p_Bracket_qq(poly p, const poly q, const ring r);
    7070
    71 int  iNCExtensions = 0x00001; // only SCA can be used by default
     71int  iNCExtensions = 0; // SCAMASK; // only SCA can be used by default
    7272
    7373
     
    145145
    146146// void nc_kBucketPolyRed(kBucket_pt b, poly p);
    147 
    148 // ideal gnc_gr_mora(const ideal, const ideal, const intvec *, const intvec *, kStrategy, const ring r); // Not yet!
    149 // ideal gnc_gr_bba (const ideal F, const ideal Q, const intvec *, const intvec *, kStrategy strat, const ring r);
    150 
    151147
    152148void nc_CleanUp(nc_struct* p); // just free memory!
     
    32133209  rGR->GetNC()->p_Procs.mm_Mult_pp  = gnc_mm_Mult_pp;
    32143210
    3215 ///////////  rGR->GetNC()->p_Procs.GB          = gnc_gr_bba; // bba even for local case!
    3216 
    3217 //   rGR->GetNC()->p_Procs.GlobalGB    = gnc_gr_bba;
    3218 //   rGR->GetNC()->p_Procs.LocalGB     = gnc_gr_mora;
    3219 
    3220 
    32213211#if 0
    32223212  // Previous Plural's implementation...
     
    32513241    r->GetNC()->mmMultP()       = gnc_mm_Mult_p;
    32523242    r->GetNC()->mmMultPP()      = gnc_mm_Mult_pp;
    3253 
    3254 //////////////    r->GetNC()->GB()            = gnc_gr_bba;
    32553243
    32563244    r->GetNC()->SPoly()         = gnc_CreateSpoly;
  • libpolys/polys/nc/sca.cc

    ra0a9f0 rc7aad0  
    8181poly sca_ReduceSpoly(const poly p1, poly p2, const ring r);
    8282
    83 /*
    84 // Modified Plural's Buchberger's algorithmus.
    85 ideal sca_gr_bba(const ideal F, const ideal Q, const intvec *, const intvec *, kStrategy strat, const ring _currRing);
    86 
    87 // Modified modern Sinuglar Buchberger's algorithm.
    88 ideal sca_bba(const ideal F, const ideal Q, const intvec *w, const intvec *, kStrategy strat, const ring _currRing);
    89 
    90 // Modified modern Sinuglar Mora's algorithm.
    91 ideal sca_mora(const ideal F, const ideal Q, const intvec *w, const intvec *, kStrategy strat, const ring _currRing);
    92 */
    93 
    94 
    9583
    9684////////////////////////////////////////////////////////////////////////////////////////////////////
    9785// Super Commutative Algebra extension by Oleksandr
    9886////////////////////////////////////////////////////////////////////////////////////////////////////
    99 
    100 /*
    101 static inline ring assureCurrentRing(ring r)
    102 {
    103   ring save = currRing;
    104 
    105   if( currRing != r )
    106     rChangeCurrRing(r);
    107 
    108   return save;
    109 }
    110 */
    111 
    112 
    11387
    11488// returns the sign of: lm(pMonomM) * lm(pMonomMM),
     
    932906}
    933907
    934 /*
    935 void addLObject(LObject& h, kStrategy& strat)
    936 {
    937   if(h.IsNull()) return;
    938 
    939   strat->initEcart(&h);
    940   h.sev=0; // pGetShortExpVector(h.p);
    941 
    942   // add h into S and L
    943   int pos=posInS(strat, strat->sl, h.p, h.ecart);
    944 
    945   if ( (pos <= strat->sl) && (pComparePolys(h.p, strat->S[pos])) )
    946   {
    947     if (TEST_OPT_PROT)
    948       PrintS("d\n");
    949   }
    950   else
    951   {
    952     if (TEST_OPT_INTSTRATEGY)
    953     {
    954       p_Cleardenom(h.p, currRing);
    955     }
    956     else
    957     {
    958       pNorm(h.p);
    959       p_Content(h.p,currRing);
    960     }
    961 
    962     if ((strat->syzComp==0)||(!strat->homog))
    963     {
    964       h.p = redtailBba(h.p,pos-1,strat);
    965 
    966       if (TEST_OPT_INTSTRATEGY)
    967       {
    968 //        pCleardenom(h.p);
    969         p_Content(h.p,currRing);
    970       }
    971       else
    972       {
    973         pNorm(h.p);
    974       }
    975     }
    976 
    977     if(h.IsNull()) return;
    978 
    979     // statistic
    980     if (TEST_OPT_PROT)
    981     {
    982       PrintS("s\n");
    983     }
    984 
    985 #ifdef KDEBUG
    986     if (TEST_OPT_DEBUG)
    987     {
    988       PrintS("new s:");
    989       wrp(h.p);
    990       PrintLn();
    991     }
    992 #endif
    993 
    994     enterpairs(h.p, strat->sl, h.ecart, 0, strat);
    995 
    996     pos=0;
    997 
    998     if (strat->sl!=-1) pos = posInS(strat, strat->sl, h.p, h.ecart);
    999     strat->enterS(h, pos, strat, -1);
    1000 //    enterT(h, strat); // ?!
    1001 
    1002     if (h.lcm!=NULL) pLmFree(h.lcm);
    1003   }
    1004 
    1005 
    1006 }
    1007 
    1008 */
    1009 
    1010 
    1011 
    1012 ideal sca_gr_bba(const ideal F, const ideal Q, const intvec *, const intvec *, kStrategy strat, const ring _currRing)
    1013 {
    1014 /*
    1015 #if MYTEST
    1016    PrintS("<sca_gr_bba>\n");
    1017 #endif
    1018 
    1019   assume(rIsSCA(currRing));
    1020 
    1021 #ifndef NDEBUG
    1022   idTest(F);
    1023   idTest(Q);
    1024 #endif
    1025 
    1026 #ifdef HAVE_PLURAL
    1027 #if MYTEST
    1028   PrintS("currRing: \n");
    1029   rWrite(currRing);
    1030 #ifdef RDEBUG
    1031   rDebugPrint(currRing);
    1032 #endif
    1033 
    1034   PrintS("F: \n");
    1035   idPrint(F);
    1036   PrintS("Q: \n");
    1037   idPrint(Q);
    1038 #endif
    1039 #endif
    1040 
    1041 
    1042   const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
    1043   const unsigned int m_iLastAltVar  = scaLastAltVar(currRing);
    1044 
    1045   ideal tempF = id_KillSquares(F, m_iFirstAltVar, m_iLastAltVar, currRing);
    1046   ideal tempQ = Q;
    1047 
    1048   if(Q == currQuotient)
    1049     tempQ = SCAQuotient(currRing);
    1050 
    1051   strat->z2homog = id_IsSCAHomogeneous(tempF, NULL, NULL, currRing); // wCx == wCy == NULL!
    1052   // redo: no_prod_crit
    1053   const BOOLEAN bIsSCA  = rIsSCA(currRing) && strat->z2homog; // for Z_2 prod-crit
    1054   strat->no_prod_crit   = ! bIsSCA;
    1055 
    1056 //  strat->homog = strat->homog && strat->z2homog; // ?
    1057 
    1058 #if MYTEST
    1059   {
    1060     PrintS("ideal tempF: \n");
    1061     idPrint(tempF);
    1062     PrintS("ideal tempQ: \n");
    1063     idPrint(tempQ);
    1064   }
    1065 #endif
    1066 
    1067 #ifdef KDEBUG
    1068   om_Opts.MinTrack = 5;
    1069 #endif
    1070 
    1071   int srmax, lrmax;
    1072   int olddeg, reduc;
    1073   int red_result = 1;
    1074 //  int hilbeledeg = 1, minimcnt = 0;
    1075   int hilbcount = 0;
    1076 
    1077   initBuchMoraCrit(strat); // set Gebauer, honey, sugarCrit
    1078 
    1079   nc_gr_initBba(tempF,strat); // set enterS, red, initEcart, initEcartPair
    1080 
    1081   initBuchMoraPos(strat);
    1082 
    1083 
    1084   // ?? set spSpolyShort, reduce ???
    1085 
    1086   initBuchMora(tempF, tempQ, strat); // SCAQuotient(currRing) instead of Q == squares!!!!!!!
    1087 
    1088   strat->posInT=posInT110; // !!!
    1089 
    1090   srmax = strat->sl;
    1091   reduc = olddeg = lrmax = 0;
    1092 
    1093 
    1094   // compute-------------------------------------------------------
    1095   for(; strat->Ll >= 0;
    1096 #ifdef KDEBUG
    1097     strat->P.lcm = NULL,
    1098 #endif
    1099     kTest(strat)
    1100     )
    1101   {
    1102     if (strat->Ll > lrmax) lrmax =strat->Ll;// stat.
    1103 
    1104 #ifdef KDEBUG
    1105     if (TEST_OPT_DEBUG) messageSets(strat);
    1106 #endif
    1107 
    1108     if (strat->Ll== 0) strat->interpt=TRUE;
    1109 
    1110     if (TEST_OPT_DEGBOUND
    1111     && ((strat->honey
    1112     && (strat->L[strat->Ll].ecart+pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg))
    1113        || ((!strat->honey) && (pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg))))
    1114     {
    1115       // stops computation if
    1116       // 24 IN test and the degree +ecart of L[strat->Ll] is bigger then
    1117       // a predefined number Kstd1_deg
    1118       while (strat->Ll >= 0) deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
    1119       break;
    1120     }
    1121 
    1122     // picks the last element from the lazyset L
    1123     strat->P = strat->L[strat->Ll];
    1124     strat->Ll--;
    1125 
    1126     //kTest(strat);
    1127 
    1128 //    assume(pNext(strat->P.p) != strat->tail); // !???
    1129     if(strat->P.IsNull()) continue;
    1130 
    1131 
    1132     if( pNext(strat->P.p) == strat->tail )
    1133     {
    1134       // deletes the int spoly and computes SPoly
    1135       pLmFree(strat->P.p); // ???
    1136       strat->P.p = nc_CreateSpoly(strat->P.p1, strat->P.p2, currRing);
    1137     }
    1138 
    1139     if(strat->P.IsNull()) continue;
    1140 
    1141 //     poly save = NULL;
    1142 //
    1143 //     if(pNext(strat->P.p) != NULL)
    1144 //       save = p_Copy(strat->P.p, currRing);
    1145 
    1146     strat->initEcart(&strat->P); // remove it?
    1147 
    1148     if (TEST_OPT_PROT)
    1149       message((strat->honey ? strat->P.ecart : 0) + strat->P.pFDeg(), &olddeg,&reduc,strat, red_result);
    1150 
    1151     // reduction of the element chosen from L wrt S
    1152     strat->red(&strat->P,strat);
    1153 
    1154     if(strat->P.IsNull()) continue;
    1155 
    1156     addLObject(strat->P, strat);
    1157 
    1158     if (strat->sl > srmax) srmax = strat->sl;
    1159 
    1160     const poly save = strat->P.p;
    1161 
    1162 #ifdef PDEBUG
    1163       p_Test(save, currRing);
    1164 #endif
    1165     assume( save != NULL );
    1166 
    1167     // SCA Specials:
    1168 
    1169     {
    1170       const poly p_next = pNext(save);
    1171 
    1172       if( p_next != NULL )
    1173       for( unsigned int i = m_iFirstAltVar; i <= m_iLastAltVar; i++ )
    1174       if( p_GetExp(save, i, currRing) != 0 )
    1175       {
    1176         assume(p_GetExp(save, i, currRing) == 1);
    1177 
    1178         const poly tt = sca_pp_Mult_xi_pp(i, p_next, currRing);
    1179 
    1180 #ifdef PDEBUG
    1181         p_Test(tt, currRing);
    1182 #endif
    1183 
    1184         if( tt == NULL) continue;
    1185 
    1186         LObject h(tt); // h = x_i * P
    1187 
    1188         if (TEST_OPT_INTSTRATEGY)
    1189         {
    1190 //           h.pCleardenom(); // also does a p_Content
    1191           p_Content(h.p,currRing);
    1192         }
    1193         else
    1194         {
    1195           h.pNorm();
    1196         }
    1197 
    1198         strat->initEcart(&h);
    1199 
    1200 
    1201 //         if (pOrdSgn==-1)
    1202 //         {
    1203 //           cancelunit(&h);  // tries to cancel a unit
    1204 //           deleteHC(&h, strat);
    1205 //         }
    1206 
    1207 //         if(h.IsNull()) continue;
    1208 
    1209 //         if (TEST_OPT_PROT)
    1210 //           message((strat->honey ? h.ecart : 0) + h.pFDeg(), &olddeg, &reduc, strat, red_result);
    1211 
    1212 //         strat->red(&h, strat); // wrt S
    1213 //         if(h.IsNull()) continue;
    1214 
    1215 //         poly save = p_Copy(h.p, currRing);
    1216 
    1217         int pos;
    1218 
    1219         if (strat->Ll==-1)
    1220           pos =0;
    1221         else
    1222           pos = strat->posInL(strat->L,strat->Ll,&h,strat);
    1223 
    1224         h.sev = pGetShortExpVector(h.p);
    1225         enterL(&strat->L,&strat->Ll,&strat->Lmax,h,pos);
    1226 
    1227   //       h.p = save;
    1228   //       addLObject(h, strat);
    1229 
    1230 //         if (strat->sl > srmax) srmax = strat->sl;
    1231       }
    1232 
    1233       // p_Delete( &save, currRing );
    1234     }
    1235 
    1236 
    1237   } // for(;;)
    1238 
    1239 
    1240 #ifdef KDEBUG
    1241   if (TEST_OPT_DEBUG) messageSets(strat);
    1242 #endif
    1243 
    1244   if (TEST_OPT_REDSB){
    1245     completeReduce(strat); // ???
    1246   }
    1247 
    1248   // release temp data--------------------------------
    1249   exitBuchMora(strat);
    1250 
    1251   if (TEST_OPT_WEIGHTM)
    1252   {
    1253     pFDeg=pFDegOld;
    1254     pLDeg=pLDegOld;
    1255     if (ecartWeights)
    1256     {
    1257       omFreeSize((ADDRESS)ecartWeights,(pVariables+1)*sizeof(int));
    1258       ecartWeights=NULL;
    1259     }
    1260   }
    1261 
    1262   if (TEST_OPT_PROT) messageStat(srmax,lrmax,hilbcount,strat);
    1263 
    1264   if (tempQ!=NULL) updateResult(strat->Shdl,tempQ,strat);
    1265 
    1266   id_Delete(&tempF, currRing);
    1267 
    1268 
    1269   // complete reduction of the standard basis---------
    1270   if (TEST_OPT_REDSB){
    1271     ideal I = strat->Shdl;
    1272     ideal erg = kInterRedOld(I,tempQ);
    1273     assume(I!=erg);
    1274     id_Delete(&I, currRing);
    1275     strat->Shdl = erg;
    1276   }
    1277 
    1278 
    1279 #if MYTEST
    1280 //   PrintS("</sca_gr_bba>\n");
    1281 #endif
    1282 
    1283   return (strat->Shdl);
    1284 */
    1285 }
    1286 
    1287 
    1288 
    1289908// should be used only inside nc_SetupQuotient!
    1290909// Check whether this our case:
     
    14981117    // NOTE: rSaveRing == currRing now!
    14991118    // NOTE: there is no better way to check this in general!
    1500 
     1119    //
    15011120//////    TODO!!!!!
    15021121//////    extern poly kNF(ideal I, ideal Q, poly f, int a, int b, const ring r);
     
    15131132//  assureCurrentRing(rSaveRing);
    15141133
    1515   if(!bSCA) return false;
     1134  if(!bSCA)
     1135  {
     1136    WarnS("sca_SetupQuotient: Sorry can not use NF: unfixed implementational issue :(");
     1137    return false;
     1138  }
     1139   
    15161140
    15171141
     
    16251249}
    16261250
    1627 
    1628 ///////////////////////////////////////////////////////////////////////////////////////
    1629 //************* SCA BBA *************************************************************//
    1630 ///////////////////////////////////////////////////////////////////////////////////////
    1631 
    1632 // Under development!!!
    1633 ideal sca_bba (const ideal F, const ideal Q, const intvec *w, const intvec * /*hilb*/, kStrategy strat)
    1634 {
    1635 /*
    1636 #if MYTEST
    1637   PrintS("\n\n<sca_bba>\n\n");
    1638 #endif
    1639 
    1640   assume(rIsSCA(currRing));
    1641 
    1642 #ifndef NDEBUG
    1643   idTest(F);
    1644   idTest(Q);
    1645 #endif
    1646 
    1647 #if MYTEST
    1648   PrintS("\ncurrRing: \n");
    1649   rWrite(currRing);
    1650 #ifdef RDEBUG
    1651 //  rDebugPrint(currRing);
    1652 #endif
    1653 
    1654   PrintS("\n\nF: \n");
    1655   idPrint(F);
    1656   PrintS("\n\nQ: \n");
    1657   idPrint(Q);
    1658 
    1659   PrintLn();
    1660 #endif
    1661 
    1662 
    1663   const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
    1664   const unsigned int m_iLastAltVar  = scaLastAltVar(currRing);
    1665 
    1666   ideal tempF = id_KillSquares(F, m_iFirstAltVar, m_iLastAltVar, currRing);
    1667 
    1668   ideal tempQ = Q;
    1669 
    1670   if(Q == currQuotient)
    1671     tempQ = SCAQuotient(currRing);
    1672 
    1673   // Q or tempQ will not be used below :(((
    1674 
    1675 
    1676 #if MYTEST
    1677 
    1678   PrintS("tempF: \n");
    1679   idPrint(tempF);
    1680   PrintS("tempQ: \n");
    1681   idPrint(tempQ);
    1682 #endif
    1683 
    1684   strat->z2homog = id_IsSCAHomogeneous(tempF, NULL, NULL, currRing); // wCx == wCy == NULL!
    1685    // redo no_prod_crit:
    1686   const BOOLEAN bIsSCA  = rIsSCA(currRing) && strat->z2homog; // for Z_2 prod-crit
    1687   strat->no_prod_crit   = ! bIsSCA;
    1688 
    1689 //  strat->homog = strat->homog && strat->z2homog; // ?
    1690 
    1691 
    1692 
    1693 #ifdef KDEBUG
    1694   om_Opts.MinTrack = 5;
    1695 #endif
    1696 
    1697   int   srmax, lrmax, red_result = 1;
    1698   int   olddeg, reduc;
    1699 
    1700 //  int hilbeledeg = 1, minimcnt = 0;
    1701   int hilbcount = 0;
    1702 
    1703   BOOLEAN withT = FALSE;
    1704 
    1705   initBuchMoraCrit(strat); // sets Gebauer, honey, sugarCrit // sca - ok???
    1706   initBuchMoraPos(strat); // sets strat->posInL, strat->posInT // check!! (Plural's: )
    1707 
    1708 //   initHilbCrit(F, Q, &hilb, strat);
    1709 
    1710 //  nc_gr_initBba(F,strat);
    1711   initBba(tempF, strat); // set enterS, red, initEcart, initEcartPair
    1712 
    1713   // set enterS, spSpolyShort, reduce, red, initEcart, initEcartPair
    1714   // ?? set spSpolyShort, reduce ???
    1715   initBuchMora(tempF, tempQ, strat); // tempQ = Q without squares!!!
    1716 
    1717 //   if (strat->minim>0) strat->M = idInit(IDELEMS(F),F->rank);
    1718 
    1719   srmax = strat->sl;
    1720   reduc = olddeg = lrmax = 0;
    1721 
    1722 #define NO_BUCKETS
    1723 
    1724 #ifndef NO_BUCKETS
    1725   if (!TEST_OPT_NOT_BUCKETS)
    1726     strat->use_buckets = 1;
    1727 #endif
    1728 
    1729   // redtailBBa against T for inhomogenous input
    1730   if (!TEST_OPT_OLDSTD)
    1731     withT = ! strat->homog;
    1732 
    1733   // strat->posInT = posInT_pLength;
    1734   kTest_TS(strat);
    1735 
    1736 #undef HAVE_TAIL_RING
    1737 
    1738 #ifdef HAVE_TAIL_RING
    1739   if(!idIs0(F) &&(!rField_is_Ring()))  // create strong gcd poly computes with tailring and S[i] ->to be fixed
    1740     kStratInitChangeTailRing(strat);
    1741 #endif
    1742   if (BVERBOSE(23))
    1743   {
    1744     if (test_PosInT!=NULL) strat->posInT=test_PosInT;
    1745     if (test_PosInL!=NULL) strat->posInL=test_PosInL;
    1746     kDebugPrint(strat);
    1747   }
    1748  
    1749 
    1750   ///////////////////////////////////////////////////////////////
    1751   // SCA:
    1752 
    1753   //  due to std( SB, p).
    1754   // Note that after initBuchMora :: initSSpecial all these additional
    1755   // elements are in S and T (and some pairs are in L, which also has no initiall
    1756   // elements!!!)
    1757   if(TEST_OPT_SB_1)
    1758   {
    1759     // For all additional elements...
    1760     for (int iNewElement = strat->newIdeal; iNewElement < IDELEMS(tempF); iNewElement++)
    1761     {
    1762       const poly pSave = tempF->m[iNewElement];
    1763 
    1764       if( pSave != NULL )
    1765       {
    1766 //        tempF->m[iNewElement] = NULL;
    1767 
    1768         const poly p_next = pNext(pSave);
    1769 
    1770         if(p_next != NULL)
    1771           for( unsigned int i = m_iFirstAltVar; i <= m_iLastAltVar; i++ )
    1772             if( p_GetExp(pSave, i, currRing) != 0 )
    1773             {
    1774               assume(p_GetExp(pSave, i, currRing) == 1);
    1775 
    1776               const poly p_new = sca_pp_Mult_xi_pp(i, p_next, currRing);
    1777 
    1778 #ifdef PDEBUG
    1779               p_Test(p_new, currRing);
    1780 #endif
    1781 
    1782               if( p_new == NULL) continue;
    1783 
    1784               LObject h(p_new); // h = x_i * strat->P
    1785               h.is_special = TRUE;
    1786 
    1787               if (TEST_OPT_INTSTRATEGY)
    1788                 h.pCleardenom(); // also does a p_Content
    1789               else
    1790                 h.pNorm();
    1791 
    1792               strat->initEcart(&h);
    1793               h.sev = pGetShortExpVector(h.p);
    1794 
    1795               int pos = 0;
    1796 
    1797               if (strat->Ll != -1)
    1798                 pos = strat->posInL(strat->L,strat->Ll,&h,strat);
    1799 
    1800               enterL(&strat->L,&strat->Ll,&strat->Lmax,h,pos);
    1801             }
    1802       }
    1803     }
    1804   }
    1805 
    1806   // compute-------------------------------------------------------
    1807   while (strat->Ll >= 0)
    1808   {
    1809     if (strat->Ll > lrmax) lrmax =strat->Ll;// stat.
    1810 
    1811 #ifdef KDEBUG
    1812 //     loop_count++;
    1813     if (TEST_OPT_DEBUG) messageSets(strat);
    1814 #endif
    1815 
    1816     if (strat->Ll== 0) strat->interpt=TRUE;
    1817 
    1818     if (TEST_OPT_DEGBOUND
    1819         && ((strat->honey && (strat->L[strat->Ll].ecart+pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg))
    1820             || ((!strat->honey) && (pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg))))
    1821     {
    1822 
    1823 #ifdef KDEBUG
    1824 //      if (TEST_OPT_DEBUG){PrintS("^^^^?");}
    1825 #endif
    1826 
    1827       // *stops computation if
    1828       // * 24 IN test and the degree +ecart of L[strat->Ll] is bigger then
    1829       // *a predefined number Kstd1_deg
    1830       while ((strat->Ll >= 0)
    1831         && ( (strat->homog==isHomog) || strat->L[strat->Ll].is_special || ((strat->L[strat->Ll].p1!=NULL) && (strat->L[strat->Ll].p2!=NULL)) )
    1832         && ((strat->honey && (strat->L[strat->Ll].ecart+pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg))
    1833             || ((!strat->honey) && (pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg)))
    1834             )
    1835       {
    1836 #ifdef KDEBUG
    1837 //        if (TEST_OPT_DEBUG){PrintS("^^^^^^^^^^^^!!!!");}
    1838 #endif
    1839         deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
    1840 //        if (TEST_OPT_PROT) PrintS("^!");
    1841       }
    1842       if (strat->Ll<0) break;
    1843       else strat->noClearS=TRUE;
    1844     }
    1845 
    1846     // picks the last element from the lazyset L
    1847     strat->P = strat->L[strat->Ll];
    1848     strat->Ll--;
    1849 
    1850 
    1851 //    assume(pNext(strat->P.p) != strat->tail);
    1852 
    1853     if(strat->P.IsNull()) continue;
    1854 
    1855     if (pNext(strat->P.p) == strat->tail)
    1856     {
    1857       // deletes the short spoly
    1858       pLmFree(strat->P.p);
    1859 
    1860       strat->P.p = nc_CreateSpoly(strat->P.p1, strat->P.p2, currRing);
    1861       if (strat->P.p!=NULL) strat->initEcart(&strat->P);
    1862     }//    else
    1863 
    1864 
    1865     if(strat->P.IsNull()) continue;
    1866 
    1867     if (strat->P.p1 == NULL)
    1868     {
    1869 //       if (strat->minim > 0)
    1870 //         strat->P.p2=p_Copy(strat->P.p, currRing, strat->tailRing);
    1871 
    1872 
    1873       // for input polys, prepare reduction
    1874         strat->P.PrepareRed(strat->use_buckets);
    1875     }
    1876 
    1877     if (TEST_OPT_PROT)
    1878       message((strat->honey ? strat->P.ecart : 0) + strat->P.pFDeg(),
    1879               &olddeg,&reduc,strat, red_result);
    1880 
    1881     // reduction of the element choosen from L
    1882     red_result = strat->red(&strat->P,strat);
    1883 
    1884 
    1885     // reduction to non-zero new poly
    1886     if (red_result == 1)
    1887     {
    1888       // statistic
    1889       if (TEST_OPT_PROT) PrintS("s");
    1890 
    1891       // get the polynomial (canonicalize bucket, make sure P.p is set)
    1892       strat->P.GetP(strat->lmBin);
    1893 
    1894       int pos = posInS(strat,strat->sl,strat->P.p,strat->P.ecart);
    1895 
    1896       // reduce the tail and normalize poly
    1897       if (TEST_OPT_INTSTRATEGY)
    1898       {
    1899         strat->P.pCleardenom();
    1900         if ((TEST_OPT_REDSB)||(TEST_OPT_REDTAIL))
    1901         {
    1902           strat->P.p = redtailBba(&(strat->P),pos-1,strat, withT); // !!!
    1903           strat->P.pCleardenom();
    1904         }
    1905       }
    1906       else
    1907       {
    1908         strat->P.pNorm();
    1909         if ((TEST_OPT_REDSB)||(TEST_OPT_REDTAIL))
    1910           strat->P.p = redtailBba(&(strat->P),pos-1,strat, withT);
    1911       }
    1912       strat->P.is_normalized=nIsOne(pGetCoeff(strat->P.p));
    1913 
    1914 #ifdef KDEBUG
    1915       if (TEST_OPT_DEBUG){PrintS(" ns:");p_wrp(strat->P.p,currRing);PrintLn();}
    1916 #endif
    1917 
    1918 //       // min_std stuff
    1919 //       if ((strat->P.p1==NULL) && (strat->minim>0))
    1920 //       {
    1921 //         if (strat->minim==1)
    1922 //         {
    1923 //           strat->M->m[minimcnt]=p_Copy(strat->P.p,currRing,strat->tailRing);
    1924 //           p_Delete(&strat->P.p2, currRing, strat->tailRing);
    1925 //         }
    1926 //         else
    1927 //         {
    1928 //           strat->M->m[minimcnt]=strat->P.p2;
    1929 //           strat->P.p2=NULL;
    1930 //         }
    1931 //         if (strat->tailRing!=currRing && pNext(strat->M->m[minimcnt])!=NULL)
    1932 //           pNext(strat->M->m[minimcnt])
    1933 //             = strat->p_shallow_copy_delete(pNext(strat->M->m[minimcnt]),
    1934 //                                            strat->tailRing, currRing,
    1935 //                                            currRing->PolyBin);
    1936 //         minimcnt++;
    1937 //       }
    1938 
    1939       // enter into S, L, and T
    1940       //if(withT)
    1941         enterT(strat->P, strat);
    1942 
    1943       // L
    1944       enterpairs(strat->P.p,strat->sl,strat->P.ecart,pos,strat, strat->tl);
    1945 
    1946       // posInS only depends on the leading term
    1947       strat->enterS(strat->P, pos, strat, strat->tl);
    1948 
    1949 //       if (hilb!=NULL) khCheck(Q,w,hilb,hilbeledeg,hilbcount,strat);
    1950 
    1951 //      Print("[%d]",hilbeledeg);
    1952       if (strat->P.lcm!=NULL) pLmFree(strat->P.lcm);
    1953 
    1954       if (strat->sl>srmax) srmax = strat->sl;
    1955 
    1956       // //////////////////////////////////////////////////////////
    1957       // SCA:
    1958       const poly pSave = strat->P.p;
    1959       const poly p_next = pNext(pSave);
    1960 
    1961 //       if(0)
    1962       if( p_next != NULL )
    1963       for( unsigned int i = m_iFirstAltVar; i <= m_iLastAltVar; i++ )
    1964       if( p_GetExp(pSave, i, currRing) != 0 )
    1965       {
    1966         assume(p_GetExp(pSave, i, currRing) == 1);
    1967         const poly p_new = sca_pp_Mult_xi_pp(i, p_next, currRing);
    1968 
    1969 #ifdef PDEBUG
    1970         p_Test(p_new, currRing);
    1971 #endif
    1972 
    1973         if( p_new == NULL) continue;
    1974 
    1975         LObject h(p_new); // h = x_i * strat->P
    1976 
    1977         h.is_special = TRUE;
    1978 
    1979         if (TEST_OPT_INTSTRATEGY)
    1980         {
    1981 //          p_Content(h.p);
    1982           h.pCleardenom(); // also does a p_Content
    1983         }
    1984         else
    1985         {
    1986           h.pNorm();
    1987         }
    1988 
    1989         strat->initEcart(&h);
    1990         h.sev = pGetShortExpVector(h.p);
    1991 
    1992         int pos = 0;
    1993 
    1994         if (strat->Ll != -1)
    1995           pos = strat->posInL(strat->L,strat->Ll,&h,strat);
    1996 
    1997         enterL(&strat->L,&strat->Ll,&strat->Lmax,h,pos);
    1998 
    1999  
    2000  
    2001  
    2002 #if 0   
    2003         h.sev = pGetShortExpVector(h.p);
    2004         strat->initEcart(&h);
    2005 
    2006         h.PrepareRed(strat->use_buckets);
    2007 
    2008         // reduction of the element choosen from L(?)
    2009         red_result = strat->red(&h,strat);
    2010 
    2011         // reduction to non-zero new poly
    2012         if (red_result != 1) continue;
    2013 
    2014 
    2015         int pos = posInS(strat,strat->sl,h.p,h.ecart);
    2016 
    2017         // reduce the tail and normalize poly
    2018         if (TEST_OPT_INTSTRATEGY)
    2019         {
    2020           h.pCleardenom();
    2021           if ((TEST_OPT_REDSB)||(TEST_OPT_REDTAIL))
    2022           {
    2023             h.p = redtailBba(&(h),pos-1,strat, withT); // !!!
    2024             h.pCleardenom();
    2025           }
    2026         }
    2027         else
    2028         {
    2029           h.pNorm();
    2030           if ((TEST_OPT_REDSB)||(TEST_OPT_REDTAIL))
    2031             h.p = redtailBba(&(h),pos-1,strat, withT);
    2032         }
    2033 
    2034 #ifdef KDEBUG
    2035         if (TEST_OPT_DEBUG){PrintS(" N:");h.wrp();PrintLn();}
    2036 #endif
    2037 
    2038 //        h.PrepareRed(strat->use_buckets); // ???
    2039 
    2040         h.sev = pGetShortExpVector(h.p);
    2041         strat->initEcart(&h);
    2042 
    2043         if (strat->Ll==-1)
    2044           pos = 0;
    2045         else
    2046           pos = strat->posInL(strat->L,strat->Ll,&h,strat);
    2047 
    2048          enterL(&strat->L,&strat->Ll,&strat->Lmax,h,pos);
    2049 // the end of "#if 0" (comment)
    2050 #endif
    2051 
    2052       } // for all x_i \in Ann(lm(P))
    2053     } // if red(P) != NULL
    2054 
    2055 //     else if (strat->P.p1 == NULL && strat->minim > 0)
    2056 //     {
    2057 //       p_Delete(&strat->P.p2, currRing, strat->tailRing);
    2058 //     }
    2059 
    2060 #ifdef KDEBUG
    2061 //    memset(&(strat->P), 0, sizeof(strat->P));
    2062 #endif
    2063 
    2064     kTest_TS(strat); // even of T is not used!
    2065 
    2066 //     Print("\n$\n");
    2067 
    2068   }
    2069 
    2070 #ifdef KDEBUG
    2071   if (TEST_OPT_DEBUG) messageSets(strat);
    2072 #endif
    2073 
    2074   // complete reduction of the standard basis---------
    2075 
    2076   if (TEST_OPT_REDSB)
    2077   {
    2078     completeReduce(strat);
    2079   }
    2080 
    2081   //release temp data--------------------------------
    2082 
    2083   exitBuchMora(strat); // cleanT!
    2084 
    2085   id_Delete(&tempF, currRing);
    2086 
    2087   if (TEST_OPT_WEIGHTM)
    2088   {
    2089     pRestoreDegProcs(pFDegOld, pLDegOld);
    2090     if (ecartWeights)
    2091     {
    2092       omFreeSize((ADDRESS)ecartWeights,(pVariables+1)*sizeof(short));
    2093       ecartWeights=NULL;
    2094     }
    2095   }
    2096 
    2097   if (TEST_OPT_PROT) messageStat(srmax,lrmax,hilbcount,strat);
    2098 
    2099 
    2100 
    2101   if (tempQ!=NULL) updateResult(strat->Shdl,tempQ,strat);
    2102 
    2103 
    2104   if (TEST_OPT_REDSB) // ???
    2105   {
    2106     // must be at the very end (after exitBuchMora) as it changes the S set!!!
    2107     ideal I = strat->Shdl;
    2108     ideal erg = kInterRedOld(I,tempQ);
    2109     assume(I!=erg);
    2110     id_Delete(&I, currRing);
    2111     strat->Shdl = erg;
    2112   }
    2113 
    2114 #if MYTEST
    2115   PrintS("\n\n</sca_bba>\n\n");
    2116 #endif
    2117 
    2118   return (strat->Shdl);
    2119 */
    2120 }
    2121 
    2122 // //////////////////////////////////////////////////////////////////////////////
    2123 // sca mora...
    2124 
    2125 /*
    2126 // returns TRUE if mora should use buckets, false otherwise
    2127 static BOOLEAN kMoraUseBucket(kStrategy strat)
    2128 {
    2129 #ifdef MORA_USE_BUCKETS
    2130   if (TEST_OPT_NOT_BUCKETS)
    2131     return FALSE;
    2132   if (strat->red == redFirst)
    2133   {
    2134 #ifdef NO_LDEG
    2135     if (!strat->syzComp)
    2136       return TRUE;
    2137 #else
    2138     if ((strat->homog || strat->honey) && !strat->syzComp)
    2139       return TRUE;
    2140 #endif
    2141   }
    2142   else
    2143   {
    2144     assume(strat->red == redEcart);
    2145     if (strat->honey && !strat->syzComp)
    2146       return TRUE;
    2147   }
    2148 #endif
    2149   return FALSE;
    2150 }
    2151 */
    2152 
    2153 #ifdef HAVE_ASSUME
    2154 static int sca_mora_count = 0;
    2155 static int sca_mora_loop_count;
    2156 #endif
    2157 
    2158 // ideal sca_mora (ideal F, ideal Q, intvec *w, intvec *, kStrategy strat)
    2159 ideal sca_mora(const ideal F, const ideal Q, const intvec *w, const intvec *, kStrategy strat, const ring _currRing)
    2160 {
    2161 /*
    2162   assume(rIsSCA(currRing));
    2163 
    2164   const unsigned int m_iFirstAltVar = scaFirstAltVar(currRing);
    2165   const unsigned int m_iLastAltVar  = scaLastAltVar(currRing);
    2166 
    2167   ideal tempF = id_KillSquares(F, m_iFirstAltVar, m_iLastAltVar, currRing);
    2168 
    2169   ideal tempQ = Q;
    2170 
    2171   if(Q == currQuotient)
    2172     tempQ = SCAQuotient(currRing);
    2173 
    2174   bool bIdHomog = id_IsSCAHomogeneous(tempF, NULL, NULL, currRing); // wCx == wCy == NULL!
    2175 
    2176   assume( !bIdHomog || strat->homog ); //  bIdHomog =====[implies]>>>>> strat->homog
    2177 
    2178   strat->homog = strat->homog && bIdHomog;
    2179 
    2180 #ifdef PDEBUG
    2181   assume( strat->homog == bIdHomog );
    2182 #endif
    2183 
    2184 #ifdef HAVE_ASSUME
    2185   sca_mora_count++;
    2186   sca_mora_loop_count = 0;
    2187 #endif
    2188 
    2189 #ifdef KDEBUG
    2190   om_Opts.MinTrack = 5;
    2191 #endif
    2192 
    2193 
    2194   strat->update = TRUE;
    2195   //- setting global variables ------------------- -
    2196   initBuchMoraCrit(strat);
    2197 //   initHilbCrit(F,NULL,&hilb,strat); // no Q!
    2198   initMora(tempF, strat);
    2199   initBuchMoraPos(strat);
    2200   //Shdl=
    2201     initBuchMora(tempF, tempQ, strat); // temp Q, F!
    2202 //   if (TEST_OPT_FASTHC) missingAxis(&strat->lastAxis,strat);
    2203   // updateS in initBuchMora has Hecketest
    2204   // * and could have put strat->kHEdgdeFound FALSE
    2205 #if 0
    2206   if (ppNoether!=NULL)
    2207   {
    2208     strat->kHEdgeFound = TRUE;
    2209   }
    2210   if (strat->kHEdgeFound && strat->update)
    2211   {
    2212     firstUpdate(strat);
    2213     updateLHC(strat);
    2214     reorderL(strat);
    2215   }
    2216   if (TEST_OPT_FASTHC && (strat->lastAxis) && strat->posInLOldFlag)
    2217   {
    2218     strat->posInLOld = strat->posInL;
    2219     strat->posInLOldFlag = FALSE;
    2220     strat->posInL = posInL10;
    2221     updateL(strat);
    2222     reorderL(strat);
    2223   }
    2224 #endif
    2225   strat->use_buckets = kMoraUseBucket(strat);
    2226 
    2227   kTest_TS(strat);
    2228 
    2229 
    2230   int srmax = strat->sl;
    2231   int lrmax = strat->Ll;
    2232   int olddeg = 0;
    2233   int reduc = 0;
    2234   int red_result = 1;
    2235 //  int hilbeledeg=1;
    2236   int hilbcount=0;
    2237 
    2238 
    2239   //- compute-------------------------------------------
    2240 
    2241 #undef HAVE_TAIL_RING
    2242 
    2243 #ifdef HAVE_TAIL_RING
    2244 //  if (strat->homog && strat->red == redFirst)
    2245 //     kStratInitChangeTailRing(strat);
    2246 #endif
    2247 
    2248 
    2249 
    2250 
    2251 
    2252 //  due to std( SB, p)
    2253   if(TEST_OPT_SB_1)
    2254   {
    2255     for (int iNewElement = strat->newIdeal; iNewElement < IDELEMS(tempF); iNewElement++)
    2256     {
    2257 
    2258       const poly pSave = tempF->m[iNewElement];
    2259 
    2260       if( pSave != NULL )
    2261       {
    2262 //        tempF->m[iNewElement] = NULL;
    2263 
    2264         const poly p_next = pNext(pSave);
    2265 
    2266         if(p_next != NULL)
    2267           for( unsigned int i = m_iFirstAltVar; i <= m_iLastAltVar; i++ )
    2268             if( p_GetExp(pSave, i, currRing) != 0 )
    2269             {
    2270 
    2271               assume(p_GetExp(pSave, i, currRing) == 1);
    2272 
    2273               const poly p_new = sca_pp_Mult_xi_pp(i, p_next, currRing);
    2274 
    2275 #ifdef PDEBUG
    2276               p_Test(p_new, currRing);
    2277 #endif
    2278 
    2279               if( p_new == NULL) continue;
    2280 
    2281               LObject h(p_new); // h = x_i * strat->P
    2282 
    2283               if (TEST_OPT_INTSTRATEGY)
    2284                 h.pCleardenom(); // also does a p_Content
    2285               else
    2286                 h.pNorm();
    2287 
    2288               strat->initEcart(&h);
    2289               h.sev = pGetShortExpVector(h.p);
    2290 
    2291               int pos = 0;
    2292 
    2293               if (strat->Ll != -1)
    2294                 pos = strat->posInL(strat->L,strat->Ll,&h,strat);
    2295 
    2296               enterL(&strat->L,&strat->Ll,&strat->Lmax,h,pos);
    2297 
    2298               if (strat->Ll>lrmax) lrmax = strat->Ll;
    2299             }
    2300       }
    2301 
    2302     }
    2303   }
    2304 
    2305 
    2306 
    2307 
    2308   while (strat->Ll >= 0)
    2309   {
    2310 #ifdef HAVE_ASSUME
    2311     sca_mora_loop_count++;
    2312 #endif
    2313     if (lrmax< strat->Ll) lrmax=strat->Ll; // stat
    2314     //test_int_std(strat->kIdeal);
    2315 #ifdef KDEBUG
    2316     if (TEST_OPT_DEBUG) messageSets(strat);
    2317 #endif
    2318     if (TEST_OPT_DEGBOUND
    2319     && (strat->L[strat->Ll].ecart+strat->L[strat->Ll].GetpFDeg()> Kstd1_deg))
    2320     {
    2321       // * stops computation if
    2322       // * - 24 (degBound)
    2323       // *   && upper degree is bigger than Kstd1_deg
    2324       while ((strat->Ll >= 0)
    2325         && (strat->L[strat->Ll].p1!=NULL) && (strat->L[strat->Ll].p2!=NULL)
    2326         && (strat->L[strat->Ll].ecart+strat->L[strat->Ll].GetpFDeg()> Kstd1_deg)
    2327       )
    2328       {
    2329         deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
    2330         //if (TEST_OPT_PROT)
    2331         //{
    2332         //   PrintS("D"); mflush();
    2333         //}
    2334       }
    2335       if (strat->Ll<0) break;
    2336       else strat->noClearS=TRUE;
    2337     }
    2338     strat->P = strat->L[strat->Ll];// - picks the last element from the lazyset L -
    2339     if (strat->Ll==0) strat->interpt=TRUE;
    2340     strat->Ll--;
    2341 
    2342     // create the real Spoly
    2343 //    assume(pNext(strat->P.p) != strat->tail);
    2344 
    2345     if(strat->P.IsNull()) continue;
    2346 
    2347 
    2348     if( pNext(strat->P.p) == strat->tail )
    2349     {
    2350       // deletes the int spoly and computes SPoly
    2351       pLmFree(strat->P.p); // ???
    2352       strat->P.p = nc_CreateSpoly(strat->P.p1, strat->P.p2, currRing);
    2353     }
    2354 
    2355 
    2356 
    2357     if (strat->P.p1 == NULL)
    2358     {
    2359       // for input polys, prepare reduction (buckets !)
    2360       strat->P.SetLength(strat->length_pLength);
    2361       strat->P.PrepareRed(strat->use_buckets);
    2362     }
    2363 
    2364     if (!strat->P.IsNull())
    2365     {
    2366       // might be NULL from noether !!!
    2367       if (TEST_OPT_PROT)
    2368         message(strat->P.ecart+strat->P.GetpFDeg(),&olddeg,&reduc,strat, red_result);
    2369       // reduce
    2370       red_result = strat->red(&strat->P,strat);
    2371     }
    2372 
    2373     if (! strat->P.IsNull())
    2374     {
    2375       strat->P.GetP();
    2376       // statistics
    2377       if (TEST_OPT_PROT) PrintS("s");
    2378       // normalization
    2379       if (!TEST_OPT_INTSTRATEGY)
    2380         strat->P.pNorm();
    2381       // tailreduction
    2382       strat->P.p = redtail(&(strat->P),strat->sl,strat);
    2383       // set ecart -- might have changed because of tail reductions
    2384       if ((!strat->noTailReduction) && (!strat->honey))
    2385         strat->initEcart(&strat->P);
    2386       // cancel unit
    2387       cancelunit(&strat->P);
    2388       // for char 0, clear denominators
    2389       if (TEST_OPT_INTSTRATEGY)
    2390         strat->P.pCleardenom();
    2391 
    2392       // put in T
    2393       enterT(strat->P,strat);
    2394       // build new pairs
    2395       enterpairs(strat->P.p,strat->sl,strat->P.ecart,0,strat, strat->tl);
    2396       // put in S
    2397       strat->enterS(strat->P,
    2398                     posInS(strat,strat->sl,strat->P.p, strat->P.ecart),
    2399                     strat, strat->tl);
    2400 
    2401 
    2402       // clear strat->P
    2403       if (strat->P.lcm!=NULL) pLmFree(strat->P.lcm);
    2404       strat->P.lcm=NULL;
    2405 
    2406       if (strat->sl>srmax) srmax = strat->sl; // stat.
    2407       if (strat->Ll>lrmax) lrmax = strat->Ll;
    2408 
    2409 
    2410 
    2411       // //////////////////////////////////////////////////////////
    2412       // SCA:
    2413       const poly pSave = strat->P.p;
    2414       const poly p_next = pNext(pSave);
    2415 
    2416       if(p_next != NULL)
    2417       for( unsigned int i = m_iFirstAltVar; i <= m_iLastAltVar; i++ )
    2418       if( p_GetExp(pSave, i, currRing) != 0 )
    2419       {
    2420 
    2421         assume(p_GetExp(pSave, i, currRing) == 1);
    2422 
    2423         const poly p_new = sca_pp_Mult_xi_pp(i, p_next, currRing);
    2424 
    2425 #ifdef PDEBUG
    2426         p_Test(p_new, currRing);
    2427 #endif
    2428 
    2429         if( p_new == NULL) continue;
    2430 
    2431         LObject h(p_new); // h = x_i * strat->P
    2432 
    2433         if (TEST_OPT_INTSTRATEGY)
    2434            h.pCleardenom(); // also does a p_Content
    2435         else
    2436           h.pNorm();
    2437 
    2438         strat->initEcart(&h);
    2439         h.sev = pGetShortExpVector(h.p);
    2440 
    2441         int pos = 0;
    2442 
    2443         if (strat->Ll != -1)
    2444           pos = strat->posInL(strat->L,strat->Ll,&h,strat);
    2445 
    2446         enterL(&strat->L,&strat->Ll,&strat->Lmax,h,pos);
    2447 
    2448         if (strat->Ll>lrmax) lrmax = strat->Ll;
    2449       }
    2450 
    2451 #ifdef KDEBUG
    2452       // make sure kTest_TS does not complain about strat->P
    2453       memset(&strat->P,0,sizeof(strat->P));
    2454 #endif
    2455     }
    2456 #if 0
    2457     if (strat->kHEdgeFound)
    2458     {
    2459       if ((TEST_OPT_FINDET)
    2460       || ((TEST_OPT_MULTBOUND) && (scMult0Int((strat->Shdl)) < mu)))
    2461       {
    2462         // obachman: is this still used ???
    2463         // * stops computation if strat->kHEdgeFound and
    2464         // * - 27 (finiteDeterminacyTest)
    2465         // * or
    2466         // * - 23
    2467         // *   (multBound)
    2468         // *   && multiplicity of the ideal is smaller then a predefined number mu
    2469         while (strat->Ll >= 0) deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
    2470       }
    2471     }
    2472 #endif
    2473     kTest_TS(strat);
    2474   }
    2475   // - complete reduction of the standard basis------------------------ -
    2476   if (TEST_OPT_REDSB) completeReduce(strat);
    2477   // - release temp data------------------------------- -
    2478   exitBuchMora(strat);
    2479   // - polynomials used for HECKE: HC, noether -
    2480   if (TEST_OPT_FINDET)
    2481   {
    2482     if (strat->kHEdge!=NULL)
    2483       Kstd1_mu=pFDeg(strat->kHEdge,currRing);
    2484     else
    2485       Kstd1_mu=-1;
    2486   }
    2487   pDelete(&strat->kHEdge);
    2488   strat->update = TRUE; //???
    2489   strat->lastAxis = 0; //???
    2490   pDelete(&strat->kNoether);
    2491   omFreeSize((ADDRESS)strat->NotUsedAxis,(pVariables+1)*sizeof(BOOLEAN));
    2492   if (TEST_OPT_PROT) messageStat(srmax,lrmax,hilbcount,strat);
    2493   if (TEST_OPT_WEIGHTM)
    2494   {
    2495     pRestoreDegProcs(pFDegOld, pLDegOld);
    2496     if (ecartWeights)
    2497     {
    2498       omFreeSize((ADDRESS)ecartWeights,(pVariables+1)*sizeof(short));
    2499       ecartWeights=NULL;
    2500     }
    2501   }
    2502   if (tempQ!=NULL) updateResult(strat->Shdl,tempQ,strat);
    2503   idTest(strat->Shdl);
    2504 
    2505   id_Delete( &tempF, currRing);
    2506 
    2507   return (strat->Shdl);
    2508 */
    2509 }
    2510 
    2511 
    2512 
    2513 
    2514 
    2515 
    25161251void sca_p_ProcsSet(ring rGR, p_Procs_s* p_Procs)
    25171252{
     
    25281263  rGR->GetNC()->p_Procs.mm_Mult_pp  = sca_mm_Mult_pp;
    25291264
    2530 
    2531   if (rHasLocalOrMixedOrdering(rGR))
    2532   {
    2533 #ifdef PDEBUG
    2534 //           Print("Local case => GB == mora!\n");
    2535 #endif
    2536     rGR->GetNC()->p_Procs.GB          = NULL; // sca_mora; // local ordering => Mora, otherwise - Buchberger!
    2537   }
    2538   else
    2539   {
    2540 #ifdef PDEBUG
    2541 //           Print("Global case => GB == bba!\n");
    2542 #endif
    2543     rGR->GetNC()->p_Procs.GB          = NULL; // sca_bba; // sca_gr_bba; // sca_bba? // sca_bba;
    2544   }
    2545 
    2546 
    2547 //   rGR->GetNC()->p_Procs.GlobalGB    = sca_gr_bba;
    2548 //   rGR->GetNC()->p_Procs.LocalGB     = sca_mora;
    2549 
    2550 
    25511265//   rGR->GetNC()->p_Procs.SPoly         = sca_SPoly;
    25521266//   rGR->GetNC()->p_Procs.ReduceSPoly   = sca_ReduceSpoly;
     
    25651279        r->GetNC()->mmMultPP()    = sca_mm_Mult_pp;
    25661280
    2567         r->GetNC()->GB()            = sca_gr_bba;
    25681281/*
    25691282        // ??????????????????????????????????????? coefficients swell...
     
    25731286//         r->GetNC()->BucketPolyRed() = gnc_kBucketPolyRed;
    25741287//         r->GetNC()->BucketPolyRed_Z()= gnc_kBucketPolyRed_Z;
    2575 
    25761288#endif
    25771289}
Note: See TracChangeset for help on using the changeset viewer.