O
- Object typepublic abstract class AbstractCoverTree<O> extends AbstractIndex<O>
Modifier and Type | Class and Description |
---|---|
static class |
AbstractCoverTree.Factory<O>
Index factory.
|
Modifier and Type | Field and Description |
---|---|
protected DistanceFunction<? super O> |
distanceFunction
Holds the instance of the trees distance function.
|
private DistanceQuery<O> |
distanceQuery
Distance query, on the data relation.
|
protected long |
distComputations
Distance computations performed.
|
(package private) double |
expansion
Constant expansion rate. 2 would be the intuitive value, but the original
version used 1.3, so we copy this.
|
(package private) double |
invLogExpansion
Logarithm base.
|
protected int |
scaleBottom
Remaining points are likely identical.
|
protected int |
truncate
Stop refining the tree at this size, but build a leaf.
|
relation
Constructor and Description |
---|
AbstractCoverTree(Relation<O> relation,
DistanceFunction<? super O> distanceFunction,
double expansion,
int truncate)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
collectByCover(DBIDRef cur,
ModifiableDoubleDBIDList candidates,
double fmax,
ModifiableDoubleDBIDList collect)
Collect all elements with respect to a new routing object.
|
protected double |
distance(DBIDRef a,
DBIDRef b)
Compute a distance (and count).
|
protected double |
distance(O a,
DBIDRef b)
Compute a distance (and count).
|
protected int |
distToScale(double d)
Convert a distance to an upper scaling bound-
|
protected void |
excludeNotCovered(ModifiableDoubleDBIDList candidates,
double fmax,
ModifiableDoubleDBIDList collect)
Retain all elements within the current cover.
|
protected abstract Logging |
getLogger()
Get the class logger.
|
java.lang.String |
getLongName()
A "pretty" name for the result, for use in titles, captions and menus.
|
java.lang.String |
getShortName()
A short name for the result, useful for file names.
|
void |
logStatistics()
Send statistics to the logger, if enabled.
|
protected double |
maxDistance(DoubleDBIDList elems)
Find maximum in a list via scanning.
|
protected double |
scaleToDist(int s)
Convert a scaling factor to a distance.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
initialize
final double expansion
final double invLogExpansion
protected final int scaleBottom
protected DistanceFunction<? super O> distanceFunction
private DistanceQuery<O> distanceQuery
protected long distComputations
protected int truncate
public AbstractCoverTree(Relation<O> relation, DistanceFunction<? super O> distanceFunction, double expansion, int truncate)
relation
- Data relationdistanceFunction
- Distance functionexpansion
- Expansion ratetruncate
- Truncate branches with less than this number of instances.protected final double scaleToDist(int s)
s
- Scaling factorprotected final int distToScale(double d)
d
- Distanceprotected double maxDistance(DoubleDBIDList elems)
elems
- Elementsprotected double distance(DBIDRef a, DBIDRef b)
a
- Object referenceb
- Object referenceprotected double distance(O a, DBIDRef b)
a
- Object referenceb
- Object referenceprotected void excludeNotCovered(ModifiableDoubleDBIDList candidates, double fmax, ModifiableDoubleDBIDList collect)
candidates
- Candidatesfmax
- Maximum distancecollect
- Far neighborsprotected void collectByCover(DBIDRef cur, ModifiableDoubleDBIDList candidates, double fmax, ModifiableDoubleDBIDList collect)
cur
- Routing objectcandidates
- Candidate listfmax
- Maximum distancecollect
- Output listpublic void logStatistics()
Index
protected abstract Logging getLogger()
public java.lang.String getLongName()
Result
getLongName
in interface Result
getLongName
in class AbstractIndex<O>
public java.lang.String getShortName()
Result
getShortName
in interface Result
getShortName
in class AbstractIndex<O>
Copyright © 2019 ELKI Development Team. License information.