net.obsearch.index.perm.impl
Class DistPermDouble<O extends OBDouble>
java.lang.Object
net.obsearch.index.AbstractOBIndex<O>
net.obsearch.index.pivot.AbstractPivotOBIndex<O>
net.obsearch.index.bucket.AbstractBucketIndex<O,B,Q,BC>
net.obsearch.index.sorter.AbstractBucketSorter<O,B,Q,BC,PermProjection,CompactPerm>
net.obsearch.index.perm.AbstractDistPerm<O,BucketObjectDouble<O>,OBQueryDouble<O>,SleekBucketDouble<O>>
net.obsearch.index.perm.impl.DistPermDouble<O>
- All Implemented Interfaces:
- Index<O>, IndexDouble<O>
public class DistPermDouble<O extends OBDouble>
- extends AbstractDistPerm<O,BucketObjectDouble<O>,OBQueryDouble<O>,SleekBucketDouble<O>>
- implements IndexDouble<O>
Method Summary |
double[] |
fullMatchLite(O query,
boolean filterSame)
This method returns a list of all the distances of the query against the DB. |
BucketObjectDouble<O> |
getBucket(O object)
Returns the bucket information for the given object. |
protected int |
getCPSize()
Return the compact representation size |
protected AbstractOBQuery<O> |
getKQuery(O object,
int k)
Returns a k query for the given object. |
protected Class<CompactPerm> |
getPInstance()
|
protected PermProjection |
getProjection(BucketObjectDouble<O> b)
|
protected SleekBucketDouble<O> |
instantiateBucketContainer(byte[] data,
byte[] address)
Get a bucket container from the given data. |
protected void |
maxKEstimationAux(O object)
Estimate ks for the given query object and the given list of objects. |
protected int |
primitiveDataTypeSize()
Return the size in bytes of the underlying primitive datatype. |
void |
searchOB(O object,
double r,
Filter<O> filter,
OBPriorityQueueDouble<O> result)
Searches the Index and returns OBResult (ID, OB and distance)
elements that are closer to "object". |
void |
searchOB(O object,
double r,
OBPriorityQueueDouble<O> result)
Searches the Index and returns OBResult (ID, OB and distance)
elements that are closer to "object". |
Methods inherited from class net.obsearch.index.sorter.AbstractBucketSorter |
bucketStats, calculateEstimators, close, estimateK, freezeDefault, getAddress, getAllObjects, getBucketContainer, getBucketPivotCount, getExpectedEP, getMaxK, init, initByteArrayBuckets, initCache, insertBucket, insertBucketBulk, loadMasks, maxKEstimation, printEstimation, searchBuckets, setExpectedError, setKAlpha, setMaxK, setSampleSize |
Methods inherited from class net.obsearch.index.AbstractOBIndex |
assertFrozen, bytesToObject, bytesToObject, clearACache, databaseSize, delete, distance, emptyPivotsArray, findAux, getBox, getObject, getStats, getType, initStorageDevices, insert, insert, insertBulk, insertBulk, intrinsicDimensionality, isFrozen, isPreFreeze, isPreFreezeCheck, loadObject, loadPivots, objectToByteBuffer, objectToBytes, resetStats, serializePivots, setFixedRecord, setFixedRecord, setIdAutoGeneration, setPreFreeze, setPreFreezeCheck, totalBoxes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.obsearch.Index |
close, databaseSize, debug, delete, exists, freeze, getBox, getObject, getStats, getType, init, insert, insert, insertBulk, insertBulk, isFrozen, loadObject, resetStats, setPreFreezeCheck, totalBoxes |
DistPermDouble
public DistPermDouble(Class<O> type,
IncrementalPivotSelector<O> pivotSelector,
int pivotCount,
int bucketPivotCount)
throws OBStorageException,
OBException
- Throws:
OBStorageException
OBException
getCPSize
protected int getCPSize()
- Description copied from class:
AbstractBucketSorter
- Return the compact representation size
- Specified by:
getCPSize
in class AbstractBucketSorter<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>,SleekBucketDouble<O extends OBDouble>,PermProjection,CompactPerm>
- Returns:
getKQuery
protected AbstractOBQuery<O> getKQuery(O object,
int k)
throws OBException,
InstantiationException,
IllegalAccessException
- Description copied from class:
AbstractBucketSorter
- Returns a k query for the given object.
- Specified by:
getKQuery
in class AbstractBucketSorter<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>,SleekBucketDouble<O extends OBDouble>,PermProjection,CompactPerm>
- Parameters:
object
- (query object)k
- the number of objects to accept in the query.
- Returns:
-
- Throws:
OBException
InstantiationException
IllegalAccessException
getPInstance
protected Class<CompactPerm> getPInstance()
- Specified by:
getPInstance
in class AbstractBucketSorter<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>,SleekBucketDouble<O extends OBDouble>,PermProjection,CompactPerm>
getProjection
protected PermProjection getProjection(BucketObjectDouble<O> b)
throws OBException
- Specified by:
getProjection
in class AbstractBucketSorter<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>,SleekBucketDouble<O extends OBDouble>,PermProjection,CompactPerm>
- Throws:
OBException
fullMatchLite
public double[] fullMatchLite(O query,
boolean filterSame)
throws OBException,
IllegalAccessException,
InstantiationException
- This method returns a list of all the distances of the query against the DB.
This helps to calculate EP values in a cheaper way. results that are equal to the original object are added
as Double.MAX_VALUE
- Specified by:
fullMatchLite
in interface IndexDouble<O extends OBDouble>
- Parameters:
query
- filterSame
- if True we do not return objects o such that query.equals(o)
- Returns:
-
- Throws:
OBException
InstantiationException
IllegalAccessException
maxKEstimationAux
protected void maxKEstimationAux(O object)
throws OBException,
InstantiationException,
IllegalAccessException
- Description copied from class:
AbstractBucketSorter
- Estimate ks for the given query object and the given list of objects.
- Specified by:
maxKEstimationAux
in class AbstractBucketSorter<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>,SleekBucketDouble<O extends OBDouble>,PermProjection,CompactPerm>
- Throws:
OBException
InstantiationException
IllegalAccessException
getBucket
public BucketObjectDouble<O> getBucket(O object)
throws OBException,
InstantiationException,
IllegalAccessException
- Description copied from class:
AbstractBucketIndex
- Returns the bucket information for the given object.
- Specified by:
getBucket
in class AbstractBucketIndex<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>,SleekBucketDouble<O extends OBDouble>>
- Parameters:
object
- The object that will be calculated
- Returns:
- The bucket information for the given object.
- Throws:
IllegalAccessException
OBException
InstantiationException
instantiateBucketContainer
protected SleekBucketDouble<O> instantiateBucketContainer(byte[] data,
byte[] address)
throws InstantiationException,
IllegalAccessException,
OBException
- Description copied from class:
AbstractBucketIndex
- Get a bucket container from the given data.
- Specified by:
instantiateBucketContainer
in class AbstractBucketIndex<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>,SleekBucketDouble<O extends OBDouble>>
- Parameters:
data
- The data from which the bucket container will be loaded.
- Returns:
- A new bucket container ready to be used.
- Throws:
InstantiationException
IllegalAccessException
OBException
primitiveDataTypeSize
protected int primitiveDataTypeSize()
- Description copied from class:
AbstractBucketIndex
- Return the size in bytes of the underlying primitive datatype.
- Specified by:
primitiveDataTypeSize
in class AbstractBucketIndex<O extends OBDouble,BucketObjectDouble<O extends OBDouble>,OBQueryDouble<O extends OBDouble>,SleekBucketDouble<O extends OBDouble>>
- Returns:
searchOB
public void searchOB(O object,
double r,
Filter<O> filter,
OBPriorityQueueDouble<O> result)
throws NotFrozenException,
InstantiationException,
IllegalIdException,
IllegalAccessException,
OutOfRangeException,
OBException
- Description copied from interface:
IndexDouble
- Searches the Index and returns OBResult (ID, OB and distance)
elements that are closer to "object". The closest element is at the
beginning of the list and the farthest elements is at the end of the
list. You can control the size of the resulting set when you create
the object "result". This becomes the k parameter of the search.
The parameter "filter" is used to remove unwanted objects from
the result (a select where clause). Users are responsible to
implement at least one filter that can be used with their O.
- Specified by:
searchOB
in interface IndexDouble<O extends OBDouble>
- Parameters:
object
- The object that has to be searchedr
- The range to be usedresult
- A priority queue that will hold the result
- Throws:
NotFrozenException
- if the index has not been frozen.
InstantiationException
- If there is a problem when instantiating objects O
IllegalIdException
- This exception is left as a Debug flag. If you receive
this exception please report the problem to:
http://code.google.com/p/obsearch/issues/list
IllegalAccessException
- If there is a problem when instantiating objects O
OutOfRangeException
- If the distance of any object to any other object exceeds
the range defined by the user.
OBException
- User generated exception
searchOB
public void searchOB(O object,
double r,
OBPriorityQueueDouble<O> result)
throws NotFrozenException,
InstantiationException,
IllegalIdException,
IllegalAccessException,
OutOfRangeException,
OBException
- Description copied from interface:
IndexDouble
- Searches the Index and returns OBResult (ID, OB and distance)
elements that are closer to "object". The closest element is at the
beginning of the list and the farthest elements is at the end of the
list. You can control the size of the resulting set when you create
the object "result". This becomes the k parameter of the search.
- Specified by:
searchOB
in interface IndexDouble<O extends OBDouble>
- Parameters:
object
- The object that has to be searchedr
- The range to be usedresult
- A priority queue that will hold the result
- Throws:
NotFrozenException
- if the index has not been frozen.
InstantiationException
- If there is a problem when instantiating objects O
IllegalIdException
- This exception is left as a Debug flag. If you receive
this exception please report the problem to:
http://code.google.com/p/obsearch/issues/list
IllegalAccessException
- If there is a problem when instantiating objects O
OutOfRangeException
- If the distance of any object to any other object exceeds
the range defined by the user.
OBException
- User generated exception
Copyright © 2007-2011 Arnoldo Jose Muller Molina. All Rights Reserved.