- Timestamp:
- Sep 18, 2016, 3:02:06 PM (8 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- b2592e64df7670d96354bd000ad8cd57484ef3fe
- Parents:
- f8041a6e2257b969d9ab5a0d69148009ee342fd8
- Location:
- Singular
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/links/silink.cc
rf8041a r266ddd 192 192 193 193 //-------------------------------------------------------------------------- 194 BOOLEAN slSetRingDummy(si_link, ring r, BOOLEAN send)194 BOOLEAN slSetRingDummy(si_link, ring r, BOOLEAN) 195 195 { 196 196 if (currRing!=r) rChangeCurrRing(r); -
Singular/newstruct.cc
rf8041a r266ddd 638 638 } 639 639 640 BOOLEAN newstruct_deserialize(blackbox ** b, void **d, si_link f)641 { 642 // newstruct is seriali azed as analog to a list,640 BOOLEAN newstruct_deserialize(blackbox **, void **d, si_link f) 641 { 642 // newstruct is serialized as analog to a list, 643 643 // just read a list and take data, 644 644 // rtyp must be set correctly (to the blackbox id) by routine calling -
Singular/walk.cc
rf8041a r266ddd 96 96 BOOLEAN Overflow_Error = FALSE; 97 97 98 #ifdef TIME_TEST 98 99 clock_t xtif, xtstd, xtlift, xtred, xtnw; 99 100 clock_t xftostd, xtextra, xftinput, to; 101 #endif 100 102 101 103 /**************************** … … 1620 1622 1621 1623 intvec* result = new intvec(niv); 1622 intvec* result1 = new intvec(niv);1623 1624 BOOLEAN nflow = FALSE; 1624 1625 … … 1767 1768 int nG = IDELEMS(G); 1768 1769 int n = nG-1; 1769 Print("\n// ** Ideal %s besteht aus %d Polynomen mit ", Ch, nG);1770 Print("\n// ** Ideal %s besteht aus %d Polynomen mit ", Ch, nG); 1770 1771 1771 1772 for(i=0; i<nG; i++) … … 1784 1785 } 1785 1786 PrintS(" Monomen.\n"); 1786 Print("// ** %s besitzt %d Monome.", Ch, nmon);1787 Print("// ** %s besitzt %d Monome.", Ch, nmon); 1787 1788 PrintLn(); 1788 1789 } … … 2907 2908 { 2908 2909 ring r = rCopy0(currRing,FALSE,FALSE); 2909 int i,nv = currRing->N;2910 int nv = currRing->N; 2910 2911 2911 2912 int nb = rBlocks(currRing) + 1; … … 2947 2948 static void DefRingPar(intvec* va) 2948 2949 { 2949 int i,nv = currRing->N;2950 int nv = currRing->N; 2950 2951 int nb = rBlocks(currRing) + 1; 2951 2952 … … 2955 2956 res->wvhdl = (int **)omAlloc0(nb * sizeof(int_ptr)); 2956 2957 res->wvhdl[0] = (int*) omAlloc(nv*sizeof(int)); 2957 for(i =0; i<nv; i++)2958 for(int i=0; i<nv; i++) 2958 2959 res->wvhdl[0][i] = (*va)[i]; 2959 2960 … … 2996 2997 static void DefRingParlp(void) 2997 2998 { 2998 int i,nv = currRing->N;2999 int nv = currRing->N; 2999 3000 3000 3001 ring r=rCopy0(currRing,FALSE,FALSE); … … 3032 3033 // r->cf->extRing->names=(char **)omAlloc(l*sizeof(char_ptr)); 3033 3034 // 3034 // for(i =l-1;i>=0;i--)3035 // for(int i=l-1;i>=0;i--) 3035 3036 // { 3036 3037 // rParameter(r)[i]=omStrDup(rParameter(currRing)[i]); … … 3216 3217 nwalk++; 3217 3218 nstep++; 3219 #ifdef TIME_TEST 3218 3220 to=clock(); 3221 #endif 3219 3222 // compute a next weight vector 3220 3223 next_weight = MkInterRedNextWeight(curr_weight,target_weight, G); 3224 #ifdef TIME_TEST 3221 3225 xtnw=xtnw+clock()-to; 3226 #endif 3222 3227 3223 3228 #ifdef PRINT_VECTORS … … 3262 3267 } 3263 3268 oldRing = currRing; 3269 #ifdef TIME_TEST 3264 3270 to=clock(); 3271 #endif 3265 3272 // compute an initial form ideal of <G> w.r.t. "curr_vector" 3266 3273 Gomega = MwalkInitialForm(G, curr_weight); 3274 #ifdef TIME_TEST 3267 3275 xtif=xtif+clock()-to; 3276 #endif 3268 3277 3269 3278 #ifdef ENDWALKS … … 3302 3311 Gomega1 = idrMoveR(Gomega, oldRing,currRing); 3303 3312 3313 #ifdef TIME_TEST 3304 3314 to=clock(); 3315 #endif 3305 3316 /* compute a reduced Groebner basis of <Gomega> w.r.t. "newRing" */ 3306 3317 #ifdef BUCHBERGER_ALG … … 3310 3321 delete hilb_func; 3311 3322 #endif // BUCHBERGER_ALG 3323 #ifdef TIME_TEST 3312 3324 xtstd=xtstd+clock()-to; 3325 #endif 3313 3326 /* change the ring to oldRing */ 3314 3327 rChangeCurrRing(oldRing); … … 3316 3329 Gomega2 = idrMoveR(Gomega1, newRing,currRing); 3317 3330 3331 #ifdef TIME_TEST 3318 3332 to=clock(); 3333 #endif 3319 3334 /* compute a reduced Groebner basis of <G> w.r.t. "newRing" */ 3320 3335 F = MLifttwoIdeal(Gomega2, M1, G); 3336 #ifdef TIME_TEST 3321 3337 xtlift=xtlift+clock()-to; 3338 #endif 3322 3339 3323 3340 idDelete(&M1); … … 3328 3345 F1 = idrMoveR(F, oldRing,currRing); 3329 3346 3347 #ifdef TIME_TEST 3330 3348 to=clock(); 3349 #endif 3331 3350 /* reduce the Groebner basis <G> w.r.t. new ring */ 3332 3351 G = kInterRedCC(F1, NULL); 3352 #ifdef TIME_TEST 3333 3353 xtred=xtred+clock()-to; 3354 #endif 3334 3355 idDelete(&F1); 3335 3356 … … 3926 3947 // BOOLEAN nOverflow_Error = FALSE; 3927 3948 3949 #ifdef TIME_TEST 3928 3950 clock_t tproc=0; 3929 3951 clock_t tinput = clock(); 3952 #endif 3930 3953 3931 3954 int i, nV = currRing->N; … … 4019 4042 goto FIRST_STEP; 4020 4043 } 4044 #ifdef TIME_TEST 4021 4045 to=clock(); 4046 #endif 4022 4047 // compute an initial form ideal of <G> w.r.t. "curr_vector" 4023 4048 Gomega = MwalkInitialForm(G, curr_weight); 4049 #ifdef TIME_TEST 4024 4050 xtif=xtif+clock()-to; 4051 #endif 4025 4052 4026 4053 #ifndef BUCHBERGER_ALG … … 4048 4075 newRing = currRing; 4049 4076 Gomega1 = idrMoveR(Gomega, oldRing,currRing); 4077 #ifdef TIME_TEST 4050 4078 to=clock(); 4079 #endif 4051 4080 // compute a reduced Groebner basis of <Gomega> w.r.t. "newRing" 4052 4081 #ifdef BUCHBERGER_ALG … … 4056 4085 delete hilb_func; 4057 4086 #endif // BUCHBERGER_ALG 4087 #ifdef TIME_TEST 4058 4088 xtstd=xtstd+clock()-to; 4089 #endif 4059 4090 // change the ring to oldRing 4060 4091 rChangeCurrRing(oldRing); … … 4062 4093 Gomega2 = idrMoveR(Gomega1, newRing,currRing); 4063 4094 4095 #ifdef TIME_TEST 4064 4096 to=clock(); 4097 #endif 4065 4098 // compute a reduced Groebner basis of <G> w.r.t. "newRing" by the lifting process 4066 4099 F = MLifttwoIdeal(Gomega2, M1, G); 4100 #ifdef TIME_TEST 4067 4101 xtlift=xtlift+clock()-to; 4102 #endif 4068 4103 idDelete(&M1); 4069 4104 idDelete(&Gomega2); … … 4074 4109 F1 = idrMoveR(F, oldRing,currRing); 4075 4110 4111 #ifdef TIME_TEST 4076 4112 to=clock(); 4113 #endif 4077 4114 // reduce the Groebner basis <G> w.r.t. new ring 4078 4115 G = kInterRedCC(F1, NULL); 4116 #ifdef TIME_TEST 4079 4117 xtred=xtred+clock()-to; 4118 #endif 4080 4119 idDelete(&F1); 4081 4120 … … 4085 4124 } 4086 4125 FIRST_STEP: 4126 #ifdef TIME_TEST 4087 4127 to=clock(); 4128 #endif 4088 4129 Overflow_Error = FALSE; 4089 4130 // compute a next weight vector 4090 4131 next_weight = MkInterRedNextWeight(curr_weight,target_weight, G); 4132 #ifdef TIME_TEST 4091 4133 xtnw=xtnw+clock()-to; 4134 #endif 4092 4135 #ifdef PRINT_VECTORS 4093 4136 MivString(curr_weight, target_weight, next_weight); … … 4126 4169 // REC_LAST_GB_ALT2: 4127 4170 //nOverflow_Error = Overflow_Error; 4171 #ifdef TIME_TEST 4128 4172 tproc=tproc+clock()-tinput; 4173 #endif 4129 4174 4130 4175 /*Print("\n// takes %d steps and calls \"Rec_LastGB\" (%d):", … … 4165 4210 // nOverflow_Error = Overflow_Error; 4166 4211 //Print("\n// takes %d steps and calls \"Rec_LastGB (%d):", tp_deg+1); 4212 #ifdef TIME_TEST 4167 4213 tproc=tproc+clock()-tinput; 4214 #endif 4168 4215 F1 = Rec_LastGB(F1,curr_weight, orig_target_weight, tp_deg+1,nnwinC); 4169 4216 } … … 4198 4245 F1 = G; 4199 4246 } 4247 #ifdef TIME_TEST 4200 4248 to=clock(); 4249 #endif 4201 4250 // Print("\n// apply the Buchberger's alg in ring = %s",rString(currRing)); 4202 4251 // idElements(F1, "F1"); 4203 4252 G = MstdCC(F1); 4253 #ifdef TIME_TEST 4204 4254 xtextra=xtextra+clock()-to; 4255 #endif 4205 4256 4206 4257 … … 4494 4545 intvec* next_weight1 = MkInterRedNextWeight(curr_weight,target_weight,G); 4495 4546 intvec* next_weight2 = new intvec(nV); 4496 intvec* next_weight22 = new intvec(nV);4497 4547 intvec* result = new intvec(nV); 4498 4548 intvec* curr_weight1; … … 4758 4808 } 4759 4809 //Print("\n//REC_GB_Mwalk: Entering the %d-th step in the %d-th recursive:\n",nwalk,tp_deg); 4810 #ifdef TIME_TEST 4760 4811 to = clock(); 4812 #endif 4761 4813 // compute an initial form ideal of <G> w.r.t. "curr_vector" 4762 4814 Gomega = MwalkInitialForm(G, curr_weight); 4815 #ifdef TIME_TEST 4763 4816 xtif = xtif + clock()-to; 4817 #endif 4764 4818 4765 4819 #ifndef BUCHBERGER_ALG … … 4788 4842 Gomega1 = idrMoveR(Gomega, oldRing,currRing); 4789 4843 4844 #ifdef TIME_TEST 4790 4845 to = clock(); 4846 #endif 4791 4847 // compute a reduced Groebner basis of <Gomega> w.r.t. "newRing" 4792 4848 #ifdef BUCHBERGER_ALG … … 4796 4852 delete hilb_func; 4797 4853 #endif 4854 #ifdef TIME_TEST 4798 4855 xtstd = xtstd + clock() - to; 4856 #endif 4799 4857 4800 4858 // change the ring to oldRing … … 4804 4862 Gomega2 = idrMoveR(Gomega1, newRing,currRing); 4805 4863 4864 #ifdef TIME_TEST 4806 4865 to = clock(); 4866 #endif 4807 4867 F = MLifttwoIdeal(Gomega2, M1, G); 4868 #ifdef TIME_TEST 4808 4869 xtlift = xtlift + clock() -to; 4870 #endif 4809 4871 4810 4872 idDelete(&M1); … … 4817 4879 F1 = idrMoveR(F, oldRing,currRing); 4818 4880 4881 #ifdef TIME_TEST 4819 4882 to = clock(); 4883 #endif 4820 4884 // reduce the Groebner basis <G> w.r.t. new ring 4821 4885 G = kInterRedCC(F1, NULL); 4886 #ifdef TIME_TEST 4822 4887 xtred = xtred + clock() -to; 4888 #endif 4823 4889 4824 4890 idDelete(&F1); … … 4829 4895 } 4830 4896 NEXT_STEP: 4897 #ifdef TIME_TEST 4831 4898 to = clock(); 4899 #endif 4832 4900 // compute a next weight vector 4833 4901 intvec* next_weight = MkInterRedNextWeight(curr_weight,target_weight, G); 4834 4902 4835 4903 4904 #ifdef TIME_TEST 4836 4905 xtnw = xtnw + clock() - to; 4906 #endif 4837 4907 4838 4908 #ifdef PRINT_VECTORS … … 4934 5004 F1 = G; 4935 5005 } 5006 #ifdef TIME_TEST 4936 5007 to=clock(); 5008 #endif 4937 5009 // apply Buchberger alg to compute a red. GB of F1 4938 5010 G = MstdCC(F1); 5011 #ifdef TIME_TEST 4939 5012 xtextra=clock()-to; 5013 #endif 4940 5014 idDelete(&F1); 4941 5015 newRing = currRing; … … 4966 5040 //Print("// pSetm_Error = (%d)", ErrorCheck()); 4967 5041 5042 #ifdef TIME_TEST 4968 5043 clock_t tinput, tostd, tif=0, tstd=0, tlift=0, tred=0, tnw=0; 4969 xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0;4970 5044 tinput = clock(); 4971 5045 clock_t tim; 5046 xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0; 5047 #endif 4972 5048 nstep=0; 4973 5049 int i; … … 4996 5072 ring XXRing = currRing; 4997 5073 5074 #ifdef TIME_TEST 4998 5075 to = clock(); 5076 #endif 4999 5077 // the monomial ordering of this current ring would be "dp" 5000 5078 G = MstdCC(Go); 5079 #ifdef TIME_TEST 5001 5080 tostd = clock()-to; 5081 #endif 5002 5082 5003 5083 if(currRing->order[0] == ringorder_a) … … 5008 5088 nwalk ++; 5009 5089 nstep ++; 5090 #ifdef TIME_TEST 5010 5091 to = clock(); 5092 #endif 5011 5093 // compute an initial form ideal of <G> w.r.t. "curr_vector" 5012 5094 Gomega = MwalkInitialForm(G, curr_weight); 5095 #ifdef TIME_TEST 5013 5096 tif = tif + clock()-to; 5097 #endif 5014 5098 oldRing = currRing; 5015 5099 … … 5018 5102 /* compute a reduced Groebner basis of Gomega w.r.t. >>_cw by 5019 5103 the recursive changed perturbation walk alg. */ 5104 #ifdef TIME_TEST 5020 5105 tim = clock(); 5106 #endif 5021 5107 #ifdef CHECK_IDEAL_MWALK 5022 5108 Print("\n// **** Groebnerwalk took %d steps and ", nwalk); … … 5041 5127 #endif 5042 5128 */ 5129 #ifdef TIME_TEST 5043 5130 to = clock(); 5131 #endif 5044 5132 F = MLifttwoIdeal(Gomega, M, G); 5133 #ifdef TIME_TEST 5045 5134 xtlift = xtlift + clock() - to; 5135 #endif 5046 5136 5047 5137 idDelete(&Gomega); … … 5089 5179 Gomega1 = idrMoveR(Gomega, oldRing,currRing); 5090 5180 5181 #ifdef TIME_TEST 5091 5182 to = clock(); 5183 #endif 5092 5184 // compute a reduced Groebner basis of <Gomega> w.r.t. "newRing" 5093 5185 #ifdef BUCHBERGER_ALG … … 5097 5189 delete hilb_func; 5098 5190 #endif 5191 #ifdef TIME_TEST 5099 5192 tstd = tstd + clock() - to; 5193 #endif 5100 5194 5101 5195 // change the ring to oldRing … … 5104 5198 Gomega2 = idrMoveR(Gomega1, newRing,currRing); 5105 5199 5200 #ifdef TIME_TEST 5106 5201 to = clock(); 5202 #endif 5107 5203 // compute a representation of the generators of submod (M) with respect 5108 5204 // to those of mod (Gomega). 5109 5205 // Gomega is a reduced Groebner basis w.r.t. the current ring. 5110 5206 F = MLifttwoIdeal(Gomega2, M1, G); 5207 #ifdef TIME_TEST 5111 5208 tlift = tlift + clock() - to; 5209 #endif 5112 5210 5113 5211 idDelete(&M1); … … 5120 5218 } 5121 5219 5220 #ifdef TIME_TEST 5122 5221 to = clock(); 5222 #endif 5123 5223 // reduce the Groebner basis <G> w.r.t. new ring 5124 5224 G = kInterRedCC(F1, NULL); 5225 #ifdef TIME_TEST 5125 5226 if(endwalks != 1) 5126 5227 { … … 5131 5232 xtred = xtred + clock() - to; 5132 5233 } 5234 #endif 5133 5235 idDelete(&F1); 5134 5236 if(endwalks == 1) … … 5137 5239 } 5138 5240 NEXT_VECTOR: 5241 #ifdef TIME_TEST 5139 5242 to = clock(); 5243 #endif 5140 5244 // compute a next weight vector 5141 5245 intvec* next_weight = MkInterRedNextWeight(curr_weight,target_weight,G); 5246 #ifdef TIME_TEST 5142 5247 tnw = tnw + clock() - to; 5248 #endif 5143 5249 #ifdef PRINT_VECTORS 5144 5250 MivString(curr_weight, target_weight, next_weight); … … 5516 5622 Set_Error(FALSE); 5517 5623 Overflow_Error = FALSE; 5518 BOOLEAN endwalks = FALSE;5519 5624 #ifdef TIME_TEST 5520 5625 clock_t tinput, tostd, tif=0, tstd=0, tlift=0, tred=0, tnw=0; … … 6075 6180 #endif 6076 6181 #ifdef ENDWALKS 6182 #ifdef TIME_TEST 6077 6183 if(printout > 1) 6078 6184 { … … 6080 6186 ((double) clock())/1000000 -((double)tim) /1000000); 6081 6187 } 6188 #endif 6082 6189 #endif 6083 6190 } … … 6227 6334 } 6228 6335 // LastGB is "better" than the kStd subroutine 6336 #ifdef TIME_TEST 6229 6337 to=clock(); 6338 #endif 6230 6339 ideal eF1; 6231 6340 if(nP == 0 || tp_deg == 1 || MivSame(orig_target, exivlp) != 1){ … … 6241 6350 F2=NULL; 6242 6351 } 6352 #ifdef TIME_TEST 6243 6353 xtextra=clock()-to; 6354 #endif 6244 6355 ring exTargetRing = currRing; 6245 6356 … … 6635 6746 to = clock(); 6636 6747 #endif 6637 next_weight = next_weight =MkInterRedNextWeight(curr_weight,target_weight, G);6748 next_weight = MkInterRedNextWeight(curr_weight,target_weight, G); 6638 6749 #ifdef TIME_TEST 6639 6750 tnw = tnw + clock() - to; … … 6858 6969 ring new_ring, testring; 6859 6970 //ring extoRing; 6860 ideal Gomega, Gomega1, Gomega2, FF, F, F1,Gresult, Gresult1, G1, Gt;6971 ideal Gomega, Gomega1, Gomega2, FF, F, Gresult, Gresult1, G1, Gt; 6861 6972 int nwalks = 0; 6862 6973 intvec* Mwlp; … … 7332 7443 G = idrMoveR(F,oRing,currRing); 7333 7444 /* 7334 F1 = idrMoveR(F, oRing,currRing);7445 ideal F1 = idrMoveR(F, oRing,currRing); 7335 7446 #ifdef TIME_TEST 7336 7447 to=clock(); … … 7358 7469 ring new_ring, testring; 7359 7470 //ring extoRing; 7360 ideal Gomega, Gomega1, Gomega2, F, FF, F1, Gresult, Gresult1, G1, Gt; 7471 ideal Gomega, Gomega1, Gomega2, F, FF, Gresult, Gresult1, G1, Gt; 7472 #ifdef TIME_TEST 7473 ideal F1; 7474 #endif 7361 7475 intvec* Mwlp; 7362 7476 #ifndef BUCHBERGER_ALG … … 8299 8413 //Print("\n// ring ro = %s;", rString(currRing)); 8300 8414 8415 #ifdef TIME_TEST 8301 8416 clock_t tostd, tif=0, tstd=0, tlift=0, tred=0, tnw=0, textra=0; 8302 #ifdef TIME_TEST8303 8417 clock_t tinput = clock(); 8304 8418 #endif … … 8315 8429 //ideal H1; 8316 8430 ideal H2, Glp; 8317 int nGB, endwalks = 0, nwalkpert=0 , npertstep=0;8431 int nGB, endwalks = 0, nwalkpert=0; 8318 8432 intvec* Mlp = MivMatrixOrderlp(nV); 8319 8433 intvec* vector_tmp = new intvec(nV); … … 8335 8449 newRing = currRing; 8336 8450 8451 #ifdef TIME_TEST 8337 8452 to=clock(); 8453 #endif 8338 8454 // compute a red. GB w.r.t. the help ring 8339 8455 if(MivComp(curr_weight, iv_dp) == 1) //rOrdStr(currRing) = "dp" … … 8349 8465 G = MstdCC(G); 8350 8466 } 8467 #ifdef TIME_TEST 8351 8468 tostd=clock()-to; 8469 #endif 8352 8470 8353 8471 #ifdef REPRESENTATION_OF_SIGMA … … 8372 8490 else 8373 8491 rChangeCurrRing(VMrDefault(curr_weight)); 8492 #ifdef TIME_TEST 8374 8493 to=clock(); 8494 #endif 8375 8495 Gw = idrMoveR(G, exring,currRing); 8376 8496 G = MstdCC(Gw); 8377 8497 Gw = NULL; 8498 #ifdef TIME_TEST 8378 8499 tostd=tostd+clock()-to; 8500 #endif 8379 8501 //ivString(curr_weight,"rep. sigma"); 8380 8502 goto COMPUTE_NEW_VECTOR; … … 8388 8510 while(1) 8389 8511 { 8512 #ifdef TIME_TEST 8390 8513 to=clock(); 8514 #endif 8391 8515 /* compute an initial form ideal of <G> w.r.t. "curr_vector" */ 8392 8516 Gomega = MwalkInitialForm(G, curr_weight); 8517 #ifdef TIME_TEST 8393 8518 tif=tif+clock()-to; 8519 #endif 8394 8520 8395 8521 #ifndef BUCHBERGER_ALG … … 8411 8537 Gomega1 = idrMoveR(Gomega, oldRing,currRing); 8412 8538 8539 #ifdef TIME_TEST 8413 8540 to=clock(); 8541 #endif 8414 8542 /* compute a reduced Groebner basis of <Gomega> w.r.t. "newRing" */ 8415 8543 #ifdef BUCHBERGER_ALG … … 8419 8547 delete hilb_func; 8420 8548 #endif // BUCHBERGER_ALG 8549 #ifdef TIME_TEST 8421 8550 tstd=tstd+clock()-to; 8551 #endif 8422 8552 8423 8553 /* change the ring to oldRing */ … … 8426 8556 Gomega2 = idrMoveR(Gomega1, newRing,currRing); 8427 8557 8558 #ifdef TIME_TEST 8428 8559 to=clock(); 8560 #endif 8429 8561 /* compute a representation of the generators of submod (M) 8430 8562 with respect to those of mod (Gomega). 8431 8563 Gomega is a reduced Groebner basis w.r.t. the current ring */ 8432 8564 F = MLifttwoIdeal(Gomega2, M1, G); 8565 #ifdef TIME_TEST 8433 8566 tlift=tlift+clock()-to; 8567 #endif 8434 8568 8435 8569 idDelete(&M1); … … 8441 8575 F1 = idrMoveR(F, oldRing,currRing); 8442 8576 8577 #ifdef TIME_TEST 8443 8578 to=clock(); 8579 #endif 8444 8580 /* reduce the Groebner basis <G> w.r.t. new ring */ 8445 8581 G = kInterRedCC(F1, NULL); 8582 #ifdef TIME_TEST 8446 8583 tred=tred+clock()-to; 8584 #endif 8447 8585 idDelete(&F1); 8448 8586 … … 8452 8590 nwalk++; 8453 8591 nwalkpert++; 8592 #ifdef TIME_TEST 8454 8593 to=clock(); 8594 #endif 8455 8595 // compute a next weight vector 8456 8596 next_weight = MwalkNextWeightCC(curr_weight,target_weight, G); 8597 #ifdef TIME_TEST 8457 8598 tnw=tnw+clock()-to; 8599 #endif 8458 8600 #ifdef PRINT_VECTORS 8459 8601 MivString(curr_weight, target_weight, next_weight); … … 8495 8637 G1 = idrMoveR(G, newRing,currRing); 8496 8638 8639 #ifdef TIME_TEST 8497 8640 to=clock(); 8641 #endif 8498 8642 /*apply kStd or LastGB to compute a lex. red. Groebner basis of <G>*/ 8499 8643 if(nP == 0 || MivSame(target_tmp, iv_lp) == 0){ … … 8511 8655 G = idrMoveR(G, newRing,currRing); 8512 8656 } 8657 #ifdef TIME_TEST 8513 8658 textra=clock()-to; 8659 #endif 8514 8660 npert[endwalks]=nwalk-npert_tmp; 8515 8661 npert_tmp = nwalk; … … 8630 8776 8631 8777 8632 npertstep = nwalk;8633 8778 nwalkpert = 1; 8634 8779 nsteppert ++; … … 8698 8843 //Print("\n// ring ro = %s;", rString(currRing)); 8699 8844 8845 #ifdef TIME_TEST 8700 8846 clock_t tostd, tif=0, tstd=0, tlift=0, tred=0, tnw=0, textra=0; 8701 #ifdef TIME_TEST8702 8847 clock_t tinput = clock(); 8703 8848 #endif … … 8737 8882 newRing = currRing; 8738 8883 8884 #ifdef TIME_TEST 8739 8885 to=clock(); 8886 #endif 8740 8887 // compute a red. GB w.r.t. the help ring 8741 8888 if(MivComp(curr_weight, iv_dp) == 1) … … 8758 8905 G = MstdCC(G); 8759 8906 } 8907 #ifdef TIME_TEST 8760 8908 tostd=clock()-to; 8909 #endif 8761 8910 8762 8911 #ifdef REPRESENTATION_OF_SIGMA … … 8788 8937 rChangeCurrRing(VMrDefault(curr_weight)); 8789 8938 } 8939 #ifdef TIME_TEST 8790 8940 to=clock(); 8941 #endif 8791 8942 Gw = idrMoveR(G, exring,currRing); 8792 8943 G = MstdCC(Gw); 8793 8944 Gw = NULL; 8945 #ifdef TIME_TEST 8794 8946 tostd=tostd+clock()-to; 8947 #endif 8795 8948 //ivString(curr_weight,"rep. sigma"); 8796 8949 goto COMPUTE_NEW_VECTOR; … … 8804 8957 while(1) 8805 8958 { 8959 #ifdef TIME_TEST 8806 8960 to=clock(); 8961 #endif 8807 8962 // compute an initial form ideal of <G> w.r.t. "curr_vector" 8808 8963 Gomega = MwalkInitialForm(G, curr_weight); 8964 #ifdef TIME_TEST 8809 8965 tif=tif+clock()-to; 8966 #endif 8810 8967 8811 8968 #ifndef BUCHBERGER_ALG … … 8834 8991 Gomega1 = idrMoveR(Gomega, oldRing,currRing); 8835 8992 8993 #ifdef TIME_TEST 8836 8994 to=clock(); 8995 #endif 8837 8996 // compute a reduced Groebner basis of <Gomega> w.r.t. "newRing" 8838 8997 #ifdef BUCHBERGER_ALG … … 8842 9001 delete hilb_func; 8843 9002 #endif 9003 #ifdef TIME_TEST 8844 9004 tstd=tstd+clock()-to; 9005 #endif 8845 9006 8846 9007 // change the ring to oldRing … … 8849 9010 Gomega2 = idrMoveR(Gomega1, newRing,currRing); 8850 9011 9012 #ifdef TIME_TEST 8851 9013 to=clock(); 9014 #endif 8852 9015 // compute a representation of the generators of submod (M) with respect to those of mod (Gomega). 8853 9016 // Gomega is a reduced Groebner basis w.r.t. the current ring 8854 9017 F = MLifttwoIdeal(Gomega2, M1, G); 9018 #ifdef TIME_TEST 8855 9019 tlift=tlift+clock()-to; 9020 #endif 8856 9021 8857 9022 idDelete(&M1); … … 8863 9028 F1 = idrMoveR(F, oldRing,currRing); 8864 9029 9030 #ifdef TIME_TEST 8865 9031 to=clock(); 9032 #endif 8866 9033 // reduce the Groebner basis <G> w.r.t. new ring 8867 9034 G = kInterRedCC(F1, NULL); 9035 #ifdef TIME_TEST 8868 9036 tred=tred+clock()-to; 9037 #endif 8869 9038 idDelete(&F1); 8870 9039 … … 8873 9042 nwalk++; 8874 9043 nwalkpert++; 9044 #ifdef TIME_TEST 8875 9045 to=clock(); 9046 #endif 8876 9047 // compute a next weight vector 8877 9048 //next_weight = MwalkNextWeightCC(curr_weight,target_weight, G); … … 8953 9124 }*/ 8954 9125 9126 #ifdef TIME_TEST 8955 9127 tnw=tnw+clock()-to; 9128 #endif 8956 9129 #ifdef PRINT_VECTORS 8957 9130 MivString(curr_weight, target_weight, next_weight); … … 9004 9177 G1 = idrMoveR(G, newRing,currRing); 9005 9178 9179 #ifdef TIME_TEST 9006 9180 to=clock(); 9181 #endif 9007 9182 // apply kStd or LastGB to compute a lex. red. Groebner basis of <G> 9008 9183 if(nP == 0 || MivSame(target_tmp, iv_lp) == 0) … … 9022 9197 G = idrMoveR(G, newRing,currRing); 9023 9198 } 9199 #ifdef TIME_TEST 9024 9200 textra=clock()-to; 9201 #endif 9025 9202 npert[endwalks]=nwalk-npert_tmp; 9026 9203 npert_tmp = nwalk; … … 9211 9388 Overflow_Error = FALSE; 9212 9389 // BOOLEAN nOverflow_Error = FALSE; 9390 #ifdef TIME_TEST 9213 9391 clock_t tproc=0; 9214 9392 clock_t tinput=clock(); 9393 #endif 9215 9394 int i, nV = currRing->N; 9216 9395 … … 9301 9480 goto FIRST_STEP; 9302 9481 } 9482 #ifdef TIME_TEST 9303 9483 to=clock(); 9484 #endif 9304 9485 // compute an initial form ideal of <G> w.r.t. "curr_vector" 9305 9486 Gomega = MwalkInitialForm(G, curr_weight); 9487 #ifdef TIME_TEST 9306 9488 xtif=xtif+clock()-to; 9489 #endif 9307 9490 9308 9491 #ifndef BUCHBERGER_ALG … … 9336 9519 #endif 9337 9520 */ 9521 #ifdef TIME_TEST 9338 9522 to=clock(); 9523 #endif 9339 9524 // compute a reduced Groebner basis of <Gomega> w.r.t. "newRing" 9340 9525 #ifdef BUCHBERGER_ALG … … 9344 9529 delete hilb_func; 9345 9530 #endif // BUCHBERGER_ALG 9531 #ifdef TIME_TEST 9346 9532 xtstd=xtstd+clock()-to; 9533 #endif 9347 9534 9348 9535 // change the ring to oldRing … … 9350 9537 M1 = idrMoveR(M, newRing,currRing); 9351 9538 Gomega2 = idrMoveR(Gomega1, newRing,currRing); 9539 #ifdef TIME_TEST 9352 9540 to=clock(); 9541 #endif 9353 9542 9354 9543 // if(endwalks == 1){PrintS("\n// Lifting is still working:");} … … 9356 9545 // compute a reduced Groebner basis of <G> w.r.t. "newRing" by the lifting process 9357 9546 F = MLifttwoIdeal(Gomega2, M1, G); 9547 #ifdef TIME_TEST 9358 9548 xtlift=xtlift+clock()-to; 9549 #endif 9359 9550 9360 9551 idDelete(&M1); … … 9365 9556 rChangeCurrRing(newRing); 9366 9557 F1 = idrMoveR(F, oldRing,currRing); 9558 #ifdef TIME_TEST 9367 9559 to=clock(); 9560 #endif 9368 9561 //if(endwalks == 1){ PrintS("\n// InterRed is still working:");} 9369 9562 // reduce the Groebner basis <G> w.r.t. the new ring 9370 9563 G = kInterRedCC(F1, NULL); 9564 #ifdef TIME_TEST 9371 9565 xtred=xtred+clock()-to; 9566 #endif 9372 9567 idDelete(&F1); 9373 9568 … … 9377 9572 FIRST_STEP: 9378 9573 Overflow_Error=FALSE; 9574 #ifdef TIME_TEST 9379 9575 to=clock(); 9576 #endif 9380 9577 // compute a next weight vector 9381 9578 next_weight = MkInterRedNextWeight(curr_weight,target_weight, G); 9579 #ifdef TIME_TEST 9382 9580 xtnw=xtnw+clock()-to; 9581 #endif 9383 9582 #ifdef PRINT_VECTORS 9384 9583 MivString(curr_weight, target_weight, next_weight); … … 9390 9589 if(tp_deg > 1){ 9391 9590 //nOverflow_Error = Overflow_Error; 9591 #ifdef TIME_TEST 9392 9592 tproc = tproc+clock()-tinput; 9593 #endif 9393 9594 //Print("\n// A subroutine takes %d steps and calls \"Mpwalk\" (1,%d):", nwalk, tp_deg-1); 9394 9595 G1 = Mpwalk_MAltwalk1(G, curr_weight, tp_deg-1); … … 9439 9640 { 9440 9641 //Print("\n// subroutine takes %d steps and applys \"std\"", nwalk); 9642 #ifdef TIME_TEST 9441 9643 to=clock(); 9644 #endif 9442 9645 ideal G2 = MstdCC(G1); 9646 #ifdef TIME_TEST 9443 9647 xtextra=xtextra+clock()-to; 9648 #endif 9444 9649 idDelete(&G1); 9445 9650 G1 = G2; … … 9449 9654 { 9450 9655 //nOverflow_Error = Overflow_Error; 9656 #ifdef TIME_TEST 9451 9657 tproc = tproc+clock()-tinput; 9658 #endif 9452 9659 // Print("\n// B subroutine takes %d steps and calls \"Mpwalk\" (1,%d) :", nwalk, tp_deg-1); 9453 9660 G1 = Mpwalk_MAltwalk1(G1, curr_weight, tp_deg-1); … … 9481 9688 // Print("// pSetm_Error = (%d)", ErrorCheck()); 9482 9689 9690 #ifdef TIME_TEST 9483 9691 xtif=0; xtstd=0; xtlift=0; xtred=0; xtnw=0; xtextra=0; 9484 9692 xftinput = clock(); 9485 9693 clock_t tostd, tproc; 9694 #endif 9486 9695 9487 9696 nstep = 0; … … 9512 9721 ring XXRing = currRing; 9513 9722 9723 #ifdef TIME_TEST 9514 9724 to=clock(); 9725 #endif 9515 9726 /* compute a pertubed weight vector of the original weight vector. 9516 9727 The perturbation degree is recursive decrease until that vector … … 9569 9780 op_deg --; 9570 9781 } 9782 #ifdef TIME_TEST 9571 9783 tostd=clock()-to; 9784 #endif 9572 9785 9573 9786 if(op_tmp != 1 ) … … 9583 9796 nstep ++; 9584 9797 9798 #ifdef TIME_TEST 9585 9799 to = clock(); 9800 #endif 9586 9801 // compute an initial form ideal of <G> w.r.t. "curr_vector" 9587 9802 Gomega = MwalkInitialForm(G, curr_weight); 9803 #ifdef TIME_TEST 9588 9804 xtif=xtif+clock()-to; 9805 #endif 9589 9806 #if 0 9590 9807 if(Overflow_Error == TRUE) … … 9623 9840 Gomega1 = idrMoveR(Gomega, oldRing,currRing); 9624 9841 9842 #ifdef TIME_TEST 9625 9843 to=clock(); 9844 #endif 9626 9845 // compute a reduced Groebner basis of <Gomega> w.r.t. "newRing" 9627 9846 #ifdef BUCHBERGER_ALG … … 9631 9850 delete hilb_func; 9632 9851 #endif // BUCHBERGER_ALG 9852 #ifdef TIME_TEST 9633 9853 xtstd=xtstd+clock()-to; 9854 #endif 9634 9855 9635 9856 // change the ring to oldRing … … 9638 9859 Gomega2 = idrMoveR(Gomega1, newRing,currRing); 9639 9860 9861 #ifdef TIME_TEST 9640 9862 to=clock(); 9863 #endif 9641 9864 // compute a reduced Groebner basis of <G> w.r.t. "newRing" by the lifting process 9642 9865 F = MLifttwoIdeal(Gomega2, M1, G); 9866 #ifdef TIME_TEST 9643 9867 xtlift=xtlift+clock()-to; 9868 #endif 9644 9869 9645 9870 idDelete(&M1); … … 9653 9878 oldRing=NULL; 9654 9879 9880 #ifdef TIME_TEST 9655 9881 to=clock(); 9882 #endif 9656 9883 // reduce the Groebner basis <G> w.r.t. new ring 9657 9884 G = kInterRedCC(F1, NULL); 9885 #ifdef TIME_TEST 9658 9886 xtred=xtred+clock()-to; 9887 #endif 9659 9888 idDelete(&F1); 9660 9889 … … 9664 9893 } 9665 9894 NEXT_VECTOR: 9895 #ifdef TIME_TEST 9666 9896 to=clock(); 9897 #endif 9667 9898 // compute a next weight vector 9668 9899 next_weight = MkInterRedNextWeight(curr_weight,target_weight, G); 9900 #ifdef TIME_TEST 9669 9901 xtnw=xtnw+clock()-to; 9902 #endif 9670 9903 #ifdef PRINT_VECTORS 9671 9904 MivString(curr_weight, target_weight, next_weight); … … 9708 9941 #ifdef TIME_TEST 9709 9942 nOverflow_Error = Overflow_Error; 9710 #endif9711 9943 tproc = clock()-xftinput; 9944 #endif 9712 9945 9713 9946 //Print("\n// main routine takes %d steps and calls \"Mpwalk\" (1,%d):", nwalk, tp_deg);
Note: See TracChangeset
for help on using the changeset viewer.