Package elki.database.query.rknn
Class WrappedRKNNDBIDByLookup<O>
- java.lang.Object
-
- elki.database.query.rknn.WrappedRKNNDBIDByLookup<O>
-
- Type Parameters:
O
- relation object type
- All Implemented Interfaces:
RKNNSearcher<DBIDRef>
- Direct Known Subclasses:
WrappedRKNNDBIDByLookup.Linear
public class WrappedRKNNDBIDByLookup<O> extends java.lang.Object implements RKNNSearcher<DBIDRef>
Find nearest neighbors by querying with the original object.- Since:
- 0.8.0
- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
WrappedRKNNDBIDByLookup.Linear<O>
Linear scan searcher.
-
Constructor Summary
Constructors Modifier Constructor Description private
WrappedRKNNDBIDByLookup(Relation<? extends O> relation, RKNNSearcher<O> inner)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description DoubleDBIDList
getRKNN(DBIDRef id, int k)
Get the reverse k nearest neighbors for a particular object.static <O> RKNNSearcher<DBIDRef>
wrap(Relation<? extends O> relation, RKNNSearcher<O> inner)
Wrap a query, if notnull
.
-
-
-
Field Detail
-
inner
private RKNNSearcher<O> inner
Inner kNN searcher.
-
-
Constructor Detail
-
WrappedRKNNDBIDByLookup
private WrappedRKNNDBIDByLookup(Relation<? extends O> relation, RKNNSearcher<O> inner)
Constructor.- Parameters:
relation
- data relationinner
- inner kNN searcher
-
-
Method Detail
-
getRKNN
public DoubleDBIDList getRKNN(DBIDRef id, int k)
Description copied from interface:RKNNSearcher
Get the reverse k nearest neighbors for a particular object.- Specified by:
getRKNN
in interfaceRKNNSearcher<O>
- Parameters:
id
- query objectk
- number of neighbors requested- Returns:
- reverse k nearest neighbors
-
wrap
public static <O> RKNNSearcher<DBIDRef> wrap(Relation<? extends O> relation, RKNNSearcher<O> inner)
Wrap a query, if notnull
.- Type Parameters:
O
- inner data type- Parameters:
relation
- Relation to get object frominner
- inner query- Returns:
- wrapped query, or
null
if inner wasnull
-
-