|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.obsearch.query.AbstractOBQuery<O> net.obsearch.query.OBQueryFloat<O>
public final class OBQueryFloat<O extends OBFloat>
Object used to store a query request.
Field Summary | |
---|---|
protected float[] |
max
Maximum part of the rectangle of the query. |
protected float[] |
min
Minimum part of the rectangle of the query. |
protected OBPriorityQueueFloat<O> |
result
Holds the results for the query. |
protected float[] |
smap
SMAPed vector |
Constructor Summary | |
---|---|
OBQueryFloat()
Constructor. |
|
OBQueryFloat(O object,
float range,
OBPriorityQueueFloat<O> result)
Creates a new OBQueryFloat object. |
|
OBQueryFloat(O object,
float range,
OBPriorityQueueFloat<O> result,
float[] smap)
Creates a new OBQueryFloat object. |
|
OBQueryFloat(O object,
OBPriorityQueueFloat<O> result)
|
Method Summary | |
---|---|
boolean |
add(long id,
O object)
Adds an object into the queue. |
boolean |
add(long id,
O obj,
float d)
Add the given object, object id and distance of type float to the queue. |
double |
approx(float[] dbin)
Calculate the 1 + E or (c for Adonis et al) for approx. |
boolean |
collides(float[][] rectangle)
Returns true if the given rectangle collides with this query. |
double |
compound(float[] dbin)
Calculates ep without multiplying by 1/k and |
double |
ep(float[] dbin)
Calculate the EP value for a sorted list of distances. |
double |
ep(List<AbstractOBResult<O>> dbin)
calculates the ep value of this query against the "DB" (all the objects of the DB sorted by distance to this query). |
float |
getDistance()
|
float[] |
getHigh()
Return low of the query rectangle. |
float[] |
getLow()
Return low of the query rectangle. |
O |
getObject()
|
OBPriorityQueueFloat<O> |
getResult()
|
List<AbstractOBResult<O>> |
getSortedElements()
|
boolean |
isCandidate(float smapDistance)
Returns true if we should calculate the real distance. |
boolean |
isFull()
|
float |
peek()
peek to the largest value if the queue is full. |
double |
precision(float[] dbin)
Calculates the precision |
double |
rde(float[] dbin)
|
double |
recall(List<AbstractOBResult<O>> perfectQuery)
calculates the recall value of this query against the "DB" (all the objects of the DB sorted by distance to this query). |
void |
setResult(OBPriorityQueueFloat<O> result)
Set the results of the matching to a new object. |
double |
tDR(float[] dbin)
Total distance ratio |
boolean |
updatedRange(float originalRange)
Returns true if the originalRange has been modified. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected OBPriorityQueueFloat<O extends OBFloat> result
protected float[] min
protected float[] max
protected float[] smap
Constructor Detail |
---|
public OBQueryFloat()
public OBQueryFloat(O object, float range, OBPriorityQueueFloat<O> result)
object
- The object that will be matched.range
- The range to be used for the match.result
- The priority queue were the results will be stored.public OBQueryFloat(O object, OBPriorityQueueFloat<O> result)
public OBQueryFloat(O object, float range, OBPriorityQueueFloat<O> result, float[] smap)
object
- The object that will be matched.range
- The range to be used for the match.result
- The priority queue were the results will be stored.smap
- SMAP vector representation of the given object.Method Detail |
---|
public O getObject()
public boolean collides(float[][] rectangle)
rectangle
- The rectangle to search.public float[] getLow()
public float[] getHigh()
public OBPriorityQueueFloat<O> getResult()
public void setResult(OBPriorityQueueFloat<O> result)
result
- The new result.public boolean isCandidate(float smapDistance)
smapDistance
- The lower-resolution distance calculated
with SMAP.public boolean add(long id, O object) throws InstantiationException, IllegalAccessException, OBException
AbstractOBQuery
add
in class AbstractOBQuery<O extends OBFloat>
id
- id number of the object to add.object
- object added.
InstantiationException
IllegalAccessException
OBException
public float getDistance()
public List<AbstractOBResult<O>> getSortedElements()
getSortedElements
in class AbstractOBQuery<O extends OBFloat>
public boolean add(long id, O obj, float d) throws InstantiationException, IllegalAccessException
id
- The id of the object to be usedobj
- The object to be addedd
- The distance to be added
IllegalAccessException
- If there is a problem when instantiating objects O
InstantiationException
- If there is a problem when instantiating objects Opublic boolean updatedRange(float originalRange)
public boolean isFull()
isFull
in class AbstractOBQuery<O extends OBFloat>
public double recall(List<AbstractOBResult<O>> perfectQuery)
AbstractOBQuery
recall
in class AbstractOBQuery<O extends OBFloat>
perfectQuery
- all the objects of the DB sorted by distance to this query
public double ep(List<AbstractOBResult<O>> dbin)
AbstractOBQuery
ep
in class AbstractOBQuery<O extends OBFloat>
dbin
- all the objects of the DB sorted by distance to this query
public double ep(float[] dbin)
public double approx(float[] dbin) throws OBException
q
-
RAException
OBException
public double compound(float[] dbin)
public double rde(float[] dbin)
public double tDR(float[] dbin)
public double precision(float[] dbin)
public float peek() throws OBException
OBException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |