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