Changeset 18dd47 in git
- Timestamp:
- Aug 12, 1997, 4:01:11 PM (26 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 573ae7acc2dadf68863ca5ee07211c1e9a07b3fb
- Parents:
- 9e76269b6654f6e38d3546d04b318c6693f2f4d9
- Location:
- Singular/LIB
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/finvar.lib
r9e7626 r18dd47 1 // $Header: /exports/cvsroot-2/cvsroot/Singular/LIB/finvar.lib,v 1. 3 1997-08-04 14:46:49Singular Exp $1 // $Header: /exports/cvsroot-2/cvsroot/Singular/LIB/finvar.lib,v 1.4 1997-08-12 14:01:05 Singular Exp $ 2 2 //////////////////////////////////////////////////////////////////////////////// 3 3 // send bugs and comments to agnes@math.uni-sb.de … … 958 958 { if (i<p^j) // finding an upper bound on i 959 959 { for (k=0;k<j-1;k=k+1) 960 { out=out+((i /p^k)%p)*a^k;// finding how often p^k is contained in960 { out=out+((i div p^k)%p)*a^k; // finding how often p^k is contained in 961 961 } // i 962 out=out+(i /p^(j-1))*a^(j-1);962 out=out+(i div p^(j-1))*a^(j-1); 963 963 if (defined(bool)=voice) 964 964 { return((-1)*out); … … 988 988 for (i=2;i<=m;i=i+1) 989 989 { degvec[i]=deg(Q[i]); 990 lcm=lcm*degvec[i] /gcd(lcm,degvec[i]); // lcm is now the least common990 lcm=lcm*degvec[i] div gcd(lcm,degvec[i]); // lcm is now the least common 991 991 } // multiple of the first i elements of Q 992 992 ideal A(1)=Q; 993 993 for (i=1;i<=m;i=i+1) 994 { A(1)[i]=(A(1)[i])^(lcm /degvec[i]); // now all elements in A(1) are of the994 { A(1)[i]=(A(1)[i])^(lcm div degvec[i]); // now all elements in A(1) are of the 995 995 } // same degree, they are the elements of 996 996 // Q raised to a power - … … 1001 1001 kill I; 1002 1002 if ((n%2)==0) // H(1) ought to be of the form: 1003 { j= int(n)/int(2);// 1,0,...,0,0,1,0,...,01003 { j=n div 2; // 1,0,...,0,0,1,0,...,0 1004 1004 } // 0,0,...,0,1,0,0,...,0 1005 1005 else // . . 1006 { j= int(n-1)/int(2);// . .1006 { j=(n-1) div 2; // . . 1007 1007 } // . . 1008 1008 for (i=1;i<=j;i=i+1) // 1,0,...,0,0,0,0,...,0 … … 1143 1143 { d=d*deg(P[i]); // building the product of the degrees of 1144 1144 } // primary invariants - 1145 int bound=d /g;// number of secondary invariants1145 int bound=d div g; // number of secondary invariants 1146 1146 if (v) 1147 1147 { " The invariant ring is Cohen-Macaulay."; 1148 " We need to find "+string(d)+" /"+string(g)+"="+string(bound)+" secondary invariants.";1148 " We need to find "+string(d)+" div "+string(g)+"="+string(bound)+" secondary invariants."; 1149 1149 ""; 1150 1150 } -
Singular/LIB/general.lib
r9e7626 r18dd47 1 // $Id: general.lib,v 1. 3 1997-07-10 14:02:30Singular Exp $1 // $Id: general.lib,v 1.4 1997-08-12 14:01:07 Singular Exp $ 2 2 //system("random",787422842); 3 3 //(GMG, last modified 22.06.96) … … 273 273 { 274 274 s = e[m]+u[m+1]; 275 u[m] = s /(m+1);275 u[m] = s div (m+1); 276 276 e[m] = s%(m+1); 277 277 } … … 303 303 intvec r,p,B,Prelim; 304 304 string result,prelim; 305 N = (10*n) /3 + 2;305 N = (10*n) div 3 + 2; 306 306 p[N+1]=0; p=p+2; r=p; 307 307 for( i=1; i<=N+1; i=i+1 ) { B[i]=2*i-1; } … … 317 317 { 318 318 r[m] = e%B[m]; 319 q = e /B[m];319 q = e div B[m]; 320 320 e = q*(m-1)+p[m-1]; 321 321 } 322 322 r[1] = e%10; 323 q = e /10;323 q = e div 10; 324 324 if( q!=10 and q!=9 ) 325 325 { … … 335 335 if( q==10 ) 336 336 { 337 Prelim = (Prelim+1)-((Prelim+1) /10)*10;337 Prelim = (Prelim+1)-((Prelim+1) div 10)*10; 338 338 for( m=size(Prelim); m>0; m=m-1) 339 339 { -
Singular/LIB/matrix.lib
r9e7626 r18dd47 1 // $Id: matrix.lib,v 1. 2 1997-04-28 19:27:22 obachmanExp $1 // $Id: matrix.lib,v 1.3 1997-08-12 14:01:08 Singular Exp $ 2 2 // (GMG/BM, last modified 22.06.96) 3 3 /////////////////////////////////////////////////////////////////////////////// … … 295 295 print(A); 296 296 int n=4; 297 ideal i = ideal(randommat(1,n*(n-1) /2,maxideal(1),9));297 ideal i = ideal(randommat(1,n*(n-1) div 2,maxideal(1),9)); 298 298 print(skewmat(n,i)); // skew matrix of generic linear forms 299 299 kill R1; … … 351 351 print(A); 352 352 int n=3; 353 ideal i = ideal(randommat(1,n*(n+1) /2,maxideal(1),9));353 ideal i = ideal(randommat(1,n*(n+1) div 2,maxideal(1),9)); 354 354 print(symmat(n,i)); // symmetric matrix of generic linear forms 355 355 kill R1; -
Singular/LIB/poly.lib
r9e7626 r18dd47 1 // $Id: poly.lib,v 1. 6 1997-08-04 15:14:19Singular Exp $1 // $Id: poly.lib,v 1.7 1997-08-12 14:01:08 Singular Exp $ 2 2 //system("random",787422842); 3 3 //(GMG, last modified 22.06.96) … … 208 208 while ( c-jet(c,i) != 0 ) { i = 2*(i+1); } 209 209 int o = i-1; 210 int u = (d != i)*((i /2)-1);210 int u = (d != i)*((i div 2)-1); 211 211 //----------------------- "quick search" for maxdeg ------------------------ 212 212 while ( (c-jet(c,i)==0)*(c-jet(c,i-1)!=0) == 0) 213 213 { 214 i = (o+1+u) /2;214 i = (o+1+u) div 2; 215 215 if (c-jet(c,i)!=0) { u = i+1; } 216 216 else { o = i-1; } … … 263 263 i = -d; 264 264 while ( c == jet(c,i,v) ) { i = 2*(i-1); } 265 int o = (d != -i)*((i /2)+2) - 1;265 int o = (d != -i)*((i div 2)+2) - 1; 266 266 int u = i+1; 267 267 int e = -1; … … 271 271 while ( c != jet(c,i,v) ) { i = 2*(i+1); } 272 272 int o = i-1; 273 int u = (d != i)*((i /2)-1);273 int u = (d != i)*((i div 2)-1); 274 274 int e = 1; 275 275 } … … 277 277 while ( ( c==jet(c,i,v) )*( c!=jet(c,i-1,v) ) == 0 ) 278 278 { 279 i = (o+e+u) /2;279 i = (o+e+u) div 2; 280 280 if ( c!=jet(c,i,v) ) { u = i+1; } 281 281 else { o = i-1; } … … 341 341 while ( jet(c,i) == 0 ) { i = 2*(i+1); } 342 342 int o = i-1; 343 int u = (d != i)*((i /2)-1);343 int u = (d != i)*((i div 2)-1); 344 344 //----------------------- "quick search" for mindeg ------------------------ 345 345 while ( (jet(c,u)==0)*(jet(c,o)!=0) ) 346 346 { 347 i = (o+u) /2;347 i = (o+u) div 2; 348 348 if (jet(c,i)==0) { u = i+1; } 349 349 else { o = i-1; } … … 397 397 i = -d; 398 398 while ( jet(c,i,v) != 0 ) { i = 2*(i-1); } 399 int o = (d != -i)*((i /2)+2) - 1;399 int o = (d != -i)*((i div 2)+2) - 1; 400 400 int u = i+1; 401 401 int e = -1; i=u; … … 405 405 while ( jet(c,i,v) == 0 ) { i = 2*(i+1); } 406 406 int o = i-1; 407 int u = (d != i)*((i /2)-1);407 int u = (d != i)*((i div 2)-1); 408 408 int e = 1; i=u; 409 409 } … … 411 411 while ( (jet(c,i-1,v)==0)*(jet(c,i,v)!=0) == 0 ) 412 412 { 413 i = (o+e+u) /2;413 i = (o+e+u) div 2; 414 414 if (jet(c,i,v)==0) { u = i+1; } 415 415 else { o = i-1; } -
Singular/LIB/prim_dec.lib
r9e7626 r18dd47 1 // $Id: prim_dec.lib,v 1. 3 1997-08-04 15:14:20Singular Exp $1 // $Id: prim_dec.lib,v 1.4 1997-08-12 14:01:09 Singular Exp $ 2 2 /////////////////////////////////////////////////////// 3 3 // pseudoprimdec.lib … … 16 16 // If choose=1, the system tries to find an "optimal ordering", 17 17 // which in some cases may considerably speed up the algorithm 18 18 19 19 // You may also may want to try one of the algorithms for 20 20 // minimal associated primes in the the library … … 22 22 // These algorithms are variants of the algorithm 23 23 // of Gianni-Trager-Zacharias 24 24 25 25 prim_dec (ideal I, int choose) 26 26 27 27 // Computes a complete primary decomposition via 28 28 // a variant of the pseudoprimary approach of 29 29 // Shimoyama-Yokoyama. 30 30 // The integer choose must be either 0, 1, 2 or 3. 31 // If choose=0, min_ass_prim_charsets with the given 31 // If choose=0, min_ass_prim_charsets with the given 32 32 // ordering of the variables is used. 33 33 // If choose=1, min_ass_prim_charsets with the "optimized" … … 49 49 proc ini_mod(poly p) 50 50 { 51 if (p==0) 51 if (p==0) 52 52 { 53 53 return(0); … … 90 90 { 91 91 verbose(notWarnSB); 92 } 92 } 93 93 if(cho==0) 94 94 { … … 102 102 /////////////////////////////////////////////////////// 103 103 // min_ass_prim_charsets0 104 // input: generators of an ideal PS 104 // input: generators of an ideal PS 105 105 // output: the minimal associated primes of PS 106 106 // algorithm: via characteristic sets … … 111 111 proc min_ass_prim_charsets0 (ideal PS) 112 112 { 113 114 matrix m=char_series(PS); // We compute an irreducible 115 // characteristic series 113 114 matrix m=char_series(PS); // We compute an irreducible 115 // characteristic series 116 116 int i,j,k; 117 117 list PSI; … … 123 123 // We compute the radical of each ideal in PHI 124 124 ideal I,JS,II; 125 int sizeJS, sizeII; 125 int sizeJS, sizeII; 126 126 for(i=size(PHI);i>=1; i--) 127 127 { … … 138 138 sizeII=0; 139 139 k=0; 140 while(k<=sizeII) // successive saturation 140 while(k<=sizeII) // successive saturation 141 141 { 142 142 option(returnSB); … … 156 156 sizeJS=sizeII; 157 157 } 158 } 158 } 159 159 PSI=insert(PSI,JS); 160 160 } … … 196 196 /////////////////////////////////////////////////////// 197 197 // min_ass_prim_charsets1 198 // input: generators of an ideal PS 198 // input: generators of an ideal PS 199 199 // output: the minimal associated primes of PS 200 200 // algorithm: via characteristic sets … … 211 211 execute "ring r="+charstr(oldring)+",("+n+"),dp;"; 212 212 ideal PS=imap(oldring,PS); 213 matrix m=char_series(PS); // We compute an irreducible 214 // characteristic series 213 matrix m=char_series(PS); // We compute an irreducible 214 // characteristic series 215 215 int i,j,k; 216 216 ideal I; … … 225 225 { 226 226 I=I,ini_mod(PHI[i][j]); 227 } 227 } 228 228 I=I[2..ncols(I)]; 229 229 ITPHI[i]=I; … … 235 235 // We compute the radical of each ideal in PHI 236 236 ideal I,JS,II; 237 int sizeJS, sizeII; 237 int sizeJS, sizeII; 238 238 for(i=size(PHI);i>=1; i--) 239 239 { … … 268 268 sizeJS=sizeII; 269 269 } 270 } 270 } 271 271 PSI=insert(PSI,JS); 272 272 } … … 310 310 // proc prim_dec 311 311 // input: generators of an ideal I and an integer choose 312 // If choose=0, min_ass_prim_charsets with the given 312 // If choose=0, min_ass_prim_charsets with the given 313 313 // ordering of the variables is used. 314 314 // If choose=1, min_ass_prim_charsets with the "optimized" … … 317 317 // If choose=3, minAssPrimes+factorizing Buchberger from primdec.lib is used 318 318 // output: a primary decomposition of I, i.e., a list 319 // of pairs consisting of a standard basis of a primary component 319 // of pairs consisting of a standard basis of a primary component 320 320 // of I and a standard basis of the corresponding associated prime. 321 321 // To compute the minimal associated primes of a given ideal 322 322 // min_ass_prim_l is called, i.e., the minimal associated primes 323 323 // are computed via characteristic sets. 324 // In the homogeneous case, the performance of the procedure 325 // will be improved if I is already given by a minimal set of 324 // In the homogeneous case, the performance of the procedure 325 // will be improved if I is already given by a minimal set of 326 326 // generators. Apply minbase if necessary. 327 327 ////////////////////////////////////////////////////////// 328 328 329 329 330 330 proc prim_dec(ideal I, int choose) 331 331 { … … 338 338 { 339 339 verbose(notWarnSB); 340 } 340 } 341 341 ideal H=1; // The intersection of the primary components 342 list U; // the leaves of the decomposition tree, i.e., 343 // pairs consisting of a primary component of I 342 list U; // the leaves of the decomposition tree, i.e., 343 // pairs consisting of a primary component of I 344 344 // and the corresponding associated prime 345 345 list W; // the non-leaf vertices in the decomposition tree. 346 346 // every entry has 6 components: 347 // 1- the vertex itself , i.e., a standard bais of the 348 // given ideal I (type 1), or a standard basis of a 349 // pseudo-primary component arising from 347 // 1- the vertex itself , i.e., a standard bais of the 348 // given ideal I (type 1), or a standard basis of a 349 // pseudo-primary component arising from 350 350 // pseudo-primary decomposition (type 2), or a 351 // standard basis of a remaining component arising from 351 // standard basis of a remaining component arising from 352 352 // pseudo-primary decomposition or extraction (type 3) 353 353 // 2- the type of the vertex as indicated above … … 359 359 // basis of a minimal associated prime ideal 360 360 // of the father of the vertex and the 361 // irreducible factors of the "minimal 361 // irreducible factors of the "minimal 362 362 // divisor" of the seperator or extractor 363 // corresponding to the prime ideal 363 // corresponding to the prime ideal 364 364 // as computed by the procedure minsat, 365 // if the vertex is of type 3, or 365 // if the vertex is of type 3, or 366 366 // the empty list otherwise 367 367 ideal SI=std(I); 368 368 int ncolsSI=ncols(SI); 369 int ncolsH=1; 369 int ncolsH=1; 370 370 W[1]=list(I,1,0,poly(1),ideal(0),list()); // The root of the tree 371 371 int weighted_tree_depth; … … 376 376 list QQ; 377 377 list WI; 378 ideal Qi,SQ,SRest,fac; 379 poly tester; 380 378 ideal Qi,SQ,SRest,fac; 379 poly tester; 380 381 381 while(1) 382 382 { … … 401 401 { 402 402 SQ,SRest,fac=extraction(V[1],V[5]); 403 // standard basis of primary component, 403 // standard basis of primary component, 404 404 // standard basis of remaining component, 405 // irreducible factors of 406 // the "minimal divisor" of the extractor 405 // irreducible factors of 406 // the "minimal divisor" of the extractor 407 407 // as computed by the procedure minsat, 408 408 check=0; … … 429 429 for(j=1;j<=ncolsSI;j++) 430 430 { 431 if(leadexp(H[j])!=leadexp(SI[j])) 431 if(leadexp(H[j])!=leadexp(SI[j])) 432 432 { 433 433 check=1; … … 445 445 } 446 446 } 447 if (SRest[1]!=1) // the remaining component is not 447 if (SRest[1]!=1) // the remaining component is not 448 448 // the whole ring 449 449 { 450 if (rad_con(V[4],SRest)==0) // the new vertex is not the 450 if (rad_con(V[4],SRest)==0) // the new vertex is not the 451 451 // root of a redundant subtree 452 452 { … … 457 457 VV[5]=ideal(0); 458 458 VV[6]=list(list(V[5],fac)); 459 W=insert(W,VV,size(W)); 459 W=insert(W,VV,size(W)); 460 460 } 461 461 } … … 465 465 if (V[2]==3) // pseudo_prim_dec_special is needed 466 466 { 467 QQ,SRest=pseudo_prim_dec_special_charsets(V[1],V[6],choose); 468 // QQ = quadruples: 469 // standard basis of pseudo-primary component, 470 // standard basis of corresponding prime, 471 // seperator, irreducible factors of 472 // the "minimal divisor" of the seperator 473 // as computed by the procedure minsat, 474 // SRest=standard basis of remaining component 475 } 476 else // V is the root, pseudo_prim_dec is needed 477 { 478 QQ,SRest=pseudo_prim_dec_charsets(I,SI,choose); 467 QQ,SRest=pseudo_prim_dec_special_charsets(V[1],V[6],choose); 479 468 // QQ = quadruples: 480 469 // standard basis of pseudo-primary component, 481 470 // standard basis of corresponding prime, 482 471 // seperator, irreducible factors of 483 // the "minimal divisor" of the seperator 472 // the "minimal divisor" of the seperator 484 473 // as computed by the procedure minsat, 485 // SRest=standard basis of remaining component 486 487 } 488 //check 474 // SRest=standard basis of remaining component 475 } 476 else // V is the root, pseudo_prim_dec is needed 477 { 478 QQ,SRest=pseudo_prim_dec_charsets(I,SI,choose); 479 // QQ = quadruples: 480 // standard basis of pseudo-primary component, 481 // standard basis of corresponding prime, 482 // seperator, irreducible factors of 483 // the "minimal divisor" of the seperator 484 // as computed by the procedure minsat, 485 // SRest=standard basis of remaining component 486 487 } 488 //check 489 489 for(i=size(QQ);i>=1;i--) 490 490 //for(i=1;i<=size(QQ);i++) 491 491 { 492 tester=QQ[i][3]*V[4]; 492 tester=QQ[i][3]*V[4]; 493 493 Qi=QQ[i][2]; 494 if(NF(tester,Qi,1)!=0) // the new vertex is not the 494 if(NF(tester,Qi,1)!=0) // the new vertex is not the 495 495 // root of a redundant subtree 496 496 { … … 499 499 VV[3]=V[3]+1; 500 500 VV[4]=tester; // the new tester as computed above 501 VV[5]=Qi; // QQ[i][2]; 501 VV[5]=Qi; // QQ[i][2]; 502 502 VV[6]=list(); 503 W=insert(W,VV,size(W)); 504 } 505 } 506 if (SRest[1]!=1) // the remaining component is not 503 W=insert(W,VV,size(W)); 504 } 505 } 506 if (SRest[1]!=1) // the remaining component is not 507 507 // the whole ring 508 508 { … … 512 512 VV[1]=SRest; 513 513 VV[2]=3; 514 VV[3]=V[3]+2; 514 VV[3]=V[3]+2; 515 515 VV[4]=V[4]; // the tester did not change 516 VV[5]=ideal(0); 516 VV[5]=ideal(0); 517 517 WI=list(); 518 518 for(i=1;i<=size(QQ);i++) … … 521 521 } 522 522 VV[6]=WI; 523 W=insert(W,VV,size(W)); 523 W=insert(W,VV,size(W)); 524 524 } 525 525 } … … 532 532 // input: Generators of an arbitrary ideal I, a standard basis SI of I, 533 533 // and an integer choo 534 // If choo=0, min_ass_prim_charsets with the given 534 // If choo=0, min_ass_prim_charsets with the given 535 535 // ordering of the variables is used. 536 536 // If choo=1, min_ass_prim_charsets with the "optimized" … … 539 539 // If choo=3, minAssPrimes+factorizing Buchberger from primdec.lib is used 540 540 // output: a pseudo primary decomposition of I, i.e., a list 541 // of pseudo primary components together with a standard basis of the 541 // of pseudo primary components together with a standard basis of the 542 542 // remaining component. Each pseudo primary component is 543 543 // represented by a quadrupel: A standard basis of the component, … … 550 550 551 551 proc pseudo_prim_dec_charsets (ideal I, ideal SI, int choo) 552 { 552 { 553 553 list L; // The list of minimal associated primes, 554 554 // each one given by a standard basis … … 566 566 { 567 567 L=minAssPrimes(I,1); 568 } 568 } 569 569 for(int i=size(L);i>=1;i=i-1) 570 570 { 571 571 L[i]=std(L[i]); 572 } 572 } 573 573 } 574 574 return (pseudo_prim_dec_i(SI,L)); … … 577 577 //////////////////////////////////////////////////////////////// 578 578 // proc pseudo_prim_dec_special_charsets 579 // input: a standard basis of an ideal I whose radical is the 580 // intersection of the radicals of ideals generated by one prime ideal 579 // input: a standard basis of an ideal I whose radical is the 580 // intersection of the radicals of ideals generated by one prime ideal 581 581 // P_i together with one polynomial f_i, the list V6 must be the list of 582 582 // pairs (standard basis of P_i, irreducible factors of f_i), 583 583 // and an integer choo 584 // If choo=0, min_ass_prim_charsets with the given 584 // If choo=0, min_ass_prim_charsets with the given 585 585 // ordering of the variables is used. 586 586 // If choo=1, min_ass_prim_charsets with the "optimized" 587 587 // ordering of the variables is used. 588 // If choo=2, minAssPrimes from primdec.lib is used 588 // If choo=2, minAssPrimes from primdec.lib is used 589 589 // If choo=3, minAssPrimes+factorizing Buchberger from primdec.lib is used 590 590 // output: a pseudo primary decomposition of I, i.e., a list 591 // of pseudo primary components together with a standard basis of the 591 // of pseudo primary components together with a standard basis of the 592 592 // remaining component. Each pseudo primary component is 593 593 // represented by a quadrupel: A standard basis of the component, … … 631 631 { 632 632 m=minAssPrimes(SP,1); 633 } 633 } 634 634 for(j=size(m);j>=1;j=j-1) 635 635 { 636 636 m[j]=std(m[j]); 637 } 637 } 638 638 } 639 639 dimSP=dim(SP); … … 688 688 // of the minimal associated primes of I 689 689 // output: a pseudo primary decomposition of I, i.e., a list 690 // of pseudo primary components together with a standard basis of the 690 // of pseudo primary components together with a standard basis of the 691 691 // remaining component. Each pseudo primary component is 692 692 // represented by a quadrupel: A standard basis of the component Q_i, … … 703 703 // the ideal is already pseudo primary 704 704 { 705 Q=SI,L[1],1; 705 Q=SI,L[1],1; 706 706 list QQ; 707 707 QQ[1]=Q; … … 719 719 { 720 720 fac=0; 721 for(j=1;j<=sizeL;j++) // compute the seperator sep_i 721 for(j=1;j<=sizeL;j++) // compute the seperator sep_i 722 722 // of the i-th component 723 723 { … … 739 739 SQi,f0,f,fac=minsat_ppd(SI,fac); 740 740 I'=I',f; 741 QP=SQi,L[i],f0,fac; 741 QP=SQi,L[i],f0,fac; 742 742 // the quadrupel: 743 743 // a standard basis of Q_i, 744 // a standard basis of P_i, 745 // sep_i, 744 // a standard basis of P_i, 745 // sep_i, 746 746 // irreducible factors of 747 // the "minimal divisor" of the seperator 747 // the "minimal divisor" of the seperator 748 748 // as computed by the procedure minsat, 749 749 Q[i]=QP; 750 750 } 751 I'=std(I'); 752 return (Q, I'); 751 I'=std(I'); 752 return (Q, I'); 753 753 // I' = remaining component 754 754 } … … 757 757 //////////////////////////////////////////////////////////////// 758 758 // proc extraction 759 // input: A standard basis of a pseudo primary ideal I, and a standard 759 // input: A standard basis of a pseudo primary ideal I, and a standard 760 760 // basis of the unique minimal associated prime P of I 761 // output: an extraction of I, i.e., a standard basis of the primary 761 // output: an extraction of I, i.e., a standard basis of the primary 762 762 // component Q of I with associated prime P, a standard basis of the 763 // remaining component, and the irreducible factors of the 763 // remaining component, and the irreducible factors of the 764 764 // "minimal divisor" of the extractor as computed by the procedure minsat 765 765 //////////////////////////////////////////////////////////////// … … 823 823 f=lcm(g); 824 824 newpoly[1]=f; 825 polys=polys+newpoly; 826 newpoly=list(); 825 polys=polys+newpoly; 826 newpoly=list(); 827 827 } 828 828 f=polys[1]; … … 841 841 { 842 842 f=1; 843 } 843 } 844 844 poly f0,h0; ideal SQ; ideal fac; 845 845 if(f!=1) 846 846 { 847 SQ,f0,h0,fac=minsat(SI,f); 848 return(SQ,std(SI+h0),fac); 849 // the tripel 847 SQ,f0,h0,fac=minsat(SI,f); 848 return(SQ,std(SI+h0),fac); 849 // the tripel 850 850 // a standard basis of Q, 851 // a standard basis of remaining component, 851 // a standard basis of remaining component, 852 852 // irreducible factors of 853 // the "minimal divisor" of the extractor 853 // the "minimal divisor" of the extractor 854 854 // as computed by the procedure minsat 855 855 } … … 863 863 // proc minsat 864 864 // input: a standard basis of an ideal I and a polynomial p 865 // output: a standard basis IS of the saturation of I w.r. to p, 865 // output: a standard basis IS of the saturation of I w.r. to p, 866 866 // the maximal squarefree factor f0 of p, 867 867 // the "minimal divisor" f of f0 such that the saturation of 868 // I w.r. to f equals the saturation of I w.r. to f0 (which is IS), 868 // I w.r. to f equals the saturation of I w.r. to f0 (which is IS), 869 869 // the irreducible factors of f 870 870 ////////////////////////////////////////////////////////// … … 884 884 ideal iold; 885 885 list quotM; 886 quotM[1]=SI; 886 quotM[1]=SI; 887 887 quotM[2]=fac; 888 quotM[3]=f0; 889 // we deal seperately with the first quotient; 888 quotM[3]=f0; 889 // we deal seperately with the first quotient; 890 890 // factors, which do not contribute to this one, 891 891 // are omitted … … 903 903 quotM=minquot(quotM); 904 904 } 905 return(quotM[1],f0,f,fac); // the quadrupel ((I:p),f0,f, //irr. factors of f)906 } 905 return(quotM[1],f0,f,fac); // the quadrupel ((I:p),f0,f, irr. factors of f) 906 } 907 907 908 908 ///////////////////////////////////////////////////// 909 909 // proc minsat_ppd 910 910 // input: a standard basis of an ideal I and a polynomial p 911 // output: a standard basis IS of the saturation of I w.r. to p, 911 // output: a standard basis IS of the saturation of I w.r. to p, 912 912 // the maximal squarefree factor f0 of p, 913 913 // the "minimal divisor" f of f0 such that the saturation of 914 // I w.r. to f equals the saturation of I w.r. to f0 (which is IS), 914 // I w.r. to f equals the saturation of I w.r. to f0 (which is IS), 915 915 // the irreducible factors of f 916 916 ////////////////////////////////////////////////////////// … … 929 929 ideal iold; 930 930 list quotM; 931 quotM[1]=SI; 931 quotM[1]=SI; 932 932 quotM[2]=fac; 933 933 quotM[3]=f0; 934 // we deal seperately with the first quotient; 934 // we deal seperately with the first quotient; 935 935 // factors, which do not contribute to this one, 936 936 // are omitted … … 941 941 { 942 942 return(quotM[1],f0,f,fac); 943 } 943 } 944 944 while(special_ideals_equal(iold,quotM[1])==0) 945 945 { … … 949 949 k++; 950 950 } 951 return(quotM[1],f0,f,fac); // the quadrupel ((I:p),f0,f, // irr. factors of f)952 } 951 return(quotM[1],f0,f,fac); // the quadrupel ((I:p),f0,f, irr. factors of f) 952 } 953 953 ///////////////////////////////////////////////////////////////// 954 954 // proc minquot … … 958 958 // output: a standard basis of the ideal (I:f0), the irreducible 959 959 // factors of the "minimal divisor" f of f0 with (I:f0) = (I:f), 960 // the "minimal divisor" f 960 // the "minimal divisor" f 961 961 ///////////////////////////////////////////////////////////////// 962 962 … … 981 981 return(laedi,ideal(1),1); 982 982 } 983 action=1; 983 action=1; 984 984 while(action==1) 985 985 { … … 995 995 { 996 996 if(i!=j) 997 { 997 { 998 998 g=g*fac[j]; 999 } 999 } 1000 1000 } 1001 1001 //std … … 1007 1007 if(special_ideals_equal(verg,star)==1) 1008 1008 { 1009 f=g; 1009 f=g; 1010 1010 fac[i]=0; 1011 1011 fac=simplify(fac,2); … … 1018 1018 } 1019 1019 } 1020 l=star,fac,f; 1021 return(l); 1020 l=star,fac,f; 1021 return(l); 1022 1022 } 1023 1023 ///////////////////////////////////////////////// -
Singular/LIB/primdec.lib
r9e7626 r18dd47 1 // $Id: primdec.lib,v 1. 2 1997-08-04 15:14:21Singular Exp $1 // $Id: primdec.lib,v 1.3 1997-08-12 14:01:10 Singular Exp $ 2 2 /////////////////////////////////////////////////////// 3 3 // primdec.lib … … 10 10 11 11 minAssPrimes (ideal I, list choose) 12 // minimal associated primes 12 // minimal associated primes 13 13 // The list choose must be either emty (minAssPrimes(I)) or 1 14 14 // (minAssPrimes(I,1)) 15 15 // In the second case the factorizing Buchberger Algorithm is used 16 16 // which in most cases may considerably speed up the algorithm 17 17 18 18 primdec (ideal I) 19 19 20 20 // Computes a complete primary decomposition via 21 21 22 22 radical(ideal I) 23 //computes the radical of the ideal I 23 //computes the radical of the ideal I 24 24 25 25 LIB "random.lib"; … … 76 76 if(deg(@h[@i])>0) 77 77 { 78 fac=fac+factorize(@h[@i],1); 78 fac=fac+factorize(@h[@i],1); 79 79 } 80 80 } … … 83 83 if(deg(fac[1])>0) 84 84 { 85 ideal iold; 85 ideal iold; 86 86 87 87 for(@i=1;@i<=size(fac);@i++) … … 130 130 if(deg(h[i])>0) 131 131 { 132 fac=fac+factorize(h[i],1); 132 fac=fac+factorize(h[i],1); 133 133 } 134 134 } … … 137 137 { 138 138 l=inew,1; 139 return(l); 139 return(l); 140 140 } 141 141 fac=sort(fac)[1]; … … 144 144 f=f*fac[i]; 145 145 } 146 quotM[1]=inew; 146 quotM[1]=inew; 147 147 quotM[2]=fac; 148 148 quotM[3]=f; 149 149 f=1; 150 option(returnSB); 150 option(returnSB); 151 151 while(specialIdealsEqual(iold,quotM[1])==0) 152 152 { … … 162 162 l=quotM[1],f; 163 163 return(l); 164 } 164 } 165 165 166 166 proc quotMin(list tsil) … … 178 178 179 179 action=1; 180 180 181 181 while(action==1) 182 182 { … … 192 192 { 193 193 if(i!=j) 194 { 194 { 195 195 g=g*fac[j]; 196 } 196 } 197 197 } 198 198 verg=quotient(laedi,g); 199 199 if(specialIdealsEqual(verg,star)==1) 200 200 { 201 f=g; 201 f=g; 202 202 fac[i]=0; 203 203 fac=simplify(fac,2); … … 210 210 } 211 211 } 212 l=star,fac,f; 213 return(l); 212 l=star,fac,f; 213 return(l); 214 214 } 215 215 … … 240 240 USAGE: factor(p) p poly 241 241 RETURN: list=; 242 NOTE: 242 NOTE: 243 243 EXAMPLE: example factor; shows an example 244 244 { 245 245 246 246 ideal @i; 247 247 list @l; … … 344 344 345 345 proc idealsEqual( ideal k, ideal j) 346 { 346 { 347 347 return(stdIdealsEqual(std(k),std(j))); 348 348 } … … 394 394 USAGE: testPrimary(pr,k) pr list, k ideal; 395 395 RETURN: int = 1, if the intersection of the ideals in pr is k, 0 if not 396 NOTE: 396 NOTE: 397 397 EEXAMPLE: example testPrimary ; shows an example 398 398 { 399 399 int i; 400 400 ideal j=pr[1]; 401 for (i=2;i<=size(pr) /2;i++)401 for (i=2;i<=size(pr) div 2;i++) 402 402 { 403 403 j=intersect(j,pr[2*i-1]); … … 425 425 USAGE: printPrimary(l) l list; 426 426 RETURN: nothing 427 NOTE: 427 NOTE: 428 428 EXAMPLE: example printPrimary; shows an example 429 429 { … … 438 438 } 439 439 int k; 440 for (k=1;k<=size(l) /2;k=k+1)440 for (k=1;k<=size(l) div 2;k=k+1) 441 441 { 442 442 " "; … … 461 461 a sum of it with a linear random combination of the other 462 462 variables 463 NOTE: 463 NOTE: 464 464 EXAMPLE: example randomLast; shows an example 465 465 { … … 502 502 503 503 //the first generator of the prim ideal for the result 504 ideal prm=p; 504 ideal prm=p; 505 505 attrib(prm,"isSB",1); 506 506 … … 523 523 m=m-1; 524 524 } 525 //check whether i[m] =(c*var(n)+h)^e modulo prm for some 525 //check whether i[m] =(c*var(n)+h)^e modulo prm for some 526 526 //h in K[var(n+1),...,var(nvars(basering))], c in K 527 527 //if not (0) is returned, else var(n)+h is added to prm 528 528 529 529 e=deg(lead(i[m])); 530 530 t=leadcoef(i[m])*e*var(n)+(i[m]-lead(i[m]))/var(n)^(e-1); … … 569 569 int sl=size(l); 570 570 571 for(i=1;i<=sl /2;i++)571 for(i=1;i<=sl div 2;i++) 572 572 { 573 573 if(sact[2][i]>1) … … 581 581 } 582 582 i=0; 583 while(i<size(l) /2)583 while(i<size(l) div 2) 584 584 { 585 585 i++; … … 600 600 } 601 601 j=0; 602 if(i<=sl /2)602 if(i<=sl div 2) 603 603 { 604 604 j=1; … … 625 625 } 626 626 if(gcdTest(act[1])==1) 627 { 627 { 628 628 for(k=2;k<=r;k++) 629 629 { 630 keepprime[size(l) /2+k-1]=interred(keepprime[i]+ideal(act[1][k]));630 keepprime[size(l) div 2+k-1]=interred(keepprime[i]+ideal(act[1][k])); 631 631 } 632 632 keepprime[i]=interred(keepprime[i]+ideal(act[1][1])); … … 655 655 { 656 656 l[s+2*k-1]=keepresult[k]; 657 keepprime[s /2+k]=interred(keepresult[k]+ideal(act[1][k]));657 keepprime[s div 2+k]=interred(keepresult[k]+ideal(act[1][k])); 658 658 if(vdim(keepresult[k])==deg(act[1][k])) 659 659 { … … 664 664 l[s+2*k]=ideal(0); 665 665 } 666 if((homog(keepresult[k])==1)||(homog(keepprime[s /2+k])==1))666 if((homog(keepresult[k])==1)||(homog(keepprime[s div 2+k])==1)) 667 667 { 668 668 l[s+2*k]=maxideal(1); … … 670 670 } 671 671 i--; 672 break; 672 break; 673 673 } 674 674 if(r>=2) … … 686 686 else 687 687 { 688 l[s+2]=ideal(0); 688 l[s+2]=ideal(0); 689 689 } 690 keepprime[s /2+1]=interred(keepprime[i]+ideal(@f));691 if(homog(keepprime[s /2+1])==1)690 keepprime[s div 2+1]=interred(keepprime[i]+ideal(@f)); 691 if(homog(keepprime[s div 2+1])==1) 692 692 { 693 693 l[s+2]=maxideal(1); 694 694 } 695 keepprime[i]=act[1]; 695 keepprime[i]=act[1]; 696 696 l[2*i-1]=act[1]; 697 697 attrib(l[2*i-1],"isSB",1); … … 700 700 l[2*i]=maxideal(1); 701 701 } 702 702 703 703 i--; 704 704 break; … … 712 712 return(l); 713 713 } 714 for(i=1;i<=size(l) /2;i++)714 for(i=1;i<=size(l) div 2;i++) 715 715 { 716 716 if((size(l[2*i])==0)&&(specialIdealsEqual(keepprime[i],l[2*i-1])!=1)) 717 717 { 718 keepprime[i]=std(keepprime[i]); 718 keepprime[i]=std(keepprime[i]); 719 719 if(homog(keepprime[i])==1) 720 { 720 { 721 721 l[2*i]=maxideal(1); 722 722 } … … 767 767 string @ri; 768 768 poly @f; 769 769 770 770 if (dim(j)>0) 771 771 { … … 794 794 else 795 795 { 796 @qh[1]=act[1][@k]; 796 @qh[1]=act[1][@k]; 797 797 } 798 798 primary[2*@k-1]=interred(@qh); … … 814 814 } 815 815 if(dim(j)==-1) 816 { 816 { 817 817 primary[1]=ideal(1); 818 818 primary[2]=ideal(1); … … 824 824 return(primary); 825 825 } 826 826 827 827 //the first element in the standardbase is factorized 828 828 if(deg(j[1])>0) … … 879 879 primary[1]=std(primary[1],act[1][1]); 880 880 } 881 881 882 882 if((act[2][1]==1)&&(vdim(primary[1])==deg(act[1][1]))) 883 883 { … … 900 900 901 901 @k=0; 902 while(@k<(size(primary) /2))902 while(@k<(size(primary) div 2)) 903 903 { 904 904 @k++; … … 915 915 phi=@P,jmap; 916 916 jmap[nva]=-(jmap[nva]-2*var(nva)); 917 psi=@P,jmap; 917 psi=@P,jmap; 918 918 @qht=primary[2*@k-1]; 919 919 @qh=phi(@qht); … … 944 944 kill @Phelp1; 945 945 @qh=clearSB(@qh); 946 attrib(@qh,"isSB",1); 946 attrib(@qh,"isSB",1); 947 947 948 948 @lh=zero_decomp (@qh,psi(ser),@wr); … … 993 993 list @lr=imap(@P,lres); 994 994 ideal @lr1; 995 995 996 996 if(size(@lr)==2) 997 997 { 998 998 @lr[2]=homog(@lr[2],@t); 999 999 @lr1=std(@lr[2]); 1000 @lvec[2]=hilb(@lr1,1); 1000 @lvec[2]=hilb(@lr1,1); 1001 1001 } 1002 1002 else 1003 1003 { 1004 for(@n=1;@n<=size(@lr) /2;@n++)1004 for(@n=1;@n<=size(@lr) div 2;@n++) 1005 1005 { 1006 1006 if(specialIdealsEqual(@lr[2*@n-1],@lr[2*@n])==1) … … 1008 1008 @lr[2*@n-1]=homog(@lr[2*@n-1],@t); 1009 1009 @lr1=std(@lr[2*@n-1]); 1010 @lvec[2*@n-1]=hilb(@lr1,1); 1011 @lvec[2*@n]=@lvec[2*@n-1]; 1010 @lvec[2*@n-1]=hilb(@lr1,1); 1011 @lvec[2*@n]=@lvec[2*@n-1]; 1012 1012 } 1013 1013 else … … 1015 1015 @lr[2*@n-1]=homog(@lr[2*@n-1],@t); 1016 1016 @lr1=std(@lr[2*@n-1]); 1017 @lvec[2*@n-1]=hilb(@lr1,1); 1017 @lvec[2*@n-1]=hilb(@lr1,1); 1018 1018 @lr[2*@n]=homog(@lr[2*@n],@t); 1019 1019 @lr1=std(@lr[2*@n]); 1020 @lvec[2*@n]=hilb(@lr1,1); 1020 @lvec[2*@n]=hilb(@lr1,1); 1021 1021 1022 1022 } 1023 } 1023 } 1024 1024 } 1025 1025 @ri= "ring @Phelp1 =" … … 1033 1033 @lr[2]=std(@lr[2],@lvec[2]); 1034 1034 @lr[2]=subst(@lr[2],@t,1); 1035 1035 1036 1036 } 1037 1037 else 1038 1038 { 1039 for(@n=1;@n<=size(@lr) /2;@n++)1039 for(@n=1;@n<=size(@lr) div 2;@n++) 1040 1040 { 1041 1041 if(specialIdealsEqual(@lr[2*@n-1],@lr[2*@n])==1) … … 1064 1064 attrib(lres[@n],"isSB",1); 1065 1065 } 1066 1066 1067 1067 primary[2*@k-1]=lres[1]; 1068 1068 primary[2*@k]=lres[2]; 1069 @s=size(primary) /2;1070 for(@n=1;@n<=size(lres) /2-1;@n++)1069 @s=size(primary) div 2; 1070 for(@n=1;@n<=size(lres) div 2-1;@n++) 1071 1071 { 1072 1072 primary[2*@s+2*@n-1]=lres[2*@n+1]; … … 1094 1094 USAGE: ggt(i); i list of polynomials 1095 1095 RETURN: poly = ggt(i[1],...,i[size(i)]) 1096 NOTE: 1096 NOTE: 1097 1097 EXAMPLE: example ggt; shows an example 1098 1098 { … … 1104 1104 } 1105 1105 1106 1106 1107 1107 for (k=2;k<=size(i);k++) 1108 1108 { … … 1168 1168 } 1169 1169 example 1170 { 1170 { 1171 1171 "EXAMPLE:"; echo = 2; 1172 1172 ring r =( 0,a,b),(x,y,z),lp; … … 1182 1182 USAGE: clearSB(i); i ideal which is SB ordered by monomial ordering 1183 1183 RETURN: ideal = minimal SB 1184 NOTE: 1184 NOTE: 1185 1185 EXAMPLE: example clearSB; shows an example 1186 1186 { … … 1188 1188 poly m; 1189 1189 int c=size(i); 1190 1190 1191 1191 if(size(#)==0) 1192 1192 { … … 1197 1197 i=ideal(1); 1198 1198 return(i); 1199 } 1199 } 1200 1200 if(deg(i[j])>0) 1201 1201 { … … 1221 1221 i=ideal(1); 1222 1222 return(i); 1223 } 1223 } 1224 1224 if(deg(i[j])>0) 1225 1225 { … … 1236 1236 { 1237 1237 i[j]=0; 1238 break; 1238 break; 1239 1239 } 1240 1240 } … … 1262 1262 ordstring with the corresponding block ordering, 1263 1263 the integer where the independent set starts in the varstring 1264 NOTE: 1264 NOTE: 1265 1265 EXAMPLE: example independentSet; shows an example 1266 1266 { … … 1269 1269 string var1,var2; 1270 1270 list v=system("indsetall",j,1); 1271 1271 1272 1272 for(n=1;n<=size(v);n++) 1273 1273 { … … 1277 1277 for(k=1;k<=size(v[n]);k++) 1278 1278 { 1279 if(v[n][k]!=0) 1279 if(v[n][k]!=0) 1280 1280 { 1281 1281 di++; … … 1329 1329 ordstring with the corresponding block ordering, 1330 1330 the integer where the independent set starts in the varstring 1331 NOTE: 1331 NOTE: 1332 1332 EXAMPLE: example maxIndependentSet; shows an example 1333 1333 { … … 1336 1336 string var1,var2; 1337 1337 list v=system("indsetall",j,0); 1338 1338 1339 1339 for(n=1;n<=size(v);n++) 1340 1340 { … … 1344 1344 for(k=1;k<=size(v[n]);k++) 1345 1345 { 1346 if(v[n][k]!=0) 1346 if(v[n][k]!=0) 1347 1347 { 1348 1348 di++; … … 1394 1394 USAGE: prepareQuotientring(nnp); nnp int 1395 1395 RETURN: string = to define Kvar(nnp+1),...,var(nvars)[..rest ] 1396 NOTE: 1396 NOTE: 1397 1397 EXAMPLE: example independentSet; shows an example 1398 { 1398 { 1399 1399 ideal @ih,@jh; 1400 1400 int npar=npars(basering); 1401 1401 int @n; 1402 1402 1403 1403 string quotring= "ring quring = ("+charstr(basering); 1404 1404 for(@n=nnp+1;@n<=nvars(basering);@n++) … … 1407 1407 @ih=@ih+var(@n); 1408 1408 } 1409 1409 1410 1410 quotring=quotring+"),(var(1)"; 1411 1411 @jh=@jh+var(1); … … 1416 1416 } 1417 1417 quotring=quotring+"),lp;"; 1418 1418 1419 1419 return(quotring); 1420 1420 … … 1431 1431 phi; 1432 1432 setring @Q; 1433 1433 1434 1434 } 1435 1435 … … 1439 1439 int i,j; 1440 1440 list lh; 1441 for(i=1;i<=size(l) /2;i++)1441 for(i=1;i<=size(l) div 2;i++) 1442 1442 { 1443 1443 if(deg(l[2*i-1][1])>0) … … 1457 1457 minAssPrimes(i,1); i ideal (to use also the factorizing Groebner) 1458 1458 RETURN: list = the minimal associated prime ideals of i 1459 NOTE: 1459 NOTE: 1460 1460 EXAMPLE: example minAssPrimes; shows an example 1461 1461 { … … 1481 1481 list @pr=facstd(i); 1482 1482 option(noredSB); 1483 int j,k,odim,ndim,count; 1483 int j,k,odim,ndim,count; 1484 1484 attrib(@pr[1],"isSB",1); 1485 1485 if(#[1]==77) … … 1502 1502 odim=ndim; 1503 1503 } 1504 if(ndim<odim) 1504 if(ndim<odim) 1505 1505 { 1506 1506 pos[j]=1; 1507 1507 } 1508 } 1508 } 1509 1509 for(j=1;j<=size(@pr);j++) 1510 1510 { … … 1524 1524 { 1525 1525 @res[j]=decomp(@pr[j],2); 1526 } 1526 } 1527 1527 } 1528 1528 … … 1554 1554 for(k=1;k<=size(l);k++) 1555 1555 { 1556 for(j=1;j<=size(l[k]) /2;j++)1556 for(j=1;j<=size(l[k]) div 2;j++) 1557 1557 { 1558 1558 if(deg(l[k][2*j][1])!=0) … … 1590 1590 { 1591 1591 @erg[k]=ideal(1); 1592 i2=ideal(1); 1593 } 1592 i2=ideal(1); 1593 } 1594 1594 } 1595 1595 if(size(reduce(i2,i1,1))==0) … … 1598 1598 { 1599 1599 break; 1600 } 1600 } 1601 1601 } 1602 1602 k++; … … 1628 1628 proc decomp (ideal i,list #) 1629 1629 USAGE: decomp(i); i ideal (for primary decomposition) (resp. 1630 decomp(i,1); (for the minimal associated primes) ) 1630 decomp(i,1); (for the minimal associated primes) ) 1631 1631 RETURN: list = list of primary ideals and their associated primes 1632 1632 (at even positions in the list) … … 1641 1641 ideal peek=i; 1642 1642 ideal ser,tras; 1643 1643 1644 1644 int @aa=timer; 1645 1645 1646 1646 homo=homog(i); 1647 1647 if(size(#)>0) … … 1681 1681 intvec @hilb=hilb(tras,1); 1682 1682 } 1683 1683 1684 1684 //---------------------------------------------------------------- 1685 1685 //i is the zero-ideal 1686 1686 //---------------------------------------------------------------- 1687 1687 1688 1688 if(size(i)==0) 1689 1689 { … … 1691 1691 return(primary); 1692 1692 } 1693 1693 1694 1694 //---------------------------------------------------------------- 1695 1695 //pass to the lexicographical ordering and compute a standardbasis … … 1697 1697 1698 1698 execute "ring gnir = ("+charstr(basering)+"),("+varstr(basering)+"),lp;"; 1699 1699 1700 1700 option(redSB); 1701 1701 ideal ser=fetch(@P,ser); 1702 1702 ideal peek=std(fetch(@P,peek)); 1703 homo=homog(peek); 1704 1703 homo=homog(peek); 1704 1705 1705 if(homo==1) 1706 1706 { … … 1730 1730 return(ideal(0)); 1731 1731 } 1732 1732 1733 1733 //---------------------------------------------------------------- 1734 1734 // the case of one variable … … 1781 1781 //search for a maximal independent set indep,i.e. 1782 1782 //look for subring such that the intersection with the ideal is zero 1783 //j intersected with K[var(indep[3]+1),...,var(nvar] is zero, 1783 //j intersected with K[var(indep[3]+1),...,var(nvar] is zero, 1784 1784 //indep[1] is the new varstring and indep[2] the string for the block-ordering 1785 1785 //------------------------------------------------------------------ … … 1791 1791 int jdim=dim(@j); 1792 1792 list fett; 1793 int lauf,di; 1793 int lauf,di; 1794 1794 1795 1795 if(@wr!=1) … … 1814 1814 indep=maxIndependSet(@j); 1815 1815 } 1816 1816 1817 1817 ideal jkeep=@j; 1818 1818 … … 1857 1857 ideal @j=std(phi(@j)); 1858 1858 } 1859 } 1859 } 1860 1860 if((deg(@j[1])==0)||(dim(@j)<jdim)) 1861 1861 { … … 1877 1877 //intersected with K[var(1),...,var(nva)] is (j:gh^n) 1878 1878 //on the other hand j=(j,gh^n) intersected with (j:gh^n) 1879 1879 1880 1880 //------------------------------------------------------------------------------------ 1881 1881 … … 1884 1884 //------------------------------------------------------------------------------------- 1885 1885 1886 quotring=prepareQuotientring(nvars(basering)-indep[@m][3]); 1886 quotring=prepareQuotientring(nvars(basering)-indep[@m][3]); 1887 1887 1888 1888 //--------------------------------------------------------------------- … … 1897 1897 1898 1898 kill gnir1; 1899 1899 1900 1900 //j is a standardbasis in the quotientring but usually not minimal 1901 1901 //here it becomes minimal … … 1913 1913 } 1914 1914 //the primary decomposition of j*K(var(nnp+1),..,var(nva))[..the rest..] 1915 1915 1916 1916 list uprimary= zero_decomp(@j,ser,@wr); 1917 1917 … … 1933 1933 list saturn; 1934 1934 ideal hpl; 1935 1935 1936 1936 for(@n=1;@n<=size(uprimary);@n++) 1937 1937 { 1938 1938 hpl=0; 1939 1939 for(@n1=1;@n1<=size(uprimary[@n]);@n1++) 1940 { 1940 { 1941 1941 hpl=hpl,leadcoef(uprimary[@n][@n1]); 1942 1942 } … … 1948 1948 //--------------------------------------------------------------------- 1949 1949 setring gnir; 1950 1950 1951 1951 collectprimary=imap(quring,uprimary); 1952 1952 lsau=imap(quring,saturn); 1953 @h=imap(quring,@h); 1953 @h=imap(quring,@h); 1954 1954 1955 1955 kill quring; … … 1958 1958 @n2=size(quprimary); 1959 1959 @n3=@n2; 1960 1961 for(@n1=1;@n1<=size(collectprimary) /2;@n1++)1960 1961 for(@n1=1;@n1<=size(collectprimary) div 2;@n1++) 1962 1962 { 1963 1963 if(deg(collectprimary[2*@n1][1])>0) … … 1970 1970 quprimary[@n2]=collectprimary[2*@n1]; 1971 1971 } 1972 } 1973 1974 //here the intersection with the polynomialring 1972 } 1973 1974 //here the intersection with the polynomialring 1975 1975 //mentioned above is really computed 1976 1976 1977 for(@n=@n3 /2+1;@n<=@n2/2;@n++)1977 for(@n=@n3 div 2+1;@n<=@n2 div 2;@n++) 1978 1978 { 1979 1979 if(specialIdealsEqual(quprimary[2*@n-1],quprimary[2*@n])) … … 2010 2010 if(deg(@h[lauf])>0) 2011 2011 { 2012 fac=fac+factorize(@h[lauf],1); 2012 fac=fac+factorize(@h[lauf],1); 2013 2013 } 2014 2014 } … … 2031 2031 @hilb=hilb(jwork,1); 2032 2032 } 2033 2033 2034 2034 setring gnir; 2035 2035 @j=imap(@Phelp,jwork); 2036 } 2036 } 2037 2037 } 2038 2038 if((size(quprimary)==0)&&(@wr>0)) … … 2055 2055 ideal htest=quprimary[1]; 2056 2056 2057 for (@n1=2;@n1<=size(quprimary) /2;@n1++)2057 for (@n1=2;@n1<=size(quprimary) div 2;@n1++) 2058 2058 { 2059 2059 htest=intersect(htest,quprimary[2*@n1-1]); … … 2064 2064 ideal htest=quprimary[2]; 2065 2065 2066 for (@n1=2;@n1<=size(quprimary) /2;@n1++)2066 for (@n1=2;@n1<=size(quprimary) div 2;@n1++) 2067 2067 { 2068 2068 htest=intersect(htest,quprimary[2*@n1]); … … 2106 2106 } 2107 2107 } 2108 2108 2109 2109 for (lauf=1;lauf<=size(@j);lauf++) 2110 2110 { … … 2121 2121 //intersected with K[var(1),...,var(nva)] is (j:gh^n) 2122 2122 //on the other hand j=(j,gh^n) intersected with (j:gh^n) 2123 2123 2124 2124 //------------------------------------------------------------------------------------ 2125 2125 … … 2128 2128 //------------------------------------------------------------------------------------- 2129 2129 2130 quotring=prepareQuotientring(nvars(basering)-restindep[@m][3]); 2130 quotring=prepareQuotientring(nvars(basering)-restindep[@m][3]); 2131 2131 2132 2132 //--------------------------------------------------------------------- 2133 2133 //we pass to the quotientring K(var(nnp+1),..,var(nva))[..the rest..] 2134 2134 //--------------------------------------------------------------------- 2135 2135 2136 2136 execute quotring; 2137 2137 … … 2141 2141 2142 2142 kill gnir1; 2143 2143 2144 2144 //j is a standardbasis in the quotientring but usually not minimal 2145 2145 //here it becomes minimal … … 2155 2155 } 2156 2156 //the primary decomposition of j*K(var(nnp+1),..,var(nva))[..the rest..] 2157 2157 2158 2158 list uprimary= zero_decomp(@j,ser,@wr); 2159 2159 2160 2160 //we need the intersection of the ideals in the list quprimary with the 2161 2161 //polynomialring, i.e. let q=(f1,...,fr) in the quotientring such an ideal … … 2167 2167 list saturn; 2168 2168 ideal hpl; 2169 2169 2170 2170 for(@n=1;@n<=size(uprimary);@n++) 2171 2171 { 2172 2172 hpl=0; 2173 2173 for(@n1=1;@n1<=size(uprimary[@n]);@n1++) 2174 { 2174 { 2175 2175 hpl=hpl,leadcoef(uprimary[@n][@n1]); 2176 2176 } … … 2182 2182 //--------------------------------------------------------------------- 2183 2183 setring gnir; 2184 2184 2185 2185 collectprimary=imap(quring,uprimary); 2186 2186 lsau=imap(quring,saturn); 2187 @h=imap(quring,@h); 2187 @h=imap(quring,@h); 2188 2188 2189 2189 kill quring; … … 2192 2192 @n2=size(quprimary); 2193 2193 @n3=@n2; 2194 2195 for(@n1=1;@n1<=size(collectprimary) /2;@n1++)2194 2195 for(@n1=1;@n1<=size(collectprimary) div 2;@n1++) 2196 2196 { 2197 2197 if(deg(collectprimary[2*@n1][1])>0) … … 2204 2204 quprimary[@n2]=collectprimary[2*@n1]; 2205 2205 } 2206 } 2207 2208 //here the intersection with the polynomialring 2206 } 2207 2208 //here the intersection with the polynomialring 2209 2209 //mentioned above is really computed 2210 2210 2211 for(@n=@n3 /2+1;@n<=@n2/2;@n++)2211 for(@n=@n3 div 2+1;@n<=@n2 div 2;@n++) 2212 2212 { 2213 2213 if(specialIdealsEqual(quprimary[2*@n-1],quprimary[2*@n])) … … 2244 2244 { 2245 2245 htprimary=decomp(@j,peek,ser); 2246 } 2246 } 2247 2247 // here we collect now both results primary(sat(j,gh)) 2248 2248 // and primary(j,gh^n) 2249 2249 2250 2250 @n=size(quprimary); 2251 2251 for (@k=1;@k<=size(htprimary);@k++) … … 2277 2277 list pr= decomp(i); 2278 2278 pr; 2279 testPrimary( pr, i); 2280 } 2279 testPrimary( pr, i); 2280 } -
Singular/LIB/random.lib
r9e7626 r18dd47 1 // $Id: random.lib,v 1. 2 1997-04-28 19:27:23 obachmanExp $1 // $Id: random.lib,v 1.3 1997-08-12 14:01:11 Singular Exp $ 2 2 //system("random",787422842); 3 3 //(GMG/BM, last modified 22.06.96) … … 213 213 { 214 214 int ii,min,l,r; intmat M[n][m]; 215 int t=(n*(n-1)) /2;215 int t=(n*(n-1)) div 2; 216 216 //----------------------------- set defaults ---------------------------------- 217 217 if( size(#)>=2 ) { int p=#[1]; int b=#[2]; }
Note: See TracChangeset
for help on using the changeset viewer.