1 package net.obsearch.index.knngraph;
2
3 import java.util.ArrayList;
4
5 import net.obsearch.example.OBSlice;
6 import net.obsearch.example.OBSliceFactory;
7 import net.obsearch.index.knngraph.impl.KnnGraphShort;
8 import net.obsearch.index.utils.IndexSmokeTUtil;
9 import net.obsearch.index.utils.IndexSmokeTUtilApprox;
10 import net.obsearch.pivots.AcceptAll;
11 import net.obsearch.pivots.bustos.impl.IncrementalBustosNavarroChavezShort;
12 import net.obsearch.pivots.dummy.IncrementalDummyPivotSelector;
13
14 import net.obsearch.storage.bdb.BDBFactoryJe;
15 import net.obsearch.storage.bdb.Utils;
16
17 import org.junit.Test;
18
19
20 public class TestKnnGraph {
21
22 @Test
23 public void testPrimeTree() throws Exception {
24
25
26 IncrementalDummyPivotSelector<OBSlice> sel = new IncrementalDummyPivotSelector<OBSlice> ();
27
28
29
30
31
32 BDBFactoryJe fact = Utils.getFactoryJe();
33
34
35
36 KnnGraphShort<OBSlice> knn = new KnnGraphShort<OBSlice>(OBSlice.class, sel, 32, 40, (short)500, 30);
37
38
39
40 knn.setT(3.0f);
41 knn.init(fact);
42 knn.setSeeds(30);
43 IndexSmokeTUtilApprox<OBSlice> t = new IndexSmokeTUtilApprox<OBSlice>(new OBSliceFactory());
44 t.tIndex(knn);
45
46
47
48
49
50
51
52
53
54
55
56
57 }
58
59 }