상속: BasicIndex, ILoadSave
예제 #1
0
파일: SATSEQ.cs 프로젝트: sadit/natix
 public void Build(SAT sat)
 {
     var n = sat.DB.Count;
     this.DB = sat.DB;
     var cov = new double[n];
     var seq = new int[n];
     this.root = sat.root.objID;
     int nonzeros = 0;
     var visit = new Action<SAT.Node,SAT.Node>((parent, child) => {
         seq[child.objID] = (parent == null) ? n : parent.objID;
         cov[child.objID] = child.cov;
         if (child.cov > 0) ++nonzeros;
     });
     visit (null, sat.root);
     this.Build_IterateSAT (sat.root, visit);
     var listibuilder = ListIBuilders.GetArray ();
     var permbuilder = PermutationBuilders.GetCyclicPerms (1, listibuilder, listibuilder);
     var seqbuilder = SequenceBuilders.GetSeqSinglePerm (permbuilder);
     this.SEQ = seqbuilder (seq, n + 1);
     this.COV = new List<double> (nonzeros);
     var cov_zero = new BitStream32 ();
     cov_zero.Write (true, n);
     for (int objID = 0; objID < n; ++objID) {
         if (cov[objID] > 0) {
             this.COV.Add(cov[objID]);
             cov_zero[objID] = false;
         }
     }
     this.COV_ZERO = new GGMN ();
     this.COV_ZERO.Build (cov_zero, 8);
 }
예제 #2
0
파일: Indexes.cs 프로젝트: sadit/natix
 public static string ExecuteSATApprox(IndexArgumentSetup setup, string nick)
 {
     var idxname = String.Format ("{0}/Index.SATApprox", nick);
     return Execute (setup, nick, idxname, (db) => {
         var sat = new SAT();
         sat.Build(db, new Random());
         var satapprox = new SAT_ApproxSearch();
         satapprox.Build(sat);
         return satapprox;
     });
 }
예제 #3
0
 public void Build(SAT sat)
 {
     this.root = sat.root;
     this.DB = sat.DB;
 }
예제 #4
0
파일: SATSEQ.cs 프로젝트: sadit/natix
 void Build_IterateSAT(SAT.Node node, Action<SAT.Node, SAT.Node> visit)
 {
     foreach (var child in node.Children) {
         visit(node, child);
         this.Build_IterateSAT(child, visit);
     }
 }
예제 #5
0
파일: Indexes.cs 프로젝트: sadit/natix
 public static string ExecuteSAT(IndexArgumentSetup setup, string nick)
 {
     var idxname = String.Format ("{0}/Index.SAT-Legacy", nick);
     return Execute (setup, nick, idxname, (db) => {
         var sat = new SAT ();
         sat.Build (db, RandomSets.GetRandom());
         return sat;
     });
 }