|
Mobios v0.91 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mobios.index.KNNQuery
public class KNNQuery
This class contains implmentation for K nearest neighbor search (KNN) and approximate K nearest neighbor search (AKNN) queries. A KNN query is in the form of (q, k). Given (q, k), the search returns the k closest objects to query object q. An aproximate KNN query is in the form of (q, k, r, sp), where r is a limiting radius and sp is the approximation policy. The search proceed accroding to the value of r and sp. 1) When both r and sp is omit, the search proceeds as KNN search 2) When r is given and sp is omit or sp is the value of KNNQuery.RADIUSLIMIRED, the search returns upto k objects that are the closest ones to query q within radius r. 3) When a non-negative value is given for sp, an approximate set of k objects is returned. Only those objects within spsmallest distance to query q are gurantee to be returned in the result set. The results of search with larger sp value have better accuracy than those of search with lower sp value and take longer to compute. When a radius value is also given, the results are further limited to those within distance r to query q.
Constructor Summary | |
---|---|
KNNQuery(IndexObject center,
int k)
Initializes the strict KNN query object |
|
KNNQuery(IndexObject center,
int k,
double radius)
|
|
KNNQuery(IndexObject center,
int k,
double radius,
int sp)
|
|
KNNQuery(IndexObject center,
int k,
double radius,
int sp,
int listSize)
|
Method Summary | |
---|---|
int |
getK()
|
int |
getMaxDistanceListSize()
|
IndexObject |
getQueryObject()
Return a reference to the query object |
double |
getRadius()
Returns the search radius of the proximity query. |
int |
getSearchPolicy()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public KNNQuery(IndexObject center, int k)
center
- the Object
that serves as the query objectk
- the number of nearest neighbors to returnpublic KNNQuery(IndexObject center, int k, double radius)
public KNNQuery(IndexObject center, int k, double radius, int sp)
public KNNQuery(IndexObject center, int k, double radius, int sp, int listSize)
Method Detail |
---|
public IndexObject getQueryObject()
getQueryObject
in interface Query
public final double getRadius()
public int getMaxDistanceListSize()
public int getK()
public int getSearchPolicy()
public String toString()
toString
in class Object
|
Mobios v0.91 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |