Changeset a8b25b8 in git
- Timestamp:
- Jan 10, 2018, 4:07:24 PM (5 years ago)
- Branches:
- (u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
- Children:
- e3fcfdc92651654535bfc26b7b0ccd1eba1ddc63
- Parents:
- ba3f63a4a803edb81908dd6f1266eba1a5d5b454
- Files:
-
- 4 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/modules.lib
rba3f63 ra8b25b8 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version=" $Id$";2 version="version modules.lib 4.1.1.0 Jan_2018 "; // $Id$ 3 3 category="Commutative Algebra"; 4 4 info=" … … 10 10 M. Mayer mayer@mathematik.uni-kl.de 11 11 12 OVERVIEW: 13 This library is used for the computation of graded free resolutions with an own graduation of 14 the monomials. For these Resolution is a new class of modules needed. These modules, can be 15 computed via the image, kernel, cokernel of a matrix or the subquotient of two matrices. 12 OVERVIEW: 13 This library is used for the computation of graded free resolutions with an own graduation of 14 the monomials. For these Resolution is a new class of modules needed. These modules, can be 15 computed via the image, kernel, cokernel of a matrix or the subquotient of two matrices. 16 16 The used matrices also have a free module as source and target, with graded generators if the 17 17 matrix is homogenous. A matrix of this new form is created by a normal matrix, source, target and … … 19 19 possible to compute the new class of modules. 20 20 This library also offers the opppurtunity to create R-module-homomorphisms betweens two modules. 21 For these homorphisms the kernel can be computed an will be returned as a module of the new class. 21 For these homorphisms the kernel can be computed an will be returned as a module of the new class. 22 22 23 23 This is experimental work in progress!!! … … 40 40 freeModule(ring,int,list) creating a graded free module 41 41 makeMatrix(matrix,#int) creating a Matrix with graded target and source if the matrix is homogenous. If # is set to 1, makeMatrix ignores the grading of source & target. 42 makeIdeal(ideal) creates an Ideal from an given ideal, is used to compute a resolution of the ideal 42 makeIdeal(ideal) creates an Ideal from an given ideal, is used to compute a resolution of the ideal 43 43 Target(Matrix) return target of the Matrix 44 44 Source(Matrix) return source of the Matrix … … 63 63 compareModules(Module,Module) return 0 or 1, compares the two Modules up to isomorphism 64 64 addModules(Module,Module) return a Module, sum of the two Modules 65 homomorphism(matrix,Module,Module) creates a R-Modul-Homomorphism 65 homomorphism(matrix,Module,Module) creates a R-Modul-Homomorphism 66 66 target(Homomorphism) return a Module, target of the Homomorphism 67 67 source(Homomorphism) return a Module, source of the Homomorphism … … 72 72 makeVector(vector,Module) creates Vector in the given Module 73 73 netVector(Vector) prints Vector 74 netMatrix(Matrix) prints Matrix 74 netMatrix(Matrix) prints Matrix 75 75 presentation(Module) converts M as a Subquotient to the Coker of a matrix C 76 76 tensorMatrix(Matrix,Matrix) computes tensorproduct of two Matrices … … 282 282 283 283 proc freeModule(def basis,int myrank,list degrees) 284 "USAGE: freeModule(r,n,l); r ring, n integer, l list 284 "USAGE: freeModule(r,n,l); r ring, n integer, l list 285 285 RETURN: a free Module over the ring r, with rank n, and degrees l for the generators 286 286 NOTE: -1 for nor graduation and 0 to set every degree to 0 … … 291 291 int mydeg=0; 292 292 FreeModule M; 293 M.over= basis; 294 M.Rank = myrank; 293 M.over= basis; 294 M.Rank = myrank; 295 295 list l=-1; 296 296 M.isgraded=0; 297 297 if(!(comparedeg(degrees,l))){ 298 M.isgraded=1; 298 M.isgraded=1; 299 299 l=0; 300 if(comparedeg(degrees,l)){ 300 if(comparedeg(degrees,l)){ 301 301 for(int j=1;j<=myrank;j++){ 302 302 M.grading[j]=mydeg; … … 306 306 else{ 307 307 if(myrank!=size(degrees)){ERROR("Graduation incorrect")} 308 M.grading=degrees; 308 M.grading=degrees; 309 309 } 310 310 } … … 340 340 list mydeg; 341 341 Matrix M; 342 M.ishomogenous=1; 342 M.ishomogenous=1; 343 343 M.over=basering; 344 344 int a; 345 345 int j; 346 346 for(int i=1;i<=ncols(m);i++){ 347 a=0; 347 a=0; 348 348 for(j=1;j<=nrows(m);j++){ 349 if(m[i][j]!=0){ 349 if(m[i][j]!=0){ 350 350 a=Deg(m[i][j]); 351 break; 351 break; 352 352 } 353 } 353 } 354 354 mydeg[i]=t[j]+a; 355 355 } 356 M.target = N; 357 M.source = freeModule(basering,ncols(m),mydeg); 356 M.target = N; 357 M.source = freeModule(basering,ncols(m),mydeg); 358 358 M.hom = m; 359 359 setring(R); … … 364 364 365 365 static proc comparedeg(list l,list j){ 366 if(size(l)!=size(j)){return(0);} 367 for(int i=1;i<=size(l);i++){ 366 if(size(l)!=size(j)){return(0);} 367 for(int i=1;i<=size(l);i++){ 368 368 if(l[i]!=j[i]){return(0);} 369 369 } … … 377 377 int j; 378 378 int f; 379 list mydeg; 379 list mydeg; 380 380 list controldeg; 381 381 for(int i=1;i<=ncols(m);i++){ … … 383 383 controldeg[i]=0; 384 384 for(j=1;j<=nrows(m);j++){ 385 if(m[j,i]!=0){ 385 if(m[j,i]!=0){ 386 386 if(controldeg[i]==1){ 387 if(mydeg[i]!=Deg(m[j,i])){return(-1)} 388 } 387 if(mydeg[i]!=Deg(m[j,i])){return(-1)} 388 } 389 389 mydeg[i]=Deg(m[j,i]); 390 390 controldeg[i]=1; … … 392 392 } 393 393 } 394 return(mydeg) 394 return(mydeg) 395 395 } 396 396 … … 483 483 Resolution R; 484 484 R.reso=mres(m,j); 485 matrix a=R.reso[1]; 486 R.dd[1]=makeMatrix(a); 487 if(!(R.dd[1].ishomogenous)){ 485 matrix a=R.reso[1]; 486 R.dd[1]=makeMatrix(a); 487 if(!(R.dd[1].ishomogenous)){ 488 488 R.isgraded=0; 489 489 for(int i=2;i<=(size(R.reso)+1);i++){ 490 a=R.reso[i]; 491 R.dd[i]=nongradedMatrix(a); 490 a=R.reso[i]; 491 R.dd[i]=nongradedMatrix(a); 492 492 } 493 493 … … 496 496 R.isgraded=1; 497 497 for(int i=2;i<=(size(R.reso));i++){ 498 a=R.reso[i]; 498 a=R.reso[i]; 499 499 mydeg=R.dd[i-1].source.grading; 500 500 R.dd[i]=resMatrix(a,mydeg,R.dd[i-1].source); … … 524 524 "USAGE: sRes(M,n); M Module or Ideal, n integer 525 525 RETURN: Resolution, with graded modules, computed with Schreyer's method using the function sres 526 NOTE: n is optional, if n ist positiv only that many steps will be computed 526 NOTE: n is optional, if n ist positiv only that many steps will be computed 527 527 use R.dd[i]; to return the diffrent modules as image of matrices, R Resolution i integer 528 528 EXAMPLE. example sRes, shows an example" … … 545 545 Resolution R; 546 546 R.reso=sres(m,j); 547 matrix a=R.reso[1]; 548 R.dd[1]=makeMatrix(a); 547 matrix a=R.reso[1]; 548 R.dd[1]=makeMatrix(a); 549 549 if(!(R.dd[1].ishomogenous)){ 550 550 R.isgraded=0; 551 551 for(int i=2;i<(size(R.reso)+1);i++){ 552 552 a=R.reso[i]; 553 R.dd[i]=nongradedMatrix(a); 553 R.dd[i]=nongradedMatrix(a); 554 554 } 555 555 … … 558 558 R.isgraded=1; 559 559 for(int i=2;i<(size(R.reso));i++){ 560 a=R.reso[i]; 560 a=R.reso[i]; 561 561 mydeg=R.dd[i-1].source.grading; 562 562 R.dd[i]=resMatrix(a,mydeg,R.dd[i-1].source); … … 586 586 "USAGE: Res(M,n); M Module or Ideal, n integer 587 587 RETURN: Resolution, resolution with graded modules 588 NOTE: n is optional, if n ist positiv only that many steps will be computed 588 NOTE: n is optional, if n ist positiv only that many steps will be computed 589 589 use R.dd[i]; to return the diffrent modules as image of matrices, R Resolution i integer 590 590 EXAMPLE. example Res, shows an example" … … 607 607 Resolution R; 608 608 R.reso=res(m,j); 609 matrix a=R.reso[1]; 610 R.dd[1]=makeMatrix(a); 609 matrix a=R.reso[1]; 610 R.dd[1]=makeMatrix(a); 611 611 if(!(R.dd[1].ishomogenous)){ 612 612 R.isgraded=0; 613 613 for(int i=2;i<(size(R.reso)+1);i++){ 614 614 a=R.reso[i]; 615 R.dd[i]=nongradedMatrix(a); 615 R.dd[i]=nongradedMatrix(a); 616 616 } 617 617 … … 811 811 matrix m[2][2]=x,y3,z,xz; 812 812 Matrix Ma=m; 813 FreeModule M=Source(Ma); 813 FreeModule M=Source(Ma); 814 814 M; 815 815 Degree(M); … … 836 836 for(j=1;j<=nrows(m);j++){ 837 837 if(size(string(m[i][j]))>l1[i]){ 838 l1[i]=size(string(m[i][j])); 839 } 840 } 838 l1[i]=size(string(m[i][j])); 839 } 840 } 841 841 } 842 842 s1=" "; … … 1129 1129 } 1130 1130 1131 if (M.isgraded == 1){ 1131 if (M.isgraded == 1){ 1132 1132 ret3 = net("Graded with:") + net(M.grading); 1133 1133 } … … 1443 1443 //////////////////////////////////////////////////////////////////////////////////////////////////////// 1444 1444 1445 //Eigene Funktionen 1445 //Eigene Funktionen 1446 1446 1447 1447 //////////////////////////////////////////////////////////////////////////////////////////////////////// … … 1452 1452 RETURN: nothing, prints the Module 1453 1453 EXAMPLE: example printModule; shows an example 1454 { 1454 { 1455 1455 netModuleShort(M); 1456 1456 } … … 1534 1534 N; 1535 1535 print(""); 1536 print("From source"); 1536 print("From source"); 1537 1537 printFreeModule(M.source); 1538 1538 print(""); … … 1540 1540 printFreeModule(M.target); 1541 1541 print(""); 1542 print("Ring:"); 1542 print("Ring:"); 1543 1543 M.over;*/ 1544 1544 return(N); … … 1691 1691 1692 1692 1693 proc tensorMatrix(Matrix A, Matrix B) 1693 proc tensorMatrix(Matrix A, Matrix B) 1694 1694 "USAGE = tensorMatrix(A,B); A,B Matrix over the same ring 1695 1695 RETURN: Tensorprodukt of A,B … … 1725 1725 target_grading = 0; //vorlÀufig 1726 1726 } 1727 T.target = freeModule(A.over,A.target.Rank*B.target.Rank,target_grading); 1727 T.target = freeModule(A.over,A.target.Rank*B.target.Rank,target_grading); 1728 1728 return(T); 1729 1729 } 1730 1730 1731 example 1731 example 1732 1732 { 1733 1733 "EXAMPLE:"; echo=2; … … 1762 1762 } 1763 1763 1764 example 1764 example 1765 1765 { 1766 1766 "EXAMPLE:"; echo=2; … … 1800 1800 } 1801 1801 1802 example 1802 example 1803 1803 { 1804 1804 "EXAMPLE:"; echo=2; … … 1844 1844 } 1845 1845 1846 example 1846 example 1847 1847 { 1848 1848 "EXAMPLE:"; echo=2; … … 1861 1861 1862 1862 1863 proc pruneModule(Module M) 1863 proc pruneModule(Module M) 1864 1864 "USAGE = pruneModule(M); M Module 1865 1865 RETURN: M in a simplyfied presentation … … 1945 1945 //dividing Pivot col with Pivot element 1946 1946 //Now add multiples of Pivot column to the other columns to make the row to zero: 1947 for(k=1;k<=cols;k++) { 1947 for(k=1;k<=cols;k++) { 1948 1948 if (k!=j) { 1949 1949 factor = -m[i,k]; 1950 m[1..rows,k] = m[1..rows,k] + factor*m[1..rows,j]; 1950 m[1..rows,k] = m[1..rows,k] + factor*m[1..rows,j]; 1951 1951 }//change all columns except pivot column 1952 1952 } … … 2008 2008 } 2009 2009 N.interpretation[1] = interpr; 2010 //Now construct the inverse map: 'forget' the i-th row and send the i-th unitvector to the according negative relations. 2010 //Now construct the inverse map: 'forget' the i-th row and send the i-th unitvector to the according negative relations. 2011 2011 list preinterpr; 2012 2012 vector v; … … 2025 2025 v = [(-1)*needthislater[1..rows,j]]; 2026 2026 preinterpr[k] = v; 2027 } 2027 } 2028 2028 } 2029 2029 N.interpretation[2] = preinterpr; … … 2047 2047 int i = int(p); 2048 2048 if (char(basering) != 0) { 2049 if (gcd(char(basering),i) == 1){ return(1); } 2049 if (gcd(char(basering),i) == 1){ return(1); } 2050 2050 else{ return(0); } 2051 2051 }else{ … … 2063 2063 proc interpretElem(Vector Elmt, int #) 2064 2064 "USAGE = interpretElem(V,n); Vector Elmt, n integer 2065 RETURN: interpretation of a Vector with # steps or until can't interpret further 2065 RETURN: interpretation of a Vector with # steps or until can't interpret further 2066 2066 EXAMPLE: example interpretElem; shows an example" 2067 2067 { … … 2089 2089 2090 2090 proc interpretList(list Elements, int #) 2091 "USAGE = interpretList(L,n); list L of Vectors all of the same Module, n integer 2091 "USAGE = interpretList(L,n); list L of Vectors all of the same Module, n integer 2092 2092 RETURN: interpretation of Elements in some abstract structure defined by the user or into a Module 2093 2093 EXAMPLE: example interpretList; shows an example" … … 2124 2124 proc reduceIntChain(Module C, int #) 2125 2125 "USAGE = reduceIntChain(C,n); C Module, n int 2126 RETURN: Module C with minimized (or # steps) interpretation list 2126 RETURN: Module C with minimized (or # steps) interpretation list 2127 2127 EXAMPLE: example reduceIntChain; shows an example" 2128 2128 { … … 2150 2150 (C.interpretation)[2] = preList; 2151 2151 // Second concatenate the interpretation maps 2152 for(i=1;i<=size((C.interpretation)[1]);i++) { 2152 for(i=1;i<=size((C.interpretation)[1]);i++) { 2153 2153 intList[i] = interpret((C.interpretation)[1][i]); 2154 2154 } … … 2158 2158 } 2159 2159 } 2160 2160 2161 2161 return(C); 2162 2162 } … … 2176 2176 2177 2177 2178 proc interpret(Vector V) 2178 proc interpret(Vector V) 2179 2179 "USAGE = interpret(V); V Vector 2180 2180 RETURN: interpretation of V into some space that is stored in the interpretationlist of V.space … … 2201 2201 W = W + V.space.interpretation[1][i]*myCoeffs[i,1]; //user needs to define '+' as well 2202 2202 } 2203 return(W); 2203 return(W); 2204 2204 } 2205 2205 … … 2234 2234 2235 2235 2236 proc interpretInv(def V, Module N) 2236 proc interpretInv(def V, Module N) 2237 2237 "USAGE = interpretInv(V,N); V Vector or Homomorphism, N Module 2238 2238 RETURN: interpretation of V into some Module N (inverse to interpret) … … 2242 2242 Module M = V.space; 2243 2243 //Check wheter there is a inverse interpretationlist: 2244 if ((size(N.interpretation)!=0) && (size((N.interpretation)[2])!=0) && (((N.interpretation)[1][1]).space == M)) { 2244 if ((size(N.interpretation)!=0) && (size((N.interpretation)[2])!=0) && (((N.interpretation)[1][1]).space == M)) { 2245 2245 // third condition checks whether the given modules are related 2246 2246 //in this case we decompose v into the generators of its Module and project those onto the generators of N 2247 2247 list DivVec = division(V.entries,M.generators.hom); 2248 2248 matrix myCoeffs = DivVec[1]; 2249 vector w = N.interpretation[2][1]*myCoeffs[1,1]; 2249 vector w = N.interpretation[2][1]*myCoeffs[1,1]; 2250 2250 //inverse maps only contain elements of type vector 2251 2251 int i; 2252 2252 for (i=2;i<=nrows(myCoeffs);i++) { 2253 w = w + N.interpretation[2][i]*myCoeffs[i,1]; 2253 w = w + N.interpretation[2][i]*myCoeffs[i,1]; 2254 2254 } 2255 2255 Vector W = w,N; 2256 return(W); 2256 return(W); 2257 2257 } 2258 2258 //If not, check wheter there exists an interpretationlist to N in the Module of V: … … 2394 2394 2395 2395 2396 static proc concMatrix(Matrix A,Matrix B) 2396 static proc concMatrix(Matrix A,Matrix B) 2397 2397 "USAGE = concMatrix(A,B); A,B Matrix over the same ring 2398 2398 RETURN: concatinated Matrix with concatinated grading … … 2432 2432 list L1 = F1.grading; 2433 2433 list L2 = F2.grading; 2434 2434 2435 2435 if (F1.isgraded == 0 || F2.isgraded == 0){ 2436 2436 return(-1); -
Singular/LIB/nets.lib
rba3f63 ra8b25b8 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version=" $Id$";2 version="version nets.lib 4.1.1.0 Jan_2018 "; // $Id$ 3 3 category="Miscellaneous"; 4 4 info=" … … 67 67 // 68 68 ring r5 = 7,(x,y,z),ds; 69 // 69 // 70 70 ring r6 = 10,(x,y,z),ds; 71 71 // 72 72 ring r7 = 7,(x(1..6)),(lp(3),dp); 73 73 // 74 ring r8 = 0,(x,y,z,a,b,c),(ds(3), dp(3)); 74 ring r8 = 0,(x,y,z,a,b,c),(ds(3), dp(3)); 75 75 // 76 76 ring r9 = 0,(x,y,z),(c,wp(2,1,3)); … … 132 132 S=S+" "; 133 133 } 134 134 135 135 return(S); 136 136 } … … 167 167 Net NM; 168 168 NM.rows=LN+LM; 169 169 170 170 return(NM); 171 171 } … … 208 208 Net NM; 209 209 NM.rows=L; 210 210 211 211 return(NM); 212 212 } … … 351 351 } 352 352 */ 353 string S=string(n)+string("^")+string(m); 353 string S=string(n)+string("^")+string(m); 354 354 return(net(/*(n)+net("^")+net(r)*/ S)); 355 355 } … … 365 365 366 366 // 367 // netRing 367 // netRing 368 368 // 369 369 proc netRing(def R) … … 382 382 Net N=netCoefficientRing(R)+net("[")+net(string(RL[2]))+net("] / ")+net(RL[4]); 383 383 } 384 384 385 385 return(N); 386 386 } 387 387 example 388 388 { 389 "EXAMPLE:"; // from 3.3.1 Examples of ring declarations 389 "EXAMPLE:"; // from 3.3.1 Examples of ring declarations 390 390 ring r1 = 32003,(x,y,z),dp; 391 391 netRing(r1); … … 402 402 ring r5 = 7,(x,y,z),ds; 403 403 netRing(r5); 404 // 404 // 405 405 ring r6 = 10,(x,y,z),ds; 406 406 netRing(r6); … … 409 409 netRing(r7); 410 410 // 411 ring r8 = 0,(x,y,z,a,b,c),(ds(3), dp(3)); 411 ring r8 = 0,(x,y,z,a,b,c),(ds(3), dp(3)); 412 412 netRing(r8); 413 413 // … … 449 449 450 450 // 451 // netMap 451 // netMap 452 452 // 453 453 proc netMap( map f) … … 467 467 468 468 // 1 469 Map=string(nameof(f)); 469 Map=string(nameof(f)); 470 470 Source=string(nameof(preimage(f))); 471 471 Target=string(nameof(basering)); … … 475 475 Output[1]=Output[1]+" , "+string(ringlist(preimage(f))[2][1])+" -> "+string(f[1]); 476 476 477 // 2 477 // 2 478 478 for (i=2; i<=v; i++){// +2 479 479 Output[i]=emptyString(empty)+" , "+string(ringlist(preimage(f))[2][i])+" -> "+string(f[i]); 480 480 }// -2 481 481 482 482 // 3 483 483 M.rows=Output; 484 484 485 // - 485 // - 486 486 return(M); 487 487 } … … 499 499 500 500 // 501 // netMap2 501 // netMap2 502 502 // 503 503 proc netMap2( map f) … … 529 529 Output[1]=Output[1]+" , "+string(ringlist(preimage(f))[2][i])+" -> "+string(f[i]); 530 530 }// -2 531 531 532 532 // 3 533 533 M.rows=Output; 534 534 535 535 // - 536 536 return(M); … … 558 558 EXAMPLE: example netBigIntMatrix; shows an example 559 559 " 560 { 560 { 561 561 // 0 562 562 int Length=100; //Length of Output … … 592 592 { 593 593 // 0 594 int Length=10; // LÀnge der Ausgabe 594 int Length=10; // LÀnge der Ausgabe 595 595 string S; 596 596 list L, SizeCol, SizeColShort; … … 602 602 Length=#[1]; 603 603 }// - 1 604 604 605 605 // 2 606 606 for (j=1; j <= ncols(M); j++){// +2 607 607 SizeCol[j]=0; 608 608 }// -2 609 610 // 3 609 610 // 3 611 611 for (j=1; j <= ncols(M); j++){// +3 612 612 SizeColShort[j]=0; 613 613 }// -3 614 614 615 615 // 4 616 616 for (j=1; j <= ncols(M); j++){// +4 … … 629 629 }// -5.1 630 630 }// -5 631 631 632 632 // 6 633 633 for (i=1; i<=nrows(M); i++ ){// +6 … … 639 639 if ( size(string(M[i,j])) > Length ){// +6.1.2.1 640 640 S=S+string(M[i,j])[1,Length]+"..."; 641 }// -6.1.2.1 641 }// -6.1.2.1 642 642 else{// +6.1.2.2 643 643 defect=SizeColShort[j]+3-size(string(M[i,j])); … … 653 653 S=""; 654 654 }// -6 655 656 // 7 655 656 // 7 657 657 for (j=1; j<=nrows(M); j++){// +7 658 658 L[j]="| "+L[j]+" |"; 659 659 }// -7 660 660 661 // 8 661 // 8 662 662 Net NM; 663 663 NM.rows=L; … … 691 691 EXAMPLE: example netBigIntMat; shows an example 692 692 " 693 { 694 // 0 693 { 694 // 0 695 695 int m=nrows(M); 696 696 int n=ncols(M); … … 699 699 bigintmat B[m][n]=M; 700 700 Net Output=netBigIntMat(B); 701 701 702 702 // - 703 703 return(Output); … … 713 713 intmat M[2][2]=a,b,c,d; 714 714 netIntMat(M); 715 } 715 } 716 716 717 717 … … 728 728 EXAMPLE: example netIntMatShort; shows an example 729 729 " 730 { 730 { 731 731 // 0 732 732 int m=nrows(M); … … 737 737 738 738 // 2 739 if( size(#)!=0 ){// +2.1 739 if( size(#)!=0 ){// +2.1 740 740 Net Output=netBigIntMatShort(B, #[1]); 741 741 }// -2.1 … … 743 743 Net Output=netBigIntMatShort(B); 744 744 }// -2.2 745 745 746 746 // - 747 747 return(Output); … … 826 826 else{// +2.2 827 827 Output=netIntMatShort(M); 828 }// -2.2 828 }// -2.2 829 829 830 830 // - … … 864 864 Size=#[1]; 865 865 }// -1 866 866 867 867 // - 868 868 return(netmatrixShort(M, Size)); … … 896 896 EXAMPLE: example netmatrixShort; shows an example 897 897 " 898 { 898 { 899 899 int i, j; 900 900 list breite = list(); 901 901 Net Output; 902 902 string Zeile; 903 903 904 904 //maximale Spaltenbreite setzen 905 905 for (i=1; i<=ncols(M); i++){ … … 911 911 } 912 912 } 913 913 914 914 //einfÃŒgen 915 915 for (i=1; i<=nrows(M); i++){ … … 917 917 for (j=1; j<=ncols(M); j++){ 918 918 Zeile = Zeile + string(M[i,j]) + emptyString( breite[j] - size(string(M[i,j])) + 1); 919 919 920 920 } 921 921 Output.rows[i] = Zeile + "|"; 922 922 } 923 923 924 924 return (Output); 925 925 } … … 1046 1046 " 1047 1047 { 1048 // 0 1048 // 0 1049 1049 matrix M=matrix(V); 1050 1050 int Size=25; … … 1059 1059 Output=netmatrix(M, Size); 1060 1060 1061 // - 1061 // - 1062 1062 return(Output); 1063 1063 } … … 1079 1079 1080 1080 // 1081 // netvectorShort 1081 // netvectorShort 1082 1082 // 1083 1083 proc netvectorShort(vector V, list #) … … 1183 1183 } // (2.1.2.1.1) 1184 1184 else { // (2.1.2.1.2) 1185 Down=Down+string( leadcoef(Q) ); 1185 Down=Down+string( leadcoef(Q) ); 1186 1186 Up=Up+emptyString( size( string( leadcoef(Q) ) ) ); //size(leadcoef(-1))=1, deshalb size(string ... 1187 1187 }// (2.1.2.1.2) 1188 1188 } // (2.1.2.1) 1189 1189 else { // (2.1.2.2) 1190 Down=Down+string( leadcoef(Q) ); // leading coef 1190 Down=Down+string( leadcoef(Q) ); // leading coef 1191 1191 Up=Up+emptyString( size( string( leadcoef(Q) ) ) ); 1192 1192 }// (2.1.2.2 1193 } // (2.1.2) 1193 } // (2.1.2) 1194 1194 S=size( ringlist(basering)[2] ); //variables 1195 1195 for ( i=1; i<=S; i++) { // (2.1.1) 1196 1196 if ( leadexp(Q)[i] == 0 ) { // (2.1.1.1) 1197 1197 } 1198 else { // (2.1.1.2)) 1198 else { // (2.1.1.2)) 1199 1199 Down=Down+string( ringlist( basering )[2][i] ); 1200 1200 Up=Up+emptyString( size (string( ringlist( basering )[2][i] ) ) ); … … 1224 1224 } // (2.2.2.1.1) 1225 1225 else { // () 1226 Down=Down+string( leadcoef(Q) ); 1226 Down=Down+string( leadcoef(Q) ); 1227 1227 Up=Up+emptyString( size( string( leadcoef(Q) ) ) ); //size(leadcoef(-1))=1 1228 1228 }// (2.2.2.1.2) … … 1231 1231 Down=Down+"+"; 1232 1232 Up=Up+" "; 1233 Down=Down+string( leadcoef(Q) ); // leading coef 1233 Down=Down+string( leadcoef(Q) ); // leading coef 1234 1234 Up=Up+emptyString( size( string( leadcoef(Q) ) ) ); 1235 1235 } // (2.2.2.2) … … 1240 1240 if ( leadexp(Q)[i] == 0 ) { // (2.2.3.1) 1241 1241 } // (2.2.3.1) 1242 else { // (2.2.3.2) 1242 else { // (2.2.3.2) 1243 1243 Down=Down+string( ringlist( basering )[2][i] ); 1244 1244 Up=Up+emptyString( size (string( ringlist( basering )[2][i] ) ) ); … … 1265 1265 { 1266 1266 "EXAMPLE:"; // from 3.3.1 Examples of ring declarations 1267 // 1267 // 1268 1268 ring R1 = 32003,(x,y,z),dp; 1269 1269 poly q6=1; … … 1296 1296 1297 1297 ring R2 = 32003,(x(1..10)),dp; 1298 1298 1299 1299 poly w6=1; 1300 1300 print(w6); … … 1369 1369 netPoly(p2); 1370 1370 1371 ring r3=7,(x,y,z),lp; 1372 poly p=17x2+24y; 1371 ring r3=7,(x,y,z),lp; 1372 poly p=17x2+24y; 1373 1373 p; 1374 1374 netPoly(p); … … 1409 1409 N=N+string(I[i])+string(", "); 1410 1410 } // (1) 1411 1411 1412 1412 N=N+string(I[size(I)])+string(">"); 1413 1413 return(net(N)); -
Tst/Short/ok_s.lst
rba3f63 ra8b25b8 103 103 modular_s 104 104 modstd_s 105 modules 106 nets 105 107 ncfactor_facNthShift1_s 106 108 ncfactor_landau_ex_s
Note: See TracChangeset
for help on using the changeset viewer.