Changeset 823679 in git for Singular/LIB/schubert.lib
- Timestamp:
- Nov 7, 2013, 10:42:07 AM (9 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/schubert.lib
r2fa80a r823679 88 88 corresponding the number of rational 89 89 curves on a general Calabi-Yau threefold 90 sumofquotients(stack,list) prepare a command for parallel 91 computation 90 92 part(poly,int) compute a homogeneous component of a 91 93 polynomial. … … 109 111 LIB "general.lib"; 110 112 LIB "homolog.lib"; 113 LIB "parallel.lib"; 111 114 112 115 //////////////////////////////////////////////////////////////////////////////// … … 844 847 } 845 848 849 proc sumofquotients(stack M, list F, list #) 850 "USAGE: sumofquotient(M,F,#); M stack, F list, # list 851 RETURN: number 852 THEORY: This is useful for the parallel computation of rationalCurve. 853 KEYWORDS: Gromov-Witten invariants, rational curves on Calabi-Yau threefolds 854 EXAMPLE: 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 } 874 example 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 846 885 proc rationalCurve(int d, list #) 847 886 "USAGE: rationalCurve(d,#); d int, # list … … 856 895 def R = basering; 857 896 setring R; 858 int n,i ,j;897 int n,i; 859 898 if (size(#) == 0) {n = 4; list l = 5;} 860 899 else {n = size(#)+3; list l = #;} … … 862 901 stack M = moduliSpace(P,d); 863 902 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); 864 915 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]; 876 919 } 877 920 return (r); … … 902 945 rationalCurve(4,list(3,2,2)); 903 946 rationalCurve(4,list(2,2,2,2)); 947 */ 904 948 } 905 949
Note: See TracChangeset
for help on using the changeset viewer.