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