Changeset 64f0ca in git
- Timestamp:
- Feb 22, 2012, 9:48:23 PM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 232bbd53fe67fd62379e6eb97d8195caeb29d405
- Parents:
- 80ca3c62104a8ede71139b7dae3090f767870f7c
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-02-22 21:48:23+01:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-02-23 20:35:08+01:00
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/Makefile.am
r80ca3c r64f0ca 30 30 SOURCES = polys.cc febase.cc feread.cc \ 31 31 hdegree.cc hilb.cc hutil.cc \ 32 gr_kstd2.cc \33 32 ideals.cc \ 34 33 khstd.cc kstdfac.cc \ 35 34 kstd1.cc kstd2.cc kutil.cc \ 35 nc.cc sca.cc gr_kstd2.cc \ 36 36 misc.cc \ 37 37 fast_maps.cc \ … … 46 46 tgb.cc tgbgauss.cc ringgb.cc f5data.cc f5lists.cc f5gb.cc f5c.cc \ 47 47 ratgring.cc shiftgb.cc gfan.cc \ 48 linearAlgebra.cc nc.ccpreimage.cc \48 linearAlgebra.cc preimage.cc \ 49 49 mod2.h 50 50 -
kernel/kstd1.cc
r80ca3c r64f0ca 2141 2141 2142 2142 return res; 2143 } 2144 2145 poly kNF (ideal F, ideal Q, poly p,int syzComp, int lazyReduce, const ring _currRing) 2146 { 2147 const ring save = currRing; if( currRing != _currRing ) rChangeCurrRing(_currRing); 2148 poly ret = kNF(F, Q, p, syzComp, lazyReduce); 2149 if( currRing != save ) rChangeCurrRing(save); 2150 return ret; 2143 2151 } 2144 2152 -
kernel/kstd1.h
r80ca3c r64f0ca 26 26 poly kNF (ideal F, ideal Q, poly p,int syzComp=0, int lazyReduce=0); 27 27 ideal kNF(ideal F, ideal Q, ideal p,int syzComp=0, int lazyReduce=0); 28 29 /// NOTE: this is just a wrapper which sets currRing for the actual kNF call 30 poly kNF (ideal F, ideal Q, poly p,int syzComp, int lazyReduce, const ring _currRing); 28 31 29 32 ideal kStd(ideal F, ideal Q, tHomog h, intvec ** mw,intvec *hilb=NULL, -
kernel/nc.h
r80ca3c r64f0ca 44 44 if( gb == NULL) 45 45 { 46 if( rIsSCA(r) ) 47 { 48 if (rHasLocalOrMixedOrdering(r)) 49 gb = sca_mora; 50 else 51 gb = sca_bba; // sca_gr_bba??? 52 } else 53 { 46 54 if (rHasLocalOrMixedOrdering(r)) 47 55 gb = gnc_gr_mora; 48 56 else 49 57 gb = gnc_gr_bba; 58 } 50 59 51 60 r->GetNC()->p_Procs.GB = cast_A_to_vptr(gb); -
kernel/sca.cc
r80ca3c r64f0ca 1 #define PLURAL_INTERNAL_DECLARATIONS 2 1 3 #include "mod2.h" 2 4 #include <misc/auxiliary.h> … … 5 7 6 8 #include <polys/simpleideals.h> 7 #include <kernel/polys.h>8 9 9 #include <polys/prCopy.h> 10 10 11 #include <polys/nc/sca.h> 12 #include <polys/nc/gb_hack.h> 13 14 #include "polys.h" 11 15 #include "ideals.h" 12 16 #include "kstd1.h" 17 #include "kutil.h" 13 18 14 19 #include "nc.h" 15 20 16 /* 21 /// nc_gr_initBba is needed for sca_gr_bba and gr_bba. 22 void nc_gr_initBba(ideal F, kStrategy strat); // from gr_kstd2.cc! 23 17 24 void addLObject(LObject& h, kStrategy& strat) 18 25 { … … 25 32 int pos=posInS(strat, strat->sl, h.p, h.ecart); 26 33 27 if ( (pos <= strat->sl) && (p ComparePolys(h.p, strat->S[pos])) )34 if ( (pos <= strat->sl) && (p_ComparePolys(h.p, strat->S[pos], currRing)) ) 28 35 { 29 36 if (TEST_OPT_PROT) … … 88 95 } 89 96 90 */91 97 92 98 ideal sca_gr_bba(const ideal F, const ideal Q, const intvec *, const intvec *, kStrategy strat, const ring _currRing) 93 99 { 94 /* 100 const ring save = currRing; 101 if( currRing != _currRing ) rChangeCurrRing(_currRing); 102 assume( currRing == _currRing ); 103 104 95 105 #if MYTEST 96 106 PrintS("<sca_gr_bba>\n"); … … 186 196 if (TEST_OPT_DEGBOUND 187 197 && ((strat->honey 188 && (strat->L[strat->Ll].ecart+ pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg))189 || ((!strat->honey) && ( pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg))))198 && (strat->L[strat->Ll].ecart+ currRing->pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg)) 199 || ((!strat->honey) && (currRing->pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg)))) 190 200 { 191 201 // stops computation if … … 321 331 exitBuchMora(strat); 322 332 323 if (TEST_OPT_WEIGHTM) 324 { 325 pFDeg=pFDegOld; 326 pLDeg=pLDegOld; 327 if (ecartWeights) 328 { 329 omFreeSize((ADDRESS)ecartWeights,(pVariables+1)*sizeof(int)); 330 ecartWeights=NULL; 331 } 332 } 333 // if (TEST_OPT_WEIGHTM) 334 // { 335 // pRestoreDegProcs(currRing,pFDegOld, pLDegOld); 336 // if (ecartWeights) 337 // { 338 // omFreeSize((ADDRESS)ecartWeights,(rVar(currRing)+1)*sizeof(int)); 339 // ecartWeights=NULL; 340 // } 341 // } 333 342 334 343 if (TEST_OPT_PROT) messageStat(hilbcount,strat); … … 353 362 #endif 354 363 364 if( currRing != save ) rChangeCurrRing(save); 365 355 366 return (strat->Shdl); 356 */357 367 } 358 368 … … 364 374 365 375 // Under development!!! 366 ideal sca_bba (const ideal F, const ideal Q, const intvec *w, const intvec * /*hilb*/, kStrategy strat )376 ideal sca_bba (const ideal F, const ideal Q, const intvec *w, const intvec * /*hilb*/, kStrategy strat, const ring _currRing) 367 377 { 368 /* 378 const ring save = currRing; 379 if( currRing != _currRing ) rChangeCurrRing(_currRing); 380 assume( currRing == _currRing ); 381 369 382 #if MYTEST 370 383 PrintS("\n\n<sca_bba>\n\n"); … … 547 560 548 561 if (TEST_OPT_DEGBOUND 549 && ((strat->honey && (strat->L[strat->Ll].ecart+ pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg))550 || ((!strat->honey) && ( pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg))))562 && ((strat->honey && (strat->L[strat->Ll].ecart+currRing->pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg)) 563 || ((!strat->honey) && (currRing->pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg)))) 551 564 { 552 565 … … 560 573 while ((strat->Ll >= 0) 561 574 && ( (strat->homog==isHomog) || strat->L[strat->Ll].is_special || ((strat->L[strat->Ll].p1!=NULL) && (strat->L[strat->Ll].p2!=NULL)) ) 562 && ((strat->honey && (strat->L[strat->Ll].ecart+ pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg))563 || ((!strat->honey) && ( pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg)))575 && ((strat->honey && (strat->L[strat->Ll].ecart+currRing->pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg)) 576 || ((!strat->honey) && (currRing->pFDeg(strat->L[strat->Ll].p,currRing)>Kstd1_deg))) 564 577 ) 565 578 { … … 813 826 id_Delete(&tempF, currRing); 814 827 815 if (TEST_OPT_WEIGHTM)816 {817 pRestoreDegProcs(pFDegOld, pLDegOld);818 if (ecartWeights)819 {820 omFreeSize((ADDRESS)ecartWeights,(pVariables+1)*sizeof(short));821 ecartWeights=NULL;822 }823 }828 // if (TEST_OPT_WEIGHTM) 829 // { 830 // pRestoreDegProcs(currRing, pFDegOld, pLDegOld); 831 // if (ecartWeights) 832 // { 833 // omFreeSize((ADDRESS)ecartWeights,(rVar(currRing)+1)*sizeof(short)); 834 // ecartWeights=NULL; 835 // } 836 // } 824 837 825 838 if (TEST_OPT_PROT) messageStat(hilbcount,strat); … … 844 857 #endif 845 858 859 if( currRing != save ) rChangeCurrRing(save); 860 846 861 return (strat->Shdl); 847 */848 862 } 849 863 … … 851 865 // sca mora... 852 866 853 /*854 867 // returns TRUE if mora should use buckets, false otherwise 855 868 static BOOLEAN kMoraUseBucket(kStrategy strat) … … 877 890 return FALSE; 878 891 } 879 */880 892 881 893 #ifdef HAVE_ASSUME … … 887 899 ideal sca_mora(const ideal F, const ideal Q, const intvec *w, const intvec *, kStrategy strat, const ring _currRing) 888 900 { 889 /* 901 const ring save = currRing; 902 if( currRing != _currRing ) rChangeCurrRing(_currRing); 903 assume( currRing == _currRing ); 904 890 905 assume(rIsSCA(currRing)); 891 906 … … 1197 1212 { 1198 1213 if (strat->kHEdge!=NULL) 1199 Kstd1_mu= pFDeg(strat->kHEdge,currRing);1214 Kstd1_mu=currRing->pFDeg(strat->kHEdge,currRing); 1200 1215 else 1201 1216 Kstd1_mu=-1; … … 1205 1220 strat->lastAxis = 0; //??? 1206 1221 pDelete(&strat->kNoether); 1207 omFreeSize((ADDRESS)strat->NotUsedAxis,( pVariables+1)*sizeof(BOOLEAN));1222 omFreeSize((ADDRESS)strat->NotUsedAxis,(rVar(currRing)+1)*sizeof(BOOLEAN)); 1208 1223 if (TEST_OPT_PROT) messageStat(hilbcount,strat); 1209 if (TEST_OPT_WEIGHTM)1210 {1211 pRestoreDegProcs(pFDegOld, pLDegOld);1212 if (ecartWeights)1213 {1214 omFreeSize((ADDRESS)ecartWeights,(pVariables+1)*sizeof(short));1215 ecartWeights=NULL;1216 }1217 }1224 // if (TEST_OPT_WEIGHTM) 1225 // { 1226 // pRestoreDegProcs(currRing, pFDegOld, pLDegOld); 1227 // if (ecartWeights) 1228 // { 1229 // omFreeSize((ADDRESS)ecartWeights,(rVar(currRing)+1)*sizeof(short)); 1230 // ecartWeights=NULL; 1231 // } 1232 // } 1218 1233 if (tempQ!=NULL) updateResult(strat->Shdl,tempQ,strat); 1219 1234 idTest(strat->Shdl); … … 1221 1236 id_Delete( &tempF, currRing); 1222 1237 1238 if( currRing != save ) rChangeCurrRing(save); 1239 1223 1240 return (strat->Shdl); 1224 */1225 1241 } 1226 1242 1227 1228 1229 1230 -
libpolys/polys/nc/sca.cc
r80ca3c r64f0ca 30 30 #include <polys/nc/sca.h> 31 31 #include <polys/nc/nc.h> 32 #include <polys/nc/gb_hack.h> 32 33 // #include <polys/gring.h> 33 34 … … 1046 1047 { 1047 1048 #if ((defined(PDEBUG) && OUTPUT) || MYTEST) 1048 1049 Print("Wrong Coeff at: [%d, %d]\n", i, j); 1049 1050 #endif 1050 1051 return false; … … 1055 1056 { 1056 1057 #if ((defined(PDEBUG) && OUTPUT) || MYTEST) 1057 1058 Print("Wrong Coeff at: [%d, %d]\n", i, j); 1058 1059 #endif 1059 1060 return false; … … 1109 1110 for ( int i = iAltVarStart; (i <= iAltVarEnd) && bSCA; i++ ) 1110 1111 if( (i < b) || (i > e) ) // otherwise it's ok since rG is an SCA! 1111 { 1112 poly square = p_One( rG); 1113 p_SetExp(square, i, 2, rG); // square = var(i)^2. 1114 p_Setm(square, rG); 1115 1116 // square = NF( var(i)^2 | Q ) 1117 // NOTE: rSaveRing == currRing now! 1118 // NOTE: there is no better way to check this in general! 1119 // 1120 ////// TODO!!!!! 1121 ////// extern poly kNF(ideal I, ideal Q, poly f, int a, int b, const ring r); 1122 ////// square = kNF(idQuotient, NULL, square, 0, 1, rG); // must ran in currRing == rG! 1123 1124 if( square != NULL ) // var(i)^2 is not in Q? 1125 { 1126 p_Delete(&square, rG); 1127 bSCA = false; 1128 break; 1129 } 1130 } 1131 1132 // assureCurrentRing(rSaveRing); 1133 1134 if(!bSCA) 1135 { 1136 WarnS("sca_SetupQuotient: Sorry can not use NF: unfixed implementational issue :("); 1137 return false; 1138 } 1139 1140 1141 1112 { 1113 poly square = p_One( rG); 1114 p_SetExp(square, i, 2, rG); // square = var(i)^2. 1115 p_Setm(square, rG); 1116 1117 // square = NF( var(i)^2 | Q ) 1118 // NOTE: there is no better way to check this in general! 1119 square = kNF(idQuotient, NULL, square, 0, 1, rG); // must ran in currRing == rG! 1120 1121 if( square != NULL ) // var(i)^2 is not in Q? 1122 { 1123 p_Delete(&square, rG); 1124 bSCA = false; 1125 break; 1126 } 1127 } 1128 1142 1129 #if ((defined(PDEBUG) && OUTPUT) || MYTEST) 1143 1130 Print("ScaVars!: [%d, %d]\n", iAltVarStart, iAltVarEnd); … … 1287 1274 // r->GetNC()->BucketPolyRed_Z()= gnc_kBucketPolyRed_Z; 1288 1275 #endif 1276 1277 // local ordering => Mora, otherwise - Buchberger! 1278 if (rHasLocalOrMixedOrdering(rGR)) 1279 rGR->GetNC()->p_Procs.GB = cast_A_to_vptr(sca_mora); 1280 else 1281 rGR->GetNC()->p_Procs.GB = cast_A_to_vptr(sca_bba); // sca_gr_bba? 1289 1282 } 1290 1283 -
libpolys/polys/nc/sca.h
r80ca3c r64f0ca 55 55 // return x_i * pPoly; preserve pPoly. 56 56 poly sca_pp_Mult_xi_pp(unsigned int i, const poly pPoly, const ring rRing); 57 58 // set pProcs for r and the variable p_Procs59 // should be used by nc_p_ProcsSet in "gring.h"60 void sca_p_ProcsSet(ring rGR, p_Procs_s* p_Procs);61 57 62 58 ////////////////////////////////////////////////////////////////////////////////////// … … 156 152 #ifdef PLURAL_INTERNAL_DECLARATIONS 157 153 154 // set pProcs for r and the variable p_Procs 155 // should be used by nc_p_ProcsSet in "gring.h" 156 void sca_p_ProcsSet(ring rGR, p_Procs_s* p_Procs); 157 158 158 // should be used only inside nc_SetupQuotient! 159 159 // Check whether this our case: … … 179 179 // #define scaFirstAltVar(R) 0 180 180 // #define scaLastAltVar(R) 0 181 #endif 181 #endif // HAVE_PLURAL 182 182 183 #endif // #ifndef SCA_H
Note: See TracChangeset
for help on using the changeset viewer.