Changeset f52bd59 in git
 Timestamp:
 Apr 17, 2015, 3:24:29 PM (8 years ago)
 Branches:
 (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
 Children:
 f90180ea47616b92dece8940b84d280e5d85e7be
 Parents:
 188cfbd973b4a999682b8826071169fe3afdfd97
 gitauthor:
 Hans Schoenemann <hannes@mathematik.unikl.de>20150417 15:24:29+02:00
 gitcommitter:
 Hans Schoenemann <hannes@mathematik.unikl.de>20150417 15:24:59+02:00
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/gitfan.lib
r188cfbd rf52bd59 1 1 /////////////////////////////////////////////////////////////////// 2 version="version gitfan.lib 4.0. 0.0 Jun_2013"; // $Id$2 version="version gitfan.lib 4.0.2.0 Apr_2015 "; // $Id$ 3 3 category="Algebraic Geometry"; 4 4 info=" … … 40 40 int n0 = n; 41 41 42 while(n0 > 0){ 43 while(2^k > n0){ 42 while(n0 > 0) 43 { 44 while(2^k > n0) 45 { 44 46 k; 45 47 //v[size(v)+1] = 0; … … 69 71 70 72 // special case: gam0 is the zerocone: 71 if (size(gam0) == 1 and gam0[1] == 0){ 73 if (size(gam0) == 1 and gam0[1] == 0) 74 { 72 75 ideal G; 73 76 … … 75 78 // set all entries to 0: 76 79 int i; 77 for (int k = 1; k <= size(a); k++) { 80 for (int k = 1; k <= ncols(a); k++) 81 { 78 82 pz = subst(a[k], var(1), 0); 79 for (i = 2; i <= nvars(basering); i++) { 83 for (i = 2; i <= nvars(basering); i++) 84 { 80 85 pz = subst(pz, var(i), 0); 81 86 } … … 86 91 87 92 // monomial inside?: 88 if(1 == G){ 93 if(1 == G) 94 { 89 95 return(0); 90 96 } … … 95 101 96 102 // ring is too big: Switch to KK[T_i; e_i\in gam0] instead: 103 def R = basering; 97 104 string initNewRing = "ring Rgam0 = 0,("; 98 99 for (int i=1; i<size(gam0); i++){105 for (int i=1; i<size(gam0); i++) 106 { 100 107 initNewRing = initNewRing + string(var(gam0[i])) + ","; 101 108 } 102 103 109 initNewRing = initNewRing + string(var(gam0[size(gam0)])) + "),dp;"; 104 def R = basering;105 110 execute(initNewRing); 111 kill i; 106 112 107 113 ideal agam0 = imap(R,a); 108 114 109 115 poly p = var(1); // first entry of g; p = prod T_i with i element of g 110 for ( i = 2; i <= nvars(basering); i++ ) { 111 p = p * var(i); 112 } 116 for (int i = 2; i <= nvars(basering); i++ ) 117 { 118 p = p * var(i); 119 } 113 120 // p is now the product over all T_i, with e_i in gam0 114 121 … … 117 124 118 125 // does G contain 1?, i.e. is G = 1? 119 if(G <> 1) { 126 if(G <> 1) 127 { 120 128 return(1); // true 121 129 } … … 140 148 //////////////////////////////////////////////////// 141 149 142 proc afacesPart(ideal a, int d, int start, int end, int r){ 150 proc afacesPart(ideal a, int d, int start, int end, int r) 151 { 143 152 intvec gam0; 144 153 int i; 145 154 list AF; 146 155 147 for(i = start; i <= end; i++){ 148 if(i < 2^r){ 156 for(i = start; i <= end; i++) 157 { 158 if(i < 2^r) 159 { 149 160 gam0 = int2face(i,r); 150 161 151 162 // take gam0 only if it has 152 163 // at least d rays: 153 if(size(gam0) >= d){ 154 if (isAface(a,gam0)){ 164 if(size(gam0) >= d) 165 { 166 if (isAface(a,gam0)) 167 { 155 168 AF[size(AF) + 1] = gam0; 156 169 } … … 158 171 } 159 172 } 160 161 173 return(AF); 162 174 } … … 178 190 int ncores = 1; 179 191 180 if ((size(#) > 0) and (typeof(#[1]) == "int")){ 192 if ((size(#) > 0) and (typeof(#[1]) == "int")) 193 { 181 194 d = #[1]; 182 195 } 183 196 184 if ((size(#) > 1) and (typeof(#[2]) == "int")){ 197 if ((size(#) > 1) and (typeof(#[2]) == "int")) 198 { 185 199 ncores = #[2]; 186 200 } … … 192 206 // check if 0 is an aface: 193 207 gam0 = 0; 194 if (isAface(a,gam0)){ 208 if (isAface(a,gam0)) 209 { 195 210 AF[size(AF) + 1] = gam0; 196 211 } … … 202 217 203 218 list args; 204 for(int k = 0; k < ncores; k++){ 219 for(int k = 0; k < ncores; k++) 220 { 205 221 args[size(args) + 1] = list(a, d, k * step + 1, (k+1) * step, r); 206 222 } … … 210 226 211 227 // do remaining ones: 212 for(i = ncores * step +1; i < 2^r; i++){ 228 for(i = ncores * step +1; i < 2^r; i++) 229 { 213 230 "another one needed"; 214 231 gam0 = int2face(i,r); … … 216 233 // take gam0 only if it has 217 234 // at least d rays: 218 if(size(gam0) >= d){ 219 if (isAface(a,gam0)){ 235 if(size(gam0) >= d) 236 { 237 if (isAface(a,gam0)) 238 { 220 239 AF[size(AF) + 1] = gam0; 221 240 } … … 224 243 225 244 // read out afaces of out into AF: 226 for(i = 1; i <= size(out); i++){ 245 for(i = 1; i <= size(out); i++) 246 { 227 247 AF = AF + out[i]; 228 248 } … … 303 323 list AF; 304 324 305 if((size(#) > 1) and (typeof(#[2]) == "int")){ 325 if((size(#) > 1) and (typeof(#[2]) == "int")) 326 { 306 327 AF = afaces(a, nrows(Q), #[2]); 307 } else 328 } 329 else 308 330 { 309 331 AF = afaces(a, nrows(Q)); … … 311 333 312 334 int dimensionBound = 0; 313 if((size(#) > 0) and (typeof(#[1]) == "int")){ 335 if((size(#) > 0) and (typeof(#[1]) == "int")) 336 { 314 337 dimensionBound = #[1]; 315 338 } … … 319 342 int j; 320 343 321 for(int i = 1; i <= size(AF); i++){ 344 for(int i = 1; i <= size(AF); i++) 345 { 322 346 gam0 = AF[i]; 323 347 324 if(gam0 == 0){ 348 if(gam0 == 0) 349 { 325 350 bigintmat M[1][nrows(Q)]; 326 } else { 351 } 352 else 353 { 327 354 bigintmat M[size(gam0)][nrows(Q)]; 328 for (j = 1; j <= size(gam0); j++){ 355 for (j = 1; j <= size(gam0); j++) 356 { 329 357 M[j,1..ncols(M)] = Q[1..nrows(Q),gam0[j]]; 330 358 } … … 332 360 cone c = coneViaPoints(M); 333 361 334 if((dimension(c) >= dimensionBound) and (!(listContainsCone(OC, c)))){ 362 if((dimension(c) >= dimensionBound) and (!(listContainsCone(OC, c)))) 363 { 335 364 OC[size(OC)+1] = c; 336 365 } … … 369 398 cone lambda = nrows(Q); 370 399 371 for(int i = 1; i <= size(OC); i++){ 400 for(int i = 1; i <= size(OC); i++) 401 { 372 402 cone c = OC[i]; 373 403 374 if(containsInSupport(c, w)){ 404 if(containsInSupport(c, w)) 405 { 375 406 lambda = convexIntersection(lambda, c); 376 407 } … … 517 548 // w.r.t. the 0ideal: 518 549 519 static proc simplicialToricOrbitCones(bigintmat Q){ 550 static proc simplicialToricOrbitCones(bigintmat Q) 551 { 520 552 intvec gam0; 521 553 list OC; … … 524 556 int j; 525 557 526 for(int i = 1; i < 2^r; i++ ){ 558 for(int i = 1; i < 2^r; i++ ) 559 { 527 560 gam0 = int2face(i,r); 528 561 529 562 // each simplicial cone is generated by 530 563 // exactly nrows(Q) many columns of Q: 531 if(size(gam0) == nrows(Q)){ 564 if(size(gam0) == nrows(Q)) 565 { 532 566 bigintmat M[size(gam0)][nrows(Q)]; 533 567 534 for(j = 1; j <= size(gam0); j++){ 568 for(j = 1; j <= size(gam0); j++) 569 { 535 570 M[j,1..ncols(M)] = Q[1..nrows(Q),gam0[j]]; 536 571 } … … 538 573 c = coneViaPoints(M); 539 574 540 if((dimension(c) == nrows(Q)) and (!(listContainsCone(OC, c)))){ 575 if((dimension(c) == nrows(Q)) and (!(listContainsCone(OC, c)))) 576 { 541 577 OC[size(OC)+1] = c; 542 578 }
Note: See TracChangeset
for help on using the changeset viewer.