V - Data typestatic class CLARA.CachedDistanceQuery<V> extends java.lang.Object implements DistanceQuery<V>
| Modifier and Type | Field and Description | 
|---|---|
(package private) int | 
bad
Number of uncacheable queries 
 | 
(package private) it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap | 
cache
Cache 
 | 
(package private) DistanceQuery<V> | 
inner
Inner distance query 
 | 
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE| Constructor and Description | 
|---|
CachedDistanceQuery(DistanceQuery<V> inner,
                   int size)
Constructor. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
clear()
Clear the distance cache. 
 | 
double | 
distance(DBIDRef id1,
        DBIDRef id2)
Returns the distance between the two objects specified by their object ids. 
 | 
double | 
distance(DBIDRef id1,
        V o2)
Returns the distance between the two objects specified by their object ids. 
 | 
double | 
distance(V o1,
        DBIDRef id2)
Returns the distance between the two objects specified by their object ids. 
 | 
double | 
distance(V o1,
        V o2)
Returns the distance between the two objects specified by their object ids. 
 | 
DistanceFunction<? super V> | 
getDistanceFunction()
Get the inner distance function. 
 | 
Relation<? extends V> | 
getRelation()
Access the underlying data query. 
 | 
boolean | 
hasUncachedQueries()
Check if any queries were uncached (not using DBIDs). 
 | 
DistanceQuery<V> inner
it.unimi.dsi.fastutil.longs.Long2DoubleOpenHashMap cache
int bad
public CachedDistanceQuery(DistanceQuery<V> inner, int size)
inner - Inner querysize - Initial size of mappublic boolean hasUncachedQueries()
public void clear()
public double distance(DBIDRef id1, DBIDRef id2)
DistanceQuerydistance in interface DistanceQuery<V>id1 - first object idid2 - second object idpublic double distance(V o1, DBIDRef id2)
DistanceQuerydistance in interface DistanceQuery<V>o1 - first objectid2 - second object idpublic double distance(DBIDRef id1, V o2)
DistanceQuerydistance in interface DistanceQuery<V>id1 - first object ido2 - second objectpublic double distance(V o1, V o2)
DistanceQuerydistance in interface DistanceQuery<V>o1 - first objecto2 - second objectpublic DistanceFunction<? super V> getDistanceFunction()
DistanceQuerygetDistanceFunction in interface DistanceQuery<V>public Relation<? extends V> getRelation()
DistanceQuerygetRelation in interface DistanceQuery<V>Copyright © 2019 ELKI Development Team. License information.