Changeset 98d6c3 in git
- Timestamp:
- May 31, 2012, 3:45:28 PM (11 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 510dbc222823c06af5c391eca075c45c04553e14
- Parents:
- 06c0b34bdca32ebe70f5b9ed855251d51dbb263e17642b3261157040015bc8ef3c5a395ba70f33cb
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/blackbox.h
r17642b r98d6c3 60 60 BOOLEAN blackbox_default_OpM(int op,leftv l, leftv r); 61 61 62 /// default procedure to print this blackbox 63 void blackbox_default_Print(blackbox *b,void *d); 64 62 65 /// return the structure to the type given by t 63 66 blackbox* getBlackboxStuff(const int t); -
Singular/ipshell.cc
r17642b r98d6c3 113 113 default: return Tok2Cmdname(t); 114 114 } 115 } 116 117 int iiOpsTwoChar(const char *s) 118 { 119 /* not handling: &&, ||, ** */ 120 if (s[1]=='\0') return s[0]; 121 else if (s[2]!='\0') return 0; 122 switch(s[0]) 123 { 124 case '.': if (s[1]=='.') return DOTDOT; 125 else return 0; 126 case ':': if (s[1]==':') return COLONCOLON; 127 else return 0; 128 case '-': if (s[1]=='-') return COLONCOLON; 129 else return 0; 130 case '+': if (s[1]=='+') return PLUSPLUS; 131 else return 0; 132 case '=': if (s[1]=='=') return EQUAL_EQUAL; 133 else return 0; 134 case '<': if (s[1]=='=') return LE; 135 else if (s[1]=='>') return NOTEQUAL; 136 else return 0; 137 case '>': if (s[1]=='=') return GE; 138 else return 0; 139 case '!': if (s[1]=='=') return NOTEQUAL; 140 else return 0; 141 } 142 return 0; 115 143 } 116 144 … … 1736 1764 const coeffs C = r->cf; 1737 1765 assume( C != NULL ); 1738 1766 1739 1767 // sanity check: require currRing==r for rings with polynomial data 1740 if ( (r!=currRing) && ( 1741 1742 || (r->qideal != NULL) 1768 if ( (r!=currRing) && ( 1769 (nCoeff_is_algExt(C) && (C != currRing->cf)) 1770 || (r->qideal != NULL) 1743 1771 #ifdef HAVE_PLURAL 1744 1772 || (rIsPluralRing(r)) … … 2192 2220 TransExtInfo extParam; 2193 2221 extParam.r = extRing; 2194 2222 assume( extRing->qideal == NULL ); 2195 2223 2196 2224 R->cf = nInitChar(n_transExt, &extParam); -
Singular/ipshell.h
r17642b r98d6c3 52 52 const char * Tok2Cmdname(int i); 53 53 const char * iiTwoOps(int t); 54 int iiOpsTwoChar(const char *s); 55 54 56 int IsPrime(int i); 55 57 -
Singular/newstruct.cc
r17642b r98d6c3 20 20 }; 21 21 22 struct newstruct_proc_s; 23 typedef struct newstruct_proc_a *newstruct_proc; 24 struct newstruct_proc_a 25 { 26 newstruct_proc next; 27 int t; /*tok id */ 28 int args; /* number of args */ 29 procinfov p; 30 }; 31 22 32 struct newstruct_desc_s 23 33 { 24 34 newstruct_member member; 25 35 newstruct_desc parent; 36 newstruct_proc procs; 26 37 int size; // number of mebers +1 27 38 int id; // the type id assigned to this bb … … 96 107 } 97 108 } 109 else if(L->m[n].rtyp==LIST_CMD) 110 { 111 N->m[n].rtyp=L->m[n].rtyp; 112 N->m[n].data=(void *)lCopy((lists)(L->m[n].data)); 113 } 98 114 else if(L->m[n].rtyp>MAX_TOK) 99 115 { … … 102 118 N->m[n].data=(void *)b->blackbox_Copy(b,L->m[n].data); 103 119 } 104 else if(L->m[n].rtyp==LIST_CMD)105 {106 N->m[n].rtyp=L->m[n].rtyp;107 N->m[n].data=(void *)lCopy((lists)(L->m[n].data));108 }109 120 else 110 121 N->m[n].Copy(&L->m[n]); … … 113 124 return N; 114 125 } 115 void * newstruct_Copy(blackbox* b, void *d)126 void * newstruct_Copy(blackbox*, void *d) 116 127 { 117 128 lists n1=(lists)d; … … 121 132 BOOLEAN newstruct_Assign(leftv l, leftv r) 122 133 { 123 blackbox *ll=getBlackboxStuff(l->Typ());124 134 if (r->Typ()>MAX_TOK) 125 135 { … … 169 179 BOOLEAN newstruct_Op2(int op, leftv res, leftv a1, leftv a2) 170 180 { 171 // interpreter: a1 is newstruct181 // interpreter: a1 or a2 is newstruct 172 182 blackbox *a=getBlackboxStuff(a1->Typ()); 173 newstruct_desc nt =(newstruct_desc)a->data;183 newstruct_desc nt; 174 184 lists al=(lists)a1->Data(); 175 switch(op) 176 { 177 case '.': 178 { 179 if (a2->name!=NULL) 180 { 181 BOOLEAN search_ring=FALSE; 182 newstruct_member nm=nt->member; 183 while ((nm!=NULL)&&(strcmp(nm->name,a2->name)!=0)) nm=nm->next; 184 if ((nm==NULL) && (strncmp(a2->name,"r_",2)==0)) 185 if (a!=NULL) 186 { 187 nt=(newstruct_desc)a->data; 188 switch(op) 189 { 190 case '.': 191 { 192 if (a2->name!=NULL) 185 193 { 186 nm=nt->member; 187 while ((nm!=NULL)&&(strcmp(nm->name,a2->name+2)!=0)) nm=nm->next; 188 if ((nm!=NULL)&&(RingDependend(nm->typ))) 189 search_ring=TRUE; 194 BOOLEAN search_ring=FALSE; 195 newstruct_member nm=nt->member; 196 while ((nm!=NULL)&&(strcmp(nm->name,a2->name)!=0)) nm=nm->next; 197 if ((nm==NULL) && (strncmp(a2->name,"r_",2)==0)) 198 { 199 nm=nt->member; 200 while ((nm!=NULL)&&(strcmp(nm->name,a2->name+2)!=0)) nm=nm->next; 201 if ((nm!=NULL)&&(RingDependend(nm->typ))) 202 search_ring=TRUE; 203 else 204 nm=NULL; 205 } 206 if (nm==NULL) 207 { 208 Werror("member %s nor found", a2->name); 209 return TRUE; 210 } 211 if (search_ring) 212 { 213 ring r; 214 res->rtyp=RING_CMD; 215 res->data=al->m[nm->pos-1].data; 216 r=(ring)res->data; 217 if (r==NULL) { res->data=(void *)currRing; r=currRing; } 218 if (r!=NULL) r->ref++; 219 else Werror("ring of this member is not set and no basering found"); 220 return r==NULL; 221 } 222 else if (RingDependend(nm->typ)) 223 { 224 if (al->m[nm->pos].data==NULL) 225 { 226 // NULL belongs to any ring 227 ring r=(ring)al->m[nm->pos-1].data; 228 if (r!=NULL) 229 { 230 r->ref--; 231 al->m[nm->pos-1].data=NULL; 232 al->m[nm->pos-1].rtyp=DEF_CMD; 233 } 234 } 235 else 236 { 237 //Print("checking ring at pos %d for dat at pos %d\n",nm->pos-1,nm->pos); 238 if ((al->m[nm->pos-1].data!=(void *)currRing) 239 &&(al->m[nm->pos-1].data!=(void*)0L)) 240 { 241 Werror("different ring %lx(data) - %lx(basering)", 242 (long unsigned)(al->m[nm->pos-1].data),(long unsigned)currRing); 243 return TRUE; 244 } 245 } 246 if ((currRing!=NULL)&&(al->m[nm->pos-1].data==NULL)) 247 { 248 // remember the ring, if not already set 249 al->m[nm->pos-1].data=(void *)currRing; 250 al->m[nm->pos-1].rtyp=RING_CMD; 251 currRing->ref++; 252 } 253 } 254 Subexpr r=(Subexpr)omAlloc0Bin(sSubexpr_bin); 255 r->start = nm->pos+1; 256 memcpy(res,a1,sizeof(sleftv)); 257 memset(a1,0,sizeof(sleftv)); 258 if (res->e==NULL) res->e=r; 190 259 else 191 nm=NULL; 260 { 261 Subexpr sh=res->e; 262 while (sh->next != NULL) sh=sh->next; 263 sh->next=r; 264 } 265 return FALSE; 192 266 } 193 if (nm==NULL)267 else 194 268 { 195 Werror ("member %s nor found", a2->name);269 WerrorS("name expected"); 196 270 return TRUE; 197 271 } 198 if (search_ring) 199 { 200 ring r; 201 res->rtyp=RING_CMD; 202 res->data=al->m[nm->pos-1].data; 203 r=(ring)res->data; 204 if (r==NULL) { res->data=(void *)currRing; r=currRing; } 205 if (r!=NULL) r->ref++; 206 else Werror("ring of this member is not set and no basering found"); 207 return r==NULL; 208 } 209 else if (RingDependend(nm->typ)) 210 { 211 if (al->m[nm->pos].data==NULL) 212 { 213 // NULL belongs to any ring 214 ring r=(ring)al->m[nm->pos-1].data; 215 if (r!=NULL) 216 { 217 r->ref--; 218 al->m[nm->pos-1].data=NULL; 219 al->m[nm->pos-1].rtyp=DEF_CMD; 220 } 221 } 222 else 223 { 224 //Print("checking ring at pos %d for dat at pos %d\n",nm->pos-1,nm->pos); 225 if ((al->m[nm->pos-1].data!=(void *)currRing) 226 &&(al->m[nm->pos-1].data!=(void*)0L)) 227 { 228 Werror("different ring %lx(data) - %lx(basering)", 229 (long unsigned)(al->m[nm->pos-1].data),(long unsigned)currRing); 230 return TRUE; 231 } 232 } 233 if ((currRing!=NULL)&&(al->m[nm->pos-1].data==NULL)) 234 { 235 // remember the ring, if not already set 236 al->m[nm->pos-1].data=(void *)currRing; 237 al->m[nm->pos-1].rtyp=RING_CMD; 238 currRing->ref++; 239 } 240 } 241 Subexpr r=(Subexpr)omAlloc0Bin(sSubexpr_bin); 242 r->start = nm->pos+1; 243 memcpy(res,a1,sizeof(sleftv)); 244 memset(a1,0,sizeof(sleftv)); 245 if (res->e==NULL) res->e=r; 246 else 247 { 248 Subexpr sh=res->e; 249 while (sh->next != NULL) sh=sh->next; 250 sh->next=r; 251 } 252 return FALSE; 253 } 254 else 255 { 256 WerrorS("name expected"); 257 return TRUE; 258 } 272 } 273 } 274 } 275 else 276 { 277 a=getBlackboxStuff(a2->Typ()); 278 nt=(newstruct_desc)a->data; 279 al=(lists)a2->Data(); 280 } 281 newstruct_proc p=nt->procs; 282 while((p!=NULL) &&(p->t=op)&&(p->args!=2)) p=p->next; 283 if (p!=NULL) 284 { 285 leftv sl; 286 sleftv tmp; 287 memset(&tmp,0,sizeof(sleftv)); 288 tmp.Copy(a1); 289 tmp.next=(leftv)omAlloc0(sizeof(sleftv)); 290 tmp.next->Copy(a2); 291 idrec hh; 292 memset(&hh,0,sizeof(hh)); 293 hh.id=Tok2Cmdname(p->t); 294 hh.typ=PROC_CMD; 295 hh.data.pinf=p->p; 296 sl=iiMake_proc(&hh,NULL,&tmp); 297 if (sl==NULL) return TRUE; 298 else 299 { 300 res->Copy(sl); 301 return FALSE; 259 302 } 260 303 } … … 267 310 // interpreter: args->1. arg is newstruct 268 311 blackbox *a=getBlackboxStuff(args->Typ()); 312 newstruct_desc nt=(newstruct_desc)a->data; 269 313 switch(op) 270 314 { … … 276 320 } 277 321 default: 278 return blackbox_default_OpM(op,res,args);279 322 break; 280 323 } 281 return TRUE; 324 newstruct_proc p=nt->procs; 325 while((p!=NULL) &&(p->t=op)&&(p->args!=4)) p=p->next; 326 if (p!=NULL) 327 { 328 leftv sl; 329 sleftv tmp; 330 memset(&tmp,0,sizeof(sleftv)); 331 tmp.Copy(args); 332 idrec hh; 333 memset(&hh,0,sizeof(hh)); 334 hh.id=Tok2Cmdname(p->t); 335 hh.typ=PROC_CMD; 336 hh.data.pinf=p->p; 337 sl=iiMake_proc(&hh,NULL,&tmp); 338 if (sl==NULL) return TRUE; 339 else 340 { 341 res->Copy(sl); 342 return FALSE; 343 } 344 } 345 return blackbox_default_OpM(op,res,args); 346 } 347 348 void lClean_newstruct(lists l) 349 { 350 if (l->nr>=0) 351 { 352 int i; 353 ring r=NULL; 354 for(i=l->nr;i>=0;i--) 355 { 356 if ((i>0) && (l->m[i-1].rtyp==RING_CMD)) 357 r=(ring)(l->m[i-1].data); 358 else 359 r=NULL; 360 l->m[i].CleanUp(r); 361 } 362 omFreeSize((ADDRESS)l->m, (l->nr+1)*sizeof(sleftv)); 363 l->nr=-1; 364 } 365 omFreeBin((ADDRESS)l,slists_bin); 282 366 } 283 367 … … 287 371 { 288 372 lists n=(lists)d; 289 n->Clean();373 lClean_newstruct(n); 290 374 } 291 375 } … … 355 439 } 356 440 441 void newstruct_Print(blackbox *b,void *d) 442 { 443 newstruct_desc dd=(newstruct_desc)b->data; 444 newstruct_proc p=dd->procs; 445 while((p!=NULL)&&(p->t!=PRINT_CMD)) 446 p=p->next; 447 if (p!=NULL) 448 { 449 leftv sl; 450 sleftv tmp; 451 memset(&tmp,0,sizeof(tmp)); 452 tmp.rtyp=dd->id; 453 tmp.data=(void*)newstruct_Copy(b,d); 454 idrec hh; 455 memset(&hh,0,sizeof(hh)); 456 hh.id=Tok2Cmdname(p->t); 457 hh.typ=PROC_CMD; 458 hh.data.pinf=p->p; 459 sl=iiMake_proc(&hh,NULL,&tmp); 460 } 461 else 462 blackbox_default_Print(b,d); 463 } 357 464 void newstruct_setup(const char *n, newstruct_desc d ) 358 465 { 359 466 blackbox *b=(blackbox*)omAlloc0(sizeof(blackbox)); 360 467 // all undefined entries will be set to default in setBlackboxStuff 361 // the default Print is quite useful e,468 // the default Print is quite useful, 362 469 // all other are simply error messages 363 470 b->blackbox_destroy=newstruct_destroy; 364 471 b->blackbox_String=newstruct_String; 365 //b->blackbox_Print=blackbox_default_Print;472 b->blackbox_Print=newstruct_Print;//blackbox_default_Print; 366 473 b->blackbox_Init=newstruct_Init; 367 474 b->blackbox_Copy=newstruct_Copy; … … 490 597 return scanNewstructFromString(s,res); 491 598 } 599 void newstructShow(newstruct_desc d) 600 { 601 newstruct_member elem; 602 Print("id: %d\n",d->id); 603 elem=d->member; 604 while (elem!=NULL) 605 { 606 Print(">>%s<< at pos %d, type %d\n",elem->name,elem->pos,elem->typ); 607 elem=elem->next; 608 } 609 } 610 611 BOOLEAN newstruct_set_proc(const char *bbname,const char *func, int args,procinfov pr) 612 { 613 int id=0; 614 blackboxIsCmd(bbname,id); 615 blackbox *bb=getBlackboxStuff(id); 616 newstruct_desc desc=(newstruct_desc)bb->data; 617 newstruct_proc p=(newstruct_proc)omAlloc(sizeof(*p)); 618 p->next=desc->procs; desc->procs=p; 619 if(!IsCmd(func,p->t)) 620 { 621 int t=0; 622 if (func[1]=='\0') p->t=func[0]; 623 else if((t=iiOpsTwoChar(func))!=0) 624 { 625 p->t=t; 626 } 627 else 628 { 629 Werror(">>%s<< is not a kernel command",func); 630 return TRUE; 631 } 632 } 633 p->args=args; 634 p->p=pr; pr->ref++; 635 return FALSE; 636 } -
Singular/newstruct.h
r17642b r98d6c3 7 7 newstruct_desc newstructFromString(const char *s); 8 8 newstruct_desc newstructChildFromString(const char *p, const char *s); 9 BOOLEAN newstruct_set_proc(const char *name,const char *func,int args, procinfov p); 10 void newstructShow(newstruct_desc d); 9 11 10 12 #endif -
Tst/Short/gcd5primtest.res.gz.uu
r06c0b3 r98d6c3 1 1 begin 644 gcd5primtest.res.gz 2 M'XL(" %2EHD\``V=C9#5P<FEM=&5S="YR97,`C91=3X,P%(;O]RM.%B\8FTC+2 M'XL("$\EQD\``V=C9#5P<FEM=&5S="YR97,`C91=3X,P%(;O]RM.%B\8FTC+ 3 3 MUPR6"^/-$N/-O#=S?*3)!,(PSAC_NVV'/86Q:9:PMN]Y3Q]X"^OGA]43`)`$ 4 4 M'E?W,&WWK;/CK]-8#%YXR5MK%D_D/R0)%-LTJ!O^UF:BJLP^G'V[:2?KK@5- 5 MH&ZJ+4A5E8'%RQ;JF:[P'/C2$]\1EX:7!30, O`4<+.(XA,P6D-:QK@IE55WM5 MH&ZJ+4A5E8'%RQ;JF:[P'/C2$]\1EX:7!30,Z@4<+.(XA,P6D-:QK@IE55WM 6 6 M/B$E3-;,4%NB1J5&42.NUO*ACU#43GR^UHH3'[(4)SZ#A0E4.Z5P#43KU.!A 7 7 M`LG.*<R!HHY,!1-;VX7T&[KBDE8[Q44%).O-122108C(F,P-K'Q1(*^G>'1! 8 M-[C999MT6V4Y6-V*X:"&`YBX2904G,R:XYIBRZM&'`( 1;PP<[A@0(@;SN3X18 M-[C999MT6V4Y6-V*X:"&`YBX2904G,R:XYIBRZM&'`(&7@P<[A@0(@;SN3X1 9 9 MGH+59\)75*#B3*E]L#CN[].C)B/+AYI_U&0LQ5`+CYJ>+[L]QF(*.H#1C(*. 10 10 M8#2@P$>GD480HL=<[B`N)!2Z@Y)_9!32GJ>?4J@(O_54D.$D2O0#"@6;\0I[ 11 11 MHCT9^?U6WR8@/Q7R2_"^MY`E<A.SC>^Y`;G<*B+G6M%>*_>/-MZY-GY/,-[L 12 .*$C@:O(# ]O].@PL%````12 .*$C@:O(#_Z\+1@L%```` 13 13 ` 14 14 end -
Tst/Short/gcd5primtest.stat
r06c0b3 r98d6c3 1 1 >> tst_memory_0 :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:2995842 1 >> tst_memory_1 :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:23674883 1 >> tst_memory_2 :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:23980484 1 >> tst_timer :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:75 2 >> tst_memory_0 :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:3014246 2 >> tst_memory_1 :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:23674887 2 >> tst_memory_2 :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:23980488 2 >> tst_timer :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:69 3 >> tst_memory_0 :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:30266810 3 >> tst_memory_1 :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:236748811 3 >> tst_memory_2 :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:239804812 3 >> tst_timer :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:413 4 >> tst_memory_0 :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:30279614 4 >> tst_memory_1 :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:236748815 4 >> tst_memory_2 :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:239804816 4 >> tst_timer_1 :: 133 6059219:3143- exported :3-1-4:ix86-Linux:mamawutz:181 1 >> tst_memory_0 :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:299584 2 1 >> tst_memory_1 :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:2367488 3 1 >> tst_memory_2 :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:2398048 4 1 >> tst_timer :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:7 5 2 >> tst_memory_0 :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:301144 6 2 >> tst_memory_1 :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:2367488 7 2 >> tst_memory_2 :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:2399076 8 2 >> tst_timer :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:5 9 3 >> tst_memory_0 :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:306644 10 3 >> tst_memory_1 :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:2367488 11 3 >> tst_memory_2 :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:2399076 12 3 >> tst_timer :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:12 13 4 >> tst_memory_0 :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:306772 14 4 >> tst_memory_1 :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:2367488 15 4 >> tst_memory_2 :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:2399076 16 4 >> tst_timer_1 :: 1338385743:3144- exported :3-1-4:ix86-Linux:mamawutz:26 -
Tst/Short/gcd5primtest.tst
r06c0b3 r98d6c3 2 2 proc test5prim (int p) 3 3 { 4 ring r= 3, x(1..11), dp;4 ring r= p, x(1..11), dp; 5 5 poly d1= x(1); 6 6 poly d2= x(2); -
factory/facBivar.cc
r06c0b3 r98d6c3 27 27 28 28 #ifdef HAVE_NTL 29 TIMING_DEFINE_PRINT(uni_factorize) 30 TIMING_DEFINE_PRINT(hensel_lift12) 29 TIMING_DEFINE_PRINT(fac_uni_factorizer) 30 TIMING_DEFINE_PRINT(fac_bi_hensel_lift) 31 TIMING_DEFINE_PRINT(fac_bi_factor_recombination) 31 32 32 33 // bound on coeffs of f (cf. Musser: Multivariate Polynomial Factorization, … … 705 706 bool earlySuccess= false; 706 707 CFList earlyFactors; 707 TIMING_START (fac_ hensel_lift);708 TIMING_START (fac_bi_hensel_lift); 708 709 uniFactors= henselLiftAndEarly 709 710 (A, earlySuccess, earlyFactors, degs, liftBound, 710 711 uniFactors, dummy, evaluation, b); 711 TIMING_END_AND_PRINT (fac_ hensel_lift, "time for hensel lifting: ");712 TIMING_END_AND_PRINT (fac_bi_hensel_lift, "time for hensel lifting: "); 712 713 DEBOUTLN (cerr, "lifted factors= " << uniFactors); 713 714 -
factory/facFactorize.cc
r06c0b3 r98d6c3 113 113 Variable v; 114 114 CFList factors; 115 for (int j= 0; j < A.level() - 2; j++) 116 { 117 if (!Aeval[j].isEmpty()) 118 { 119 v= Variable (Aeval[j].getFirst().level()); 120 121 factors= ratBiSqrfFactorize (Aeval[j].getFirst(), w); 122 123 if (factors.getFirst().inCoeffDomain()) 124 factors.removeFirst(); 125 126 if (minFactorsLength == 0) 127 minFactorsLength= factors.length(); 128 else 129 minFactorsLength= tmin (minFactorsLength, factors.length()); 130 131 if (factors.length() == 1) 132 { 133 irred= true; 134 return; 135 } 136 sortList (factors, x); 137 Aeval [j]= factors; 138 } 115 CanonicalForm LCA= LC (A,1); 116 if (!LCA.inCoeffDomain()) 117 { 118 for (int j= 0; j < A.level() - 2; j++) 119 { 120 if (!Aeval[j].isEmpty() && (degree (LCA, j+3) > 0)) 121 { 122 v= Variable (Aeval[j].getFirst().level()); 123 124 factors= ratBiSqrfFactorize (Aeval[j].getFirst(), w); 125 126 if (factors.getFirst().inCoeffDomain()) 127 factors.removeFirst(); 128 129 if (minFactorsLength == 0) 130 minFactorsLength= factors.length(); 131 else 132 minFactorsLength= tmin (minFactorsLength, factors.length()); 133 134 if (factors.length() == 1) 135 { 136 irred= true; 137 return; 138 } 139 sortList (factors, x); 140 Aeval [j]= factors; 141 } 142 else if (!Aeval[j].isEmpty()) 143 { 144 Aeval[j]=CFList(); 145 } 146 } 147 } 148 else 149 { 150 for (int j= 0; j < A.level() - 2; j++) 151 Aeval[j]= CFList(); 139 152 } 140 153 } -
factory/facFqBivar.cc
r06c0b3 r98d6c3 45 45 #endif 46 46 47 TIMING_DEFINE_PRINT(fac_uni_factorizer) 48 TIMING_DEFINE_PRINT(fac_hensel_lift12) 47 TIMING_DEFINE_PRINT(fac_fq_uni_factorizer) 48 TIMING_DEFINE_PRINT(fac_fq_bi_hensel_lift) 49 TIMING_DEFINE_PRINT(fac_fq_bi_factor_recombination) 49 50 50 51 CanonicalForm prodMod0 (const CFList& L, const CanonicalForm& M, const modpk& b) … … 5912 5913 5913 5914 // univariate factorization 5914 TIMING_START (fac_ uni_factorizer);5915 TIMING_START (fac_fq_uni_factorizer); 5915 5916 bufUniFactors= uniFactorizer (bufAeval, alpha, GF); 5916 TIMING_END_AND_PRINT (fac_ uni_factorizer,5917 TIMING_END_AND_PRINT (fac_fq_uni_factorizer, 5917 5918 "time for univariate factorization: "); 5918 5919 DEBOUTLN (cerr, "Lc (bufAeval)*prod (bufUniFactors)== bufAeval " << … … 5921 5922 if (!derivXZero && !fail2) 5922 5923 { 5923 TIMING_START (fac_ uni_factorizer);5924 TIMING_START (fac_fq_uni_factorizer); 5924 5925 bufUniFactors2= uniFactorizer (bufAeval2, alpha, GF); 5925 TIMING_END_AND_PRINT (fac_ uni_factorizer,5926 TIMING_END_AND_PRINT (fac_fq_uni_factorizer, 5926 5927 "time for univariate factorization in y: "); 5927 5928 DEBOUTLN (cerr, "Lc (bufAeval2)*prod (bufUniFactors2)== bufAeval2 " << … … 6084 6085 bool earlySuccess= false; 6085 6086 CFList earlyFactors; 6086 TIMING_START (fac_ hensel_lift12);6087 TIMING_START (fac_fq_bi_hensel_lift); 6087 6088 uniFactors= henselLiftAndEarly 6088 6089 (A, earlySuccess, earlyFactors, degs, liftBound, 6089 6090 uniFactors, info, evaluation); 6090 TIMING_END_AND_PRINT (fac_ hensel_lift12, "time for hensel lifting: ");6091 TIMING_END_AND_PRINT (fac_fq_bi_hensel_lift, "time for hensel lifting: "); 6091 6092 DEBOUTLN (cerr, "lifted factors= " << uniFactors); 6092 6093 … … 6107 6108 else if (degree (A) > 4 && beta.level() == 1 && (2*minBound)/degMipo < 32) 6108 6109 { 6109 TIMING_START (fac_ hensel_lift12);6110 TIMING_START (fac_fq_bi_hensel_lift); 6110 6111 if (extension) 6111 6112 { … … 6125 6126 factors= Union (lll, factors); 6126 6127 } 6127 TIMING_END_AND_PRINT (fac_ hensel_lift12, "time for hensel lifting: ");6128 TIMING_END_AND_PRINT (fac_fq_bi_hensel_lift, "time for hensel lifting: "); 6128 6129 DEBOUTLN (cerr, "lifted factors= " << uniFactors); 6129 6130 } … … 6132 6133 bool earlySuccess= false; 6133 6134 CFList earlyFactors; 6134 TIMING_START (fac_ hensel_lift12);6135 TIMING_START (fac_fq_bi_hensel_lift); 6135 6136 uniFactors= henselLiftAndEarly 6136 6137 (A, earlySuccess, earlyFactors, degs, liftBound, 6137 6138 uniFactors, info, evaluation); 6138 TIMING_END_AND_PRINT (fac_ hensel_lift12, "time for hensel lifting: ");6139 TIMING_END_AND_PRINT (fac_fq_bi_hensel_lift, "time for hensel lifting: "); 6139 6140 DEBOUTLN (cerr, "lifted factors= " << uniFactors); 6140 6141 -
factory/facFqFactorize.cc
r06c0b3 r98d6c3 37 37 #include "NTLconvert.h" 38 38 39 TIMING_DEFINE_PRINT(fac_ bi_factorizer)40 TIMING_DEFINE_PRINT(fac_ hensel_lift)41 TIMING_DEFINE_PRINT(fac_f actor_recombination)39 TIMING_DEFINE_PRINT(fac_fq_bi_factorizer) 40 TIMING_DEFINE_PRINT(fac_fq_hensel_lift) 41 TIMING_DEFINE_PRINT(fac_fq_factor_recombination) 42 42 43 43 static inline … … 2412 2412 bufLift= degree (A, y) + 1 + degree (LC(A, x), y); 2413 2413 2414 TIMING_START (fac_ bi_factorizer);2414 TIMING_START (fac_fq_bi_factorizer); 2415 2415 if (!GF && alpha.level() == 1) 2416 2416 bufBiFactors= FpBiSqrfFactorize (bufAeval.getFirst()); … … 2419 2419 else 2420 2420 bufBiFactors= FqBiSqrfFactorize (bufAeval.getFirst(), alpha); 2421 TIMING_END_AND_PRINT (fac_ bi_factorizer,2421 TIMING_END_AND_PRINT (fac_fq_bi_factorizer, 2422 2422 "time for bivariate factorization: "); 2423 2423 bufBiFactors.removeFirst(); … … 2716 2716 bool earlySuccess; 2717 2717 CFList earlyFactors, liftedFactors; 2718 TIMING_START (fac_ hensel_lift);2718 TIMING_START (fac_fq_hensel_lift); 2719 2719 liftedFactors= henselLiftAndEarly 2720 2720 (A, MOD, liftBounds, earlySuccess, earlyFactors, 2721 2721 Aeval, biFactors, evaluation, info); 2722 TIMING_END_AND_PRINT (fac_ hensel_lift, "time for hensel lifting: ");2722 TIMING_END_AND_PRINT (fac_fq_hensel_lift, "time for hensel lifting: "); 2723 2723 2724 2724 if (!extension) 2725 2725 { 2726 TIMING_START (fac_f actor_recombination);2726 TIMING_START (fac_fq_factor_recombination); 2727 2727 factors= factorRecombination (A, liftedFactors, MOD); 2728 TIMING_END_AND_PRINT (fac_f actor_recombination,2728 TIMING_END_AND_PRINT (fac_fq_factor_recombination, 2729 2729 "time for factor recombination: "); 2730 2730 } 2731 2731 else 2732 2732 { 2733 TIMING_START (fac_f actor_recombination);2733 TIMING_START (fac_fq_factor_recombination); 2734 2734 factors= extFactorRecombination (liftedFactors, A, MOD, info, evaluation); 2735 TIMING_END_AND_PRINT (fac_f actor_recombination,2735 TIMING_END_AND_PRINT (fac_fq_factor_recombination, 2736 2736 "time for factor recombination: "); 2737 2737 }
Note: See TracChangeset
for help on using the changeset viewer.