|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.database.AbstractDatabase<O>
de.lmu.ifi.dbs.elki.database.IndexDatabase<O>
de.lmu.ifi.dbs.elki.database.MetricalIndexDatabase<O,D,N,E>
O
- the type of FeatureVector as element of the databaseD
- Distance typeN
- Node typeE
- Entry type@Description(value="Database using a metrical index") public class MetricalIndexDatabase<O extends DatabaseObject,D extends Distance<D>,N extends MetricalNode<N,E>,E extends MTreeEntry<D>>
MetricalIndexDatabase is a database implementation which is supported by a metrical index structure.
Field Summary | |
---|---|
(package private) MetricalIndex<O,D,N,E> |
index
The metrical index storing the data. |
static OptionID |
INDEX_ID
OptionID for INDEX_PARAM |
private ObjectParameter<MetricalIndex<O,D,N,E>> |
INDEX_PARAM
Parameter to specify the metrical index to use. |
private Collection<Pair<OptionID,Object>> |
params
Store own parameters, for partitioning. |
Fields inherited from class de.lmu.ifi.dbs.elki.database.AbstractDatabase |
---|
listenerList |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug, logger |
Constructor Summary | |
---|---|
MetricalIndexDatabase(Parameterization config)
Constructor, adhering to Parameterizable |
Method Summary | ||
---|---|---|
|
bulkKNNQueryForID(List<Integer> ids,
int k,
DistanceFunction<O,T> distanceFunction)
Performs k-nearest neighbor queries for the given object IDs. |
|
MetricalIndex<O,D,N,E> |
getIndex()
Returns the index of this database. |
|
protected Collection<Pair<OptionID,Object>> |
getParameters()
|
|
void |
insert(List<Pair<O,Associations>> objectsAndAssociationsList)
Calls the super method and afterwards inserts the specified objects into the underlying index structure. |
|
Integer |
insert(Pair<O,Associations> objectAndAssociations)
Calls the super method and afterwards inserts the specified object into the underlying index structure. |
|
|
kNNQueryForID(Integer id,
int k,
DistanceFunction<O,T> distanceFunction)
Performs a k-nearest neighbor query for the given object ID. |
|
|
kNNQueryForObject(O queryObject,
int k,
DistanceFunction<O,T> distanceFunction)
Performs a k-nearest neighbor query for the given object. |
|
|
rangeQuery(Integer id,
String epsilon,
DistanceFunction<O,T> distanceFunction)
Performs a range query for the given object ID with the given epsilon range and the according distance function. |
|
|
rangeQuery(Integer id,
T epsilon,
DistanceFunction<O,T> distanceFunction)
Performs a range query for the given object ID with the given epsilon range and the according distance function. |
|
|
reverseKNNQuery(Integer id,
int k,
DistanceFunction<O,T> distanceFunction)
Performs a reverse k-nearest neighbor query for the given object ID. |
|
String |
toString()
Returns a string representation of this database. |
Methods inherited from class de.lmu.ifi.dbs.elki.database.IndexDatabase |
---|
delete, delete, getLogicalPageAccess, getPhysicalReadAccess, getPhysicalWriteReadAccess, resetPageAccess |
Methods inherited from class de.lmu.ifi.dbs.elki.database.AbstractDatabase |
---|
addDatabaseListener, associate, associateGlobally, deleteAssociations, dimensionality, fireObjectInserted, fireObjectRemoved, fireObjectsChanged, fireObjectsInserted, fireObjectsRemoved, get, getAssociation, getAssociations, getGlobalAssociation, getIDs, getName, getObjects, isSet, isSetForAllObjects, isSetGlobally, iterator, partition, partition, partition, randomSample, removeDatabaseListener, restoreID, setAssociations, setNewID, size |
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final OptionID INDEX_ID
INDEX_PARAM
private final ObjectParameter<MetricalIndex<O extends DatabaseObject,D extends Distance<D>,N extends MetricalNode<N,E>,E extends MTreeEntry<D>>> INDEX_PARAM
Key: -metricalindexdb.index
MetricalIndex<O extends DatabaseObject,D extends Distance<D>,N extends MetricalNode<N,E>,E extends MTreeEntry<D>> index
private Collection<Pair<OptionID,Object>> params
Constructor Detail |
---|
public MetricalIndexDatabase(Parameterization config)
Parameterizable
config
- ParameterizationMethod Detail |
---|
public Integer insert(Pair<O,Associations> objectAndAssociations) throws UnableToComplyException
insert
in interface Database<O extends DatabaseObject>
insert
in class AbstractDatabase<O extends DatabaseObject>
objectAndAssociations
- the object and its associations to be inserted
UnableToComplyException
- if database reached limit of storage
capacitypublic void insert(List<Pair<O,Associations>> objectsAndAssociationsList) throws UnableToComplyException
insert
in interface Database<O extends DatabaseObject>
insert
in class AbstractDatabase<O extends DatabaseObject>
objectsAndAssociationsList
- the list of objects and their
associations to be inserted
UnableToComplyException
- if initialization is not possiblepublic <T extends Distance<T>> List<DistanceResultPair<T>> rangeQuery(Integer id, String epsilon, DistanceFunction<O,T> distanceFunction)
Database
Performs a range query for the given object ID with the given epsilon range and the according distance function.
The query result is sorted in ascending order w.r.t. the distance to the query object.
rangeQuery
in interface Database<O extends DatabaseObject>
T
- distance typeid
- the ID of the query objectepsilon
- the string representation of the query rangedistanceFunction
- the distance function that computes the distances
between the objects
public <T extends Distance<T>> List<DistanceResultPair<T>> rangeQuery(Integer id, T epsilon, DistanceFunction<O,T> distanceFunction)
Database
Performs a range query for the given object ID with the given epsilon range and the according distance function.
The query result is sorted in ascending order w.r.t. the distance to the query object.
rangeQuery
in interface Database<O extends DatabaseObject>
T
- distance typeid
- the ID of the query objectepsilon
- the string representation of the query rangedistanceFunction
- the distance function that computes the distances
between the objects
public <T extends Distance<T>> List<DistanceResultPair<T>> kNNQueryForObject(O queryObject, int k, DistanceFunction<O,T> distanceFunction)
Database
Performs a k-nearest neighbor query for the given object.
The query result is sorted in ascending order w.r.t. the distance to the query object.
The general contract for the result of kNN queries in ELKI is that the resulting list contains exactly k nearest neighbors including the query object if it is an element of this database. Generally, ties will be resolved by the order of objects in the database. Any implementing method should inform about the exact policy of resolving ties.
Generally, it is assumed that the database does not contain less than k objects.
kNNQueryForObject
in interface Database<O extends DatabaseObject>
T
- distance typequeryObject
- the query objectk
- the number of nearest neighbors to be returneddistanceFunction
- the distance function that computes the distances
between the objects
public <T extends Distance<T>> List<DistanceResultPair<T>> kNNQueryForID(Integer id, int k, DistanceFunction<O,T> distanceFunction)
Database
Performs a k-nearest neighbor query for the given object ID.
The query result is sorted in ascending order w.r.t. the distance to the query object.
The general contract for the result of kNN queries in ELKI is that the resulting list contains exactly k nearest neighbors including the query object. Generally, ties will be resolved by the order of objects in the database. Any implementing method should inform about the exact policy of resolving ties.
Generally, it is assumed that the database does not contain less than k objects.
kNNQueryForID
in interface Database<O extends DatabaseObject>
T
- distance typeid
- the ID of the query objectk
- the number of nearest neighbors to be returneddistanceFunction
- the distance function that computes the distances
between the objects
public <T extends Distance<T>> List<List<DistanceResultPair<T>>> bulkKNNQueryForID(List<Integer> ids, int k, DistanceFunction<O,T> distanceFunction)
Database
Performs k-nearest neighbor queries for the given object IDs.
The query result is sorted in ascending order w.r.t. the distance to the query object.
The general contract for the result of kNN queries in ELKI is that the resulting lists contain exactly k nearest neighbors including the query objects. Generally, ties will be resolved by the order of objects in the database. Any implementing method should inform about the exact policy of resolving ties.
Generally, it is assumed that the database does not contain less than k objects.
bulkKNNQueryForID
in interface Database<O extends DatabaseObject>
T
- distance typeids
- the IDs of the query objectsk
- the number of nearest neighbors to be returneddistanceFunction
- the distance function that computes the distances
between the objects
public <T extends Distance<T>> List<DistanceResultPair<T>> reverseKNNQuery(Integer id, int k, DistanceFunction<O,T> distanceFunction)
Database
Performs a reverse k-nearest neighbor query for the given object ID.
The query result is sorted in ascending order w.r.t. the distance to the query object.
Generally, it is assumed that the database does not contain less than k objects.
reverseKNNQuery
in interface Database<O extends DatabaseObject>
T
- distance typeid
- the ID of the query objectk
- the size of k-nearest neighborhood of any database object
o
to contain a database object in order to include
o
in the result listdistanceFunction
- the distance function that computes the distances
between the objects
public String toString()
toString
in class Object
public MetricalIndex<O,D,N,E> getIndex()
getIndex
in class IndexDatabase<O extends DatabaseObject>
protected Collection<Pair<OptionID,Object>> getParameters()
getParameters
in class AbstractDatabase<O extends DatabaseObject>
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |