Changeset 2fa80a in git for Singular


Ignore:
Timestamp:
Nov 6, 2013, 6:07:39 PM (10 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
823679a657c538153cba3a477bf92e2c9102c451
Parents:
2ea781ea236dc6d65399e46b262e9954538749a1d600e1863951bfc5135d0138b61badb20b1ec70a
Message:
Merge pull request #414 from steenpass/resources_sw

release acquired semaphores before shutdown
Location:
Singular
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/binresol.lib

    rd600e18 r2fa80a  
    11///////////////////////////////////////////////////////////////////////////
    22version="version binresol.lib 4.0.0.0 Jun_2013 "; // $Id$
    3 category="Commutaive algebra";
     3category="Commutative algebra";
    44info="
    55LIBRARY: binresol.lib    Combinatorial algorithm of resolution of singularities
  • Singular/LIB/ellipticcovers.lib

    rd600e18 r2fa80a  
    2323over a rational function. The path integral is computed as a residue.
    2424
    25 The sum of N_(G,b) over all branch types b of sum d gives the
     25The sum of N_(G,b) over all branch types b of sum d gives N_(G,d)*|Aut(G)|, with the
    2626Gromov-Witten invariant N_(G,d) of degree d stable maps from a genus g curve
    2727of topological type G to the elliptic curve.
     
    380380THEORY:  Computes @*
    381381
    382          - the Gromov-Witten of a given propagator P, or @*
    383 
    384          - the invariant N_(G,d) where d is the degree of the covering, or @*
     382         - the Gromov-Witten invariant of a given propagator P, or @*
     383
     384         - the invariant N_(G,d)*|Aut(G)| where d is the degree of the covering, or @*
    385385
    386386         - the number N_(G,b) of coverings with source G and target an elliptic curves with branch type a over a
  • Singular/LIB/primdec.lib

    rd600e18 r2fa80a  
    37693769    I=interred(I+F);option(set,save);return(I);
    37703770   }
    3771    I=simplify(I,1);
     3771   //I=simplify(I,1);
    37723772
    37733773   for(i=1;i<=n;i++)             //consider all polynomials over
     
    37803780   ideal F=imap(R,F);
    37813781
    3782    string nR="ring @S="+string(p)+",(y(1..m),"+varstr(R)+","+parstr(R)+"),dp;";
     3782   string nR1="ring @S1="+string(p)+",("+varstr(R)+","+parstr(R)+",@y(1..m)),dp;";
     3783   execute(nR1);
     3784   list lR=ringlist(@S1)[2];
     3785   lR=lR[(size(lR)-m+1)..(size(lR))];
     3786
     3787   string nR="ring @S="+string(p)+",("+string(lR)+","+varstr(R)+","+parstr(R)+"),dp;";
    37833788   execute(nR);
    37843789
     
    37923797   {
    37933798      J=J,var(i)^k-var(m+n+i);
    3794       el=el*y(i);
     3799      el=el*var(i);
    37953800   }
    37963801
  • Singular/LIB/schubert.lib

    rd600e18 r2fa80a  
    11////////////////////////////////////////////////////////////////////////////////
    2 version="version schubert.lib 4.0.0.0 Jun_2013 "; // $Id$
     2version="version schubert.lib 4.0.0.0 Nov_2013 "; // $Id$
    33category="Algebraic Geometry";
    44info="
    5 LIBRARY:    Schubert.lib    Proceduces for Intersection Theory
    6 
    7 AUTHOR:     Hiep Dang,      email: hiep@mathematik.uni-kl.de
     5LIBRARY:    schubert.lib    Proceduces for Intersection Theory
     6
     7AUTHOR:     Hiep Dang,          email: hiep@mathematik.uni-kl.de
    88
    99OVERVIEW:
    1010
    1111    We implement new classes (variety, sheaf, stack, graph) and methods for
    12     computing with them. Here a variety is represented by a nonnegative integer
    13     which is its dimension and a graded ring which is its Chow ring. A sheaf is
    14     represented by a variety and a polynomial which is its Chern character.
    15     In particular, we implement the concrete varieties such as projective spaces
    16     , Grassmannians, and projective bundles.
     12    computing with them. An abstract variety is represented by a nonnegative
     13    integer which is its dimension and a graded ring which is its Chow ring.
     14    An abstract sheaf is represented by a variety and a polynomial which is its
     15    Chern character. In particular, we implement the concrete varieties such as
     16    projective spaces, Grassmannians, and projective bundles.
    1717
    1818    An important task of this library is related to the computation of
     
    2424    Kontsevich, and the graphs corresponding to the fixed point components of a
    2525    torus action on the moduli spaces of stable maps.
     26
     27    As an insightful example, the numbers of rational curves on general complete
     28    intersection Calabi-Yau threefolds in projective spaces are computed up to
     29    degree 6. The results are all in agreement with predictions made from mirror
     30    symmetry computations.
    2631
    2732REFERENCES:
     
    95100    dualPartition(list)                 compute the dual of a partition
    96101
    97 KEYWORDS:       Intersection Theory; Enumerative Geometry; Schubert Calculus;
    98                 Bott's formula.
     102KEYWORDS:       Intersection theory; Enumerative geometry; Schubert calculus;
     103                Bott's formula; Gromov-Witten invariants.
    99104
    100105";
     
    217222"
    218223{
    219     int i,j,k,h,m,n,p;
     224    int i,j,k,h,m,n,p,q;
    220225    list l;
    221226    int d = M.degreeCurve;
     
    228233            if (i <> j)
    229234            {
    230                 l = insert(l,list(graph1(d,i,j),2*d),size(l));
     235                l[size(l)+1] = list(graph1(d,i,j),2*d);
    231236            }
    232237        }
     
    242247                    if (i <> j and j <> k)
    243248                    {
    244                         l = insert(l,list(graph2(list(1,1),i,j,k),2),size(l));
     249                        l[size(l)+1] = list(graph2(list(1,1),i,j,k),2);
    245250                    }
    246251                }
     
    258263                    if (i <> j and j <> k)
    259264                    {
    260                         l = insert(l,list(graph2(list(2,1),i,j,k),2),size(l));
     265                        l[size(l)+1] = list(graph2(list(2,1),i,j,k),2);
    261266                        for (h=0;h<=r;h++)
    262267                        {
    263268                            if (h <> k)
    264269                            {
    265                                 l = insert(l,list(graph31(list(1,1,1),i,j,k,h),2),size(l));
     270                                l[size(l)+1] = list(graph31(list(1,1,1),i,j,k,h),2);
    266271                            }
    267272                            if (h <> j)
    268273                            {
    269                                 l = insert(l,list(graph32(list(1,1,1),i,j,k,h),6),size(l));
     274                                l[size(l)+1] = list(graph32(list(1,1,1),i,j,k,h),6);
    270275                            }
    271276                        }
     
    285290                    if (i <> j and j <> k)
    286291                    {
    287                         l = insert(l,list(graph2(list(3,1),i,j,k),3),size(l));
    288                         l = insert(l,list(graph2(list(2,2),i,j,k),8),size(l));
     292                        l[size(l)+1] = list(graph2(list(3,1),i,j,k),3);
     293                        l[size(l)+1] = list(graph2(list(2,2),i,j,k),8);
    289294                        for (h=0;h<=r;h++)
    290295                        {
    291296                            if (h <> k)
    292297                            {
    293                                 l = insert(l,list(graph31(list(2,1,1),i,j,k,h),2),size(l));
    294                                 l = insert(l,list(graph31(list(1,2,1),i,j,k,h),4),size(l));
     298                                l[size(l)+1] = list(graph31(list(2,1,1),i,j,k,h),2);
     299                                l[size(l)+1] = list(graph31(list(1,2,1),i,j,k,h),4);
    295300                            }
    296301                            if (h <> j)
    297302                            {
    298                                 l = insert(l,list(graph32(list(2,1,1),i,j,k,h),4),size(l));
     303                                l[size(l)+1] = list(graph32(list(2,1,1),i,j,k,h),4);
    299304                            }
    300305                            for (m=0;m<=r;m++)
     
    302307                                if (k <> h and m <> h)
    303308                                {
    304                                     l = insert(l,list(graph41(list(1,1,1,1),i,j,k,h,m),2),size(l));
     309                                    l[size(l)+1] = list(graph41(list(1,1,1,1),i,j,k,h,m),2);
    305310                                }
    306311                                if (k <> h and m <> k)
    307312                                {
    308                                     l = insert(l,list(graph42(list(1,1,1,1),i,j,k,h,m),2),size(l));
     313                                    l[size(l)+1] = list(graph42(list(1,1,1,1),i,j,k,h,m),2);
    309314                                }
    310315                                if (h <> j and m <> j)
    311316                                {
    312                                     l = insert(l,list(graph43(list(1,1,1,1),i,j,k,h,m),24),size(l));
     317                                    l[size(l)+1] = list(graph43(list(1,1,1,1),i,j,k,h,m),24);
    313318                                }
    314319                            }
     
    329334                    if (i <> j and j <> k)
    330335                    {
    331                         l = insert(l,list(graph2(list(4,1),i,j,k),4),size(l));
    332                         l = insert(l,list(graph2(list(3,2),i,j,k),6),size(l));
     336                        l[size(l)+1] = list(graph2(list(4,1),i,j,k),4);
     337                        l[size(l)+1] = list(graph2(list(3,2),i,j,k),6);
    333338                        for (h=0;h<=r;h++)
    334339                        {
    335340                            if (k <> h)
    336341                            {
    337                                 l = insert(l,list(graph31(list(3,1,1),i,j,k,h),3),size(l));
    338                                 l = insert(l,list(graph31(list(1,3,1),i,j,k,h),6),size(l));
    339                                 l = insert(l,list(graph31(list(2,2,1),i,j,k,h),4),size(l));
    340                                 l = insert(l,list(graph31(list(2,1,2),i,j,k,h),8),size(l));
     342                                l[size(l)+1] = list(graph31(list(3,1,1),i,j,k,h),3);
     343                                l[size(l)+1] = list(graph31(list(1,3,1),i,j,k,h),6);
     344                                l[size(l)+1] = list(graph31(list(2,2,1),i,j,k,h),4);
     345                                l[size(l)+1] = list(graph31(list(2,1,2),i,j,k,h),8);
    341346                            }
    342347                            if (j <> h)
    343348                            {
    344                                 l = insert(l,list(graph32(list(3,1,1),i,j,k,h),6),size(l));
    345                                 l = insert(l,list(graph32(list(2,2,1),i,j,k,h),8),size(l));
     349                                l[size(l)+1] = list(graph32(list(3,1,1),i,j,k,h),6);
     350                                l[size(l)+1] = list(graph32(list(2,2,1),i,j,k,h),8);
    346351                            }
    347352                            for (m=0;m<=r;m++)
     
    349354                                if (k <> h and h <> m)
    350355                                {
    351                                     l = insert(l,list(graph41(list(2,1,1,1),i,j,k,h,m),2),size(l));
    352                                     l = insert(l,list(graph41(list(1,2,1,1),i,j,k,h,m),2),size(l));
     356                                    l[size(l)+1] = list(graph41(list(2,1,1,1),i,j,k,h,m),2);
     357                                    l[size(l)+1] = list(graph41(list(1,2,1,1),i,j,k,h,m),2);
    353358                                }
    354359                                if (k <> h and k <> m)
    355360                                {
    356                                     l = insert(l,list(graph42(list(2,1,1,1),i,j,k,h,m),4),size(l));
    357                                     l = insert(l,list(graph42(list(1,2,1,1),i,j,k,h,m),4),size(l));
    358                                     l = insert(l,list(graph42(list(1,1,2,1),i,j,k,h,m),2),size(l));
     361                                    l[size(l)+1] = list(graph42(list(2,1,1,1),i,j,k,h,m),4);
     362                                    l[size(l)+1] = list(graph42(list(1,2,1,1),i,j,k,h,m),4);
     363                                    l[size(l)+1] = list(graph42(list(1,1,2,1),i,j,k,h,m),2);
    359364                                }
    360365                                if (j <> h and j <> m)
    361366                                {
    362                                     l = insert(l,list(graph43(list(2,1,1,1),i,j,k,h,m),12),size(l));
     367                                    l[size(l)+1] = list(graph43(list(2,1,1,1),i,j,k,h,m),12);
    363368                                }
    364369                                for (n=0;n<=r;n++)
     
    366371                                    if (k <> h and h <> m and m <> n)
    367372                                    {
    368                                         l = insert(l,list(graph51(list(1,1,1,1,1),i,j,k,h,m,n),2),size(l));
     373                                        l[size(l)+1] = list(graph51(list(1,1,1,1,1),i,j,k,h,m,n),2);
    369374                                    }
    370375                                    if (k <> h and h <> m and h <> n)
    371376                                    {
    372                                         l = insert(l,list(graph52(list(1,1,1,1,1),i,j,k,h,m,n),2),size(l));
     377                                        l[size(l)+1] = list(graph52(list(1,1,1,1,1),i,j,k,h,m,n),2);
    373378                                    }
    374379                                    if (k <> h and k <> m and k <> n)
    375380                                    {
    376                                         l = insert(l,list(graph53(list(1,1,1,1,1),i,j,k,h,m,n),6),size(l));
     381                                        l[size(l)+1] = list(graph53(list(1,1,1,1,1),i,j,k,h,m,n),6);
    377382                                    }
    378383                                    if (j <> h and h <> m and h <> n)
    379384                                    {
    380                                         l = insert(l,list(graph54(list(1,1,1,1,1),i,j,k,h,m,n),8),size(l));
     385                                        l[size(l)+1] = list(graph54(list(1,1,1,1,1),i,j,k,h,m,n),8);
    381386                                    }
    382387                                    if (k <> h and k <> m and h <> n)
    383388                                    {
    384                                         l = insert(l,list(graph55(list(1,1,1,1,1),i,j,k,h,m,n),2),size(l));
     389                                        l[size(l)+1] = list(graph55(list(1,1,1,1,1),i,j,k,h,m,n),2);
    385390                                    }
    386391                                    if (j <> h and j <> m and j <> n)
    387392                                    {
    388                                         l = insert(l,list(graph56(list(1,1,1,1,1),i,j,k,h,m,n),120),size(l));
     393                                        l[size(l)+1] = list(graph56(list(1,1,1,1,1),i,j,k,h,m,n),120);
    389394                                    }
    390395                                }
     
    406411                    if (i <> j and j <> k)
    407412                    {
    408                         l = insert(l,list(graph2(list(5,1),i,j,k),5),size(l));
    409                         l = insert(l,list(graph2(list(4,2),i,j,k),8),size(l));
    410                         l = insert(l,list(graph2(list(3,3),i,j,k),18),size(l));
     413                        l[size(l)+1] = list(graph2(list(5,1),i,j,k),5);
     414                        l[size(l)+1] = list(graph2(list(4,2),i,j,k),8);
     415                        l[size(l)+1] = list(graph2(list(3,3),i,j,k),18);
    411416                        for (h=0;h<=r;h++)
    412417                        {
    413418                            if (k <> h)
    414419                            {
    415                                 l = insert(l,list(graph31(list(4,1,1),i,j,k,h),4),size(l));
    416                                 l = insert(l,list(graph31(list(1,4,1),i,j,k,h),8),size(l));
    417                                 l = insert(l,list(graph31(list(3,2,1),i,j,k,h),6),size(l));
    418                                 l = insert(l,list(graph31(list(3,1,2),i,j,k,h),6),size(l));
    419                                 l = insert(l,list(graph31(list(1,3,2),i,j,k,h),6),size(l));
    420                                 l = insert(l,list(graph31(list(2,2,2),i,j,k,h),16),size(l));
     420                                l[size(l)+1] = list(graph31(list(4,1,1),i,j,k,h),4);
     421                                l[size(l)+1] = list(graph31(list(1,4,1),i,j,k,h),8);
     422                                l[size(l)+1] = list(graph31(list(3,2,1),i,j,k,h),6);
     423                                l[size(l)+1] = list(graph31(list(3,1,2),i,j,k,h),6);
     424                                l[size(l)+1] = list(graph31(list(1,3,2),i,j,k,h),6);
     425                                l[size(l)+1] = list(graph31(list(2,2,2),i,j,k,h),16);
    421426                            }
    422427                            if (j <> h)
    423428                            {
    424                                 l = insert(l,list(graph32(list(4,1,1),i,j,k,h),8),size(l));
    425                                 l = insert(l,list(graph32(list(3,2,1),i,j,k,h),6),size(l));
    426                                 l = insert(l,list(graph32(list(2,2,2),i,j,k,h),48),size(l));
     429                                l[size(l)+1] = list(graph32(list(4,1,1),i,j,k,h),8);
     430                                l[size(l)+1] = list(graph32(list(3,2,1),i,j,k,h),6);
     431                                l[size(l)+1] = list(graph32(list(2,2,2),i,j,k,h),48);
    427432                            }
    428433                            for (m=0;m<=r;m++)
     
    430435                                if (k <> h and h <> m)
    431436                                {
    432                                     l = insert(l,list(graph41(list(3,1,1,1),i,j,k,h,m),3),size(l));
    433                                     l = insert(l,list(graph41(list(1,3,1,1),i,j,k,h,m),3),size(l));
    434                                     l = insert(l,list(graph41(list(2,2,1,1),i,j,k,h,m),4),size(l));
    435                                     l = insert(l,list(graph41(list(2,1,2,1),i,j,k,h,m),4),size(l));
    436                                     l = insert(l,list(graph41(list(2,1,1,2),i,j,k,h,m),8),size(l));
    437                                     l = insert(l,list(graph41(list(1,2,2,1),i,j,k,h,m),8),size(l));
     437                                    l[size(l)+1] = list(graph41(list(3,1,1,1),i,j,k,h,m),3);
     438                                    l[size(l)+1] = list(graph41(list(1,3,1,1),i,j,k,h,m),3);
     439                                    l[size(l)+1] = list(graph41(list(2,2,1,1),i,j,k,h,m),4);
     440                                    l[size(l)+1] = list(graph41(list(2,1,2,1),i,j,k,h,m),4);
     441                                    l[size(l)+1] = list(graph41(list(2,1,1,2),i,j,k,h,m),8);
     442                                    l[size(l)+1] = list(graph41(list(1,2,2,1),i,j,k,h,m),8);
    438443                                }
    439444                                if (k <> h and k <> m)
    440445                                {
    441                                     l = insert(l,list(graph42(list(3,1,1,1),i,j,k,h,m),6),size(l));
    442                                     l = insert(l,list(graph42(list(1,3,1,1),i,j,k,h,m),6),size(l));
    443                                     l = insert(l,list(graph42(list(1,1,3,1),i,j,k,h,m),3),size(l));
    444                                     l = insert(l,list(graph42(list(2,2,1,1),i,j,k,h,m),8),size(l));
    445                                     l = insert(l,list(graph42(list(1,1,2,2),i,j,k,h,m),8),size(l));
    446                                     l = insert(l,list(graph42(list(2,1,2,1),i,j,k,h,m),4),size(l));
    447                                     l = insert(l,list(graph42(list(1,2,2,1),i,j,k,h,m),4),size(l));
     446                                    l[size(l)+1] = list(graph42(list(3,1,1,1),i,j,k,h,m),6);
     447                                    l[size(l)+1] = list(graph42(list(1,3,1,1),i,j,k,h,m),6);
     448                                    l[size(l)+1] = list(graph42(list(1,1,3,1),i,j,k,h,m),3);
     449                                    l[size(l)+1] = list(graph42(list(2,2,1,1),i,j,k,h,m),8);
     450                                    l[size(l)+1] = list(graph42(list(1,1,2,2),i,j,k,h,m),8);
     451                                    l[size(l)+1] = list(graph42(list(2,1,2,1),i,j,k,h,m),4);
     452                                    l[size(l)+1] = list(graph42(list(1,2,2,1),i,j,k,h,m),4);
    448453                                }
    449454                                if (j <> h and j <> m)
    450455                                {
    451                                     l = insert(l,list(graph43(list(3,1,1,1),i,j,k,h,m),18),size(l));
    452                                     l = insert(l,list(graph43(list(2,2,1,1),i,j,k,h,m),16),size(l));
     456                                    l[size(l)+1] = list(graph43(list(3,1,1,1),i,j,k,h,m),18);
     457                                    l[size(l)+1] = list(graph43(list(2,2,1,1),i,j,k,h,m),16);
    453458                                }
    454459                                for (n=0;n<=r;n++)
     
    456461                                    if (k <> h and h <> m and m <> n)
    457462                                    {
    458                                         l = insert(l,list(graph51(list(2,1,1,1,1),i,j,k,h,m,n),2),size(l));
    459                                         l = insert(l,list(graph51(list(1,2,1,1,1),i,j,k,h,m,n),2),size(l));
    460                                         l = insert(l,list(graph51(list(1,1,2,1,1),i,j,k,h,m,n),4),size(l));
     463                                        l[size(l)+1] = list(graph51(list(2,1,1,1,1),i,j,k,h,m,n),2);
     464                                        l[size(l)+1] = list(graph51(list(1,2,1,1,1),i,j,k,h,m,n),2);
     465                                        l[size(l)+1] = list(graph51(list(1,1,2,1,1),i,j,k,h,m,n),4);
    461466                                    }
    462467                                    if (k <> h and h <> m and h <> n)
    463468                                    {
    464                                         l = insert(l,list(graph52(list(2,1,1,1,1),i,j,k,h,m,n),4),size(l));
    465                                         l = insert(l,list(graph52(list(1,2,1,1,1),i,j,k,h,m,n),4),size(l));
    466                                         l = insert(l,list(graph52(list(1,1,2,1,1),i,j,k,h,m,n),4),size(l));
    467                                         l = insert(l,list(graph52(list(1,1,1,2,1),i,j,k,h,m,n),2),size(l));
     469                                        l[size(l)+1] = list(graph52(list(2,1,1,1,1),i,j,k,h,m,n),4);
     470                                        l[size(l)+1] = list(graph52(list(1,2,1,1,1),i,j,k,h,m,n),4);
     471                                        l[size(l)+1] = list(graph52(list(1,1,2,1,1),i,j,k,h,m,n),4);
     472                                        l[size(l)+1] = list(graph52(list(1,1,1,2,1),i,j,k,h,m,n),2);
    468473                                    }
    469474                                    if (k <> h and k <> m and k <> n)
    470475                                    {
    471                                         l = insert(l,list(graph53(list(2,1,1,1,1),i,j,k,h,m,n),12),size(l));
    472                                         l = insert(l,list(graph53(list(1,2,1,1,1),i,j,k,h,m,n),12),size(l));
    473                                         l = insert(l,list(graph53(list(1,1,2,1,1),i,j,k,h,m,n),4),size(l));
     476                                        l[size(l)+1] = list(graph53(list(2,1,1,1,1),i,j,k,h,m,n),12);
     477                                        l[size(l)+1] = list(graph53(list(1,2,1,1,1),i,j,k,h,m,n),12);
     478                                        l[size(l)+1] = list(graph53(list(1,1,2,1,1),i,j,k,h,m,n),4);
    474479                                    }
    475480                                    if (j <> h and h <> m and h <> n)
    476481                                    {
    477                                         l = insert(l,list(graph54(list(2,1,1,1,1),i,j,k,h,m,n),4),size(l));
    478                                         l = insert(l,list(graph54(list(1,1,2,1,1),i,j,k,h,m,n),16),size(l));
     482                                        l[size(l)+1] = list(graph54(list(2,1,1,1,1),i,j,k,h,m,n),4);
     483                                        l[size(l)+1] = list(graph54(list(1,1,2,1,1),i,j,k,h,m,n),16);
    479484                                    }
    480485                                    if (k <> h and k <> m and h <> n)
    481486                                    {
    482                                         l = insert(l,list(graph55(list(2,1,1,1,1),i,j,k,h,m,n),2),size(l));
    483                                         l = insert(l,list(graph55(list(1,2,1,1,1),i,j,k,h,m,n),2),size(l));
    484                                         l = insert(l,list(graph55(list(1,1,1,2,1),i,j,k,h,m,n),4),size(l));
     487                                        l[size(l)+1] = list(graph55(list(2,1,1,1,1),i,j,k,h,m,n),2);
     488                                        l[size(l)+1] = list(graph55(list(1,2,1,1,1),i,j,k,h,m,n),2);
     489                                        l[size(l)+1] = list(graph55(list(1,1,1,2,1),i,j,k,h,m,n),4);
    485490                                    }
    486491                                    if (j <> h and j <> m and j <> n)
    487492                                    {
    488                                         l = insert(l,list(graph56(list(2,1,1,1,1),i,j,k,h,m,n),48),size(l));
     493                                        l[size(l)+1] = list(graph56(list(2,1,1,1,1),i,j,k,h,m,n),48);
    489494                                    }
    490495                                    for (p=0;p<=r;p++)
     
    492497                                        if (k <> h and h <> m and m <> n and n <> p)
    493498                                        {
    494                                             l = insert(l,list(graph61(list(1,1,1,1,1,1),i,j,k,h,m,n,p),2),size(l));
     499                                            l[size(l)+1] = list(graph61(list(1,1,1,1,1,1),i,j,k,h,m,n,p),2);
    495500                                        }
    496501                                        if (k <> h and h <> m and m <> n and m <> p)
    497502                                        {
    498                                             l = insert(l,list(graph62(list(1,1,1,1,1,1),i,j,k,h,m,n,p),2),size(l));
     503                                            l[size(l)+1] = list(graph62(list(1,1,1,1,1,1),i,j,k,h,m,n,p),2);
    499504                                        }
    500505                                        if (k <> h and h <> m and h <> n and n <> p)
    501506                                        {
    502                                             l = insert(l,list(graph63(list(1,1,1,1,1,1),i,j,k,h,m,n,p),1),size(l));
     507                                            l[size(l)+1] = list(graph63(list(1,1,1,1,1,1),i,j,k,h,m,n,p),1);
    503508                                        }
    504509                                        if (k <> h and h <> m and h <> n and h <> p)
    505510                                        {
    506                                             l = insert(l,list(graph64(list(1,1,1,1,1,1),i,j,k,h,m,n,p),6),size(l));
     511                                            l[size(l)+1] = list(graph64(list(1,1,1,1,1,1),i,j,k,h,m,n,p),6);
    507512                                        }
    508513                                        if (k <> h and k <> m and k <> n and n <> p)
    509514                                        {
    510                                             l = insert(l,list(graph65(list(1,1,1,1,1,1),i,j,k,h,m,n,p),4),size(l));
     515                                            l[size(l)+1] = list(graph65(list(1,1,1,1,1,1),i,j,k,h,m,n,p),4);
    511516                                        }
    512517                                        if (k <> h and k <> m and m <> p and h <> n)
    513518                                        {
    514                                             l = insert(l,list(graph66(list(1,1,1,1,1,1),i,j,k,h,m,n,p),6),size(l));
     519                                            l[size(l)+1] = list(graph66(list(1,1,1,1,1,1),i,j,k,h,m,n,p),6);
    515520                                        }
    516521                                        if (j <> h and h <> m and m <> n and m <> p)
    517522                                        {
    518                                             l = insert(l,list(graph67(list(1,1,1,1,1,1),i,j,k,h,m,n,p),8),size(l));
     523                                            l[size(l)+1] = list(graph67(list(1,1,1,1,1,1),i,j,k,h,m,n,p),8);
    519524                                        }
    520525                                        if (j <> h and h <> m and h <> n and h <> p)
    521526                                        {
    522                                             l = insert(l,list(graph68(list(1,1,1,1,1,1),i,j,k,h,m,n,p),12),size(l));
     527                                            l[size(l)+1] = list(graph68(list(1,1,1,1,1,1),i,j,k,h,m,n,p),12);
    523528                                        }
    524529                                        if (j <> h and h <> m and h <> n and n <> p)
    525530                                        {
    526                                             l = insert(l,list(graph69(list(1,1,1,1,1,1),i,j,k,h,m,n,p),2),size(l));
     531                                            l[size(l)+1] = list(graph69(list(1,1,1,1,1,1),i,j,k,h,m,n,p),2);
    527532                                        }
    528533                                        if (k <> h and k <> m and k <> n and k <> p)
    529534                                        {
    530                                             l = insert(l,list(graph610(list(1,1,1,1,1,1),i,j,k,h,m,n,p),24),size(l));
     535                                            l[size(l)+1] = list(graph610(list(1,1,1,1,1,1),i,j,k,h,m,n,p),24);
    531536                                        }
    532537                                        if (j <> h and j <> m and j <> n and j <> p)
    533538                                        {
    534                                             l = insert(l,list(graph611(list(1,1,1,1,1,1),i,j,k,h,m,n,p),720),size(l));
     539                                            l[size(l)+1] = list(graph611(list(1,1,1,1,1,1),i,j,k,h,m,n,p),720);
    535540                                        }
    536541                                    }
     
    548553{
    549554    "EXAMPLE:"; echo=2;
    550     ring r = 0,(x),dp;
     555    ring r = 0,x,dp;
    551556    variety P = projectiveSpace(4);
    552557    stack M = moduliSpace(P,2);
     
    573578    for (i=0;i<=n;i++)
    574579    {
    575         l = insert(l,number(5^i),size(l));
     580        l = insert(l,number(10^i),size(l));
    576581    }
    577582    return (l);
     
    580585{
    581586    "EXAMPLE:"; echo=2;
    582     ring r = 0,(x),dp;
     587    ring r = 0,x,dp;
    583588    variety P = projectiveSpace(4);
    584589    def L = torusList(P);
     
    657662{
    658663    "EXAMPLE:"; echo=2;
    659     ring r = 0,(x),dp;
     664    ring r = 0,x,dp;
    660665    variety P = projectiveSpace(4);
    661666    stack M = moduliSpace(P,2);
     
    691696        int d = e[j][3];
    692697        number c = (-1)^d*factorial(d)^2;
    693         number y = c*(L[e[j][1]+1]-L[e[j][2]+1])^(2*d)/(d^(2*d));
     698        number y = c*(L[e[j][1]+1]-L[e[j][2]+1])^(2*d)/(number(d)^(2*d));
    694699        for (k=0;k<=n;k++)
    695700        {
     
    749754{
    750755    "EXAMPLE:"; echo=2;
    751     ring r = 0,(x),dp;
     756    ring r = 0,x,dp;
    752757    variety P = projectiveSpace(4);
    753758    stack M = moduliSpace(P,2);
     
    788793{
    789794    "EXAMPLE:"; echo=2;
    790     ring r = 0,(x),dp;
     795    ring r = 0,x,dp;
    791796    multipleCover(1);
    792797    multipleCover(2);
     
    794799    multipleCover(4);
    795800    multipleCover(5);
     801    multipleCover(6);
    796802}
    797803
     
    812818    def F = fixedPoints(M);
    813819    int i;
    814     poly r = 0;
     820    number r = 0;
    815821    for (i=1;i<=size(F);i++)
    816822    {
     
    826832{
    827833    "EXAMPLE:"; echo=2;
    828     ring r = 0,(x),dp;
     834    ring r = 0,x,dp;
    829835    linesHypersurface(2);
    830836    linesHypersurface(3);
     
    874880{
    875881    "EXAMPLE:"; echo=2;
    876     ring r = 0,(x),dp;
     882    ring r = 0,x,dp;
    877883    rationalCurve(1);
    878884    /*
     
    880886    rationalCurve(3);
    881887    rationalCurve(4);
    882     rationalCurve(5);
    883888    rationalCurve(1,list(4,2));
    884889    rationalCurve(1,list(3,3));
     
    897902    rationalCurve(4,list(3,2,2));
    898903    rationalCurve(4,list(2,2,2,2));
    899     rationalCurve(5,list(4,2));
    900     rationalCurve(5,list(3,3));
    901     rationalCurve(5,list(3,2,2));
    902     rationalCurve(5,list(2,2,2,2));
    903     */
    904904}
    905905
     
    921921{
    922922    "EXAMPLE:"; echo=2;
    923     ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp;
     923    ring r = 0,x,dp;
    924924    graph G = makeGraph(list(list(0,1,list(0,1,2)),list(1,1,list(1,0,2))),
    925925    list(list(0,1,2)));
     
    943943{
    944944    "EXAMPLE:"; echo=2;
    945     ring R=(0,x1,x2,x3,x4),(q1,q2,q3,q4,q5,q6),dp;
     945    ring r = 0,x,dp;
    946946    graph G = makeGraph(list(list(0,1,list(0,1,2)),list(1,1,list(1,0,2))),
    947947    list(list(0,1,2)));
     
    13731373    list v3 = k,3,f4,f5,f7;
    13741374    list v4 = h,2,f6,f9;
    1375     list v5 = m,1,f8,f11;
     1375    list v5 = m,2,f8,f11;
    13761376    list v6 = n,1,f10;
    13771377    list v7 = p,1,f12;
     
    15161516}
    15171517
    1518 ////////////////////////////////////////////////////////////////////////////////
    1519 /// Auxilary Static Procedures in this Library /////////////////////////////////
    1520 ////////////////////////////////////////////////////////////////////////////////
    1521 
    15221518proc part(poly f, int n)
    15231519"USAGE:     part(f,n); f poly, n int
     
    16461642{
    16471643    "EXAMPLE:"; echo=2;
    1648     ring r = 0,(x),dp;
     1644    ring r = 0,x,dp;
    16491645    poly f = 3+x;
    16501646    expp(f,3);
     
    17181714{
    17191715    "EXAMPLE:"; echo=2;
    1720     ring r = 0, (h,e), wp(1,1);
     1716    ring r = 0,(h,e),wp(1,1);
    17211717    ideal rels = he,h2+e2;
    17221718    variety V = makeVariety(2,rels);
     
    17441740{
    17451741    "EXAMPLE:"; echo=2;
    1746     ring r = 0, (h,e), wp(1,1);
     1742    ring r = 0,(h,e),wp(1,1);
    17471743    ideal rels = he,h2+e2;
    17481744    variety V = makeVariety(2,rels);
     
    17691765{
    17701766    "EXAMPLE:"; echo=2;
    1771     ring r = 0, (h,e), wp(1,1);
     1767    ring r = 0,(h,e),wp(1,1);
    17721768    ideal rels = he,h2+e2;
    17731769    int d = 2;
     
    20862082
    20872083////////////////////////////////////////////////////////////////////////////////
    2088 ////////// Procedures concerned with sheaves ///////////////////////////////////
     2084////////// Procedures concerned with abstract sheaves ///////////////////////////////////
    20892085////////////////////////////////////////////////////////////////////////////////
    20902086
  • Singular/cntrlc.cc

    r2ea781 r2fa80a  
    3030#include <Singular/cntrlc.h>
    3131#include <Singular/feOpt.h>
     32#include <Singular/misc_ip.h>
    3233#include <Singular/si_signals.h>
    3334#include <Singular/links/silink.h>
     
    8889}
    8990
     91volatile BOOLEAN do_shutdown = FALSE;
     92volatile int defer_shutdown = 0;
     93
    9094void sig_term_hdl(int /*sig*/)
    9195{
    92   if (ssiToBeClosed_inactive)
    93   {
    94     ssiToBeClosed_inactive=FALSE;
    95     while (ssiToBeClosed!=NULL)
    96     {
    97       slClose(ssiToBeClosed->l);
    98       if (ssiToBeClosed==NULL) break;
    99       ssiToBeClosed=(link_list)ssiToBeClosed->next;
    100     }
    101     exit(1);
    102   }
    103   //else: we already shutting down: let's do m2_end ist work
     96  do_shutdown = TRUE;
     97  if (!defer_shutdown)
     98  {
     99    m2_end(1);
     100  }
    104101}
    105102
  • Singular/cntrlc.h

    r2ea781 r2fa80a  
    1919/* TRUE for child of a fork or started with --batch*/
    2020
     21/* for deferring the call of m2_end() in SIGTERM handler if necessary */
     22extern volatile BOOLEAN do_shutdown;
     23extern volatile int defer_shutdown;
     24
    2125#endif
  • Singular/ipid.cc

    rd600e18 r2fa80a  
    4848//omBin ip_package_bin = omGetSpecBin(sizeof(ip_package));
    4949omBin idrec_bin = omGetSpecBin(sizeof(idrec));
    50 omBin char_ptr_bin =  omGetSpecBin(sizeof(char*));
    5150
    5251coeffs coeffs_BIGINT;
  • Singular/links/semaphore.c

    r2ea781 r2fa80a  
    99# include "simpleipc.h"
    1010
     11#include <Singular/cntrlc.h>
    1112#include <Singular/si_signals.h>
    1213
     
    2324// but are supported more widely.
    2425
    25 static sem_t *semaphore[SIPC_MAX_SEMAPHORES];
     26sem_t *semaphore[SIPC_MAX_SEMAPHORES];
     27int sem_acquired[SIPC_MAX_SEMAPHORES];
    2628
    2729/* return 1 on success,
     
    7476{
    7577  if ((id<0) || (id >= SIPC_MAX_SEMAPHORES) || (semaphore[id]==NULL))  return -1;
     78  defer_shutdown++;
    7679  si_sem_wait(semaphore[id]);
     80  sem_acquired[id]++;
     81  defer_shutdown--;
     82  if (!defer_shutdown && do_shutdown) m2_end(1);
    7783  return 1;
    7884}
     
    8187{
    8288  if ((id<0) || (id >= SIPC_MAX_SEMAPHORES) || (semaphore[id]==NULL))  return -1;
    83   return !si_sem_trywait(semaphore[id]);
     89  defer_shutdown++;
     90  int trywait = si_sem_trywait(semaphore[id]);
     91  if (!trywait)
     92  {
     93    sem_acquired[id]++;
     94  }
     95  defer_shutdown--;
     96  if (!defer_shutdown && do_shutdown) m2_end(1);
     97  return !trywait;
    8498}
    8599
     
    87101{
    88102  if ((id<0) || (id >= SIPC_MAX_SEMAPHORES) || (semaphore[id]==NULL))  return -1;
     103  defer_shutdown++;
    89104  sem_post(semaphore[id]);
     105  sem_acquired[id]--;
     106  defer_shutdown--;
     107  if (!defer_shutdown && do_shutdown) m2_end(1);
    90108  return 1;
    91109}
  • Singular/links/simpleipc.h

    r2ea781 r2fa80a  
     1#include <semaphore.h>
     2
    13#ifndef _SIMPLEIPC_H
    24#define _SIMPLEIPC_H
     
    911
    1012#define USE_SEM_INIT 0
     13
     14extern sem_t *semaphore[SIPC_MAX_SEMAPHORES];
     15extern int sem_acquired[SIPC_MAX_SEMAPHORES];
    1116
    1217int sipc_semaphore_init(int id, int count);
  • Singular/links/ssiLink.cc

    r2ea781 r2fa80a  
    805805          }
    806806          ssiToBeClosed->next=NULL;
     807#ifdef HAVE_SIMPLEIPC
     808          memset(sem_acquired, 0, SIPC_MAX_SEMAPHORES*sizeof(sem_acquired[0]));
     809#endif   // HAVE_SIMPLEIPC
    807810          si_close(pc[1]); si_close(cp[0]);
    808811          d->f_write=fdopen(cp[1],"w");
  • Singular/misc_ip.cc

    r2ea781 r2fa80a  
    2323#define SI_DONT_HAVE_GLOBAL_VARS
    2424#include <factory/factory.h>
     25#endif
     26
     27#ifdef HAVE_SIMPLEIPC
     28#include <Singular/links/simpleipc.h>
    2529#endif
    2630
     
    10481052*/
    10491053extern "C" {
     1054/* Note: We cannot use a mutex here because mutexes are not async-safe, but
     1055 * m2_end is called by sig_term_hdl(). Anyway, the race condition in the first
     1056 * few lines of m2_end() should not matter.
     1057 */
     1058volatile BOOLEAN m2_end_called = FALSE;
    10501059
    10511060void m2_end(int i)
    10521061{
    1053   fe_reset_input_mode();
    1054   #ifdef PAGE_TEST
    1055   mmEndStat();
    1056   #endif
    1057   fe_reset_input_mode();
    1058   if (ssiToBeClosed_inactive)
    1059   {
    1060     link_list hh=ssiToBeClosed;
    1061     while(hh!=NULL)
    1062     {
    1063       //Print("close %s\n",hh->l->name);
    1064       slPrepClose(hh->l);
    1065       hh=(link_list)hh->next;
    1066     }
    1067     ssiToBeClosed_inactive=FALSE;
    1068 
    1069     idhdl h = currPack->idroot;
    1070     while(h != NULL)
    1071     {
    1072       if(IDTYP(h) == LINK_CMD)
    1073       {
    1074         idhdl hh=h->next;
    1075         //Print("kill %s\n",IDID(h));
    1076         killhdl(h, currPack);
    1077         h = hh;
     1062  if (!m2_end_called)
     1063  {
     1064    m2_end_called = TRUE;
     1065#ifdef HAVE_SIMPLEIPC
     1066    for (int i = SIPC_MAX_SEMAPHORES; i >= 0; i--)
     1067    {
     1068      if (semaphore[i] != NULL)
     1069      {
     1070        while (sem_acquired[i] > 0)
     1071        {
     1072          sem_post(semaphore[i]);
     1073          sem_acquired[i]--;
     1074        }
     1075      }
     1076    }
     1077#endif   // HAVE_SIMPLEIPC
     1078    fe_reset_input_mode();
     1079#ifdef PAGE_TEST
     1080    mmEndStat();
     1081#endif
     1082    fe_reset_input_mode();
     1083    if (ssiToBeClosed_inactive)
     1084    {
     1085      link_list hh=ssiToBeClosed;
     1086      while(hh!=NULL)
     1087      {
     1088        //Print("close %s\n",hh->l->name);
     1089        slPrepClose(hh->l);
     1090        hh=(link_list)hh->next;
     1091      }
     1092      ssiToBeClosed_inactive=FALSE;
     1093
     1094      idhdl h = currPack->idroot;
     1095      while(h != NULL)
     1096      {
     1097        if(IDTYP(h) == LINK_CMD)
     1098        {
     1099          idhdl hh=h->next;
     1100          //Print("kill %s\n",IDID(h));
     1101          killhdl(h, currPack);
     1102          h = hh;
     1103        }
     1104        else
     1105        {
     1106          h = h->next;
     1107        }
     1108      }
     1109      hh=ssiToBeClosed;
     1110      while(hh!=NULL)
     1111      {
     1112        //Print("close %s\n",hh->l->name);
     1113        slClose(hh->l);
     1114        hh=ssiToBeClosed;
     1115      }
     1116    }
     1117    if (!singular_in_batchmode)
     1118    {
     1119      if (i<=0)
     1120      {
     1121        if (TEST_V_QUIET)
     1122        {
     1123          if (i==0)
     1124            printf("Auf Wiedersehen.\n");
     1125          else
     1126            printf("\n$Bye.\n");
     1127        }
     1128        //#ifdef sun
     1129        //  #ifndef __svr4__
     1130        //    _cleanup();
     1131        //    _exit(0);
     1132        //  #endif
     1133        //#endif
     1134        i=0;
    10781135      }
    10791136      else
    10801137      {
    1081         h = h->next;
    1082       }
    1083     }
    1084     hh=ssiToBeClosed;
    1085     while(hh!=NULL)
    1086     {
    1087       //Print("close %s\n",hh->l->name);
    1088       slClose(hh->l);
    1089       hh=ssiToBeClosed;
    1090     }
    1091   }
    1092   if (!singular_in_batchmode)
    1093   {
    1094     if (i<=0)
    1095     {
    1096       if (TEST_V_QUIET)
    1097       {
    1098         if (i==0)
    1099           printf("Auf Wiedersehen.\n");
    1100         else
    1101           printf("\n$Bye.\n");
    1102       }
    1103       //#ifdef sun
    1104       //  #ifndef __svr4__
    1105       //    _cleanup();
    1106       //    _exit(0);
    1107       //  #endif
    1108       //#endif
    1109       i=0;
    1110     }
    1111     else
    1112     {
    11131138        printf("\nhalt %d\n",i);
    1114     }
    1115   }
    1116   exit(i);
     1139      }
     1140    }
     1141    exit(i);
     1142  }
    11171143}
    11181144}
Note: See TracChangeset for help on using the changeset viewer.