Beispiel #1
0
 public KnrLSH(KnrLSH other)
     : base()
 {
     this.DB = other.DB;
     this.K = other.K;
     this.R = other.R;
     this.TABLE = other.TABLE;
 }
Beispiel #2
0
 public KnrLSHQueryExpansion(KnrLSH other)
     : base()
 {
     this.DB = other.DB;
     this.K = other.K;
     this.R = other.R;
     this.TABLE = other.TABLE;
 }
Beispiel #3
0
 public override void Load(BinaryReader Input)
 {
     base.Load (Input);
     var len = Input.ReadInt32 ();
     this.A = new KnrLSH[len];
     for (int i = 0; i < len; ++i) {
         var a = new KnrLSH();
         a.Load(Input);
         this.A[i] = a;
     }
 }
Beispiel #4
0
 public void Build(MetricDB db, int K, int num_refs, int num_instances)
 {
     this.A = new KnrLSH[num_instances];
     this.DB = db;
     var seed = RandomSets.GetRandomInt ();
     int I = 0;
     Action<int> compute = delegate (int i) {
         var a = new KnrLSH();
         a.Build(db, K, num_refs, RandomSets.GetRandom(seed + i));
         this.A[i] = a;
         ++I;
         Console.WriteLine ("=== Created {0}/{1} KnrLSH index", I, num_instances);
     };
     //			for(int i = 0; i < num_instances; ++i) {
     //				compute.Invoke(i);
     //			}
     ParallelOptions ops = new ParallelOptions ();
     ops.MaxDegreeOfParallelism = -1;
     Parallel.For(0, num_instances, ops, compute);
 }