Changeset 823679 in git


Ignore:
Timestamp:
Nov 7, 2013, 10:42:07 AM (9 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'c987db42cd2ec943b97ac5746c99892ceddf909c')
Children:
a97ac01c3b64767f26ac2bbccd84652d536f371ddcd92ddcba49d3aa5461148604e8d6f4e99d4625
Parents:
2fa80a36c041e00aa30582d92c55f22cc3fe47d8
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-11-07 10:42:07+01:00
git-committer:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2013-11-07 10:42:48+01:00
Message:
chg: new schubert.lib (using parallel.lib)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/schubert.lib

    r2fa80a r823679  
    8888                                        corresponding the number of rational
    8989                                        curves on a general Calabi-Yau threefold
     90    sumofquotients(stack,list)          prepare a command for parallel
     91                                        computation
    9092    part(poly,int)                      compute a homogeneous component of a
    9193                                        polynomial.
     
    109111LIB "general.lib";
    110112LIB "homolog.lib";
     113LIB "parallel.lib";
    111114
    112115////////////////////////////////////////////////////////////////////////////////
     
    844847}
    845848
     849proc sumofquotients(stack M, list F, list #)
     850"USAGE:     sumofquotient(M,F,#); M stack, F list, # list
     851RETURN:     number
     852THEORY:     This is useful for the parallel computation of rationalCurve.
     853KEYWORDS:   Gromov-Witten invariants, rational curves on Calabi-Yau threefolds
     854EXAMPLE:    example sumofquotients; shows an example
     855"
     856{
     857    if (size(#) == 0) {list l = 5;}
     858    else {list l = #;}
     859    number sum = 0;
     860    number s, t;
     861    int i,j;
     862    for (i = size(F); i > 0; i--)
     863    {
     864        s = 1;
     865        for (j=1;j<=size(l);j++)
     866        {
     867            s = s*contributionBundle(M,F[i][1],list(l[j]));
     868        }
     869        t = F[i][2]*normalBundle(M,F[i][1]);
     870        sum = sum + s/t;
     871    }
     872    return(sum);
     873}
     874example
     875{
     876    "EXAMPLE:"; echo=2;
     877    ring r = 0,x,dp;
     878    variety P = projectiveSpace(4);
     879    stack M = moduliSpace(P,2);
     880    list F = fixedPoints(M);
     881    sumofquotients(M,F);
     882    sumofquotients(M,F,list(5));
     883}
     884
    846885proc rationalCurve(int d, list #)
    847886"USAGE:     rationalCurve(d,#); d int, # list
     
    856895    def R = basering;
    857896    setring R;
    858     int n,i,j;
     897    int n,i;
    859898    if (size(#) == 0) {n = 4; list l = 5;}
    860899    else {n = size(#)+3; list l = #;}
     
    862901    stack M = moduliSpace(P,d);
    863902    def F = fixedPoints(M);
     903    int ncpus = system("cpu");
     904    int sizeF = size(F);
     905    list args;
     906    int from = 1;
     907    int to;
     908    for (i = 1; i <= ncpus; i++)
     909    {
     910        to = (sizeF*i) div ncpus;
     911        args[i] = list(M, list(F[from..to]), l);
     912        from = to+1;
     913    }
     914    list results = parallelWaitAll("sumofquotients", args);
    864915    number r = 0;
    865     for (i=1;i<=size(F);i++)
    866     {
    867         graph G = F[i][1];
    868         number s = 1;
    869         for (j=1;j<=size(l);j++)
    870         {
    871             s = s*contributionBundle(M,G,list(l[j]));
    872         }
    873         number t = F[i][2]*normalBundle(M,G);
    874         r = r + s/t;
    875         kill s,t,G;
     916    for (i = 1; i <= ncpus; i++)
     917    {
     918        r = r + results[i];
    876919    }
    877920    return (r);
     
    902945    rationalCurve(4,list(3,2,2));
    903946    rationalCurve(4,list(2,2,2,2));
     947    */
    904948}
    905949
Note: See TracChangeset for help on using the changeset viewer.