Changeset ebbcea in git


Ignore:
Timestamp:
Mar 21, 2011, 11:28:13 AM (13 years ago)
Author:
Stefan Steidel <steidel@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'b21a664aa22dc6e196223af8a74ad4885e83547c')
Children:
f4a33e267c2b5be378ef1fc5426935bee8f1e4d9
Parents:
3542f7c7fb52228c2cae41980c84109e503eaf75
Message:
Added procedure that sorts list of primary/prime ideals.

git-svn-id: file:///usr/local/Singular/svn/trunk@14020 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Tst/Long/primdecint.tst

    r3542f7 rebbcea  
    44LIB "primdecint.lib";
    55
     6proc sortPDZ(list l)
     7{
     8   int i,j,notReady;
     9   list K;
     10   intvec save_opt=option(get);
     11   option(redSB,redTail);
     12   for(i=1;i<=size(l);i++){"start";l[i][1]=std(l[i][1]);l[i][2]=std(l[i][2]);"end";}
     13   option(set,save_opt);
     14   notReady=1;
     15   while(notReady)
     16   {
     17      notReady=0;
     18      i=0;
     19      while(i<size(l)-1)
     20      {
     21         i++;
     22         j=i;
     23         while(j<size(l))
     24         {
     25            j++;
     26            if(compareI(l[i][2],l[j][2]))
     27            {
     28               notReady=1;
     29               K=l[i];
     30               l[i]=l[j];
     31               l[j]=K;
     32               i--;
     33               break;
     34            }
     35         }
     36      }
     37   }
     38   return(l); 
     39}
     40
     41proc compareI(ideal I, ideal J)
     42{
     43   return(string(I)>string(J));
     44}
     45
     46
    647ring R1 = integer,(a,b,c,d,e,f,g),dp;
    748ideal I = 2*3,a2+2de+2cf+2bg+a, 2ab+e2+2df+2cg+b,
    849          b2+2ac+2ef+2dg+c, 2bc+2ad+f2+2eg+d,
    950          c2+2bd+2ae+2fg+e, 2cd+2be+2af+g2+f, d2+2ce+2bf+2ag+g;
    10 primdecZ(I,1);
    11 primdecZ(I,3);
     51sortPDZ(primdecZ(I,1));
     52sortPDZ(primdecZ(I,3));
    1253
    1354
     
    1556ideal I = 2*3*181*32003, xzw+(-y^2+y)*z^2, (-x^2+x)*w^2+yzw,
    1657          ((y^4-2*y^3+y^2)*x-y^4+y^3)*z^3,y2z2w+(-y*4+2*y^3-y^2)*z3;
    17 primdecZ(I,1);
    18 primdecZ(I,3);
     58sortPDZ(primdecZ(I,1));
     59sortPDZ(primdecZ(I,3));
    1960
    2061ring R5 = integer,(x,y,z),dp;
    2162ideal I = 2*13*181*32003, x2-y2-z2, xy-z2, y3+xz2-yz2+2z3+xy-z2,
    2263          -y2z2+2z4+x2-y2+z2, y3z9+3y2z10+3yz11+z12-y2z2+2z4;
    23 primdecZ(I,1);
    24 primdecZ(I,3);
     64sortPDZ(primdecZ(I,1));
     65sortPDZ(primdecZ(I,3));
    2566
    2667ring R7 = integer,(x,y,z),dp;
     
    2970          -y^2*(z+2)^2+2*(z+2)^4+x2-y2+(z+2)^2,
    3071          y3z9+3y2z10+3yz11+z12-y2z2+2z4;
    31 primdecZ(I,1);
    32 primdecZ(I,2);
    33 primdecZ(I,3);
    34 primdecZ(I,4);
     72sortPDZ(primdecZ(I,1));
     73sortPDZ(primdecZ(I,2));
     74sortPDZ(primdecZ(I,3));
     75sortPDZ(primdecZ(I,4));
    3576
    3677ring R8 = integer,(x,y,z),dp;
     
    3980          -y^2*(z+2)^2+2*(z+2)^4+x2-y2+(z+2)^2,
    4081          y3z9+3y2z10+3yz11+z12-y2z2+2z4;
    41 primdecZ(I,1);
    42 primdecZ(I,3);
     82sortPDZ(primdecZ(I,1));
     83sortPDZ(primdecZ(I,3));
    4384
    4485ring R9 = integer,(w,z,y,x),dp;
    4586ideal I = 2*3*5*630, ((y^2-y)*x-y^3+y^2)*z^2, (x-y)*zw,
    4687          (x-y^2)*zw+(-y^2+y)*z^2, (-x^2+x)*w^2+(-yx+y)*zw;
    47 primdecZ(I,1);
    48 primdecZ(I,3);
     88sortPDZ(primdecZ(I,1));
     89sortPDZ(primdecZ(I,3));
    4990
    5091ring R10 = integer,(w,z,y,x),dp;
     
    5293          ((-y^2+y)*x-y^3+2*y^2-y)*z^3,
    5394          (y^2-y)*z^2*w+(-y^2+y)*z^2*w+(-y^2+y)*z^3;
    54 primdecZ(I,1);
    55 primdecZ(I,3);
     95sortPDZ(primdecZ(I,1));
     96sortPDZ(primdecZ(I,3));
    5697
    5798ring R11 = integer,(w,z,y,x),dp;
     
    63104          (x + 1)*zw +(- y^2 -y)*z^2,
    64105          (x^2 +x)*w^2 + (-yx - y)*zw;
    65 primdecZ(I,1);
    66 primdecZ(I,2);
    67 primdecZ(I,3);
    68 primdecZ(I,4);
     106sortPDZ(primdecZ(I,1));
     107sortPDZ(primdecZ(I,2));
     108sortPDZ(primdecZ(I,3));
     109sortPDZ(primdecZ(I,4));
    69110
    70111ring R12 = integer,(w,z,y,x),dp;
     
    73114          (y + 1)*zw + (-y^3 -y^2)*z^2,
    74115          (x + 1)*zw + (-y^2 -y)*z^2, (x^2 + x)*w^2 + (-yx - y)*zw;
    75 primdecZ(I,1);
    76 primdecZ(I,3);
     116sortPDZ(primdecZ(I,1));
     117sortPDZ(primdecZ(I,3));
    77118
    78119ring R14 = integer,(x(1),x(2),x(3),x(4)),dp;
     
    80121          x(2)^2*x(4)^2, x(2)^2*x(3)*x(4), x(1)*x(2)*x(3)*x(4),
    81122          x(1)*x(3)^2*x(4), x(3)^3*x(4);
    82 primdecZ(I,1);
    83 primdecZ(I,3);
     123sortPDZ(primdecZ(I,1));
     124sortPDZ(primdecZ(I,3));
    84125
    85126ring R15 = integer,(x,y,z),dp; 
     
    92133          (z^3 - z^2)*x^4 + (2*z^3 -2*z^2)*x^3 + (z^3 -z^2)*x^2,
    93134          z*y^2*x^2;
    94 primdecZ(I,1);
    95 primdecZ(I,3);
     135sortPDZ(primdecZ(I,1));
     136sortPDZ(primdecZ(I,3));
    96137
    97138ring R16 = integer,(x(1),x(2),x(3),x(4),x(5)),dp;
     
    104145I = intersectZ(I,ideal(64*181,x(1)^2));
    105146I;
    106 primdecZ(I,1);
    107 primdecZ(I,2);
    108 primdecZ(I,3);
    109 primdecZ(I,4);
     147sortPDZ(primdecZ(I,1));
     148sortPDZ(primdecZ(I,2));
     149sortPDZ(primdecZ(I,3));
     150sortPDZ(primdecZ(I,4));
    110151
    111152ring R17 = integer,(x,y,z),dp;
     
    116157          136xy-136xz-136yz+2z6-281z4+5376z2-3081,
    117158          204x2+136xz3-3128xz+z6-149z4+2739z2+117;
    118 primdecZ(I,1);
    119 primdecZ(I,3);
     159sortPDZ(primdecZ(I,1));
     160sortPDZ(primdecZ(I,3));
    120161
    121162ring R24 = integer,(a,b,c,d,e,f,g,h,j),dp;
    122163ideal I = 2*3*5*7*11*13*17, a+2b+c-d+g, f2gh-a, efg-c, fg2j-b,
    123164          a+b+c+f+g-1, 3ad+3bd+2cd+df+dg-a-2b-c-g;
    124 primdecZ(I,1);
    125 primdecZ(I,3);
     165sortPDZ(primdecZ(I,1));
     166sortPDZ(primdecZ(I,3));
    126167
    127168ring R25 = integer,(s,r,b,u,v,w,x,y,z),dp;
    128169ideal I = 2*3*5*7*11*13*17*19*23, su+bv, ru+bw, rv+sw, sx+by, rx+bz,
    129170          ry+sz, vx+uy, wx+uz, wy+vz;
    130 primdecZ(I,1);
    131 primdecZ(I,3);
     171sortPDZ(primdecZ(I,1));
     172sortPDZ(primdecZ(I,3));
    132173
    133174tst_status(1);$
Note: See TracChangeset for help on using the changeset viewer.