[BACK]Return to minimal.k CVS log [TXT][DIR] Up to [local] / OpenXM / src / k097 / lib / minimal

Diff for /OpenXM/src/k097/lib/minimal/minimal.k between version 1.21 and 1.26

version 1.21, 2000/08/01 03:42:35 version 1.26, 2000/08/10 02:59:08
Line 1 
Line 1 
 /* $OpenXM: OpenXM/src/k097/lib/minimal/minimal.k,v 1.20 2000/07/31 02:25:34 takayama Exp $ */  /* $OpenXM: OpenXM/src/k097/lib/minimal/minimal.k,v 1.25 2000/08/02 05:14:31 takayama Exp $ */
 #define DEBUG 1  #define DEBUG 1
 Sordinary = false;  Sordinary = false;
 /* If you run this program on openxm version 1.1.2 (FreeBSD),  /* If you run this program on openxm version 1.1.2 (FreeBSD),
Line 239  def SresolutionFrameWithTower(g,opt) {
Line 239  def SresolutionFrameWithTower(g,opt) {
           }            }
         }          }
       }        }
     }else{      } else if (IsNull(opt)){
       } else {
       Println("Warning: option should be given by an array.");        Println("Warning: option should be given by an array.");
         Println(opt);
         Println("--------------------------------------------");
     }      }
   }    }
   
Line 962  HelpAdd(["Sminimal",
Line 965  HelpAdd(["Sminimal",
 def Sminimal(g,opt) {  def Sminimal(g,opt) {
   local r, freeRes, redundantTable, reducer, maxLevel,    local r, freeRes, redundantTable, reducer, maxLevel,
         minRes, seq, maxSeq, level, betti, q, bases, dr,          minRes, seq, maxSeq, level, betti, q, bases, dr,
         betti_levelplus, newbases, i, j,qq, tminRes;          betti_levelplus, newbases, i, j,qq, tminRes,bettiTable, ansSminimal;
   if (Length(Arglist) < 2) {    if (Length(Arglist) < 2) {
      opt = null;       opt = null;
   }    }
Line 975  def Sminimal(g,opt) {
Line 978  def Sminimal(g,opt) {
   freeRes = r[0];    freeRes = r[0];
   redundantTable = r[1];    redundantTable = r[1];
   reducer = r[2];    reducer = r[2];
     bettiTable = SbettiTable(redundantTable);
     Println("Betti numbers are ------");
     sm1_pmat(bettiTable);
   minRes = SnewArrayOfFormat(freeRes);    minRes = SnewArrayOfFormat(freeRes);
   seq = 0;    seq = 0;
   maxSeq = SgetMaxSeq(redundantTable);    maxSeq = SgetMaxSeq(redundantTable);
Line 1028  def Sminimal(g,opt) {
Line 1034  def Sminimal(g,opt) {
     }      }
    }     }
    tminRes = Stetris(minRes,redundantTable);     tminRes = Stetris(minRes,redundantTable);
    return([SpruneZeroRow(tminRes), tminRes,     ansSminimal = [SpruneZeroRow(tminRes), tminRes,
           [ minRes, redundantTable, reducer,r[3],r[4]],r[0],r[5]]);                    [ minRes, redundantTable, reducer,r[3],r[4]],r[0],r[5]];
      Println("------------ Note -----------------------------");
      Println("To get shift vectors, use Reparse and SgetShifts(resmat,w)");
      Println("To get initial of the complex, use Reparse and Sinit_w(resmat,w)");
      Println("0: minimal resolution, 3: Schreyer resolution ");
      Println("------------ Resolution Summary  --------------");
      Print("Betti numbers : ");
      Println(Map(ansSminimal[0],"Length"));
      Print("Betti numbers of the Schreyer frame: ");
      Println(Map(ansSminimal[3],"Length"));
      Println("-----------------------------------------------");
   
      sm1(" restoreEnvAfterResolution ");
      Sordinary = false;
   
      return(ansSminimal);
   /* r[4] is the redundantTable_ordinary */    /* r[4] is the redundantTable_ordinary */
   /* r[0] is the freeResolution */    /* r[0] is the freeResolution */
   /* r[5] is the skelton */    /* r[5] is the skelton */
Line 1500  HelpAdd(["Sinit_w",
Line 1521  HelpAdd(["Sinit_w",
  "           c=Sinit_w(b,w); c:"   "           c=Sinit_w(b,w); c:"
 ]]);  ]]);
   
   /* This method does not work, because we have zero rows.
      Think about it later. */
   def SbettiTable(rtable) {
     local ans,i,j,pp;
     ans = SnewArrayOfFormat(rtable);
     for (i=0; i<Length(rtable); i++) {
       pp = 0;
       for (j=0; j<Length(rtable[i]); j++) {
          if (rtable[i,j] != 0) {pp = pp+1;}
       }
       ans[i] = pp;
     }
     return(ans);
   }
   

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.26

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>