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