|
|
|||||||||||||||||||||
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.SequentialDatabase<O>
O
- the type of FeatureVector as element of the database@Description(value="Database using an in-memory hashtable and doing linear scans.") public class SequentialDatabase<O extends DatabaseObject>
SequentialDatabase is a simple implementation of a Database.
It does not support any index structure and holds all objects in main memory (as a Map).
Field Summary |
---|
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 | |
---|---|
SequentialDatabase()
Provides a database for main memory holding all objects in a hashtable. |
Method Summary | ||
---|---|---|
|
bulkKNNQueryForID(List<Integer> ids,
int k,
DistanceFunction<O,D> distanceFunction)
Retrieves the k nearest neighbors for the query objects. |
|
protected Collection<Pair<OptionID,Object>> |
getParameters()
|
|
|
kNNQueryForID(Integer id,
int k,
DistanceFunction<O,D> distanceFunction)
Retrieves the k nearest neighbors for the query object. |
|
|
kNNQueryForObject(O queryObject,
int k,
DistanceFunction<O,D> distanceFunction)
Retrieves the k nearest neighbors for the query object. |
|
|
rangeQuery(Integer id,
D epsilon,
DistanceFunction<O,D> distanceFunction)
Performs a range query for the given object ID with the given epsilon range and the according distance function. |
|
|
rangeQuery(Integer id,
String epsilon,
DistanceFunction<O,D> 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,D> distanceFunction)
Performs a reverse k-nearest neighbor query for the given object ID. |
Methods inherited from class de.lmu.ifi.dbs.elki.database.AbstractDatabase |
---|
addDatabaseListener, associate, associateGlobally, delete, delete, deleteAssociations, dimensionality, fireObjectInserted, fireObjectRemoved, fireObjectsChanged, fireObjectsInserted, fireObjectsRemoved, get, getAssociation, getAssociations, getGlobalAssociation, getIDs, getName, getObjects, insert, insert, 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, toString, wait, wait, wait |
Constructor Detail |
---|
public SequentialDatabase()
Method Detail |
---|
public <D extends Distance<D>> List<DistanceResultPair<D>> kNNQueryForObject(O queryObject, int k, DistanceFunction<O,D> distanceFunction)
KNNList
, see KNNList.add(DistanceResultPair)
.
kNNQueryForObject
in interface Database<O extends DatabaseObject>
D
- distance typequeryObject
- the query objectk
- the number of nearest neighbors to be returneddistanceFunction
- the distance function that computes the distances
between the objects
Database.kNNQueryForObject(DatabaseObject, int, DistanceFunction)
public <D extends Distance<D>> List<DistanceResultPair<D>> kNNQueryForID(Integer id, int k, DistanceFunction<O,D> distanceFunction)
KNNList
, see KNNList.add(DistanceResultPair)
.
kNNQueryForID
in interface Database<O extends DatabaseObject>
D
- 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
Database.kNNQueryForObject(DatabaseObject, int, DistanceFunction)
public <D extends Distance<D>> List<List<DistanceResultPair<D>>> bulkKNNQueryForID(List<Integer> ids, int k, DistanceFunction<O,D> distanceFunction)
KNNList
, see KNNList.add(DistanceResultPair)
.
bulkKNNQueryForID
in interface Database<O extends DatabaseObject>
D
- 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
Database.kNNQueryForObject(DatabaseObject, int, DistanceFunction)
public <D extends Distance<D>> List<DistanceResultPair<D>> rangeQuery(Integer id, String epsilon, DistanceFunction<O,D> 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>
D
- 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 <D extends Distance<D>> List<DistanceResultPair<D>> rangeQuery(Integer id, D epsilon, DistanceFunction<O,D> 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>
D
- 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 <D extends Distance<D>> List<DistanceResultPair<D>> reverseKNNQuery(Integer id, int k, DistanceFunction<O,D> 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>
D
- 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
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 |