de.lmu.ifi.dbs.elki.database.query.rknn
Class LinearScanRKNNQuery<O,D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery<O>
      extended by de.lmu.ifi.dbs.elki.database.query.rknn.AbstractRKNNQuery<O,D>
          extended by de.lmu.ifi.dbs.elki.database.query.rknn.LinearScanRKNNQuery<O,D>
Type Parameters:
O - Database object type
D - Distance type
All Implemented Interfaces:
DatabaseQuery, LinearScanQuery, RKNNQuery<O,D>

public class LinearScanRKNNQuery<O,D extends Distance<D>>
extends AbstractRKNNQuery<O,D>
implements LinearScanQuery

Default linear scan RKNN query class.


Field Summary
protected  KNNQuery<O,D> knnQuery
          KNN query we use.
 
Fields inherited from class de.lmu.ifi.dbs.elki.database.query.rknn.AbstractRKNNQuery
distanceQuery
 
Fields inherited from class de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery
relation
 
Fields inherited from interface de.lmu.ifi.dbs.elki.database.query.DatabaseQuery
HINT_BULK, HINT_EXACT, HINT_HEAVY_USE, HINT_NO_CACHE, HINT_OPTIMIZED_ONLY, HINT_SINGLE
 
Constructor Summary
LinearScanRKNNQuery(DistanceQuery<O,D> distanceQuery, KNNQuery<O,D> knnQuery, Integer maxk)
          Constructor.
 
Method Summary
 List<List<DistanceResultPair<D>>> getRKNNForBulkDBIDs(ArrayDBIDs ids, int k)
          Bulk query method for reverse k nearest neighbors for ids.
 List<DistanceResultPair<D>> getRKNNForDBID(DBID id, int k)
          Get the reverse k nearest neighbors for a particular id.
 List<DistanceResultPair<D>> getRKNNForObject(O obj, int k)
          Get the reverse k nearest neighbors for a particular object.
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.rknn.AbstractRKNNQuery
getDistanceFactory
 
Methods inherited from class de.lmu.ifi.dbs.elki.database.query.AbstractDataBasedQuery
getRelation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.database.query.rknn.RKNNQuery
getRelation
 

Field Detail

knnQuery

protected final KNNQuery<O,D extends Distance<D>> knnQuery
KNN query we use.

Constructor Detail

LinearScanRKNNQuery

public LinearScanRKNNQuery(DistanceQuery<O,D> distanceQuery,
                           KNNQuery<O,D> knnQuery,
                           Integer maxk)
Constructor.

Parameters:
distanceQuery - Distance function to use
knnQuery - kNN query to use.
maxk - k to use
Method Detail

getRKNNForObject

public List<DistanceResultPair<D>> getRKNNForObject(O obj,
                                                    int k)
Description copied from interface: RKNNQuery
Get the reverse k nearest neighbors for a particular object.

Specified by:
getRKNNForObject in interface RKNNQuery<O,D extends Distance<D>>
Parameters:
obj - query object instance
k - number of neighbors requested
Returns:
reverse k nearest neighbors

getRKNNForDBID

public List<DistanceResultPair<D>> getRKNNForDBID(DBID id,
                                                  int k)
Description copied from interface: RKNNQuery
Get the reverse k nearest neighbors for a particular id.

Specified by:
getRKNNForDBID in interface RKNNQuery<O,D extends Distance<D>>
Specified by:
getRKNNForDBID in class AbstractRKNNQuery<O,D extends Distance<D>>
Parameters:
id - query object ID
k - number of neighbors requested
Returns:
reverse k nearest neighbors

getRKNNForBulkDBIDs

public List<List<DistanceResultPair<D>>> getRKNNForBulkDBIDs(ArrayDBIDs ids,
                                                             int k)
Description copied from interface: RKNNQuery
Bulk query method for reverse k nearest neighbors for ids.

Specified by:
getRKNNForBulkDBIDs in interface RKNNQuery<O,D extends Distance<D>>
Parameters:
ids - query object IDs
k - number of neighbors requested
Returns:
reverse k nearest neighbors

Release 0.4.0 (2011-09-20_1324)