Changeset a8b25b8 in git


Ignore:
Timestamp:
Jan 10, 2018, 4:07:24 PM (5 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
Children:
e3fcfdc92651654535bfc26b7b0ccd1eba1ddc63
Parents:
ba3f63a4a803edb81908dd6f1266eba1a5d5b454
Message:
fix: format, tests
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/modules.lib

    rba3f63 ra8b25b8  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id$";
     2version="version modules.lib 4.1.1.0 Jan_2018 "; // $Id$
    33category="Commutative Algebra";
    44info="
     
    1010          M. Mayer mayer@mathematik.uni-kl.de
    1111
    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. 
     12OVERVIEW:
     13This library is used for the computation of graded free resolutions with an own graduation of
     14the monomials. For these Resolution is a new class of modules needed. These modules, can be
     15computed via the image, kernel, cokernel of a matrix or the subquotient of two matrices.
    1616The used matrices also have a free module as source and target, with graded generators if the
    1717matrix is homogenous. A matrix of this new form is created by a normal matrix, source, target and
     
    1919possible to compute the new class of modules.
    2020This 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. 
     21For these homorphisms the kernel can be computed an will be returned as a module of the new class.
    2222
    2323This is experimental work in progress!!!
     
    4040freeModule(ring,int,list)       creating a graded free module
    4141makeMatrix(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     
     42makeIdeal(ideal)                creates an Ideal from an given ideal, is used to compute a resolution of the ideal
    4343Target(Matrix)                  return target of the Matrix
    4444Source(Matrix)                  return source of the Matrix
     
    6363compareModules(Module,Module)   return 0 or 1, compares the two Modules up to isomorphism
    6464addModules(Module,Module)       return a Module, sum of the two Modules
    65 homomorphism(matrix,Module,Module)      creates a R-Modul-Homomorphism 
     65homomorphism(matrix,Module,Module)      creates a R-Modul-Homomorphism
    6666target(Homomorphism)            return a Module, target of the Homomorphism
    6767source(Homomorphism)            return a Module, source of the Homomorphism
     
    7272makeVector(vector,Module)               creates Vector in the given Module
    7373netVector(Vector)                       prints Vector
    74 netMatrix(Matrix)                       prints Matrix 
     74netMatrix(Matrix)                       prints Matrix
    7575presentation(Module)                    converts M as a Subquotient to the Coker of a matrix C
    7676tensorMatrix(Matrix,Matrix)             computes tensorproduct of two Matrices
     
    282282
    283283proc 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
    285285RETURN: a free Module over the ring r, with rank n, and degrees l for the generators
    286286NOTE: -1 for nor graduation and 0 to set every degree to 0
     
    291291int mydeg=0;
    292292FreeModule M;
    293 M.over= basis;                 
    294 M.Rank = myrank;               
     293M.over= basis;
     294M.Rank = myrank;
    295295list l=-1;
    296296M.isgraded=0;
    297297if(!(comparedeg(degrees,l))){
    298         M.isgraded=1;           
     298        M.isgraded=1;
    299299        l=0;
    300         if(comparedeg(degrees,l)){     
     300        if(comparedeg(degrees,l)){
    301301                for(int j=1;j<=myrank;j++){
    302302                        M.grading[j]=mydeg;
     
    306306        else{
    307307        if(myrank!=size(degrees)){ERROR("Graduation incorrect")}
    308         M.grading=degrees;     
     308        M.grading=degrees;
    309309        }
    310310}
     
    340340list mydeg;
    341341Matrix M;
    342 M.ishomogenous=1;               
     342M.ishomogenous=1;
    343343M.over=basering;
    344344int a;
    345345int j;
    346346for(int i=1;i<=ncols(m);i++){
    347         a=0;           
     347        a=0;
    348348        for(j=1;j<=nrows(m);j++){
    349                 if(m[i][j]!=0){                 
     349                if(m[i][j]!=0){
    350350                        a=Deg(m[i][j]);
    351                         break; 
     351                        break;
    352352                }
    353         }       
     353        }
    354354        mydeg[i]=t[j]+a;
    355355}
    356 M.target = N;                   
    357 M.source = freeModule(basering,ncols(m),mydeg); 
     356M.target = N;
     357M.source = freeModule(basering,ncols(m),mydeg);
    358358M.hom = m;
    359359setring(R);
     
    364364
    365365static proc comparedeg(list l,list j){
    366 if(size(l)!=size(j)){return(0);}       
    367 for(int i=1;i<=size(l);i++){           
     366if(size(l)!=size(j)){return(0);}
     367for(int i=1;i<=size(l);i++){
    368368        if(l[i]!=j[i]){return(0);}
    369369}
     
    377377int j;
    378378int f;
    379 list mydeg;     
     379list mydeg;
    380380list controldeg;
    381381for(int i=1;i<=ncols(m);i++){
     
    383383        controldeg[i]=0;
    384384        for(j=1;j<=nrows(m);j++){
    385                 if(m[j,i]!=0){         
     385                if(m[j,i]!=0){
    386386                        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                        }
    389389                        mydeg[i]=Deg(m[j,i]);
    390390                        controldeg[i]=1;
     
    392392        }
    393393}
    394 return(mydeg)   
     394return(mydeg)
    395395}
    396396
     
    483483Resolution R;
    484484R.reso=mres(m,j);
    485 matrix a=R.reso[1];             
    486 R.dd[1]=makeMatrix(a);                 
    487 if(!(R.dd[1].ishomogenous)){   
     485matrix a=R.reso[1];
     486R.dd[1]=makeMatrix(a);
     487if(!(R.dd[1].ishomogenous)){
    488488        R.isgraded=0;
    489489        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);
    492492        }
    493493
     
    496496        R.isgraded=1;
    497497        for(int i=2;i<=(size(R.reso));i++){
    498                 a=R.reso[i];           
     498                a=R.reso[i];
    499499                mydeg=R.dd[i-1].source.grading;
    500500                R.dd[i]=resMatrix(a,mydeg,R.dd[i-1].source);
     
    524524"USAGE: sRes(M,n); M Module or Ideal, n integer
    525525RETURN: 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 
     526NOTE: n is optional, if n ist positiv only that many steps will be computed
    527527      use R.dd[i]; to return the diffrent modules as image of matrices, R Resolution i integer
    528528EXAMPLE. example sRes, shows an example"
     
    545545Resolution R;
    546546R.reso=sres(m,j);
    547 matrix a=R.reso[1];     
    548 R.dd[1]=makeMatrix(a);                 
     547matrix a=R.reso[1];
     548R.dd[1]=makeMatrix(a);
    549549if(!(R.dd[1].ishomogenous)){
    550550        R.isgraded=0;
    551551        for(int i=2;i<(size(R.reso)+1);i++){
    552552                a=R.reso[i];
    553                 R.dd[i]=nongradedMatrix(a);     
     553                R.dd[i]=nongradedMatrix(a);
    554554        }
    555555
     
    558558        R.isgraded=1;
    559559        for(int i=2;i<(size(R.reso));i++){
    560                 a=R.reso[i];   
     560                a=R.reso[i];
    561561                mydeg=R.dd[i-1].source.grading;
    562562                R.dd[i]=resMatrix(a,mydeg,R.dd[i-1].source);
     
    586586"USAGE: Res(M,n); M Module or Ideal, n integer
    587587RETURN: Resolution, resolution with graded modules
    588 NOTE: n is optional, if n ist positiv only that many steps will be computed 
     588NOTE: n is optional, if n ist positiv only that many steps will be computed
    589589      use R.dd[i]; to return the diffrent modules as image of matrices, R Resolution i integer
    590590EXAMPLE. example Res, shows an example"
     
    607607Resolution R;
    608608R.reso=res(m,j);
    609 matrix a=R.reso[1]; 
    610 R.dd[1]=makeMatrix(a);                 
     609matrix a=R.reso[1];
     610R.dd[1]=makeMatrix(a);
    611611if(!(R.dd[1].ishomogenous)){
    612612        R.isgraded=0;
    613613        for(int i=2;i<(size(R.reso)+1);i++){
    614614                a=R.reso[i];
    615                 R.dd[i]=nongradedMatrix(a);     
     615                R.dd[i]=nongradedMatrix(a);
    616616        }
    617617
     
    811811 matrix m[2][2]=x,y3,z,xz;
    812812 Matrix Ma=m;
    813  FreeModule M=Source(Ma); 
     813 FreeModule M=Source(Ma);
    814814 M;
    815815 Degree(M);
     
    836836                for(j=1;j<=nrows(m);j++){
    837837                        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                }
    841841        }
    842842        s1="   ";
     
    11291129}
    11301130
    1131 if (M.isgraded == 1){   
     1131if (M.isgraded == 1){
    11321132        ret3 = net("Graded with:") + net(M.grading);
    11331133}
     
    14431443////////////////////////////////////////////////////////////////////////////////////////////////////////
    14441444
    1445 //Eigene Funktionen 
     1445//Eigene Funktionen
    14461446
    14471447////////////////////////////////////////////////////////////////////////////////////////////////////////
     
    14521452RETURN: nothing, prints the Module
    14531453EXAMPLE: example printModule; shows an example
    1454 {       
     1454{
    14551455        netModuleShort(M);
    14561456}
     
    15341534N;
    15351535print("");
    1536 print("From source"); 
     1536print("From source");
    15371537printFreeModule(M.source);
    15381538print("");
     
    15401540printFreeModule(M.target);
    15411541print("");
    1542 print("Ring:"); 
     1542print("Ring:");
    15431543M.over;*/
    15441544return(N);
     
    16911691
    16921692
    1693 proc tensorMatrix(Matrix A, Matrix B) 
     1693proc tensorMatrix(Matrix A, Matrix B)
    16941694"USAGE = tensorMatrix(A,B); A,B Matrix over the same ring
    16951695RETURN: Tensorprodukt of A,B
     
    17251725        target_grading = 0; //vorlÀufig
    17261726}
    1727 T.target = freeModule(A.over,A.target.Rank*B.target.Rank,target_grading); 
     1727T.target = freeModule(A.over,A.target.Rank*B.target.Rank,target_grading);
    17281728return(T);
    17291729}
    17301730
    1731 example 
     1731example
    17321732{
    17331733"EXAMPLE:"; echo=2;
     
    17621762}
    17631763
    1764 example 
     1764example
    17651765{
    17661766"EXAMPLE:"; echo=2;
     
    18001800}
    18011801
    1802 example 
     1802example
    18031803{
    18041804"EXAMPLE:"; echo=2;
     
    18441844}
    18451845
    1846 example 
     1846example
    18471847{
    18481848"EXAMPLE:"; echo=2;
     
    18611861
    18621862
    1863 proc pruneModule(Module M) 
     1863proc pruneModule(Module M)
    18641864"USAGE = pruneModule(M); M Module
    18651865RETURN: M in a simplyfied presentation
     
    19451945                                //dividing Pivot col with Pivot element
    19461946                                //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++) {
    19481948                                        if (k!=j) {
    19491949                                        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];
    19511951                                        }//change all columns except pivot column
    19521952                                }
     
    20082008        }
    20092009        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.
    20112011        list preinterpr;
    20122012        vector v;
     
    20252025                        v = [(-1)*needthislater[1..rows,j]];
    20262026                        preinterpr[k] = v;
    2027                 }                       
     2027                }
    20282028        }
    20292029        N.interpretation[2] = preinterpr;
     
    20472047        int i = int(p);
    20482048        if (char(basering) != 0) {
    2049                 if (gcd(char(basering),i) == 1){ return(1); } 
     2049                if (gcd(char(basering),i) == 1){ return(1); }
    20502050                else{ return(0); }
    20512051        }else{
     
    20632063proc interpretElem(Vector Elmt, int #)
    20642064"USAGE = interpretElem(V,n); Vector Elmt, n integer
    2065 RETURN: interpretation of a Vector with # steps or until can't interpret further 
     2065RETURN: interpretation of a Vector with # steps or until can't interpret further
    20662066EXAMPLE: example interpretElem; shows an example"
    20672067{
     
    20892089
    20902090proc 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
    20922092RETURN: interpretation of Elements in some abstract structure defined by the user or into a Module
    20932093EXAMPLE: example interpretList; shows an example"
     
    21242124proc reduceIntChain(Module C, int #)
    21252125"USAGE = reduceIntChain(C,n); C Module, n int
    2126 RETURN: Module C with minimized (or # steps) interpretation list 
     2126RETURN: Module C with minimized (or # steps) interpretation list
    21272127EXAMPLE: example reduceIntChain; shows an example"
    21282128{
     
    21502150                        (C.interpretation)[2] = preList;
    21512151                        // 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++) {
    21532153                                intList[i] = interpret((C.interpretation)[1][i]);
    21542154                        }
     
    21582158                }
    21592159        }
    2160        
     2160
    21612161        return(C);
    21622162}
     
    21762176
    21772177
    2178 proc interpret(Vector V) 
     2178proc interpret(Vector V)
    21792179"USAGE = interpret(V); V Vector
    21802180RETURN: interpretation of V into some space that is stored in the interpretationlist of V.space
     
    22012201                W = W + V.space.interpretation[1][i]*myCoeffs[i,1]; //user needs to define '+' as well
    22022202        }
    2203         return(W);     
     2203        return(W);
    22042204}
    22052205
     
    22342234
    22352235
    2236 proc interpretInv(def V, Module N) 
     2236proc interpretInv(def V, Module N)
    22372237"USAGE = interpretInv(V,N); V Vector or Homomorphism, N Module
    22382238RETURN: interpretation of V into some Module N (inverse to interpret)
     
    22422242                Module M = V.space;
    22432243                //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)) {
    22452245                // third condition checks whether the given modules are related
    22462246                        //in this case we decompose v into the generators of its Module and project those onto the generators of N
    22472247                        list DivVec = division(V.entries,M.generators.hom);
    22482248                        matrix myCoeffs = DivVec[1];
    2249                         vector w = N.interpretation[2][1]*myCoeffs[1,1]; 
     2249                        vector w = N.interpretation[2][1]*myCoeffs[1,1];
    22502250                        //inverse maps only contain elements of type vector
    22512251                        int i;
    22522252                        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];
    22542254                        }
    22552255                        Vector W = w,N;
    2256                         return(W);     
     2256                        return(W);
    22572257                }
    22582258                //If not, check wheter there exists an interpretationlist to N in the Module of V:
     
    23942394
    23952395
    2396 static proc concMatrix(Matrix A,Matrix B) 
     2396static proc concMatrix(Matrix A,Matrix B)
    23972397"USAGE = concMatrix(A,B); A,B Matrix over the same ring
    23982398RETURN: concatinated Matrix with concatinated grading
     
    24322432        list L1 = F1.grading;
    24332433        list L2 = F2.grading;
    2434        
     2434
    24352435        if (F1.isgraded == 0 || F2.isgraded == 0){
    24362436                return(-1);
  • Singular/LIB/nets.lib

    rba3f63 ra8b25b8  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id$";
     2version="version nets.lib 4.1.1.0 Jan_2018 "; // $Id$
    33category="Miscellaneous";
    44info="
     
    6767//
    6868        ring r5 = 7,(x,y,z),ds;
    69 //     
     69//
    7070        ring r6 = 10,(x,y,z),ds;
    7171//
    7272        ring r7 = 7,(x(1..6)),(lp(3),dp);
    7373//
    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));
    7575//
    7676        ring r9 = 0,(x,y,z),(c,wp(2,1,3));
     
    132132                S=S+" ";
    133133        }
    134        
     134
    135135return(S);
    136136}
     
    167167        Net NM;
    168168        NM.rows=LN+LM;
    169        
     169
    170170return(NM);
    171171}
     
    208208        Net NM;
    209209        NM.rows=L;
    210        
     210
    211211return(NM);
    212212}
     
    351351        }
    352352        */
    353         string S=string(n)+string("^")+string(m);       
     353        string S=string(n)+string("^")+string(m);
    354354return(net(/*(n)+net("^")+net(r)*/ S));
    355355}
     
    365365
    366366//
    367 //  netRing 
     367//  netRing
    368368//
    369369proc netRing(def R)
     
    382382             Net N=netCoefficientRing(R)+net("[")+net(string(RL[2]))+net("] / ")+net(RL[4]);
    383383        }
    384        
     384
    385385return(N);
    386386}
    387387example
    388388{
    389 "EXAMPLE:"; // from 3.3.1 Examples of ring declarations 
     389"EXAMPLE:"; // from 3.3.1 Examples of ring declarations
    390390        ring r1 = 32003,(x,y,z),dp;
    391391        netRing(r1);
     
    402402        ring r5 = 7,(x,y,z),ds;
    403403        netRing(r5);
    404 //     
     404//
    405405        ring r6 = 10,(x,y,z),ds;
    406406        netRing(r6);
     
    409409        netRing(r7);
    410410//
    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));
    412412        netRing(r8);
    413413//
     
    449449
    450450//
    451 //  netMap 
     451//  netMap
    452452//
    453453proc netMap( map f)
     
    467467
    468468// 1
    469         Map=string(nameof(f)); 
     469        Map=string(nameof(f));
    470470        Source=string(nameof(preimage(f)));
    471471        Target=string(nameof(basering));
     
    475475        Output[1]=Output[1]+" , "+string(ringlist(preimage(f))[2][1])+" -> "+string(f[1]);
    476476
    477 // 2   
     477// 2
    478478        for (i=2; i<=v; i++){// +2
    479479                Output[i]=emptyString(empty)+" , "+string(ringlist(preimage(f))[2][i])+" -> "+string(f[i]);
    480480        }// -2
    481        
     481
    482482// 3
    483483        M.rows=Output;
    484484
    485 // -   
     485// -
    486486        return(M);
    487487}
     
    499499
    500500//
    501 //  netMap2 
     501//  netMap2
    502502//
    503503proc netMap2( map f)
     
    529529                Output[1]=Output[1]+" , "+string(ringlist(preimage(f))[2][i])+" -> "+string(f[i]);
    530530        }// -2
    531        
     531
    532532// 3
    533533        M.rows=Output;
    534        
     534
    535535// -
    536536        return(M);
     
    558558EXAMPLE: example netBigIntMatrix; shows an example
    559559"
    560 { 
     560{
    561561// 0
    562562        int Length=100; //Length of Output
     
    592592{
    593593// 0
    594         int Length=10; // LÀnge der Ausgabe 
     594        int Length=10; // LÀnge der Ausgabe
    595595        string S;
    596596    list L, SizeCol, SizeColShort;
     
    602602                Length=#[1];
    603603        }// - 1
    604    
     604
    605605// 2
    606606   for (j=1; j <= ncols(M); j++){// +2
    607607                SizeCol[j]=0;
    608608        }// -2
    609        
    610 // 3   
     609
     610// 3
    611611        for (j=1; j <= ncols(M); j++){// +3
    612612                SizeColShort[j]=0;
    613613        }// -3
    614        
     614
    615615// 4
    616616        for (j=1; j <= ncols(M); j++){// +4
     
    629629                }// -5.1
    630630        }// -5
    631        
     631
    632632// 6
    633633    for (i=1; i<=nrows(M); i++ ){// +6
     
    639639                        if ( size(string(M[i,j])) > Length ){// +6.1.2.1
    640640                                S=S+string(M[i,j])[1,Length]+"...";
    641                         }// -6.1.2.1 
     641                        }// -6.1.2.1
    642642                        else{// +6.1.2.2
    643643                                defect=SizeColShort[j]+3-size(string(M[i,j]));
     
    653653        S="";
    654654    }// -6
    655    
    656 // 7     
     655
     656// 7
    657657    for (j=1; j<=nrows(M); j++){// +7
    658658       L[j]="| "+L[j]+" |";
    659659    }// -7
    660660
    661 // 8   
     661// 8
    662662    Net NM;
    663663    NM.rows=L;
     
    691691EXAMPLE: example netBigIntMat; shows an example
    692692"
    693 { 
    694 // 0   
     693{
     694// 0
    695695        int m=nrows(M);
    696696        int n=ncols(M);
     
    699699        bigintmat B[m][n]=M;
    700700        Net Output=netBigIntMat(B);
    701        
     701
    702702// -
    703703        return(Output);
     
    713713intmat M[2][2]=a,b,c,d;
    714714netIntMat(M);
    715 }       
     715}
    716716
    717717
     
    728728EXAMPLE: example netIntMatShort; shows an example
    729729"
    730 {       
     730{
    731731// 0
    732732        int m=nrows(M);
     
    737737
    738738// 2
    739         if( size(#)!=0 ){// +2.1       
     739        if( size(#)!=0 ){// +2.1
    740740                Net Output=netBigIntMatShort(B, #[1]);
    741741        }// -2.1
     
    743743                Net Output=netBigIntMatShort(B);
    744744        }// -2.2
    745                
     745
    746746// -
    747747        return(Output);
     
    826826        else{// +2.2
    827827                Output=netIntMatShort(M);
    828         }// -2.2       
     828        }// -2.2
    829829
    830830// -
     
    864864                Size=#[1];
    865865        }// -1
    866    
     866
    867867// -
    868868        return(netmatrixShort(M, Size));
     
    896896EXAMPLE: example netmatrixShort; shows an example
    897897"
    898 { 
     898{
    899899        int i, j;
    900900        list breite = list();
    901901        Net Output;
    902902        string Zeile;
    903        
     903
    904904        //maximale Spaltenbreite setzen
    905905        for (i=1; i<=ncols(M); i++){
     
    911911                }
    912912        }
    913        
     913
    914914        //einfÃŒgen
    915915        for (i=1; i<=nrows(M); i++){
     
    917917                for (j=1; j<=ncols(M); j++){
    918918                        Zeile = Zeile + string(M[i,j]) + emptyString( breite[j] - size(string(M[i,j])) + 1);
    919                        
     919
    920920                }
    921921                Output.rows[i] = Zeile + "|";
    922922        }
    923        
     923
    924924        return (Output);
    925925}
     
    10461046"
    10471047{
    1048 // 0 
     1048// 0
    10491049        matrix M=matrix(V);
    10501050        int Size=25;
     
    10591059        Output=netmatrix(M, Size);
    10601060
    1061 // - 
     1061// -
    10621062        return(Output);
    10631063}
     
    10791079
    10801080//
    1081 //  netvectorShort 
     1081//  netvectorShort
    10821082//
    10831083proc netvectorShort(vector V, list #)
     
    11831183                                                } // (2.1.2.1.1)
    11841184                                                else { // (2.1.2.1.2)
    1185                                                 Down=Down+string( leadcoef(Q) ); 
     1185                                                Down=Down+string( leadcoef(Q) );
    11861186                                                Up=Up+emptyString( size( string( leadcoef(Q) ) ) ); //size(leadcoef(-1))=1, deshalb size(string ...
    11871187                                                }// (2.1.2.1.2)
    11881188                                        } // (2.1.2.1)
    11891189                                        else { // (2.1.2.2)
    1190                                                 Down=Down+string( leadcoef(Q) ); // leading coef 
     1190                                                Down=Down+string( leadcoef(Q) ); // leading coef
    11911191                                                Up=Up+emptyString( size( string( leadcoef(Q) ) ) );
    11921192                                        }// (2.1.2.2
    1193                                 } // (2.1.2)           
     1193                                } // (2.1.2)
    11941194                                S=size( ringlist(basering)[2] ); //variables
    11951195                                for ( i=1; i<=S; i++) { // (2.1.1)
    11961196                                        if ( leadexp(Q)[i] == 0 ) { // (2.1.1.1)
    11971197                                        }
    1198                                         else { // (2.1.1.2))   
     1198                                        else { // (2.1.1.2))
    11991199                                                Down=Down+string( ringlist( basering )[2][i] );
    12001200                                                Up=Up+emptyString( size (string( ringlist( basering )[2][i] ) ) );
     
    12241224                                                } // (2.2.2.1.1)
    12251225                                                else { // ()
    1226                                                 Down=Down+string( leadcoef(Q) ); 
     1226                                                Down=Down+string( leadcoef(Q) );
    12271227                                                Up=Up+emptyString( size( string( leadcoef(Q) ) ) ); //size(leadcoef(-1))=1
    12281228                                                }// (2.2.2.1.2)
     
    12311231                                                Down=Down+"+";
    12321232                                                Up=Up+" ";
    1233                                                 Down=Down+string( leadcoef(Q) ); // leading coef 
     1233                                                Down=Down+string( leadcoef(Q) ); // leading coef
    12341234                                                Up=Up+emptyString( size( string( leadcoef(Q) ) ) );
    12351235                                        } // (2.2.2.2)
     
    12401240                                        if ( leadexp(Q)[i] == 0 ) { // (2.2.3.1)
    12411241                                        } // (2.2.3.1)
    1242                                         else { // (2.2.3.2)     
     1242                                        else { // (2.2.3.2)
    12431243                                                Down=Down+string( ringlist( basering )[2][i] );
    12441244                                                Up=Up+emptyString( size (string( ringlist( basering )[2][i] ) ) );
     
    12651265{
    12661266"EXAMPLE:"; // from 3.3.1 Examples of ring declarations
    1267 //     
     1267//
    12681268        ring R1 = 32003,(x,y,z),dp;
    12691269        poly q6=1;
     
    12961296
    12971297        ring R2 = 32003,(x(1..10)),dp;
    1298        
     1298
    12991299        poly w6=1;
    13001300        print(w6);
     
    13691369        netPoly(p2);
    13701370
    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;
    13731373        p;
    13741374        netPoly(p);
     
    14091409                N=N+string(I[i])+string(", ");
    14101410        } // (1)
    1411  
     1411
    14121412        N=N+string(I[size(I)])+string(">");
    14131413        return(net(N));
  • Tst/Short/ok_s.lst

    rba3f63 ra8b25b8  
    103103modular_s
    104104modstd_s
     105modules
     106nets
    105107ncfactor_facNthShift1_s
    106108ncfactor_landau_ex_s
Note: See TracChangeset for help on using the changeset viewer.