Changeset 74c4462 in git
 Timestamp:
 Dec 18, 2013, 1:35:56 PM (9 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
 Children:
 6e3023af87cd7303404f428f8b9a5e633065747b
 Parents:
 744d97d5e92e1748aaf0b260cbdf6664488b810039ac9b5ba107b75d93bb6651df2d303bc73c330d
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/gitfan.lib
r744d97d r74c4462 1 1 /////////////////////////////////////////////////////////////////// 2 version="version gitfan.lib 4.0.0.0 Jun_2013 "; // $Id$2 version="version gitfan.lib 4.0.0.0 Jun_2013 "; // $Id$ 3 3 category="Algebraic Geometry"; 4 4 info=" … … 27 27 28 28 LIB "parallel.lib"; // for parallelWaitAll 29 LIB "general.lib";30 29 31 30 //////////////////////////////////////////////////// 32 33 proc int2face(int n, int r) 31 proc mod_init() 32 { 33 LIB"gfanlib.so"; 34 } 35 36 static proc int2face(int n, int r) 34 37 { 35 38 int k = r1; … … 40 43 while(2^k > n0){ 41 44 k; 45 //v[size(v)+1] = 0; 42 46 } 43 47 … … 52 56 ///////////////////////////////// 53 57 54 proc isAface(ideal a, intvec gam0 , int n)58 proc isAface(ideal a, intvec gam0) 55 59 "USAGE: isAface(a,gam0); a: ideal, gam0:intvec 56 60 PURPOSE: Checks whether the face of the positive orthant, … … 62 66 " 63 67 { 68 poly pz; 69 64 70 // special case: gam0 is the zerocone: 65 71 if (size(gam0) == 1 and gam0[1] == 0){ 66 poly pz;ideal G;72 ideal G; 67 73 68 74 // is an aface if and only if RL0(0,...,0) = const … … 87 93 } 88 94 89 // ring is too big: Switch to KK[T_i  e_i\in gam0] instead: 90 intvec w=ringlist(basering)[3][1][2]; 91 intvec w0; 95 96 // ring is too big: Switch to KK[T_i; e_i\in gam0] instead: 92 97 string initNewRing = "ring Rgam0 = 0,("; 93 98 94 99 for (int i=1; i<size(gam0); i++){ 95 100 initNewRing = initNewRing + string(var(gam0[i])) + ","; 96 w0[i]=w[gam0[i]]; 97 } 98 99 w0 = w0,w[gam0[i]],1; 100 initNewRing = initNewRing + string(var(gam0[size(gam0)])) + ",U),Wp("+string(w0)+");"; 101 } 102 103 initNewRing = initNewRing + string(var(gam0[size(gam0)])) + "),dp;"; 101 104 def R = basering; 102 105 execute(initNewRing); 103 106 104 107 ideal agam0 = imap(R,a); 105 106 for (i = 1; i<=size(agam0); i=i+1)107 {108 if (size(agam0[i]) == 1)109 { return(0,0); }110 }111 108 112 109 poly p = var(1); // first entry of g; p = prod T_i with i element of g … … 117 114 118 115 agam0 = agam0, p  1; // radmembership 119 agam0 = timeStd(agam0,5); 120 // "timestd finished after: "+string(timert); 121 // int timeout = 0; 122 if (attrib(agam0,"isSB") < 1) 123 { 124 kill agam0; kill Rgam0; kill initNewRing; kill w; kill w0; setring R; kill R; 125 return(0,1); 126 // // "timestd failed in "+string(gam0)+", falling back to saturation!"; 127 // setring R; kill Rgam0; 128 129 // initNewRing = "ring Rgam0 = 0,("; 130 131 // w0 = 0; 132 // for (i=1; i<size(gam0); i++){ 133 // initNewRing = initNewRing + string(var(gam0[i])) + ","; 134 // w0[i]=w[gam0[i]]; 135 // } 136 137 // w0 = w0,w[gam0[i]]; 138 // initNewRing = initNewRing + string(var(gam0[size(gam0)])) + "),Wp("+string(w0)+");"; 139 // execute(initNewRing); 140 141 // ideal G = imap(R,a); 142 143 // timeout = 1; 144 // int t=rtimer; 145 // for(int k=nvars(basering); k>0; k) { G=sat(G,var(k))[1]; } 146 // t = (rtimer  t) div 1000; 147 // string(n)+": saturation successful after "+string(t)+" with: "+string(G<>1); 148 } 116 ideal G = std(agam0); 149 117 150 118 // does G contain 1?, i.e. is G = 1? 151 if(agam0 <> 1) { 152 kill agam0; kill Rgam0; kill initNewRing; kill w; kill w0; setring R; kill R; 153 return(1,0); // true 154 } 155 156 kill agam0; kill Rgam0; kill initNewRing; kill w; kill w0; setring R; kill R; 157 return(0,0); // false 119 if(G <> 1) { 120 return(1); // true 121 } 122 123 return(0); // false 158 124 } 159 125 example … … 172 138 } 173 139 174 175 proc isAfaceNonZero(ideal a, intvec gam0)176 {177 string initNewRing = "ring Rgam0 = 0,(";178 for (int i=1; i<size(gam0); i++)179 { initNewRing = initNewRing + string(var(gam0[i])) + ","; }180 initNewRing = initNewRing + string(var(gam0[size(gam0)])) + "),dp;";181 def R = basering;182 execute(initNewRing);183 184 ideal agam0 = imap(R,a);185 186 for ( i = 1; i<=size(agam0); i=i+1)187 { if (size(agam0[i]) == 1) { return(0); } }188 189 poly p = var(1);190 for ( i = 2; i <= nvars(basering); i++ )191 { p = p * var(i); }192 193 agam0 = agam0, p  1;194 ideal G = std(agam0);195 196 if(G <> 1)197 { return(1); }198 199 return(0);200 }201 140 //////////////////////////////////////////////////// 202 141 … … 206 145 list AF; 207 146 208 for(i = start; i <= end; i =i+1){147 for(i = start; i <= end; i++){ 209 148 if(i < 2^r){ 210 string(i)+" "+string(size(AF));211 149 gam0 = int2face(i,r); 212 150 … … 227 165 228 166 proc afaces(ideal a, list #) 229 "USAGE: afaces(a, b, c); a: ideal, b: int, c: int167 "USAGE: afaces(a, b, c); a: ideal, d: int, c: int 230 168 PURPOSE: Returns a list of all afaces (represented by intvecs). 231 169 Moreover, it is possible to specify a dimensional bound b, … … 272 210 273 211 // do remaining ones: 274 for(i = ncores * step +1; i < 2^r; i =i+1){212 for(i = ncores * step +1; i < 2^r; i++){ 275 213 "another one needed"; 276 214 gam0 = int2face(i,r); … … 285 223 } 286 224 287 int l;288 225 // read out afaces of out into AF: 289 for( l = 1; l <= size(out); l++){290 AF = AF + out[ l];226 for(i = 1; i <= size(out); i++){ 227 AF = AF + out[i]; 291 228 } 292 229
Note: See TracChangeset
for help on using the changeset viewer.