Changeset 74c4462 in git


Ignore:
Timestamp:
Dec 18, 2013, 1:35:56 PM (11 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd25190065115c859833252500a64cfb7b11e3a50')
Children:
6e3023af87cd7303404f428f8b9a5e633065747b
Parents:
744d97d5e92e1748aaf0b260cbdf6664488b810039ac9b5ba107b75d93bb6651df2d303bc73c330d
Message:
Merge pull request #452 from YueRen/spielwiese

fix: unwanted changes in gitfan.lib
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/gitfan.lib

    r744d97d r74c4462  
    11///////////////////////////////////////////////////////////////////
    2 version="version gitfan.lib 4.0.0.0 Jun_2013 "; // $Id$
     2version="version gitfan.lib 4.0.0.0 Jun_2013 ";  // $Id$
    33category="Algebraic Geometry";
    44info="
     
    2727
    2828LIB "parallel.lib"; // for parallelWaitAll
    29 LIB "general.lib";
    3029
    3130////////////////////////////////////////////////////
    32 
    33 proc int2face(int n, int r)
     31proc mod_init()
     32{
     33  LIB"gfanlib.so";
     34}
     35
     36static proc int2face(int n, int r)
    3437{
    3538  int k = r-1;
     
    4043    while(2^k > n0){
    4144      k--;
     45      //v[size(v)+1] = 0;
    4246    }
    4347
     
    5256/////////////////////////////////
    5357
    54 proc isAface(ideal a, intvec gam0, int n)
     58proc isAface(ideal a, intvec gam0)
    5559"USAGE:  isAface(a,gam0); a: ideal, gam0:intvec
    5660PURPOSE: Checks whether the face of the positive orthant,
     
    6266"
    6367{
     68  poly pz;
     69
    6470  // special case: gam0 is the zero-cone:
    6571  if (size(gam0) == 1 and gam0[1] == 0){
    66     poly pz; ideal G;
     72    ideal G;
    6773
    6874    // is an a-face if and only if RL0(0,...,0) = const
     
    8793  }
    8894
    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:
    9297  string initNewRing = "ring Rgam0 = 0,(";
    9398
    9499  for (int i=1; i<size(gam0); i++){
    95100    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;";
    101104  def R = basering;
    102105  execute(initNewRing);
    103106
    104107  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   }
    111108
    112109  poly p = var(1); // first entry of g; p = prod T_i with i element of g
     
    117114
    118115  agam0 = agam0, p - 1; // rad-membership
    119   agam0 = timeStd(agam0,5);
    120   // "timestd finished after: "+string(timer-t);
    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);
    149117
    150118  // 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
    158124}
    159125example
     
    172138}
    173139
    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 }
    201140////////////////////////////////////////////////////
    202141
     
    206145  list AF;
    207146
    208   for(i = start; i <= end; i=i+1){
     147  for(i = start; i <= end; i++){
    209148    if(i < 2^r){
    210       string(i)+"    "+string(size(AF));
    211149      gam0 = int2face(i,r);
    212150
     
    227165
    228166proc afaces(ideal a, list #)
    229 "USAGE:  afaces(a, b, c); a: ideal, b: int, c: int
     167"USAGE:  afaces(a, b, c); a: ideal, d: int, c: int
    230168PURPOSE: Returns a list of all a-faces (represented by intvecs).
    231169         Moreover, it is possible to specify a dimensional bound b,
     
    272210
    273211  // 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++){
    275213    "another one needed";
    276214    gam0 = int2face(i,r);
     
    285223  }
    286224
    287   int l;
    288225  // 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];
    291228  }
    292229
Note: See TracChangeset for help on using the changeset viewer.