Changeset f2b5839 in git
- Timestamp:
- Jun 9, 2008, 8:16:04 AM (15 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 52e2f60700ff18f1b002b09ada312e11d8a71027
- Parents:
- ee586a66c94f553b815e0af833a1d2aba622d56f
- Location:
- kernel
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/tgb.cc
ree586a rf2b5839 5 5 * Computer Algebra System SINGULAR * 6 6 ****************************************/ 7 /* $Id: tgb.cc,v 1.15 3 2008-03-19 17:44:12 SingularExp $ */7 /* $Id: tgb.cc,v 1.154 2008-06-09 06:16:03 bricken Exp $ */ 8 8 /* 9 9 * ABSTRACT: slimgb and F4 implementation … … 351 351 return FALSE; 352 352 } 353 static BOOLEAN get_last_dp_block_start(ring r){ 353 354 static BOOLEAN lies_in_last_dp_block(poly p, slimgb_alg* c){ 355 ring r=c->r; 356 if (p_GetComp(p,r)!=0) return FALSE; 357 if (c->lastDpBlockStart<=pVariables){ 358 int i; 359 for(i=1;i<c->lastDpBlockStart;i++){ 360 if (p_GetExp(p,i,r)!=0){ 361 break; 362 } 363 } 364 if (i>=c->lastDpBlockStart) { 365 //wrp(p); 366 //PrintS("\n"); 367 return TRUE; 368 } 369 else return FALSE; 370 }else 371 return FALSE; 372 } 373 374 static int get_last_dp_block_start(ring r){ 354 375 //ring r=c->r; 355 376 int last_block; … … 1135 1156 1136 1157 1137 static void add_later(poly p, const char* prot, slimgb_alg* c) 1138 { 1158 static void add_later(poly p, char* prot, slimgb_alg* c){ 1139 1159 int i=0; 1140 1160 //check, if it is already in the queue 1141 1161 1142 1162 1143 while(c->add_later->m[i]!=NULL) 1144 { 1163 while(c->add_later->m[i]!=NULL){ 1145 1164 if (p_LmEqual(c->add_later->m[i],p,c->r)) 1146 1165 return; … … 2368 2387 qsort(terms,reduced_sum,sizeof(poly),terms_sort_crit); 2369 2388 int nterms=reduced_sum; 2370 if (TEST_OPT_PROT)2371 2389 //if (TEST_OPT_PROT) 2390 //Print("orig estimation:%i\n",reduced_sum); 2372 2391 unify_terms(terms,nterms); 2373 if (TEST_OPT_PROT)2374 Print("actual number of columns:%i\n",nterms);2392 //if (TEST_OPT_PROT) 2393 // Print("actual number of columns:%i\n",nterms); 2375 2394 int rank=reduced_c; 2376 2395 linalg_step_modp(reduced, p,rank,terms,nterms,c); … … 2394 2413 #ifdef USE_NORO 2395 2414 //Print("module rank%d\n",c->S->rank); 2396 const BOOLEAN use_noro=((!(c->nc))&&(c->S->rank<=1)&&(rField_is_Zp(c->r)) &&(!(c->eliminationProblem))&&(npPrimeM<=32003));2415 const BOOLEAN use_noro=c->use_noro; 2397 2416 #else 2398 2417 const BOOLEAN use_noro=FALSE; … … 2406 2425 i=0; 2407 2426 int max_pairs=bundle_size; 2408 if (use_noro) 2427 2428 #ifdef USE_NORO 2429 if ((use_noro)||(c->use_noro_last_block)) 2409 2430 max_pairs=bundle_size_noro; 2431 #endif 2410 2432 poly* p=(poly*) omalloc((max_pairs+1)*sizeof(poly));//nullterminated 2411 2433 … … 2500 2522 } 2501 2523 2502 if (TEST_OPT_PROT){2503 Print("reported rank:%i\n",pn);2504 }2524 //if (TEST_OPT_PROT){ 2525 // Print("reported rank:%i\n",pn); 2526 //} 2505 2527 mass_add(p,pn,c); 2506 2528 omfree(p); … … 2580 2602 2581 2603 //if (!c->nc) { 2582 if ( c->tailReductions){2604 if ((c->tailReductions) ||(lies_in_last_dp_block(p,c))){ 2583 2605 p=redNFTail(p,c->strat->sl,c->strat, 0); 2584 2606 } else { … … 2972 2994 idDelete(&I); 2973 2995 add_later=idInit(ADD_LATER_SIZE,S->rank); 2996 #ifdef USE_NORO 2997 use_noro=((!(nc))&&(S->rank<=1)&&(rField_is_Zp(r)) &&(!(eliminationProblem))&&(npPrimeM<=32003)); 2998 use_noro_last_block=false; 2999 if ((!(use_noro))&&(lastDpBlockStart<=pVariables)){ 3000 use_noro_last_block=((!(nc))&&(S->rank<=1)&&(rField_is_Zp(r)) &&(npPrimeM<=32003)); 3001 } 3002 #else 3003 use_noro=false; 3004 use_noro_last_block=false; 3005 #endif 3006 //Print("NORO last block %i",use_noro_last_block); 2974 3007 memset(add_later->m,0,ADD_LATER_SIZE*sizeof(poly)); 2975 3008 } … … 4123 4156 // nullen loeschen 4124 4157 while(curr_pos>=0){ 4125 4158 if ((c->use_noro_last_block)&&(lies_in_last_dp_block(los[curr_pos].p,c))){ 4159 PrintS("L"); 4160 int pn_noro=curr_pos+1; 4161 poly* p_noro=(poly*) omalloc(pn_noro*sizeof(poly)); 4162 for(i=0;i<pn_noro;i++){ 4163 int dummy_len; 4164 poly p; 4165 los[i].p=NULL; 4166 kBucketClear(los[i].bucket,&p,&dummy_len); 4167 p_noro[i]=p; 4168 } 4169 4170 4171 if (npPrimeM<255){ 4172 noro_step<tgb_uint8>(p_noro,pn_noro,c); 4173 } else { 4174 if (npPrimeM<65000){ 4175 noro_step<tgb_uint16>(p_noro,pn_noro,c); 4176 } else{ 4177 noro_step<tgb_uint32>(p_noro,pn_noro,c); 4178 } 4179 } 4180 for(i=0;i<pn_noro;i++){ 4181 los[i].p=p_noro[i]; 4182 los[i].sev=pGetShortExpVector(los[i].p); 4183 //ignore quality 4184 kBucketInit(los[i].bucket,los[i].p,pLength(los[i].p)); 4185 4186 } 4187 qsort(los,pn_noro,sizeof(red_object),red_object_better_gen); 4188 int deleted=multi_reduction_clear_zeroes(los, losl, pn_noro, curr_pos); 4189 losl -= deleted; 4190 curr_pos -= deleted; 4191 break; 4192 } 4126 4193 find_erg erg; 4194 4127 4195 multi_reduction_find(los, losl,c,curr_pos,erg);//last argument should be curr_pos 4128 4196 if(erg.reduce_by<0) break; 4129 4197 4130 4131 4198 4199 4132 4200 erg.expand=NULL; 4133 4201 int d=erg.to_reduce_u-erg.to_reduce_l+1; -
kernel/tgb_internal.h
ree586a rf2b5839 5 5 * Computer Algebra System SINGULAR * 6 6 ****************************************/ 7 /* $Id: tgb_internal.h,v 1. 69 2007-02-27 10:40:57bricken Exp $ */7 /* $Id: tgb_internal.h,v 1.70 2008-06-09 06:16:04 bricken Exp $ */ 8 8 /* 9 9 * ABSTRACT: tgb internal .h file … … 19 19 #include "stdlib.h" 20 20 #include <modulop.h> 21 //#define USE_NORO 121 #define USE_NORO 1 22 22 23 23 … … 241 241 int lastDpBlockStart; 242 242 int lastCleanedDeg; 243 BOOLEAN use_noro; 244 BOOLEAN use_noro_last_block; 243 245 BOOLEAN isDifficultField; 244 246 BOOLEAN completed; … … 1529 1531 template <class number_type > void simplest_gauss_modp(number_type* a, int nrows,int ncols){ 1530 1532 //use memmoves for changing rows 1531 if (TEST_OPT_PROT)1532 PrintS("StartGauss\n");1533 //if (TEST_OPT_PROT) 1534 // PrintS("StartGauss\n"); 1533 1535 ModPMatrixProxyOnArray<number_type> mat(a,nrows,ncols); 1534 1536 … … 1544 1546 backmat.backwardSubstitute(); 1545 1547 //backward substitutions 1546 if (TEST_OPT_PROT)1547 1548 //if (TEST_OPT_PROT) 1549 //PrintS("StopGauss\n"); 1548 1550 } 1549 1551 //int term_nodes_sort_crit(const void* a, const void* b);
Note: See TracChangeset
for help on using the changeset viewer.