|
|
|||||||||||||||||||||
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.utilities.optionhandling.AbstractParameterizable
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 typepublic 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 ClassParameter<MetricalIndex<O,D,N,E>> |
INDEX_PARAM
Parameter to specify the metrical index to use. |
Fields inherited from class de.lmu.ifi.dbs.elki.database.AbstractDatabase |
---|
listenerList |
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
optionHandler |
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable |
---|
debug, logger |
Constructor Summary | |
---|---|
MetricalIndexDatabase()
Constructor |
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. |
|
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. |
|
|
reverseKNNQuery(Integer id,
int k,
DistanceFunction<O,T> distanceFunction)
Performs a reverse k-nearest neighbor query for the given object ID. |
|
List<String> |
setParameters(List<String> args)
Sets the values for the parameter bulk. |
|
String |
shortDescription()
Returns a short description of the database. |
|
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, getObjects, isSet, isSetForAllObjects, isSetGlobally, iterator, partition, partition, randomSample, removeDatabaseListener, restoreID, setAssociations, setNewID, size |
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable |
---|
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable |
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 |
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable |
---|
checkGlobalParameterConstraints, collectOptions, getParameters |
Field Detail |
---|
public static final OptionID INDEX_ID
INDEX_PARAM
private final ClassParameter<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
Constructor Detail |
---|
public MetricalIndexDatabase()
Method 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.
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.
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.
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.
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.
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>
public List<String> setParameters(List<String> args) throws ParameterException
setParameters
in interface Parameterizable
setParameters
in class AbstractParameterizable
args
- parameters to set the attributes accordingly to
ParameterException
- in case of wrong parameter-settingpublic String shortDescription()
shortDescription
in interface Parameterizable
shortDescription
in class AbstractParameterizable
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |