MCPcopy Create free account
hub / github.com/davisking/dlib / sample_pair

Class sample_pair

dlib/graph_utils/sample_pair.h:15–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13// ----------------------------------------------------------------------------------------
14
15 class sample_pair
16 {
17 public:
18 sample_pair(
19 ) :
20 _index1(0),
21 _index2(0)
22 {
23 _distance = 1;
24 }
25
26 sample_pair (
27 const unsigned long idx1,
28 const unsigned long idx2
29 )
30 {
31 _distance = 1;
32 if (idx1 < idx2)
33 {
34 _index1 = idx1;
35 _index2 = idx2;
36 }
37 else
38 {
39 _index1 = idx2;
40 _index2 = idx1;
41 }
42 }
43
44 sample_pair (
45 const unsigned long idx1,
46 const unsigned long idx2,
47 const double dist
48 )
49 {
50 _distance = dist;
51 if (idx1 < idx2)
52 {
53 _index1 = idx1;
54 _index2 = idx2;
55 }
56 else
57 {
58 _index1 = idx2;
59 _index2 = idx1;
60 }
61 }
62
63 const unsigned long& index1 (
64 ) const { return _index1; }
65
66 const unsigned long& index2 (
67 ) const { return _index2; }
68
69 const double& distance (
70 ) const { return _distance; }
71
72 private:

Callers 15

deserializeFunction · 0.70
operator()Method · 0.70
find_k_nearest_neighborsFunction · 0.70
chinese_clusterFunction · 0.50
chinese_whispers_rawFunction · 0.50
make_test_graphFunction · 0.50
perform_testMethod · 0.50
test_knn1Method · 0.50
test_knn1_approxMethod · 0.50

Calls

no outgoing calls

Tested by 7

make_test_graphFunction · 0.40
perform_testMethod · 0.40
test_knn1Method · 0.40
test_knn1_approxMethod · 0.40
test_knn2Method · 0.40
test_knn2_approxMethod · 0.40