Changeset 9102bb in git
- Timestamp:
- Aug 6, 2019, 3:21:38 PM (4 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- 695288e2d57e72ad6969a3bdcc02d8d019857a56
- Parents:
- 48f20b0402356f0f7fa136772209441b8b6d869cf006a1a0d5b28b1d503bf27a7ce5902096a20eba
- git-author:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2019-08-06 15:21:38+02:00
- git-committer:
- GitHub <noreply@github.com>2019-08-06 15:21:38+02:00
- Files:
-
- 51 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/algebra.lib
rf006a1 r9102bb 1032 1032 } 1033 1033 // --------------------- change of variable names ------------------------- 1034 execute("ring @bsr = ("+charstr(bsr)+"),y(1..m),("+os+");"); 1034 list l2; 1035 for (int ii = 1; ii <= m; ii++) 1036 { 1037 l2[ii] = "y("+string(ii)+")"; 1038 } 1039 ring @bsr = create_ring(ringlist(bsr)[1], l2, "("+os+")", "no_minpoly"); 1035 1040 ideal J = fetch(bsr,J); 1036 1041 ideal PHI = fetch(bsr,PHI); -
Singular/LIB/assprimeszerodim.lib
rf006a1 r9102bb 364 364 //=== mapping T to p and test if d=deg(F) 365 365 def R = basering; 366 execute("ring Rhelp = ("+charstr(R)+"), T, dp;");366 ring Rhelp = create_ring(ringlist(R)[1], "T", "dp", "no_minpoly"); 367 367 setring R; 368 368 map phi = Rhelp,p; -
Singular/LIB/chern.lib
rf006a1 r9102bb 3305 3305 int n=nvars(basering); 3306 3306 def br@=basering; // remember the base ring 3307 execute("ring r@=("+ charstr(basering) +"),("+varstr(basering)+",homvar@), dp;");3307 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+",homvar@)", "dp", "no_minpoly"); 3308 3308 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 3309 3309 ideal I=F(I); -
Singular/LIB/ellipticcovers.lib
rf006a1 r9102bb 67 67 68 68 69 proc mod_init() 70 { 71 newstruct("graph","list vertices, list edges"); 72 newstruct("Net","list rows"); 73 74 system("install","graph","print",printGraph,1); 75 system("install","Net","print",printNet,1); 76 system("install","Net","+",catNet,2); 77 78 } 79 69 static proc mod_init() 70 { 71 newstruct("graph","list vertices, list edges"); 72 newstruct("Net","list rows"); 73 74 system("install","graph","print",printGraph,1); 75 system("install","Net","print",printNet,1); 76 system("install","Net","+",catNet,2); 77 } 80 78 81 79 static proc catNet(Net N, Net M) 82 80 { 83 list L;84 list LN=N.rows;85 list LM=M.rows;86 int widthN=size(LN[1]);87 int widthM=size(LM[1]);88 int nm=max(size(LN),size(LM));89 for (int j=1; j<=nm; j++)90 {81 list L; 82 list LN=N.rows; 83 list LM=M.rows; 84 int widthN=size(LN[1]); 85 int widthM=size(LM[1]); 86 int nm=max(size(LN),size(LM)); 87 for (int j=1; j<=nm; j++) 88 { 91 89 if (j>size(LN)){LN[j]=emptyString(widthN);} 92 90 if (j>size(LM)){LM[j]=emptyString(widthM);} 93 91 L[j]=LN[j]+LM[j]; 94 } 95 Net NM; 96 NM.rows=L; 97 return(NM);} 92 } 93 Net NM; 94 NM.rows=L; 95 return(NM); 96 } 98 97 99 98 … … 111 110 static proc printNet(Net N) 112 111 { 113 list L = N.rows; 114 for (int j=1; j<=size(L); j++) 115 { 116 print(L[j]); 117 } 118 } 119 120 static proc net(def M){ 121 if (typeof(M)=="list"){ 112 list L = N.rows; 113 for (int j=1; j<=size(L); j++) 114 { 115 print(L[j]); 116 } 117 } 118 119 static proc net(def M) 120 { 121 if (typeof(M)=="list") 122 { 122 123 return(netList(M)); 123 124 } … … 126 127 L[1]=string(M); 127 128 N.rows=L; 128 return(N);} 129 return(N); 130 } 129 131 130 132 … … 147 149 G; 148 150 } 149 150 151 151 152 152 proc makeGraph(list v, list e) … … 170 170 G; 171 171 } 172 173 172 174 173 proc propagator(def xy, def d) … … 195 194 " 196 195 { 197 if ((typeof(xy)=="list")||(typeof(d)=="int")) { 196 if ((typeof(xy)=="list")||(typeof(d)=="int")) 197 { 198 198 number x = xy[1]; 199 199 number y = xy[2]; … … 201 201 if (d==0) {return(x^2*y^2/(x^2-y^2)^2);} 202 202 number p=0; 203 for (int j=1; j<=d; j++){ 203 for (int j=1; j<=d; j++) 204 { 204 205 if (d%j==0){p=p+(j*x^(4*j)+j*y^(4*j))/(x*y)^(2*j);} 205 206 } 206 207 return(p); 207 208 } 208 if ((typeof(xy)=="graph")||(typeof(d)=="list")) { 209 if ((typeof(xy)=="graph")||(typeof(d)=="list")) 210 { 209 211 list xl = ringlist(basering)[1][2]; 210 212 list ed = xy.edges; 211 213 number f=1; 212 for (int j=1; j<=size(ed); j++){ 214 for (int j=1; j<=size(ed); j++) 215 { 213 216 execute("number xx1 = "+xl[ed[j][1]]); 214 217 execute("number xx2 = "+xl[ed[j][2]]); … … 219 222 return(f); 220 223 } 221 if ((typeof(xy)=="graph")||(typeof(d)=="int")) { 222 } 223 ERROR("wrong input type");} 224 if ((typeof(xy)=="graph")||(typeof(d)=="int")) 225 { 226 } 227 ERROR("wrong input type"); 228 } 224 229 example 225 230 { "EXAMPLE:"; echo=2; … … 230 235 propagator(G,list(1,1,1,0,0,0)); 231 236 } 232 233 234 235 236 237 237 238 proc computeConstant(number f,number xx) … … 240 241 RETURN: number, the constant coefficient of the Laurent series of f in the variable x. 241 242 THEORY: Computes the constant coefficient of the Laurent series by iterative differentiation. 242 243 243 KEYWORDS: Laurent series 244 244 EXAMPLE: example computeConstant; shows an example … … 250 250 int j; 251 251 poly de; 252 while (tst==0){ 253 ff=f*xx^k; 254 for (j=1; j<=k; j++){ 255 ff=diff(ff,xx)/j; 256 } 257 de = subst(denominator(ff),xx,0); 258 if (de!=0){ 259 poly nu = subst(numerator(ff),xx,0); 260 return(number(nu/de)); 261 } 262 k=k+1; 263 } 264 ERROR("error in computeConstant");} 252 while (tst==0) 253 { 254 ff=f*xx^k; 255 for (j=1; j<=k; j++) 256 { 257 ff=diff(ff,xx)/j; 258 } 259 de = subst(denominator(ff),xx,0); 260 if (de!=0) 261 { 262 poly nu = subst(numerator(ff),xx,0); 263 return(number(nu/de)); 264 } 265 k++; 266 } 267 ERROR("error in computeConstant"); 268 } 265 269 example 266 270 { "EXAMPLE:"; echo=2; … … 270 274 computeConstant(P,x2); 271 275 } 272 273 274 275 276 276 277 proc evaluateIntegral(number P, list xL) … … 289 290 { 290 291 number p = P; 291 for(int j=1; j<=size(xL); j++){ 292 for(int j=1; j<=size(xL); j++) 293 { 292 294 p=computeConstant(p,xL[j]); 293 295 } 294 return(p);} 296 return(p); 297 } 295 298 example 296 299 { "EXAMPLE:"; echo=2; … … 300 303 evaluateIntegral(p,list(x1,x3,x4,x2)); 301 304 } 302 303 305 304 306 proc permute (list N) … … 314 316 " 315 317 { 316 int i,j,k; 317 list L,L1; 318 if (size(N)==1){ 319 return(list(N)); 320 } else { 321 k=1; 322 for (i=1; i<=size(N); i++){ 323 L=permute(delete(N,i)); 324 for (j=1; j<=size(L); j++){ 325 L1[k]=L[j]+list(N[i]); 326 k=k+1; 327 } 328 } 329 } 330 return(L1);} 318 int i,j,k; 319 list L,L1; 320 if (size(N)==1) 321 { 322 return(list(N)); 323 } 324 else 325 { 326 k=1; 327 for (i=1; i<=size(N); i++) 328 { 329 L=permute(delete(N,i)); 330 for (j=1; j<=size(L); j++) 331 { 332 L1[k]=L[j]+list(N[i]); 333 k=k+1; 334 } 335 } 336 } 337 return(L1); 338 } 331 339 example 332 340 { "EXAMPLE:"; echo=2; … … 349 357 " 350 358 { 351 ring R = 2,(x(1..n)),dp; 352 ideal I = maxideal(a); 353 list L; 354 for (int j=1;j<=size(I);j++){ 355 L[j]=leadexp(I[j]); 356 } 357 return(L);} 359 ring R = 2,(x(1..n)),dp; 360 ideal I = maxideal(a); 361 list L; 362 for (int j=1;j<=size(I);j++) 363 { 364 L[j]=leadexp(I[j]); 365 } 366 return(L); 367 } 358 368 example 359 369 { "EXAMPLE:"; echo=2; 360 370 partitions(3,7); 361 371 } 362 363 364 372 365 373 proc gromovWitten(def P,list #) … … 385 393 " 386 394 { 387 if (typeof(P)=="number") { 388 list xl = ringlist(basering)[1][2]; 389 int j; 390 for(j=1; j<=size(xl); j++){ 391 execute("number n= "+xl[j]); 392 xl[j]=n; 393 kill n; 394 } 395 list pxl = permute(xl); 396 number p = 0; 397 for(j=1; j<=size(pxl); j++){ 398 p=p+evaluateIntegral(P,pxl[j]); 399 } 400 return(p); 401 } 402 if (typeof(P)=="graph"){ 403 if (size(#)>1){ 404 return(gromovWitten(propagator(P,#))); 405 } else { 395 if (typeof(P)=="number") 396 { 397 list xl = ringlist(basering)[1][2]; 398 int j; 399 for(j=1; j<=size(xl); j++) 400 { 401 execute("number n= "+xl[j]); 402 xl[j]=n; 403 kill n; 404 } 405 list pxl = permute(xl); 406 number p = 0; 407 for(j=1; j<=size(pxl); j++) 408 { 409 p=p+evaluateIntegral(P,pxl[j]); 410 } 411 return(p); 412 } 413 if (typeof(P)=="graph") 414 { 415 if (size(#)>1) 416 { 417 return(gromovWitten(propagator(P,#))); 418 } 419 else 420 { 406 421 int d =#[1]; 407 422 list pa = partitions(size(P.edges),d); 408 423 list re; 409 424 int ti; 410 for (int j=1; j<=size(pa); j++) { 411 ti=timer; 412 re[j]=gromovWitten(propagator(P,pa[j])); 413 ti=timer-ti; 414 //print(string(j)+" / "+string(size(pa))+" "+string(pa[j])+" "+string(re[j])+" "+string(sum(re))+" "+string(ti)); 425 for (int j=1; j<=size(pa); j++) 426 { 427 ti=timer; 428 re[j]=gromovWitten(propagator(P,pa[j])); 429 ti=timer-ti; 430 //print(string(j)+" / "+string(size(pa))+" "+string(pa[j])+" "+string(re[j])+" "+string(sum(re))+" "+string(ti)); 415 431 } 416 return(lsum(re));417 432 return(lsum(re)); 433 } 418 434 } 419 435 } … … 427 443 gromovWitten(G,2); 428 444 } 429 430 431 445 432 446 proc computeGromovWitten(graph P,int d, int st, int en, list #) … … 443 457 " 444 458 { 445 number s =0; 446 list pararg; 447 list re; 448 list pa = partitions(size(P.edges),d); 449 int vb=0; 450 if (size(#)>0){vb=#[1];} 451 int ti; 452 if (vb>0){print(size(pa));} 453 for (int j=1; j<=size(pa); j++) { 454 if ((j>=st)&(j<=en)){ 455 ti=timer; 456 //pararg[j]=list(propagator(G,pa[j])); 457 re[j]=gromovWitten(propagator(P,pa[j])); 458 ti=timer-ti; 459 if (vb>0){print(string(j)+" / "+string(size(pa))+" "+string(pa[j])+" "+string(re[j])+" "+string(lsum(re))+" "+string(ti));} 460 } else {re[j]=s;} 461 } 462 //list re = parallelWaitAll("gromovWitten", pararg, list(list(list(2)))); 463 return(re); 459 number s =0; 460 list pararg; 461 list re; 462 list pa = partitions(size(P.edges),d); 463 int vb=0; 464 if (size(#)>0){vb=#[1];} 465 int ti; 466 if (vb>0){print(size(pa));} 467 for (int j=1; j<=size(pa); j++) 468 { 469 if ((j>=st)&(j<=en)) 470 { 471 ti=timer; 472 //pararg[j]=list(propagator(G,pa[j])); 473 re[j]=gromovWitten(propagator(P,pa[j])); 474 ti=timer-ti; 475 if (vb>0){print(string(j)+" / "+string(size(pa))+" "+string(pa[j])+" "+string(re[j])+" "+string(lsum(re))+" "+string(ti));} 476 } 477 else 478 {re[j]=s;} 479 } 480 //list re = parallelWaitAll("gromovWitten", pararg, list(list(list(2)))); 481 return(re); 464 482 } 465 483 example … … 471 489 computeGromovWitten(G,2,3,7,1); 472 490 } 473 474 491 475 492 proc lsum(list L) … … 485 502 { 486 503 execute(typeof(L[1])+" s"); 487 for(int j=1; j<=size(L); j++){ 488 s=s+L[j]; 489 } 490 return(s);} 504 for(int j=1; j<=size(L); j++) 505 { 506 s=s+L[j]; 507 } 508 return(s); 509 } 491 510 example 492 511 { "EXAMPLE:"; echo=2; … … 494 513 lsum(L); 495 514 } 496 497 498 515 499 516 proc generatingFunction(graph G, int d) … … 512 529 int j,jj; 513 530 list pa,L; 514 for (j=1; j<=d; j++){ 531 for (j=1; j<=d; j++) 532 { 515 533 pa = partitions(size(G.edges),j); 516 534 L = computeGromovWitten(G,j,1,size(pa)); 517 for (jj=1; jj<=size(pa); jj++) { 518 s=s+L[jj]*monomial(pa[jj]); 519 } 520 } 521 return(s);} 535 for (jj=1; jj<=size(pa); jj++) 536 { 537 s=s+L[jj]*monomial(pa[jj]); 538 } 539 } 540 return(s); 541 } 522 542 example 523 543 { "EXAMPLE:"; echo=2; -
Singular/LIB/finvar.lib
rf006a1 r9102bb 1390 1390 poly A(1)=M[1,2]; // denominator of Molien series (for now) 1391 1391 string mp=string(minpoly); 1392 execute("ring R=("+charstr(br)+"),("+varstr(br)+"),ds;");1392 ring R = create_ring(ringlist(br)[1], "("+varstr(br)+")", "ds", "no_minpoly"); 1393 1393 if (mp!="0") 1394 1394 { -
Singular/LIB/goettsche.lib
rf006a1 r9102bb 81 81 def br@=basering; // remember the base ring 82 82 // add additional variables z@, t@ to the base ring 83 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");83 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 84 84 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 85 85 // compute the generating function by the Goettsche's formula up to degree n in t@ … … 144 144 def br@=basering; // remember the base ring 145 145 // add additional variables z@, t@ to the base ring 146 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");146 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 147 147 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 148 148 // compute the generating function by the Goettsche's formula up to degree n in t@ … … 208 208 def br@=basering; // remember the base ring 209 209 // add additional variables z@, t@ to the base ring 210 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");210 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 211 211 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 212 212 poly rez=1; … … 267 267 def br@=basering; // remember the base ring 268 268 // add additional variables z@, t@ to the base ring 269 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");269 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 270 270 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 271 271 // compute the generating function by the Nakajima-Yoshioka formula up to degree n in t@ … … 322 322 def br@=basering; // remember the base ring 323 323 // add additional variables z@, t@ to the base ring 324 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");324 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 325 325 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 326 326 // compute the generating function by the Nakajima-Yoshioka formula up to degree n in t@ … … 377 377 def br@=basering; // remember the base ring 378 378 // add additional variables z@, t@ to the base ring 379 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");379 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 380 380 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 381 381 poly rez=1; … … 434 434 def br@=basering; // remember the base ring 435 435 // add additional variables z@, t@ to the base ring 436 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");436 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 437 437 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 438 438 poly rez=1; … … 485 485 def br@=basering; // remember the base ring 486 486 // add additional variables z@, t@ to the base ring 487 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");487 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 488 488 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 489 489 poly rez=1; … … 536 536 def br@=basering; // remember the base ring 537 537 // add additional variables z@, t@ to the base ring 538 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");538 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 539 539 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 540 540 poly rez=1; … … 594 594 def br@=basering; // remember the base ring 595 595 // add additional variable t@ to the base ring 596 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", t@), dp;");596 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", t@)", "dp", "no_minpoly"); 597 597 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 598 598 poly rez=(1-t@^2)*PPolyW(q, m, n, t@, d); … … 637 637 def br@=basering; // remember the base ring 638 638 // add additional variable t@ to the base ring 639 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", t@), dp;");639 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", t@)", "dp", "no_minpoly"); 640 640 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 641 641 poly rez=(1-t@^2)*PPolyW(q, m, n, t@, d); -
Singular/LIB/graal.lib
rf006a1 r9102bb 210 210 { 211 211 def origin = basering; 212 execute("ring ringForGeneralPosition = ("+charstr(basering)+"),("+varstr(basering)+"),lp;");212 ring ringForGeneralPosition = create_ring(ringlist(basering)[1], "("+varstr(basering)+")", "lp", "no_minpoly"); 213 213 ideal m = fetch(origin,m); 214 214 newRing = 1; -
Singular/LIB/numerAlg.lib
rf006a1 r9102bb 230 230 setring W1; 231 231 number j1=jj; 232 execute("ring q=(real,0),("+varstr(S)+"),dp;");232 ring q = create_ring("(real,0)", "("+varstr(S)+")", "dp"); 233 233 ideal I=imap(W1,I); 234 234 ideal J=imap(W1,J); 235 execute("ring qq=0,("+varstr(S)+"),dp;");235 ring qq = create_ring(0, "("+varstr(S)+")", "dp"); 236 236 ideal I=imap(S,I); 237 237 ideal J=imap(S,J); … … 315 315 if((u^2)==0) 316 316 { 317 execute("ring A=(real,e-1),("+varstr(S)+",I),ds;");317 ring A = create_ring("(real,e-1)", "("+varstr(S)+",I)", "ds"); 318 318 ideal II=imap(S,J); 319 319 list rw=imap(S,rw); … … 332 332 { 333 333 int d=dim(std(J)); 334 execute("ring R=(complex,e-1,I),("+varstr(S)+"),ds;");334 ring R = create_ring("(complex,e-1,I)", "("+varstr(S)+")", "ds"); 335 335 list w=imap(S,w); 336 336 ideal II=imap(S,J); … … 355 355 if(tt==d) 356 356 { 357 execute("ring A=(complex,e,I),("+varstr(S)+"),dp;");357 ring A = create_ring("(complex,e,I)", "("+varstr(S)+")", "dp"); 358 358 t=tt; 359 359 } 360 360 else 361 361 { 362 execute("ring RR=(real,e-2),("+varstr(S)+",I),dp;");362 ring RR = create_ring("(real,e-2)", "("+varstr(S)+",I)", "dp"); 363 363 ideal II=imap(S,J); 364 364 list rw=imap(S,rw); … … 398 398 setring M; 399 399 sz1=size(SOL); 400 execute("ring RRRQ=(real,e-1),("+varstr(S)+",I),dp;");400 ring RRRQ = create_ring("(real,e-1)", "("+varstr(S)+",I)", "dp"); 401 401 ideal HH=imap(RR,HH); 402 402 if(dim(std(HH))==0) … … 413 413 if(sz1==sz2) 414 414 { 415 execute("ring A=(complex,e,I),("+varstr(S)+"),dp;");415 ring A = create_ring("(complex,e,I)", "("+varstr(S)+")", "dp"); 416 416 t=d; 417 417 } 418 418 else 419 419 { 420 execute("ring RQ=(real,e-1),("+varstr(S)+"),dp;");420 ring RQ = create_ring("(real,e-1)", "("+varstr(S)+")", "dp"); 421 421 ideal II=imap(S,J); 422 422 def RW=WitSet(II); … … 448 448 if((ni+nr)<1/10^(2*e-3)) 449 449 { 450 execute("ring A=(complex,e,I),("+varstr(S)+"),dp;");450 ring A = create_ring("(complex,e,I)", "("+varstr(S)+")", "dp"); 451 451 list W(ii)=imap(RW,W(ii)); 452 452 t=0; … … 459 459 { 460 460 def SS=Singular2bertini(W(ii)); 461 execute("ring D=(complex,e,I),("+varstr(S)+",s,gamma),dp;");461 ring D = create_ring("(complex,e,I)", "("+varstr(S)+",s,gamma)", "dp"); 462 462 string nonsin; 463 463 ideal H,L; … … 504 504 if(tr<=1/10^(2*e-3)) 505 505 { 506 execute("ring A=(complex,e,I),("+varstr(S)+"),dp;");506 ring A = create_ring("(complex,e,I)", "("+varstr(S)+")", "dp"); 507 507 t=ii; 508 508 ii=d+1; -
Singular/LIB/numerDecom.lib
rf006a1 r9102bb 349 349 if((n-rn)!=dd) 350 350 { 351 execute("ring R=0,("+varstr(S)+",z(1..dd)),dp;"); 351 list l2 = ringlist(S)[2]; 352 for (int ii = 1; ii <= dd; ii++) 353 { 354 l2[size(l2)+1] = "z("+string(ii)+")"; 355 } 356 ring R = create_ring(0, l2, "dp"); 352 357 ideal I=imap(rs,I); 353 358 ideal H(0..n),L,LL,L(1..dd),LL(1..dd),h(1..dd),N(0..dd); … … 483 488 { 484 489 int w(q-1)=0; 485 execute("ring D(q)=(0,s,gamma),("+varstr(S)+",z(1..q)),dp;"); 490 list l2 = ringlist(S)[2]; 491 for (int ii = 1; ii <= q; ii++) 492 { 493 l2[size(l2)+1] = "z("+string(ii)+")"; 494 } 495 ring D(q) = create_ring("(0,s,gamma)", l2, "dp"); 486 496 string nonsin(q),stnonsin(q); 487 497 ideal H(1..q); … … 579 589 for(qq=q-1;qq>=1;qq--) 580 590 { 581 execute("ring T(qq)=(complex,16,I),("+varstr(S)+",z(1..qq)),dp;"); 591 list l2 = ringlist(S)[2]; 592 for (int ii = 1; ii <= qq; ii++) 593 { 594 l2[size(l2)+1] = "z("+string(ii)+")"; 595 } 596 ring T(qq) = create_ring("(complex,16,I)", l2, "dp"); 582 597 list W(qq-1)=var(1); 583 598 } … … 591 606 { 592 607 int w(qq-1); 593 execute("ring T(qq)=(complex,16,I),("+varstr(S)+",z(1..qq)),dp;"); 608 list l2 = ringlist(S)[2]; 609 for (int ii = 1; ii <= qq; ii++) 610 { 611 l2[size(l2)+1] = "z("+string(ii)+")"; 612 } 613 ring T(qq) = create_ring("(complex,16,I)", l2, "dp"); 594 614 list W(qq-1)=var(1); 595 615 } … … 600 620 for(qq=q;qq>=1;qq--) 601 621 { 602 execute("ring T(qq)=(complex,16,I),("+varstr(S)+",z(1..qq)),dp;"); 622 list l2 = ringlist(S)[2]; 623 for (int ii = 1; ii <= qq; ii++) 624 { 625 l2[size(l2)+1] = "z("+string(ii)+")"; 626 } 627 ring T(qq) = create_ring("(complex,16,I)", l2, "dp"); 603 628 list W(qq-1)=var(1); 604 629 } … … 1951 1976 export(J(i)); 1952 1977 } 1953 execute("ring RR=0,(x(1..n),"+varstr(S)+"),dp;"); 1978 list l2; 1979 for (int ii = 1; ii <= n; ii++) 1980 { 1981 l2[ii] = "x("+string(ii)+")"; 1982 } 1983 l2 = l2+ringlist(S)[2]; 1984 ring RR = create_ring(0, l2, "dp"); 1954 1985 for(i=1;i<=d;i++) 1955 1986 { … … 1995 2026 int zc=size(D(d)); 1996 2027 export(zc); 1997 execute("ring DR=0,("+varstr(S)+",x(1..zc)),dp;"); 2028 list l2 = ringlist(S)[2]; 2029 for (int ii = 1; ii <= zc; ii++) 2030 { 2031 l2[size(l2)+1] = "x("+string(ii)+")"; 2032 } 2033 ring DR = create_ring(0, l2, "dp"); 1998 2034 matrix TT(d)=imap(R,TT(d)); 1999 2035 ideal I=imap(S,I); -
Singular/LIB/resolve.lib
rf006a1 r9102bb 396 396 laM=subst(laM,var(templist[4][j]),0); 397 397 } 398 execute("ring Rnew=("+charstr(basering)+"),("+string(templist[1])+"),dp;");398 ring Rnew = create_ring(ringlist(basering)[1], "("+string(templist[1])+")", "dp", "no_minpoly"); 399 399 ideal Jnew=imap(R,Jsub); 400 400 ideal eD=imap(R,Esub); … … 639 639 v=N[4]; 640 640 for(j=1;j<=size(v);j++){BO[5]=subst(BO[5],var(v[j]),0);} 641 execute("ring R1=("+charstr(R0)+"),("+newvar+"),dp;");641 ring R1 = create_ring(ringlist(R0)[1], "("+newvar+")", "dp", "no_minpoly"); 642 642 list BO=imap(R0,BO); 643 643 ideal C=imap(R0,C); … … 1115 1115 laM=subst(laM,var(v[j]),0); 1116 1116 } 1117 execute("ring R2=("+charstr(S)+"),("+newvar+"),dp;");1117 ring R2 = create_ring(ringlist(S)[1], "("+newvar+")", "dp", "no_minpoly"); 1118 1118 list BO=imap(S,B); 1119 1119 ideal laM=imap(S,laM); … … 2984 2984 //--- hypersurface is V(@f) 2985 2985 @f=Jb[fvec[i]]; 2986 execute("ring R1=("+charstr(R)+"),(@y,"+varstr(R)+"),dp;");2986 ring R1 = create_ring(ringlist(R)[1], "(@y,"+varstr(R)+")", "dp", "no_minpoly"); 2987 2987 poly p=imap(R,@p); 2988 2988 poly f=imap(R,@f); … … 4233 4233 kill tr,L; 4234 4234 } 4235 execute("ring R1=("+charstr(S)+"),(@z,"+varstr(S)+"),dp;");4235 ring R1 = create_ring(ringlist(S)[1], "(@z,"+varstr(S)+")", "dp", "no_minpoly"); 4236 4236 poly p=imap(S,@p); 4237 4237 list BO=imap(S,BO); … … 4800 4800 { 4801 4801 string newvar=string(N[1]); 4802 execute("ring R1=("+charstr(R)+"),("+newvar+"),dp;");4802 ring R1 = create_ring(ringlist(R)[1], "("+newvar+")", "dp", "no_minpoly"); 4803 4803 list BO=imap(R,BO); 4804 4804 ideal cent=imap(R,cent); -
Singular/LIB/rinvar.lib
rf006a1 r9102bb 658 658 minPoly = string(minpoly); 659 659 } 660 execute("ring RA1=0,(" + varstr(basering) + "," + parName + "), lp;");660 ring RA1 = create_ring(0, "(" + varstr(basering) + "," + parName + ")", "lp"); 661 661 if (minPoly!="0") { execute("ideal mpoly = std(" + minPoly + ");"); } 662 662 ideal I = imap(RIRR,invarsGens); … … 962 962 minPoly = string(minpoly); 963 963 } 964 execute("ring RA1=0,(" + varstr(basering) + "," + parName + "), lp;");964 ring RA1 = create_ring(0, "(" + varstr(basering) + "," + parName + ")", "lp"); 965 965 if (minPoly!="0") { execute("ideal mpoly = std(" + minPoly + ");"); } 966 966 ideal Grp = imap(ROBR,Grp); -
Singular/LIB/sing.lib
rf006a1 r9102bb 1076 1076 int ii; 1077 1077 def bas = basering; 1078 execute("ring @r_locstd 1079 =("+charstr(bas)+"),(@t@,"+varstr(bas)+"),(dp(1),dp);"); 1078 ring @r_locstd = create_ring(ringlist(bas)[1], "(@t@,"+varstr(bas)+")", "(dp(1),dp)", "no_minpoly"); 1080 1079 ideal @id = imap(bas,id); 1081 1080 ideal @hid = homog(@id,@t@); -
Singular/LIB/standard.lib
rf006a1 r9102bb 2572 2572 { 2573 2573 string name; 2574 intvec w;2575 2574 int b1 = find(ordering, "(", 1); 2576 2575 if (b1 == 0) // no parentheses … … 2579 2578 if (name == "C" || name == "c") 2580 2579 { 2581 w = intvec(0);2580 intvec w = intvec(0); 2582 2581 } 2583 2582 else 2584 2583 { 2585 w = 1:n_vars;2584 intvec w = 1:n_vars; 2586 2585 } 2587 2586 } … … 2593 2592 if (c == 0) 2594 2593 { 2595 w = 1:int(ordering[b1+1, b2-b1-1]); 2594 if (name == "L") 2595 { 2596 int w = int(ordering[b1+1, b2-b1-1]); 2597 } 2598 else 2599 { 2600 intvec w = 1:int(ordering[b1+1, b2-b1-1]); 2601 } 2596 2602 } 2597 2603 else 2598 2604 { 2599 2605 list W = tuple_to_tokens(ordering[b1, b2-b1+1]); 2600 w = intvec(int(W[1..size(W)]));2606 intvec w = intvec(int(W[1..size(W)])); 2601 2607 } 2602 2608 } -
Singular/LIB/tropical.lib
rf006a1 r9102bb 3644 3644 CHARAKTERISTIK=CHARAKTERISTIK[1..size(CHARAKTERISTIK)-2]; 3645 3645 def BASERING=basering; 3646 execute("ring INITIALRING=("+CHARAKTERISTIK+"),("+varstr(basering)+"),("+ordstr(basering)+");");3646 ring INITIALRING = create_ring("("+CHARAKTERISTIK+")", "("+varstr(basering)+")", "("+ordstr(basering)+")"); 3647 3647 list l=solve(imap(BASERING,i)); 3648 3648 l; … … 5551 5551 setring LIFTRing; 5552 5552 poly mp=minpoly; 5553 execute("ring TESTRing=("+charstr(LIFTRing)+"),("+varstr(BASERING)+"),dp;");5553 ring TESTRing = create_ring(ringlist(LIFTRing)[1], "("+varstr(BASERING)+")", "dp", "no_minpoly"); 5554 5554 minpoly=number(imap(LIFTRing,mp)); 5555 5555 ideal i=imap(BASERING,i); … … 5939 5939 else 5940 5940 { 5941 execute("ring PARARing=("+charstr(basering)+"),t,ls;");5941 ring PARARing = create_ring(ringlist(basering)[1], "t", "ls", "no_minpoly"); 5942 5942 } 5943 5943 ideal PARA; // will contain the parametrisation … … 6200 6200 else 6201 6201 { 6202 execute("ring SATURATERING=("+charstr(basering)+"),("+varstr(basering)+"),("+ordstr(basering)+");");6202 ring SATURATERING = create_ring(ringlist(basering)[1], "("+varstr(basering)+")", "("+ordstr(basering)+")", "no_minpoly"); 6203 6203 ideal i=imap(BASERING,i); 6204 6204 export(i); … … 6341 6341 // - the variable t is superflous, 6342 6342 // the variable @a is not if it was already present 6343 execute("ring INITIALRING=("+charstr(basering)+"),("+string(variablen)+"),dp;");6343 ring INITIALRING = create_ring(ringlist(basering)[1], "("+string(variablen)+")", "dp", "no_minpoly"); 6344 6344 ideal ini=imap(BASERING,ini); 6345 6345 // compute the minimal associated primes of the … … 6367 6367 // define the extension ring which contains 6368 6368 // the new variable @a, if it is not yet present 6369 execute("ring EXTENSIONRING=("+charstr(BASERING)+"),("+string(imap(BASERING,variablen))+",@a,"+tvar+"),(dp("+string(anzahlvariablen-1)+"),dp(1),lp(1));");6369 ring EXTENSIONRING = create_ring(ringlist(BASERING)[1], "("+string(imap(BASERING,variablen))+",@a,"+tvar+")", "(dp("+string(anzahlvariablen-1)+"),dp(1),lp(1))", "no_minpoly"); 6370 6370 // phi maps x_i to x_i, @a to @a (if present in the ring), 6371 6371 // and the additional variable … … 6378 6378 else // @a was already present in the BASERING or no 6379 6379 { // field extension is necessary 6380 execute("ring EXTENSIONRING=("+charstr(BASERING)+"),("+varstr(BASERING)+"),("+ordstr(BASERING)+");");6380 ring EXTENSIONRING = create_ring(ringlist(BASERING)[1], "("+varstr(BASERING)+")", "("+ordstr(BASERING)+")", "no_minpoly"); 6381 6381 // phi maps x_i to x_i, @a to @a (if present in the ring), 6382 6382 // and the additional variable … … 7255 7255 { 7256 7256 def BASERING=basering; 7257 execute("ring INTERRING=0,("+varstr(basering)+"),("+ordstr(basering)+");");7257 ring INTERRING = create_ring(0, "("+varstr(basering)+")", "("+ordstr(basering)+")"); 7258 7258 poly n=imap(BASERING,n); 7259 execute("ring REALRING=(real,50,100),("+varstr(basering)+"),("+ordstr(basering)+");");7259 ring REALRING = create_ring("(real,50,100)", "("+varstr(basering)+")", "("+ordstr(basering)+")"); 7260 7260 map phi=INTERRING,maxideal(1); 7261 7261 string s=string(phi(n)); … … 7873 7873 { 7874 7874 def BASERING=basering; 7875 execute("ring TRING="+string(char(BASERING))+",t,ds;");7875 ring TRING = create_ring(string(char(BASERING)), "t", "ds"); 7876 7876 poly hn=imap(BASERING,hn); 7877 7877 poly c4=imap(BASERING,c4); -
Singular/dyn_modules/freealgebra/freealgebra.cc
r48f20b r9102bb 5 5 { 6 6 const short t1[]={2,RING_CMD,INT_CMD}; 7 if (iiCheckTypes(args,t1,1)) 7 const short t2[]={3,RING_CMD,INT_CMD,INT_CMD}; 8 if (iiCheckTypes(args, t2, 0) || iiCheckTypes(args, t1, 1)) 8 9 { 9 10 ring r=(ring)args->Data(); … … 32 33 return TRUE; 33 34 } 34 ring R=freeAlgebra(r,d); 35 int ncGenCount = 0; 36 if (iiCheckTypes(args,t2,0)) 37 ncGenCount = (int)(long) args->next->next->Data(); 38 ring R=freeAlgebra(r,d,ncGenCount); 35 39 res->rtyp=RING_CMD; 36 40 res->data=R; -
Singular/dyn_modules/python/Makefile.am
rf006a1 r9102bb 51 51 python_moduledir = ${datadir}/singular/LIB 52 52 python_module_DATA = cart.py interpreter.py perf.py symm.py util.py 53 EXTRA_DIST=cart.py interpreter.py perf.py symm.py util.py -
Singular/dyn_modules/systhreads/Makefile.am
rf006a1 r9102bb 18 18 endif 19 19 20 SOURCES = shared.cc lintree.cc bytebuf.cc thread.cc bytebuf.h lintree.h channel.h syncvar.h threadconf.h 20 SOURCES = shared.cc lintree.cc bytebuf.cc thread.cc bytebuf.h lintree.h channel.h syncvar.h threadconf.h thread.h singthreads.h 21 21 systhreads_la_SOURCES = $(SOURCES) 22 22 systhreads_la_CPPFLAGS = ${MYINCLUDES} ${P_PROCS_CPPFLAGS_COMMON} -
Singular/iparith.cc
r48f20b r9102bb 5153 5153 ideal v_id=(ideal)v->Data(); 5154 5154 tHomog hom=testHomog; 5155 #ifdef HAVE_SHIFTBBA 5156 if (rIsLPRing(currRing)) 5157 { 5158 if (currRing->LPncGenCount < IDELEMS(v_id)) 5159 { 5160 Werror("At least %d ncgen variables are needed for this computation.", IDELEMS(v_id)); 5161 return TRUE; 5162 } 5163 } 5164 #endif 5155 5165 if (ww!=NULL) 5156 5166 { -
Singular/ipshell.cc
rf006a1 r9102bb 2252 2252 // R->cf->ch=0; 2253 2253 // ---------------------------------------- 2254 // 1:2254 // 0, (r1,r2) [, "i" ] 2255 2255 if (L->m[1].rtyp!=LIST_CMD) 2256 2256 { … … 2259 2259 } 2260 2260 lists LL=(lists)L->m[1].data; 2261 if (( (LL->nr!=2)2261 if ((LL->nr!=2) 2262 2262 || (LL->m[0].rtyp!=INT_CMD) 2263 2263 || (LL->m[1].rtyp!=INT_CMD)) 2264 && ((LL->nr!=1) 2265 || (LL->m[0].rtyp!=INT_CMD))) 2266 { 2267 WerrorS("invalid coeff. field description list"); 2264 { 2265 WerrorS("invalid coeff. field description list, expected list(`int`,`int`)"); 2268 2266 return; 2269 2267 } 2270 2268 int r1=(int)(long)LL->m[0].data; 2271 2269 int r2=(int)(long)LL->m[1].data; 2270 r1=si_min(r1,32767); 2271 r2=si_min(r2,32767); 2272 LongComplexInfo par; memset(&par, 0, sizeof(par)); 2273 par.float_len=r1; 2274 par.float_len2=r2; 2272 2275 if (L->nr==2) // complex 2273 R->cf = nInitChar(n_long_C, NULL); 2274 else if ((r1<=SHORT_REAL_LENGTH) 2275 && (r2<=SHORT_REAL_LENGTH)) 2276 R->cf = nInitChar(n_R, NULL); 2277 else 2278 { 2279 LongComplexInfo* p = (LongComplexInfo *)omAlloc0(sizeof(LongComplexInfo)); 2280 p->float_len=r1; 2281 p->float_len2=r2; 2282 R->cf = nInitChar(n_long_R, p); 2283 } 2284 2285 if ((r1<=SHORT_REAL_LENGTH) // should go into nInitChar 2286 && (r2<=SHORT_REAL_LENGTH)) 2287 { 2288 R->cf->float_len=SHORT_REAL_LENGTH/2; 2289 R->cf->float_len2=SHORT_REAL_LENGTH; 2290 } 2291 else 2292 { 2293 R->cf->float_len=si_min(r1,32767); 2294 R->cf->float_len2=si_min(r2,32767); 2295 } 2296 // ---------------------------------------- 2297 // 2: list (par) 2298 if (L->nr==2) 2299 { 2300 //R->cf->extRing->N=1; 2276 { 2301 2277 if (L->m[2].rtyp!=STRING_CMD) 2302 2278 { … … 2304 2280 return; 2305 2281 } 2306 //(rParameter(R))=(char**)omAlloc0(rPar(R)*sizeof(char_ptr)); 2307 rParameter(R)[0]=omStrDup((char *)L->m[2].data); 2308 } 2309 // ---------------------------------------- 2282 par.par_name=(char*)L->m[2].data; 2283 R->cf = nInitChar(n_long_C, &par); 2284 } 2285 else if ((r1<=SHORT_REAL_LENGTH) && (r2<=SHORT_REAL_LENGTH)) /* && L->nr==1*/ 2286 R->cf = nInitChar(n_R, NULL); 2287 else /* && L->nr==1*/ 2288 { 2289 R->cf = nInitChar(n_long_R, &par); 2290 } 2310 2291 } 2311 2292 -
Singular/table.h
r48f20b r9102bb 278 278 ,{D(jjSTD), STD_CMD, SMATRIX_CMD, SMATRIX_CMD , ALLOW_NC |ALLOW_RING} 279 279 ,{D(jjDUMMY), STRING_CMD, STRING_CMD, STRING_CMD , ALLOW_NC |ALLOW_RING} 280 ,{D(jjSYZYGY), SYZYGY_CMD, MODUL_CMD, IDEAL_CMD , ALLOW_ PLURAL|ALLOW_RING}281 ,{D(jjSYZYGY), SYZYGY_CMD, MODUL_CMD, MODUL_CMD , ALLOW_ PLURAL|ALLOW_RING}280 ,{D(jjSYZYGY), SYZYGY_CMD, MODUL_CMD, IDEAL_CMD , ALLOW_NC |ALLOW_RING} 281 ,{D(jjSYZYGY), SYZYGY_CMD, MODUL_CMD, MODUL_CMD , ALLOW_NC |ALLOW_RING} 282 282 #ifdef HAVE_PLURAL 283 283 ,{D(jjENVELOPE), ENVELOPE_CMD, RING_CMD, RING_CMD , ALLOW_PLURAL |NO_RING} -
Tst/Short/absfact.res.gz.uu
rf006a1 r9102bb 1 1 begin 640 absfact.res.gz 2 M'XL(" `O%'%T"`V%B<V9A8W0N<F5S`.V<6V_;.!;'W_,IB&*`D2PI(0]OX@3V3 MP^QB%P,L]J'IVZ`IY-2>&IM-@EC=2/WT> VC9)%W1M]:=+K9*45OFS1+/__QX4 M1)&^>?/7W_Y)"&$3\H_??B6OZF5]>;^8OKJ^N%G GP(1@XKO%PZ).TNL+^TXF5 M$U)-E_/JKKY\F+U<+NNJ=N7YA+AC<=F UNBF\W;(,2JI+\KQX^(.\)F.2T#0G6 M29.W^';_Y,OK"5E^>'RNQX3ZQ')"GA[O6_)D*Q9ZU-P"R0B,FE &[.E*C!E_;7 M 6X&O3*P3A4Y'B6P@:R&]Y:.D*=KT5OA&S82\G\W)#;:)I_XW//7'Y\6G6?*48 M DNN+BZLK\G.8_#.Y>YY5]>P]J587D9/%`WGYL+C[@`GWBV5M&WF\_UC/WLU79 M =98DJ3_,;#N;#++.2,EB299X-'M_:?/?/)+J[FZV7!*LT+7U.._5RDG=/LU(10 M LIBOBCU4_Y[AN;]42U(MEXL_'F;O;5OUXRKW>59_?'X@_ZGN/\[27VS&^F\Y11 M J^W9)S?I=>^$KR^(LQ6CD["L2V81\S"81-KZG;W]!1LD[_!@S*Z`,9#=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ory_0 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:1906322 1 >> tst_memory_1 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:24862723 1 >> tst_memory_2 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:24862724 1 >> tst_timer :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:185 2 >> tst_memory_0 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:1950486 2 >> tst_memory_1 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:27402247 2 >> tst_memory_2 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:27402248 2 >> tst_timer :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:509 3 >> tst_memory_0 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:19504810 3 >> tst_memory_1 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:274022411 3 >> tst_memory_2 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:274022412 3 >> tst_timer :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:113 4 >> tst_memory_0 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:19646414 4 >> tst_memory_1 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:274022415 4 >> tst_memory_2 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:274022416 4 >> tst_timer :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:917 5 >> tst_memory_0 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:19596818 5 >> tst_memory_1 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:274022419 5 >> tst_memory_2 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:274022420 5 >> tst_timer_1 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:831 1 >> tst_memory_0 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:192208 2 1 >> tst_memory_1 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2506752 3 1 >> tst_memory_2 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2506752 4 1 >> tst_timer :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:18 5 2 >> tst_memory_0 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:197648 6 2 >> tst_memory_1 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 7 2 >> tst_memory_2 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 8 2 >> tst_timer :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:50 9 3 >> tst_memory_0 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:197648 10 3 >> tst_memory_1 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 11 3 >> tst_memory_2 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 12 3 >> tst_timer :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2 13 4 >> tst_memory_0 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:202280 14 4 >> tst_memory_1 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 15 4 >> tst_memory_2 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 16 4 >> tst_timer :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:9 17 5 >> tst_memory_0 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:201784 18 5 >> tst_memory_1 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 19 5 >> tst_memory_2 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 20 5 >> tst_timer_1 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:83 -
Tst/Short/bug_zp.res.gz.uu
rf006a1 r9102bb 1 1 begin 640 bug_zp.res.gz 2 M'XL(" -%LPED"`V)U9U]Z<"YR97,`E5!-3\)`$+WW5[P0#B6I"[O(AQ#6Q'@A3 M ,5[P1K19RK9.`FTSNX3*KW>KI.K1T[QY;U[FS6Q>'M?/`*3&T_H!/>^\.-"N4 M MXPV5T5I!#*EDGP\6$9MA=;8G8KT4HO2GH7SQG?C8XT.WPH,AS@;+A-0CIKI5 M :$$.OJIP,%Q8Y!4C-YFO^&/1V28"3&4!7DW&T_E,CD8R:9)]_9-IJJ\NNEC$6 M C;J1(5G@[Y&]&PZ*97*>LC_+XJ-I6D*]J;O!/Z>W\G716M(`5C+:JN]6=HEF7 7O\Z>BZ^/M6\YN3A$ZT>?0,1X.V<!````2 M'XL("$.:.5T"`V)U9U]Z<"YR97,`55#+;L(P$+S[*T:(0Y""P>99$$:J>D&J 3 M>H$;:B.3.F$E2"+;B)2OK].BM)QV=V9'L[/;W<OF#8!0>-T\H^.=YR<Z=)9L 4 M>V>D0@`3*LA'O25K*I3"X9(GMXH7YLJ=U[Y='RFT_9AC,,!5VR(&9:@LG0W( 5 MP9<E3MKF!EEID>G4E_9KT<HF'):*''8U&4WG,S$<BKB./ZN_FZ;JKJ*;053+ 6 MO@B7!7R-]*AM8(PEYRE],(O.NFX`^2&?>FPOWA>-)`G-2K"]_!U%ZS'[%V3. 7 3?W[0!+VX*)AUV3<,'@((.0$````` 8 8 ` 9 9 end -
Tst/Short/bug_zp.stat
rf006a1 r9102bb 1 1 >> tst_memory_0 :: 15 05914065:4103, 64 bit:4.1.0:x86_64-Linux:nepomuck:835922 1 >> tst_memory_1 :: 15 05914065:4103, 64 bit:4.1.0:x86_64-Linux:nepomuck:22159363 1 >> tst_memory_2 :: 15 05914065:4103, 64 bit:4.1.0:x86_64-Linux:nepomuck:22159364 1 >> tst_timer_1 :: 15 05914065:4103, 64 bit:4.1.0:x86_64-Linux:nepomuck:01 1 >> tst_memory_0 :: 1564056131:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:85680 2 1 >> tst_memory_1 :: 1564056131:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:2150192 3 1 >> tst_memory_2 :: 1564056131:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:2191296 4 1 >> tst_timer_1 :: 1564056131:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:5 -
doc/NEWS.texi
rf006a1 r9102bb 21 21 22 22 @heading News for version @value{VERSION} 23 24 Changes in the kernel/build system: 25 @itemize 26 @item improved gcd and multiplication via FLINT 27 @end itemize 28 29 @heading News for version 4-1-2 23 30 New libraries: 24 31 @itemize -
factory/FLINTconvert.cc
rf006a1 r9102bb 24 24 #include "singext.h" 25 25 #include "cf_algorithm.h" 26 27 #ifdef HAVE_OMALLOC 28 #define Alloc(L) omAlloc(L) 29 #define Free(A,L) omFreeSize(A,L) 30 #else 31 #define Alloc(L) malloc(L) 32 #define Free(A,L) free(A) 33 #endif 26 34 27 35 #ifdef HAVE_FLINT … … 53 61 #include <flint/fq_nmod_mat.h> 54 62 #endif 63 #if ( __FLINT_RELEASE >= 20503) 64 #include <flint/fmpq_mpoly.h> 65 #endif 55 66 #ifdef __cplusplus 56 67 } … … 152 163 if (f.isImm ()) 153 164 { 154 fmpz_set_si (fmpq_numref (result), f.num().intval()); 155 fmpz_set_si (fmpq_denref (result), f.den().intval()); 156 } 157 else 165 fmpq_set_si (result, f.intval(), 1); 166 } 167 else if(f.inQ()) 158 168 { 159 169 mpz_t gmp_val; … … 165 175 mpz_clear (gmp_val); 166 176 } 177 else if(f.inZ()) 178 { 179 mpz_t gmp_val; 180 f.mpzval(gmp_val); 181 fmpz_set_mpz (fmpq_numref (result), gmp_val); 182 mpz_clear (gmp_val); 183 fmpz_one(fmpq_denref(result)); 184 } 185 else 186 { 187 printf("wrong type\n"); 188 } 167 189 } 168 190 … … 181 203 182 204 CanonicalForm result; 183 if (mpz_is_imm (nnum) && mpz_is_imm (nden)) 184 { 185 num= CanonicalForm (mpz_get_si(nnum)); 186 den= CanonicalForm (mpz_get_si(nden)); 187 mpz_clear (nnum); 188 mpz_clear (nden); 189 result= num/den; 190 if (!isRat) 191 Off (SW_RATIONAL); 192 return result; 205 if (mpz_is_imm (nden)) 206 { 207 if (mpz_is_imm(nnum)) 208 { 209 num= CanonicalForm (mpz_get_si(nnum)); 210 den= CanonicalForm (mpz_get_si(nden)); 211 mpz_clear (nnum); 212 mpz_clear (nden); 213 result= num/den; 214 } 215 else if (mpz_cmp_si(nden,1)==0) 216 { 217 result= CanonicalForm( CFFactory::basic(nnum)); 218 mpz_clear (nden); 219 } 220 else 221 result= CanonicalForm( CFFactory::rational( nnum, nden, false)); 193 222 } 194 223 else 195 224 { 196 result= make_cf (nnum, nden, false);197 if (!isRat)198 Off (SW_RATIONAL);199 return result;200 }225 result= CanonicalForm( CFFactory::rational( nnum, nden, false)); 226 } 227 if (!isRat) 228 Off (SW_RATIONAL); 229 return result; 201 230 } 202 231 … … 528 557 } 529 558 #endif 530 531 #endif 532 533 559 #if __FLINT_RELEASE >= 20503 560 static void convFlint_RecPP ( const CanonicalForm & f, ulong * exp, nmod_mpoly_t result, nmod_mpoly_ctx_t ctx, int N ) 561 { 562 // assume f!=0 563 if ( ! f.inCoeffDomain() ) 564 { 565 int l = f.level(); 566 for ( CFIterator i = f; i.hasTerms(); i++ ) 567 { 568 exp[N-l] = i.exp(); 569 convFlint_RecPP( i.coeff(), exp, result, ctx, N ); 570 } 571 exp[N-l] = 0; 572 } 573 else 574 { 575 int c=f.intval(); // with Off(SW_SYMMETRIC_FF): 0<=c<p 576 nmod_mpoly_push_term_ui_ui(result,c,exp,ctx); 577 } 578 } 579 580 static void convFlint_RecPP ( const CanonicalForm & f, ulong * exp, fmpq_mpoly_t result, fmpq_mpoly_ctx_t ctx, int N ) 581 { 582 // assume f!=0 583 if ( ! f.inBaseDomain() ) 584 { 585 int l = f.level(); 586 for ( CFIterator i = f; i.hasTerms(); i++ ) 587 { 588 exp[N-l] = i.exp(); 589 convFlint_RecPP( i.coeff(), exp, result, ctx, N ); 590 } 591 exp[N-l] = 0; 592 } 593 else 594 { 595 fmpq_t c; 596 fmpq_init(c); 597 convertCF2Fmpq(c,f); 598 fmpq_mpoly_push_term_fmpq_ui(result,c,exp,ctx); 599 fmpq_clear(c); 600 } 601 } 602 603 void convFactoryPFlintMP ( const CanonicalForm & f, nmod_mpoly_t res, nmod_mpoly_ctx_t ctx, int N ) 604 { 605 if (f.isZero()) return; 606 ulong * exp = (ulong*)Alloc(N*sizeof(ulong)); 607 memset(exp,0,N*sizeof(ulong)); 608 bool save_sym_ff= isOn (SW_SYMMETRIC_FF); 609 if (save_sym_ff) Off (SW_SYMMETRIC_FF); 610 convFlint_RecPP( f, exp, res, ctx, N ); 611 if (save_sym_ff) On(SW_SYMMETRIC_FF); 612 Free(exp,N*sizeof(ulong)); 613 } 614 615 void convFactoryPFlintMP ( const CanonicalForm & f, fmpq_mpoly_t res, fmpq_mpoly_ctx_t ctx, int N ) 616 { 617 if (f.isZero()) return; 618 ulong * exp = (ulong*)Alloc(N*sizeof(ulong)); 619 memset(exp,0,N*sizeof(ulong)); 620 convFlint_RecPP( f, exp, res, ctx, N ); 621 fmpq_mpoly_reduce(res,ctx); 622 Free(exp,N*sizeof(ulong)); 623 } 624 625 CanonicalForm convFlintMPFactoryP(nmod_mpoly_t f, nmod_mpoly_ctx_t ctx, int N) 626 { 627 CanonicalForm result; 628 int d=nmod_mpoly_length(f,ctx)-1; 629 ulong* exp=(ulong*)Alloc(N*sizeof(ulong)); 630 for(int i=d; i>=0; i--) 631 { 632 ulong c=nmod_mpoly_get_term_coeff_ui(f,i,ctx); 633 nmod_mpoly_get_term_exp_ui(exp,f,i,ctx); 634 CanonicalForm term=(int)c; 635 for ( int i = 0; i <N; i++ ) 636 { 637 if (exp[i]!=0) term*=CanonicalForm( Variable( N-i ), exp[i] ); 638 } 639 result+=term; 640 } 641 Free(exp,N*sizeof(ulong)); 642 return result; 643 } 644 645 CanonicalForm convFlintMPFactoryP(fmpq_mpoly_t f, fmpq_mpoly_ctx_t ctx, int N) 646 { 647 CanonicalForm result; 648 int d=fmpq_mpoly_length(f,ctx)-1; 649 ulong* exp=(ulong*)Alloc(N*sizeof(ulong)); 650 fmpq_t c; 651 fmpq_init(c); 652 for(int i=d; i>=0; i--) 653 { 654 fmpq_mpoly_get_term_coeff_fmpq(c,f,i,ctx); 655 fmpq_mpoly_get_term_exp_ui(exp,f,i,ctx); 656 CanonicalForm term=convertFmpq_t2CF(c); 657 for ( int i = 0; i <N; i++ ) 658 { 659 if (exp[i]!=0) term*=CanonicalForm( Variable( N-i ), exp[i] ); 660 } 661 result+=term; 662 } 663 fmpq_clear(c); 664 Free(exp,N*sizeof(ulong)); 665 return result; 666 } 667 668 // stolen from: 669 // https://graphics.stanford.edu/~seander/bithacks.html#IntegerLog 670 static inline int SI_LOG2(int v) 671 { 672 const unsigned int b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; 673 const unsigned int S[] = {1, 2, 4, 8, 16}; 674 675 unsigned int r = 0; // result of log2(v) will go here 676 if (v & b[4]) { v >>= S[4]; r |= S[4]; } 677 if (v & b[3]) { v >>= S[3]; r |= S[3]; } 678 if (v & b[2]) { v >>= S[2]; r |= S[2]; } 679 if (v & b[1]) { v >>= S[1]; r |= S[1]; } 680 if (v & b[0]) { v >>= S[0]; r |= S[0]; } 681 return (int)r; 682 } 683 684 CanonicalForm mulFlintMP_Zp(const CanonicalForm& F,int lF, const CanonicalForm& G, int lG,int m) 685 { 686 int bits=SI_LOG2(m)+1; 687 int N=F.level(); 688 nmod_mpoly_ctx_t ctx; 689 nmod_mpoly_ctx_init(ctx,N,ORD_LEX,getCharacteristic()); 690 nmod_mpoly_t f,g,res; 691 nmod_mpoly_init3(f,lF,bits,ctx); 692 nmod_mpoly_init3(g,lG,bits,ctx); 693 convFactoryPFlintMP(F,f,ctx,N); 694 convFactoryPFlintMP(G,g,ctx,N); 695 nmod_mpoly_init(res,ctx); 696 nmod_mpoly_mul(res,f,g,ctx); 697 nmod_mpoly_clear(g,ctx); 698 nmod_mpoly_clear(f,ctx); 699 CanonicalForm RES=convFlintMPFactoryP(res,ctx,N); 700 nmod_mpoly_clear(res,ctx); 701 nmod_mpoly_ctx_clear(ctx); 702 return RES; 703 } 704 705 CanonicalForm mulFlintMP_QQ(const CanonicalForm& F,int lF, const CanonicalForm& G, int lG, int m) 706 { 707 int bits=SI_LOG2(m)+1; 708 int N=F.level(); 709 fmpq_mpoly_ctx_t ctx; 710 fmpq_mpoly_ctx_init(ctx,N,ORD_LEX); 711 fmpq_mpoly_t f,g,res; 712 fmpq_mpoly_init3(f,lF,bits,ctx); 713 fmpq_mpoly_init3(g,lG,bits,ctx); 714 convFactoryPFlintMP(F,f,ctx,N); 715 convFactoryPFlintMP(G,g,ctx,N); 716 fmpq_mpoly_init(res,ctx); 717 fmpq_mpoly_mul(res,f,g,ctx); 718 fmpq_mpoly_clear(g,ctx); 719 fmpq_mpoly_clear(f,ctx); 720 CanonicalForm RES=convFlintMPFactoryP(res,ctx,N); 721 fmpq_mpoly_clear(res,ctx); 722 fmpq_mpoly_ctx_clear(ctx); 723 return RES; 724 } 725 726 CanonicalForm gcdFlintMP_Zp(const CanonicalForm& F, const CanonicalForm& G) 727 { 728 int N=F.level(); 729 int lf,lg,m=1<<MPOLY_MIN_BITS; 730 lf=size_maxexp(F,m); 731 lg=size_maxexp(G,m); 732 int bits=SI_LOG2(m)+1; 733 nmod_mpoly_ctx_t ctx; 734 nmod_mpoly_ctx_init(ctx,N,ORD_LEX,getCharacteristic()); 735 nmod_mpoly_t f,g,res; 736 nmod_mpoly_init3(f,lf,bits,ctx); 737 nmod_mpoly_init3(g,lg,bits,ctx); 738 convFactoryPFlintMP(F,f,ctx,N); 739 convFactoryPFlintMP(G,g,ctx,N); 740 nmod_mpoly_init(res,ctx); 741 int ok=nmod_mpoly_gcd(res,f,g,ctx); 742 nmod_mpoly_clear(g,ctx); 743 nmod_mpoly_clear(f,ctx); 744 CanonicalForm RES=1; 745 if (ok) 746 { 747 RES=convFlintMPFactoryP(res,ctx,N); 748 } 749 nmod_mpoly_clear(res,ctx); 750 nmod_mpoly_ctx_clear(ctx); 751 return RES; 752 } 753 754 static CanonicalForm b_content ( const CanonicalForm & f ) 755 { 756 if ( f.inCoeffDomain() ) 757 return f; 758 else 759 { 760 CanonicalForm result = 0; 761 CFIterator i; 762 for ( i = f; i.hasTerms() && (!result.isOne()); i++ ) 763 result=bgcd( b_content(i.coeff()) , result ); 764 return result; 765 } 766 } 767 768 769 CanonicalForm gcdFlintMP_QQ(const CanonicalForm& F, const CanonicalForm& G) 770 { 771 int N=F.level(); 772 fmpq_mpoly_ctx_t ctx; 773 fmpq_mpoly_ctx_init(ctx,N,ORD_LEX); 774 fmpq_mpoly_t f,g,res; 775 fmpq_mpoly_init(f,ctx); 776 fmpq_mpoly_init(g,ctx); 777 convFactoryPFlintMP(F,f,ctx,N); 778 convFactoryPFlintMP(G,g,ctx,N); 779 fmpq_mpoly_init(res,ctx); 780 int ok=fmpq_mpoly_gcd(res,f,g,ctx); 781 fmpq_mpoly_clear(g,ctx); 782 fmpq_mpoly_clear(f,ctx); 783 CanonicalForm RES=1; 784 if (ok) 785 { 786 // Flint normalizes the gcd to be monic. 787 // Singular wants a gcd defined over ZZ that is primitive and has a positive leading coeff. 788 if (!fmpq_mpoly_is_zero(res, ctx)) 789 { 790 fmpq_t content; 791 fmpq_init(content); 792 fmpq_mpoly_content(content, res, ctx); 793 fmpq_mpoly_scalar_div_fmpq(res, res, content, ctx); 794 fmpq_clear(content); 795 } 796 RES=convFlintMPFactoryP(res,ctx,N); 797 // gcd(2x,4x) should be 2x, so RES should also have the gcd(lc(F),lc(G)) 798 RES*=bgcd(b_content(F),b_content(G)); 799 } 800 fmpq_mpoly_clear(res,ctx); 801 fmpq_mpoly_ctx_clear(ctx); 802 return RES; 803 } 804 805 #endif 806 807 #endif 808 809 -
factory/FLINTconvert.h
rf006a1 r9102bb 250 250 251 251 252 #endif 253 #endif 252 #if __FLINT_RELEASE >= 20503 253 CanonicalForm mulFlintMP_Zp(const CanonicalForm& F,int lF, const CanonicalForm& Gi, int lG, int m); 254 CanonicalForm mulFlintMP_QQ(const CanonicalForm& F,int lF, const CanonicalForm& Gi, int lG, int m); 255 CanonicalForm gcdFlintMP_Zp(const CanonicalForm& F, const CanonicalForm& G); 256 CanonicalForm gcdFlintMP_QQ(const CanonicalForm& F, const CanonicalForm& G); 257 #endif 258 #endif 259 #endif -
factory/Makefile.am
rf006a1 r9102bb 173 173 libfactory_includedir = ${includedir}/factory 174 174 175 nodist_libfactory_include_HEADERS = factory.h factoryconf.h globaldefs.h 175 nodist_libfactory_include_HEADERS = factory.h factoryconf.h 176 libfactory_include_HEADERS = globaldefs.h 176 177 177 178 -
factory/NTLconvert.cc
rf006a1 r9102bb 33 33 #include "NTLconvert.h" 34 34 35 #ifdef HAVE_OMALLOC 36 #define Alloc(L) omAlloc(L) 37 #define Free(A,L) omFreeSize(A,L) 38 #else 35 39 #define Alloc(L) malloc(L) 36 40 #define Free(A,L) free(A) 41 #endif 37 42 38 43 void out_cf(const char *s1,const CanonicalForm &f,const char *s2); -
factory/canonicalform.cc
rf006a1 r9102bb 17 17 #include "gfops.h" 18 18 #include "facMul.h" 19 #include "facAlgFuncUtil.h" 19 20 #include "FLINTconvert.h" 20 21 … … 707 708 else if ( value->level() == cf.value->level() ) { 708 709 #if (HAVE_NTL && HAVE_FLINT && __FLINT_RELEASE >= 20400) 710 #if (__FLINT_RELEASE >= 20503) 711 int l_this,l_cf,m=1; 712 if ((getCharacteristic()>0) 713 && (CFFactory::gettype() != GaloisFieldDomain) 714 &&(!hasAlgVar(*this)) 715 &&(!hasAlgVar(cf)) 716 &&((l_cf=size_maxexp(cf,m))>10) 717 &&((l_this=size_maxexp(*this,m))>10) 718 ) 719 { 720 *this=mulFlintMP_Zp(*this,l_this,cf,l_cf,m); 721 } 722 else 723 /*-----------------------------------------------------*/ 724 if ((getCharacteristic()==0) 725 &&(!hasAlgVar(*this)) 726 &&(!hasAlgVar(cf)) 727 &&((l_cf=size_maxexp(cf,m))>10) 728 &&((l_this=size_maxexp(*this,m))>10) 729 ) 730 { 731 *this=mulFlintMP_QQ(*this,l_this,cf,l_cf,m); 732 } 733 else 734 #endif 735 709 736 if (value->levelcoeff() == cf.value->levelcoeff() && cf.isUnivariate() && (*this).isUnivariate()) 710 737 { -
factory/cf_char.cc
rf006a1 r9102bb 33 33 theDegree = 1; 34 34 CFFactory::settype( FiniteFieldDomain ); 35 ff_big = c > cf_getSmallPrime( cf_getNumSmallPrimes()-1 ); 36 if (c!=theCharacteristic) 37 { 38 if (c > 536870909) factoryError("characteristic is too large(max is 2^29)"); 39 ff_setprime( c ); 40 } 35 41 theCharacteristic = c; 36 ff_big = c > cf_getSmallPrime( cf_getNumSmallPrimes()-1 );37 if (c > 536870909) factoryError("characteristic is too large(max is 2^29)");38 ff_setprime( c );39 42 } 40 43 } -
factory/cf_gcd.cc
rf006a1 r9102bb 26 26 #include "cfSubResGcd.h" 27 27 #include "cfModGcd.h" 28 #include "FLINTconvert.h" 28 29 #include "facAlgFuncUtil.h" 29 30 … … 100 101 if ( getCharacteristic() != 0 ) 101 102 { 103 #if defined(HAVE_FLINT) && ( __FLINT_RELEASE >= 20503) 104 if ( isOn( SW_USE_FL_GCD_P) 105 && (CFFactory::gettype() != GaloisFieldDomain) 106 && (getCharacteristic()>10) 107 &&(!hasAlgVar(fc)) && (!hasAlgVar(gc))) 108 { 109 return gcdFlintMP_Zp(fc,gc); 110 } 111 #endif 102 112 #ifdef HAVE_NTL 103 113 if ((!fc_and_gc_Univariate) && (isOn( SW_USE_EZGCD_P ))) … … 119 129 fc = subResGCD_p( fc, gc ); 120 130 } 121 else if (!fc_and_gc_Univariate) 131 else if (!fc_and_gc_Univariate) /* && char==0*/ 122 132 { 133 #if defined(HAVE_FLINT) && ( __FLINT_RELEASE >= 20503) 134 if (( isOn( SW_USE_FL_GCD_0) ) 135 &&(!hasAlgVar(fc)) && (!hasAlgVar(gc))) 136 { 137 return gcdFlintMP_QQ(fc,gc); 138 } 139 else 140 #endif 123 141 if ( isOn( SW_USE_EZGCD ) ) 124 142 fc= ezgcd (fc, gc); 125 #ifdef HAVE_NTL143 #ifdef HAVE_NTL 126 144 else if (isOn(SW_USE_CHINREM_GCD)) 127 145 fc = modGCDZ( fc, gc); 128 #endif146 #endif 129 147 else 130 148 { … … 311 329 CanonicalForm cdF = bCommonDen( f ); 312 330 CanonicalForm cdG = bCommonDen( g ); 331 CanonicalForm F = f * cdF, G = g * cdG; 313 332 Off( SW_RATIONAL ); 314 CanonicalForm l = lcm( cdF, cdG ); 315 On( SW_RATIONAL ); 316 CanonicalForm F = f * l, G = g * l; 317 Off( SW_RATIONAL ); 318 l = gcd_poly( F, G ); 333 CanonicalForm l = gcd_poly( F, G ); 319 334 On( SW_RATIONAL ); 320 335 return abs( l ); -
factory/cf_switches.cc
rf006a1 r9102bb 32 32 #ifdef HAVE_NTL 33 33 On(SW_USE_CHINREM_GCD); 34 //Off(SW_USE_NTL_SORT); 34 On(SW_USE_NTL_SORT); 35 #endif 36 #ifdef HAVE_FLINT 35 37 On(SW_USE_FL_GCD_P); 36 //On(SW_USE_FL_GCD_0);38 On(SW_USE_FL_GCD_0); 37 39 #endif 38 40 On(SW_USE_EZGCD); -
factory/facFqBivar.cc
rf006a1 r9102bb 6883 6883 #ifdef HAVE_FLINT 6884 6884 nmod_mat_t FLINTN; 6885 #else 6885 #endif 6886 6886 6887 if (fac_NTL_char != getCharacteristic()) 6887 6888 { … … 6890 6891 } 6891 6892 mat_zz_p NTLN; 6892 #endif6893 6893 6894 6894 if (alpha.level() != 1) … … 6898 6898 } 6899 6899 mat_zz_pE NTLNe; 6900 6900 6901 if (alpha.level() == 1) 6901 6902 { -
kernel/GBEngine/kstd1.cc
r48f20b r9102bb 38 38 #include "kernel/GBEngine/kInline.h" 39 39 40 #ifdef HAVE_SHIFTBBA 41 #include "polys/shiftop.h" 42 #endif 40 43 41 44 /* the list of all options which give a warning by test */ … … 2343 2346 2344 2347 #ifdef HAVE_SHIFTBBA 2345 if(rIsLPRing(currRing)) return freegb(F, Q);2348 if(rIsLPRing(currRing)) return kStdShift(F, Q, h, w, hilb, syzComp, newIdeal, vw, FALSE); 2346 2349 #endif 2347 2350 … … 2820 2823 int newIdeal, intvec *vw, BOOLEAN rightGB) 2821 2824 { 2825 assume(rIsLPRing(currRing)); 2826 assume(idIsInV(F)); 2822 2827 ideal r; 2823 2828 BOOLEAN b=currRing->pLexOrder,toReset=FALSE; … … 2913 2918 delete(strat); 2914 2919 if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w; 2920 assume(idIsInV(r)); 2915 2921 return r; 2916 2922 } -
kernel/GBEngine/kstd1.h
r48f20b r9102bb 42 42 int syzComp=0, int newIdeal=0, intvec *vw=NULL, BOOLEAN rightGB=FALSE); 43 43 44 ideal freegb(ideal F, ideal Q);45 44 ideal rightgb(ideal F, ideal Q); 46 45 -
kernel/GBEngine/kstd2.cc
r48f20b r9102bb 4520 4520 } 4521 4521 4522 4523 ideal freegb(ideal F, ideal Q) 4524 { 4525 assume(rIsLPRing(currRing)); 4526 assume(idIsInV(F)); 4527 ideal RS = kStdShift(F, Q, testHomog, NULL); 4528 idSkipZeroes(RS); // is this even necessary? 4529 assume(idIsInV(RS)); 4530 return(RS); 4531 } 4532 4522 #ifdef HAVE_SHIFTBBA 4533 4523 ideal rightgb(ideal F, ideal Q) 4534 4524 { … … 4540 4530 return(RS); 4541 4531 } 4532 #endif 4542 4533 4543 4534 /*2 -
kernel/ideals.cc
r48f20b r9102bb 617 617 p = h2->m[j]; 618 618 q = pOne(); 619 #ifdef HAVE_SHIFTBBA 620 // non multiplicative variable 621 if (rIsLPRing(currRing)) 622 { 623 pSetExp(q, currRing->isLPring - currRing->LPncGenCount + j + 1, 1); 624 p_Setm(q, currRing); 625 } 626 #endif 619 627 pSetComp(q,syzcomp+1+j); 620 628 pSetmComp(q); 621 629 if (p!=NULL) 622 630 { 623 while (pNext(p)) pIter(p); 624 p->next = q; 631 #ifdef HAVE_SHIFTBBA 632 if (rIsLPRing(currRing)) 633 { 634 h2->m[j] = pAdd(p, q); 635 } 636 else 637 #endif 638 { 639 while (pNext(p)) pIter(p); 640 p->next = q; 641 } 625 642 } 626 643 else … … 630 647 idTest(h2); 631 648 649 #ifdef HAVE_SHIFTBBA 650 if (rIsLPRing(currRing)) alg = GbStd; 651 #endif 632 652 ideal h3=NULL; 633 653 if (alg==GbDefault) alg=GbStd; -
kernel/mod2.h
rf006a1 r9102bb 77 77 #endif 78 78 79 #define SINGULAR_PATCHLEVEL 079 #define SINGULAR_PATCHLEVEL 2 80 80 #define SINGULAR_VERSION ((SINGULAR_MAJOR_VERSION*1000 + SINGULAR_MINOR_VERSION*100 + SINGULAR_SUB_VERSION*10)+SINGULAR_PATCHLEVEL) 81 81 -
kernel/preimage.cc
rf006a1 r9102bb 88 88 } 89 89 90 assume(n_SetMap(theImageRing->cf, dst_r->cf) == ndCopyMap);91 92 90 if (theImageRing->cf != dst_r->cf) 93 91 { -
libpolys/coeffs/Makefile.am
rf006a1 r9102bb 44 44 test_LDADD = libcoeffs.la $(libcoeffs_la_LIBADD) 45 45 46 EXTRA_DIST = rintegers2.cc rinteger 3.cc46 EXTRA_DIST = rintegers2.cc rintegers3.cc -
libpolys/coeffs/rintegers2.cc
rf006a1 r9102bb 515 515 } 516 516 517 static void nrzMPZ(mpz_t res, number &a, const coeffs) 518 { 519 mpz_init_set(res, (mpz_ptr) a); 520 } 521 517 522 static number nrzFarey(number r, number N, const coeffs R) 518 523 { … … 621 626 r->cfInit = nrzInit; 622 627 r->cfInitMPZ = nrzInitMPZ; 628 r->cfMPZ = nrzMPZ; 623 629 r->cfSize = nrzSize; 624 630 r->cfInt = nrzInt; -
libpolys/polys/clapconv.cc
rf006a1 r9102bb 87 87 p1=p; 88 88 l=l/2; 89 while(l> 0) { p=pNext(p); l--; }89 while(l>1) { p=pNext(p); l--; } 90 90 p2=pNext(p); 91 91 pNext(p)=NULL; … … 101 101 102 102 #define MIN_CONV_LEN 7 103 CanonicalForm convSingPFactoryP( poly p,const ring r )103 static CanonicalForm convSingPFactoryP_intern( poly p, int l, BOOLEAN & setChar,const ring r ) 104 104 { 105 105 CanonicalForm result = 0; 106 106 int e, n = rVar(r); 107 BOOLEAN setChar=TRUE; 108 109 int l; 110 if ((l=pLength(p))>MIN_CONV_LEN) 107 assume(l==pLength(p)); 108 109 if (l>MIN_CONV_LEN) 111 110 { 112 111 poly p1,p2; 113 112 convPhalf(p,l,p1,p2); 114 CanonicalForm P=convSingPFactoryP (p1,r);115 P+=convSingPFactoryP (p2,r);113 CanonicalForm P=convSingPFactoryP_intern(p1,l/2,setChar,r); 114 P+=convSingPFactoryP_intern(p2,l-l/2,setChar,r); 116 115 convPunhalf(p1,p2); 117 116 return P; 118 117 } 118 BOOLEAN setChar_loc=setChar; 119 setChar=FALSE; 119 120 while ( p!=NULL ) 120 121 { 121 CanonicalForm term=r->cf->convSingNFactoryN(pGetCoeff( p ),setChar , r->cf);122 CanonicalForm term=r->cf->convSingNFactoryN(pGetCoeff( p ),setChar_loc, r->cf); 122 123 if (errorreported) break; 123 setChar =FALSE;124 setChar_loc=FALSE; 124 125 for ( int i = 1; i <=n; i++ ) 125 126 { … … 131 132 } 132 133 return result; 134 } 135 136 CanonicalForm convSingPFactoryP( poly p, const ring r ) 137 { 138 BOOLEAN setChar=TRUE; 139 return convSingPFactoryP_intern(p,pLength(p),setChar,r); 133 140 } 134 141 -
libpolys/polys/clapsing.cc
rf006a1 r9102bb 59 59 #ifdef HAVE_FLINT 60 60 #if __FLINT_RELEASE >= 20503 61 if (rField_is_Zp(r) && (r->cf->ch> 500))61 if (rField_is_Zp(r) && (r->cf->ch>10)) 62 62 { 63 63 nmod_mpoly_ctx_t ctx; -
libpolys/polys/flint_mpoly.cc
rf006a1 r9102bb 65 65 #if 1 66 66 // memory allocation is not thread safe; singular polynomials must be constructed in serial 67 68 /* 69 We agree the that result of a singular -> fmpq_mpoly conversion is 70 readonly. This restricts the usage of the result in flint functions to 71 const arguments. However, the real readonly conversion is currently only 72 implemented in the threaded conversion below since it requires a scan of 73 all coefficients anyways. The _fmpq_mpoly_clear_readonly_sing needs to 74 be provided for a consistent interface in the polynomial operations. 75 */ 76 static void _fmpq_mpoly_clear_readonly_sing(fmpq_mpoly_t a, fmpq_mpoly_ctx_t ctx) 77 { 78 fmpq_mpoly_clear(a, ctx); 79 } 67 80 68 81 void convSingPFlintMP(fmpq_mpoly_t res, fmpq_mpoly_ctx_t ctx, poly p, int lp, const ring r) … … 186 199 } 187 200 201 202 /* 203 In order that flint may sometimes borrow the large integer coeffs of 204 polynomials over QQ (borrow means: simply point to the same GMP structs 205 that singular has already allocated), we define the result of a 206 singular -> fmpq_mpoly conversion to be readonly. This means we agree 207 that 208 - it can only be used as an const argument to a flint function 209 - singular must not mutate the original coeffs while the readonly object is in use 210 */ 211 212 static void _fmpq_mpoly_clear_readonly_sing(fmpq_mpoly_t a, fmpq_mpoly_ctx_t ctx) 213 { 214 if (fmpq_is_one(a->content)) 215 { 216 if (a->zpoly->alloc > 0) 217 { 218 flint_free(a->zpoly->coeffs); 219 flint_free(a->zpoly->exps); 220 } 221 222 fmpq_clear(a->content); 223 } 224 else 225 { 226 fmpq_mpoly_clear(a, ctx); 227 } 228 } 229 188 230 /* singular -> fmpq_mpoly conversion */ 189 231 … … 197 239 std::vector<poly> markers; 198 240 ring r; 199 200 convert_sing_to_fmpq_mpoly_base(slong num_threads_, fmpq_mpoly_struct * res_, 201 const fmpq_mpoly_ctx_struct * ctx_, const ring r_, poly p) 202 : num_threads(num_threads_), 241 fmpq_t content; 242 243 convert_sing_to_fmpq_mpoly_base(fmpq_mpoly_struct * res_, 244 const fmpq_mpoly_ctx_struct * ctx_, const ring r_, poly p) 245 : num_threads(0), 203 246 res(res_), 204 247 ctx(ctx_), 205 248 r(r_) 206 249 { 250 fmpq_t c; 251 fmpq_init(c); 252 fmpq_init(content); 253 fmpq_zero(content); 254 207 255 length = 0; 208 256 while (1) 209 257 { 210 258 if ((length % 4096) == 0) 259 { 260 my_convSingNFlintN_QQ(c, number(pGetCoeff(p))); 261 fmpq_gcd(content, content, c); 211 262 markers.push_back(p); 263 } 212 264 if (p == NULL) 213 265 return; … … 215 267 pIter(p); 216 268 } 269 270 fmpq_clear(c); 271 } 272 273 ~convert_sing_to_fmpq_mpoly_base() 274 { 275 fmpq_clear(content); 217 276 } 218 277 }; … … 248 307 249 308 flint_bitcnt_t required_bits = MPOLY_MIN_BITS; 250 fmpq_ zero(arg->content);309 fmpq_set(arg->content, base->content); 251 310 252 311 while (idx < arg->end_idx) 253 312 { 254 my_convSingNFlintN_QQ(c, number(pGetCoeff(p))); 255 fmpq_gcd(arg->content, arg->content, c); 313 number n = number(pGetCoeff(p)); 314 315 if (fmpq_is_one(arg->content) && (SR_HDL(n)&SR_INT || n->s >= 3)) 316 { 317 /* content is 1 and n is an integer, nothing to do */ 318 } 319 else 320 { 321 my_convSingNFlintN_QQ(c, n); 322 fmpq_gcd(arg->content, arg->content, c); 323 } 256 324 257 325 #if SIZEOF_LONG==8 … … 293 361 } 294 362 363 slong N = mpoly_words_per_exp(base->res->zpoly->bits, base->ctx->zctx->minfo); 364 fmpz * res_coeffs = base->res->zpoly->coeffs; 365 ulong * res_exps = base->res->zpoly->exps; 366 flint_bitcnt_t res_bits = base->res->zpoly->bits; 367 295 368 while (idx < arg->end_idx) 296 369 { 297 my_convSingNFlintN_QQ(c, number(pGetCoeff(p))); 298 FLINT_ASSERT(!fmpq_is_zero(base->res->content)); 299 fmpq_div(t, c, base->res->content); 300 FLINT_ASSERT(fmpz_is_one(fmpq_denref(t))); 301 302 slong N = mpoly_words_per_exp(base->res->zpoly->bits, base->ctx->zctx->minfo); 303 fmpz_swap(base->res->zpoly->coeffs + idx, fmpq_numref(t)); 370 if (fmpq_is_one(base->res->content)) 371 { 372 // borrowing singular integers 373 // the entry res_coeffs[idx] is junk, we should just overwrite it 374 375 number n = number(pGetCoeff(p)); 376 377 if (SR_HDL(n)&SR_INT) 378 { 379 // n is a singular-small integer 380 res_coeffs[idx] = SR_TO_INT(n); 381 } 382 else if (n->s<3) 383 { 384 // n is an element of QQ \ ZZ, should not happen 385 assume(false); 386 } 387 else 388 { 389 // n is a singular-large integer, n may be flint-small 390 res_coeffs[idx] = PTR_TO_COEFF(n->z); 391 if (fmpz_fits_si(res_coeffs + idx)) 392 { 393 slong val = fmpz_get_si(res_coeffs + idx); 394 if (val >= COEFF_MIN && val <= COEFF_MAX) 395 res_coeffs[idx] = val; 396 } 397 } 398 } 399 else 400 { 401 my_convSingNFlintN_QQ(c, number(pGetCoeff(p))); 402 FLINT_ASSERT(!fmpq_is_zero(base->res->content)); 403 fmpq_div(t, c, base->res->content); 404 FLINT_ASSERT(fmpz_is_one(fmpq_denref(t))); 405 fmpz_swap(res_coeffs + idx, fmpq_numref(t)); 406 } 407 304 408 #if SIZEOF_LONG==8 305 409 p_GetExpVL(p, (int64*)exp, base->r); 306 mpoly_set_monomial_ui( base->res->zpoly->exps + N*idx, exp, base->res->zpoly->bits, base->ctx->zctx->minfo);410 mpoly_set_monomial_ui(res_exps + N*idx, exp, res_bits, base->ctx->zctx->minfo); 307 411 #else 308 412 p_GetExpV(p, (int*)exp, base->r); 309 mpoly_set_monomial_ui( base->res->zpoly->exps + N*idx, &(exp[1]), base->res->zpoly->bits, base->ctx->minfo);413 mpoly_set_monomial_ui(res_exps + N*idx, &(exp[1]), res_bits, base->ctx->minfo); 310 414 #endif 311 415 … … 324 428 thread_pool_handle * handles; 325 429 slong num_handles; 326 slong thread_limit = 1000; 327 328 /* get workers */ 430 slong thread_limit = 1000; // TODO: should be paramter to this function 431 432 /* the constructor works out the length of p and sets some markers */ 433 convert_sing_to_fmpq_mpoly_base base(res, ctx, r, p); 434 435 /* sensibly limit thread count and get workers */ 436 thread_limit = FLINT_MIN(thread_limit, base.length/1024); 329 437 handles = NULL; 330 438 num_handles = 0; … … 340 448 } 341 449 342 convert_sing_to_fmpq_mpoly_base base(num_handles + 1, res, ctx, r, p);343 344 450 /* fill in thread division points */ 451 base.num_threads = 1 + num_handles; 345 452 convert_sing_to_fmpq_mpoly_arg * args = new convert_sing_to_fmpq_mpoly_arg[base.num_threads]; 346 453 slong cur_idx = 0; … … 348 455 { 349 456 slong next_idx = i + 1 < base.num_threads ? (i + 1)*base.length/base.num_threads : base.length; 457 FLINT_ASSERT(cur_idx <= base.length); 350 458 next_idx = FLINT_MAX(next_idx, cur_idx); 351 459 next_idx = FLINT_MIN(next_idx, base.length); … … 367 475 required_bits = FLINT_MAX(required_bits, args[i].required_bits); 368 476 369 /* initialize res with optimal bits */370 fmpq_mpoly_init3(res, base.length, mpoly_fix_bits(required_bits, ctx->zctx->minfo), ctx);371 372 477 /* sign of content should match sign of first coeff */ 373 fmpq_zero(base.res->content); 478 fmpq_t content; 479 fmpq_init(content); 480 fmpq_zero(content); 374 481 for (slong i = 0; i < base.num_threads; i++) 375 fmpq_gcd( base.res->content, base.res->content, args[i].content);482 fmpq_gcd(content, content, args[i].content); 376 483 if (p != NULL) 377 484 { … … 380 487 my_convSingNFlintN_QQ(c, number(pGetCoeff(p))); 381 488 if (fmpq_sgn(c) < 0) 382 fmpq_neg( base.res->content, base.res->content);489 fmpq_neg(content, content); 383 490 fmpq_clear(c); 384 491 } 492 493 /* initialize res with optimal bits */ 494 required_bits = mpoly_fix_bits(required_bits, ctx->zctx->minfo); 495 if (fmpq_is_one(content)) 496 { 497 /* initialize borrowed coeffs */ 498 slong N = mpoly_words_per_exp(required_bits, ctx->zctx->minfo); 499 slong alloc = base.length; 500 if (alloc != 0) 501 { 502 res->zpoly->coeffs = (fmpz *) flint_malloc(alloc*sizeof(fmpz)); 503 res->zpoly->exps = (ulong *) flint_malloc(alloc*N*sizeof(ulong)); 504 } 505 else 506 { 507 res->zpoly->coeffs = NULL; 508 res->zpoly->exps = NULL; 509 } 510 res->zpoly->alloc = alloc; 511 res->zpoly->length = 0; 512 res->zpoly->bits = required_bits; 513 514 fmpq_init(res->content); 515 fmpq_one(res->content); 516 } 517 else 518 { 519 /* initialize coeffs that will be created and destroyed */ 520 fmpq_mpoly_init3(res, base.length, required_bits, ctx); 521 fmpq_swap(res->content, content); 522 } 523 524 fmpq_clear(content); 385 525 386 526 /* fill in res->zpoly */ … … 468 608 thread_pool_handle * handles; 469 609 slong num_handles; 470 slong thread_limit = 1000; 471 472 /* get workers */ 610 slong thread_limit = 1000;// TODO: should be paramter to this function 611 612 /* sensibly limit threads and get workers */ 613 thread_limit = FLINT_MIN(thread_limit, f->zpoly->length/1024); 473 614 handles = NULL; 474 615 num_handles = 0; … … 485 626 486 627 convert_fmpq_mpoly_to_sing_base base(num_handles + 1, f, ctx, r); 487 488 628 convert_fmpq_mpoly_to_sing_arg * args = new convert_fmpq_mpoly_to_sing_arg[base.num_threads]; 489 629 slong cur_idx = 0; … … 492 632 slong next_idx = i + 1 < base.num_threads ? (i + 1)*base.f->zpoly->length/base.num_threads 493 633 : base.f->zpoly->length; 634 FLINT_ASSERT(cur_idx <= base.f->zpoly->length); 494 635 next_idx = FLINT_MAX(next_idx, cur_idx); 495 636 next_idx = FLINT_MIN(next_idx, base.f->zpoly->length); … … 542 683 ring r; 543 684 544 convert_sing_to_nmod_mpoly_base( slong num_threads_,nmod_mpoly_struct * res_,545 546 : num_threads( num_threads_),685 convert_sing_to_nmod_mpoly_base(nmod_mpoly_struct * res_, 686 const nmod_mpoly_ctx_struct * ctx_, const ring r_, poly p) 687 : num_threads(0), 547 688 res(res_), 548 689 ctx(ctx_), … … 624 765 } 625 766 767 slong N = mpoly_words_per_exp(base->res->bits, base->ctx->minfo); 768 ulong * res_coeffs = base->res->coeffs; 769 ulong * res_exps = base->res->exps; 770 flint_bitcnt_t res_bits = base->res->bits; 771 626 772 while (idx < arg->end_idx) 627 773 { 628 slong N = mpoly_words_per_exp(base->res->bits, base->ctx->minfo);629 774 #if SIZEOF_LONG==8 630 775 p_GetExpVL(p, (int64*)exp, base->r); 631 mpoly_set_monomial_ui( base->res->exps + N*idx, exp, base->res->bits, base->ctx->minfo);776 mpoly_set_monomial_ui(res_exps + N*idx, exp, res_bits, base->ctx->minfo); 632 777 #else 633 778 p_GetExpV(p, (int*)exp, base->r); 634 mpoly_set_monomial_ui( base->res->exps + N*idx, &(exp[1]), base->res->bits, base->ctx->minfo);779 mpoly_set_monomial_ui(res_exps + N*idx, &(exp[1]), res_bits, base->ctx->minfo); 635 780 #endif 636 781 637 base->res->coeffs[idx] = (ulong)(number(pGetCoeff(p)));782 res_coeffs[idx] = (ulong)(number(pGetCoeff(p))); 638 783 639 784 pIter(p); … … 649 794 thread_pool_handle * handles; 650 795 slong num_handles; 651 slong thread_limit = 1000; 652 653 /* get workers */ 796 slong thread_limit = 1000; // TODO: should be paramter to this function 797 798 /* the constructor works out the length of p and sets some markers */ 799 convert_sing_to_nmod_mpoly_base base(res, ctx, r, p); 800 801 /* sensibly limit thread count and get workers */ 802 thread_limit = FLINT_MIN(thread_limit, base.length/1024); 654 803 handles = NULL; 655 804 num_handles = 0; … … 665 814 } 666 815 667 convert_sing_to_nmod_mpoly_base base(num_handles + 1, res, ctx, r, p);668 669 816 /* fill in thread division points */ 817 base.num_threads = 1 + num_handles; 670 818 convert_sing_to_nmod_mpoly_arg * args = new convert_sing_to_nmod_mpoly_arg[base.num_threads]; 671 819 slong cur_idx = 0; … … 674 822 slong next_idx = i + 1 < base.num_threads ? (i + 1)*base.length/base.num_threads 675 823 : base.length; 824 FLINT_ASSERT(cur_idx <= base.length); 676 825 next_idx = FLINT_MAX(next_idx, cur_idx); 677 826 next_idx = FLINT_MIN(next_idx, base.length); … … 777 926 thread_pool_handle * handles; 778 927 slong num_handles; 779 slong thread_limit = 1000; 780 781 /* get workers */ 928 slong thread_limit = 1000; // TODO: should be paramter to this function 929 930 /* sensibly limit threads and get workers */ 931 thread_limit = FLINT_MIN(thread_limit, f->length/1024); 782 932 handles = NULL; 783 933 num_handles = 0; … … 794 944 795 945 convert_nmod_mpoly_to_sing_base base(num_handles + 1, f, ctx, r); 796 797 946 convert_nmod_mpoly_to_sing_arg * args = new convert_nmod_mpoly_to_sing_arg[base.num_threads]; 798 947 slong cur_idx = 0; … … 801 950 slong next_idx = i + 1 < base.num_threads ? (i + 1)*base.f->length/base.num_threads 802 951 : base.f->length; 952 FLINT_ASSERT(cur_idx <= base.f->length); 803 953 next_idx = FLINT_MAX(next_idx, cur_idx); 804 954 next_idx = FLINT_MIN(next_idx, base.f->length); … … 845 995 { 846 996 fmpq_mpoly_t pp,qq,res; 847 convSingPFlintMP(pp,ctx,p,lp,r); 848 convSingPFlintMP(qq,ctx,q,lq,r); 997 convSingPFlintMP(pp,ctx,p,lp,r); // pp read only 998 convSingPFlintMP(qq,ctx,q,lq,r); // qq read only 849 999 fmpq_mpoly_init(res,ctx); 850 1000 fmpq_mpoly_mul(res,pp,qq,ctx); 851 1001 poly pres=convFlintMPSingP(res,ctx,r); 852 1002 fmpq_mpoly_clear(res,ctx); 853 fmpq_mpoly_clear(pp,ctx);854 fmpq_mpoly_clear(qq,ctx);1003 _fmpq_mpoly_clear_readonly_sing(pp,ctx); 1004 _fmpq_mpoly_clear_readonly_sing(qq,ctx); 855 1005 fmpq_mpoly_ctx_clear(ctx); 856 1006 p_Test(pres,r); … … 878 1028 { 879 1029 fmpq_mpoly_t pp,qq,res; 880 convSingPFlintMP(pp,ctx,p,lp,r); 881 convSingPFlintMP(qq,ctx,q,lq,r); 1030 convSingPFlintMP(pp,ctx,p,lp,r); // pp read only 1031 convSingPFlintMP(qq,ctx,q,lq,r); // qq read only 882 1032 fmpq_mpoly_init(res,ctx); 883 1033 fmpq_mpoly_divides(res,pp,qq,ctx); 884 1034 poly pres = convFlintMPSingP(res,ctx,r); 885 1035 fmpq_mpoly_clear(res,ctx); 886 fmpq_mpoly_clear(pp,ctx);887 fmpq_mpoly_clear(qq,ctx);1036 _fmpq_mpoly_clear_readonly_sing(pp,ctx); 1037 _fmpq_mpoly_clear_readonly_sing(qq,ctx); 888 1038 fmpq_mpoly_ctx_clear(ctx); 889 1039 p_Test(pres,r); … … 934 1084 { 935 1085 fmpq_mpoly_t pp,qq,res; 936 convSingPFlintMP(pp,ctx,p,lp,r); 937 convSingPFlintMP(qq,ctx,q,lq,r); 1086 convSingPFlintMP(pp,ctx,p,lp,r); // pp read only 1087 convSingPFlintMP(qq,ctx,q,lq,r); // qq read only 938 1088 fmpq_mpoly_init(res,ctx); 939 1089 int ok=fmpq_mpoly_gcd(res,pp,qq,ctx); … … 959 1109 } 960 1110 fmpq_mpoly_clear(res,ctx); 961 fmpq_mpoly_clear(pp,ctx);962 fmpq_mpoly_clear(qq,ctx);1111 _fmpq_mpoly_clear_readonly_sing(pp,ctx); 1112 _fmpq_mpoly_clear_readonly_sing(qq,ctx); 963 1113 fmpq_mpoly_ctx_clear(ctx); 964 1114 return pres; -
libpolys/polys/monomials/ring.cc
r48f20b r9102bb 432 432 if (rIsLPRing(r)) 433 433 { 434 Print("\n// letterplace ring (block size %d )",r->isLPring);434 Print("\n// letterplace ring (block size %d, ncgen count %d)",r->isLPring, r->LPncGenCount); 435 435 } 436 436 #endif … … 1393 1393 #ifdef HAVE_SHIFTBBA 1394 1394 res->isLPring=r->isLPring; /* 0 for non-letterplace rings, otherwise the number of LP blocks, at least 1, known also as lV */ 1395 res->LPncGenCount=r->LPncGenCount; 1395 1396 #endif 1396 1397 … … 1522 1523 #ifdef HAVE_SHIFTBBA 1523 1524 res->isLPring=r->isLPring; /* 0 for non-letterplace rings, otherwise the number of LP blocks, at least 1, known also as lV */ 1525 res->LPncGenCount=r->LPncGenCount; 1524 1526 #endif 1525 1527 … … 1667 1669 #ifdef HAVE_SHIFTBBA 1668 1670 if (r1->isLPring!=r2->isLPring) return FALSE; 1671 if (r1->LPncGenCount!=r2->LPncGenCount) return FALSE; 1669 1672 #endif 1670 1673 -
libpolys/polys/monomials/ring.h
r48f20b r9102bb 312 312 #ifdef HAVE_SHIFTBBA 313 313 short isLPring; /* 0 for non-letterplace rings, otherwise the number of LP blocks, at least 1, known also as lV */ 314 short LPncGenCount; 314 315 #endif 315 316 -
libpolys/polys/operations/p_Mult_q.cc
rf006a1 r9102bb 67 67 } 68 68 69 static void pqLengthApprox(poly p, poly q, int &lp, int &lq, const int min) 70 { 71 int l = 0; 72 73 do 74 { 75 if (p == NULL) 76 { 77 lp=l; 78 lq=l+(q!=NULL); 79 return; 80 } 81 if (q == NULL) /* && p!=NULL */ 82 { 83 lp=l+1; 84 lq=l; 85 return; 86 } 87 if (l>min) /* && p,q!=NULL */ 88 { 89 lp=l; lq=l; 90 return; 91 } 92 pIter(p); 93 pIter(q); 94 l++; 95 } 96 while (1); 97 } 98 69 99 70 100 static poly _p_Mult_q_Bucket(poly p, const int lp, … … 290 320 poly pt; 291 321 292 pqLength(p, q, lp, lq, MIN_LENGTH_FACTORY); 322 // MIN_LENGTH_FACTORY must be >= MIN_LENGTH_FACTORY_QQ, MIN_FLINT_QQ, MIN_FLINT_Zp 20 323 pqLengthApprox(p, q, lp, lq, MIN_LENGTH_FACTORY); 293 324 294 325 if (lp < lq) … … 309 340 if (pure_polys && rField_is_Q(r) && !convSingRFlintR(ctx,r)) 310 341 { 311 lp=pLength(p); 312 //printf("mul in flint\n"); 313 poly res=Flint_Mult_MP(p,lp,q,lq,ctx,r); 342 // lq is a lower bound for the length of p and q 343 poly res=Flint_Mult_MP(p,lq,q,lq,ctx,r); 314 344 if (!copy) 315 345 { … … 325 355 if (pure_polys && rField_is_Zp(r) && !convSingRFlintR(ctx,r)) 326 356 { 327 lp=pLength(p); 328 //printf("mul in flint\n"); 329 poly res=Flint_Mult_MP(p,lp,q,lq,ctx,r); 357 // lq is a lower bound for the length of p and q 358 poly res=Flint_Mult_MP(p,lq,q,lq,ctx,r); 330 359 if (!copy) 331 360 { … … 357 386 { 358 387 lp=pLength(p); 359 assume(lq == pLength(q));388 lq=pLength(q); 360 389 return _p_Mult_q_Bucket(p, lp, q, lq, copy, r); 361 390 } -
libpolys/polys/shiftop.cc
r48f20b r9102bb 529 529 PrintLn(); WriteLPExpV(m1ExpV, ri); 530 530 #endif 531 assume(_p_mLPNCGenValid(m1ExpV, ri)); 531 532 } 532 533 … … 564 565 PrintLn(); WriteLPExpV(m1ExpV, ri); 565 566 #endif 567 assume(_p_mLPNCGenValid(m1ExpV, ri)); 566 568 } 567 569 … … 608 610 assume(p_FirstVblock(m1,r) <= 1); 609 611 assume(p_FirstVblock(m2,r) <= 1); 612 } 613 614 BOOLEAN _p_mLPNCGenValid(int *mExpV, const ring r) 615 { 616 BOOLEAN hasNCGen = FALSE; 617 int lV = r->isLPring; 618 int degbound = r->N/lV; 619 int ncGenCount = r->LPncGenCount; 620 for (int i = 1; i <= degbound; i++) 621 { 622 for (int j = i*lV; j > (i*lV - ncGenCount); j--) 623 { 624 if (mExpV[j]) 625 { 626 if (hasNCGen) 627 { 628 return FALSE; 629 } 630 hasNCGen = TRUE; 631 } 632 } 633 } 634 return TRUE; 610 635 } 611 636 … … 673 698 if (B[j]!=0) break; 674 699 } 675 /* do not need e anymore */ 700 701 if (j==0) 702 { 703 omFreeSize((ADDRESS) e, (r->N+1)*sizeof(int)); 704 omFreeSize((ADDRESS) B, (b+1)*sizeof(int)); 705 return 1; 706 } 707 708 if (!_p_mLPNCGenValid(e, r)) 709 { 710 omFreeSize((ADDRESS) e, (r->N+1)*sizeof(int)); 711 omFreeSize((ADDRESS) B, (b+1)*sizeof(int)); 712 return 0; 713 } 714 676 715 omFreeSize((ADDRESS) e, (r->N+1)*sizeof(int)); 677 716 678 if (j==0) goto ret_true;679 717 // { 680 718 // /* it is a zero exp vector, which is in V */ … … 688 726 { 689 727 omFreeSize((ADDRESS) B, (b+1)*sizeof(int)); 690 return (0);691 } 692 } 693 ret_true: 728 return 0; 729 } 730 } 731 694 732 omFreeSize((ADDRESS) B, (b+1)*sizeof(int)); 695 return (1);733 return 1; 696 734 } 697 735 … … 783 821 } 784 822 785 ring freeAlgebra(ring r, int d) 786 { 823 ring freeAlgebra(ring r, int d, int ncGenCount) 824 { 825 if (ncGenCount) r = rCopy0(r); 826 for (int i = 1; i <= ncGenCount; i++) 827 { 828 char *varname=(char *)omAlloc(256); 829 sprintf(varname, "ncgen(%d)", i); 830 ring save = r; 831 r = rPlusVar(r, varname, 0); 832 omFreeSize(varname, 256); 833 rDelete(save); 834 } 787 835 ring R=rCopy0(r); 788 836 int p; … … 795 843 R->N=r->N*d; 796 844 R->isLPring=r->N; 845 R->LPncGenCount=ncGenCount; 797 846 // create R->order 798 847 BOOLEAN has_order_a=FALSE; … … 883 932 R->names=names; 884 933 934 if (ncGenCount) rDelete(r); 885 935 rComplete(R,TRUE); 886 936 return R; -
libpolys/polys/shiftop.h
r48f20b r9102bb 55 55 BOOLEAN _p_LPLmDivisibleByNoComp(poly a, poly b, const ring r); 56 56 57 BOOLEAN _p_mLPNCGenValid(int *mExpV, const ring r); 58 57 59 poly p_LPVarAt(poly p, int pos, const ring r); 58 60 59 61 /// create the letterplace ring corresponding to r up to degree d 60 ring freeAlgebra(ring r, int d );62 ring freeAlgebra(ring r, int d, int LPncGenCount = 0); 61 63 #endif 62 64 #endif
Note: See TracChangeset
for help on using the changeset viewer.