|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.obsearch.query.AbstractOBQuery<O>
net.obsearch.query.OBQueryDouble<O>
public final class OBQueryDouble<O extends OBDouble>
Object used to store a query request.
Field Summary | |
---|---|
protected double[] |
max
Maximum part of the rectangle of the query. |
protected double[] |
min
Minimum part of the rectangle of the query. |
protected OBPriorityQueueDouble<O> |
result
Holds the results for the query. |
protected double[] |
smap
SMAPed vector |
Constructor Summary | |
---|---|
OBQueryDouble()
Constructor. |
|
OBQueryDouble(O object,
double range,
OBPriorityQueueDouble<O> result)
Creates a new OBQueryDouble object. |
|
OBQueryDouble(O object,
double range,
OBPriorityQueueDouble<O> result,
double[] smap)
Creates a new OBQueryDouble object. |
|
OBQueryDouble(O object,
OBPriorityQueueDouble<O> result)
|
Method Summary | |
---|---|
boolean |
add(long id,
O object)
Adds an object into the queue. |
boolean |
add(long id,
O obj,
double d)
Add the given object, object id and distance of type float to the queue. |
double |
approx(double[] dbin)
Calculate the 1 + E or (c for Adonis et al) for approx. |
boolean |
collides(double[][] rectangle)
Returns true if the given rectangle collides with this query. |
double |
compound(double[] dbin)
Calculates ep without multiplying by 1/k and |
double |
ep(double[] 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). |
double |
getDistance()
|
double[] |
getHigh()
Return low of the query rectangle. |
double[] |
getLow()
Return low of the query rectangle. |
O |
getObject()
|
OBPriorityQueueDouble<O> |
getResult()
|
List<AbstractOBResult<O>> |
getSortedElements()
|
boolean |
isCandidate(double smapDistance)
Returns true if we should calculate the real distance. |
boolean |
isFull()
|
double |
peek()
peek to the largest value if the queue is full. |
double |
precision(double[] dbin)
Calculates the precision |
double |
rde(double[] 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(OBPriorityQueueDouble<O> result)
Set the results of the matching to a new object. |
double |
tDR(double[] dbin)
Total distance ratio |
boolean |
updatedRange(double 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 OBPriorityQueueDouble<O extends OBDouble> result
protected double[] min
protected double[] max
protected double[] smap
Constructor Detail |
---|
public OBQueryDouble()
public OBQueryDouble(O object, double range, OBPriorityQueueDouble<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 OBQueryDouble(O object, OBPriorityQueueDouble<O> result)
public OBQueryDouble(O object, double range, OBPriorityQueueDouble<O> result, double[] 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(double[][] rectangle)
rectangle
- The rectangle to search.public double[] getLow()
public double[] getHigh()
public OBPriorityQueueDouble<O> getResult()
public void setResult(OBPriorityQueueDouble<O> result)
result
- The new result.public boolean isCandidate(double 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 OBDouble>
id
- id number of the object to add.object
- object added.
InstantiationException
IllegalAccessException
OBException
public double getDistance()
public List<AbstractOBResult<O>> getSortedElements()
getSortedElements
in class AbstractOBQuery<O extends OBDouble>
public boolean add(long id, O obj, double 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(double originalRange)
public boolean isFull()
isFull
in class AbstractOBQuery<O extends OBDouble>
public double recall(List<AbstractOBResult<O>> perfectQuery)
AbstractOBQuery
recall
in class AbstractOBQuery<O extends OBDouble>
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 OBDouble>
dbin
- all the objects of the DB sorted by distance to this query
public double ep(double[] dbin)
public double approx(double[] dbin) throws OBException
q
-
RAException
OBException
public double compound(double[] dbin)
public double rde(double[] dbin)
public double tDR(double[] dbin)
public double precision(double[] dbin)
public double peek() throws OBException
OBException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |