MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / search

Method search

JSAT/src/jsat/linear/vectorcollection/VectorArray.java:103–118  ·  view source on GitHub ↗
(Vec query, double range)

Source from the content-addressed store, hash-verified

101
102
103 @Override
104 public List<? extends VecPaired<V, Double>> search(Vec query, double range)
105 {
106 List<VecPairedComparable<V, Double>> list = new ArrayList<VecPairedComparable<V, Double>>();
107
108 List<Double> qi = distanceMetric.getQueryInfo(query);
109
110 for(int i = 0; i < size(); i++)
111 {
112 double distance = distanceMetric.dist(i, query, qi, this, distCache);
113 if(distance <= range)
114 list.add(new VecPairedComparable<V, Double>(get(i), distance));
115 }
116 Collections.sort(list);
117 return list;
118 }
119
120 @Override
121 public List<? extends VecPaired<V, Double>> search(Vec query, int neighbors)

Callers 15

testSearch_Vec_doubleMethod · 0.95
testSearch_Vec_intMethod · 0.95
testSearch_Vec_doubleMethod · 0.95
testSearch_Vec_intMethod · 0.95
testSearch_Vec_doubleMethod · 0.95
testSearch_Vec_intMethod · 0.95
testSearch_Vec_doubleMethod · 0.95
testSearch_Vec_intMethod · 0.95
testSearch_Vec_doubleMethod · 0.95
testSearch_Vec_intMethod · 0.95

Calls 9

addMethod · 0.95
getMatchMethod · 0.80
getProbabilityMethod · 0.80
getQueryInfoMethod · 0.65
sizeMethod · 0.65
distMethod · 0.65
addMethod · 0.45
getMethod · 0.45
sortMethod · 0.45

Tested by 15

testSearch_Vec_doubleMethod · 0.76
testSearch_Vec_intMethod · 0.76
testSearch_Vec_doubleMethod · 0.76
testSearch_Vec_intMethod · 0.76
testSearch_Vec_doubleMethod · 0.76
testSearch_Vec_intMethod · 0.76
testSearch_Vec_doubleMethod · 0.76
testSearch_Vec_intMethod · 0.76
testSearch_Vec_doubleMethod · 0.76
testSearch_Vec_intMethod · 0.76