de.lmu.ifi.dbs.elki.database.query.rknn
Class PreprocessorRKNNQuery<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.PreprocessorRKNNQuery<O,D>
All Implemented Interfaces:
DatabaseQuery, RKNNQuery<O,D>

public class PreprocessorRKNNQuery<O,D extends Distance<D>>
extends AbstractDataBasedQuery<O>
implements RKNNQuery<O,D>

Instance for a particular database, invoking the preprocessor.


Field Summary
private  MaterializeKNNAndRKNNPreprocessor<O,D> preprocessor
          The last preprocessor result
private  boolean warned
          Warn only once.
 
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
PreprocessorRKNNQuery(Relation<O> database, MaterializeKNNAndRKNNPreprocessor.Factory<O,D> preprocessor)
          Constructor.
PreprocessorRKNNQuery(Relation<O> database, MaterializeKNNAndRKNNPreprocessor<O,D> preprocessor)
          Constructor.
 
Method Summary
 D getDistanceFactory()
          Get the distance data type of the function.
 AbstractMaterializeKNNPreprocessor<O,D> getPreprocessor()
          Get the preprocessor instance.
 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.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

preprocessor

private final MaterializeKNNAndRKNNPreprocessor<O,D extends Distance<D>> preprocessor
The last preprocessor result


warned

private boolean warned
Warn only once.

Constructor Detail

PreprocessorRKNNQuery

public PreprocessorRKNNQuery(Relation<O> database,
                             MaterializeKNNAndRKNNPreprocessor<O,D> preprocessor)
Constructor.

Parameters:
database - Database to query
preprocessor - Preprocessor instance to use

PreprocessorRKNNQuery

public PreprocessorRKNNQuery(Relation<O> database,
                             MaterializeKNNAndRKNNPreprocessor.Factory<O,D> preprocessor)
Constructor.

Parameters:
database - Database to query
preprocessor - Preprocessor to use
Method Detail

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>>
Parameters:
id - query object ID
k - number of neighbors requested
Returns:
reverse k nearest neighbors

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

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

getPreprocessor

public AbstractMaterializeKNNPreprocessor<O,D> getPreprocessor()
Get the preprocessor instance.

Returns:
preprocessor instance

getDistanceFactory

public D getDistanceFactory()
Description copied from interface: RKNNQuery
Get the distance data type of the function.

Specified by:
getDistanceFactory in interface RKNNQuery<O,D extends Distance<D>>

Release 0.4.0 (2011-09-20_1324)