示例#1
0
文件: KnrLSH.cs 项目: KeithNel/natix
 public KnrLSH(KnrLSH other)
     : base()
 {
     this.DB = other.DB;
     this.K = other.K;
     this.R = other.R;
     this.TABLE = other.TABLE;
 }
示例#2
0
 public KnrLSHQueryExpansion(KnrLSH other)
     : base()
 {
     this.DB = other.DB;
     this.K = other.K;
     this.R = other.R;
     this.TABLE = other.TABLE;
 }
示例#3
0
文件: MKnrLSH.cs 项目: KeithNel/natix
 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;
     }
 }
示例#4
0
文件: MKnrLSH.cs 项目: KeithNel/natix
 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);
 }