net.obsearch.index.perm.impl
Class DistPermInt<O extends OBInt>

java.lang.Object
  extended by net.obsearch.index.AbstractOBIndex<O>
      extended by net.obsearch.index.pivot.AbstractPivotOBIndex<O>
          extended by net.obsearch.index.bucket.AbstractBucketIndex<O,B,Q,BC>
              extended by net.obsearch.index.sorter.AbstractBucketSorter<O,B,Q,BC,net.obsearch.index.perm.PermProjection,net.obsearch.index.perm.CompactPerm>
                  extended by net.obsearch.index.perm.AbstractDistPerm<O,BucketObjectInt<O>,OBQueryInt<O>,SleekBucketInt<O>>
                      extended by net.obsearch.index.perm.impl.DistPermInt<O>
All Implemented Interfaces:
net.obsearch.Index<O>, IndexInt<O>

public class DistPermInt<O extends OBInt>
extends net.obsearch.index.perm.AbstractDistPerm<O,BucketObjectInt<O>,OBQueryInt<O>,SleekBucketInt<O>>
implements IndexInt<O>


Nested Class Summary
 
Nested classes/interfaces inherited from class net.obsearch.index.bucket.AbstractBucketIndex
net.obsearch.index.bucket.AbstractBucketIndex.BucketIterator
 
Field Summary
 
Fields inherited from class net.obsearch.index.sorter.AbstractBucketSorter
bucketCache, bucketPivotCount, kEstimators, projections, projectionStorage, userK
 
Fields inherited from class net.obsearch.index.bucket.AbstractBucketIndex
Buckets
 
Fields inherited from class net.obsearch.index.pivot.AbstractPivotOBIndex
intrinsicDimensionalityPairs, pivots, pivotSelector
 
Fields inherited from class net.obsearch.index.AbstractOBIndex
A, fact, isFrozen, stats, type
 
Fields inherited from interface net.obsearch.Index
ID_SIZE
 
Constructor Summary
DistPermInt(Class<O> type, net.obsearch.pivots.IncrementalPivotSelector<O> pivotSelector, int pivotCount, int bucketPivotCount)
           
 
Method Summary
 int[] fullMatchLite(O query, boolean filterSame)
          This method returns a list of all the distances of the query against the DB.
 BucketObjectInt<O> getBucket(O object)
           
protected  int getCPSize()
           
protected  net.obsearch.query.AbstractOBQuery<O> getKQuery(O object, int k)
           
protected  Class<net.obsearch.index.perm.CompactPerm> getPInstance()
           
protected  net.obsearch.index.perm.PermProjection getProjection(BucketObjectInt<O> b)
           
protected  SleekBucketInt<O> instantiateBucketContainer(byte[] data, byte[] address)
           
protected  void maxKEstimationAux(O object)
           
protected  int primitiveDataTypeSize()
           
 void searchOB(O object, int r, net.obsearch.filter.Filter<O> filter, OBPriorityQueueInt<O> result)
          Searches the Index and returns OBResult (ID, OB and distance) elements that are closer to "object".
 void searchOB(O object, int r, OBPriorityQueueInt<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.perm.AbstractDistPerm
bytesToCompactRepresentation, compactRepresentationToBytes, convertLongToBytesAddress, freeze, updateDistance
 
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.bucket.AbstractBucketIndex
debug, deleteAux, exists, getBuckets, getObjectFreeze, idMap, insertAux, insertAuxBulk, iterateBuckets
 
Methods inherited from class net.obsearch.index.pivot.AbstractPivotOBIndex
calculateIntrinsicDimensionality, createPivotsArray, getObjects, getPivotCount, selectPivots
 
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
 

Constructor Detail

DistPermInt

public DistPermInt(Class<O> type,
                   net.obsearch.pivots.IncrementalPivotSelector<O> pivotSelector,
                   int pivotCount,
                   int bucketPivotCount)
            throws net.obsearch.exception.OBStorageException,
                   net.obsearch.exception.OBException
Throws:
net.obsearch.exception.OBStorageException
net.obsearch.exception.OBException
Method Detail

getCPSize

protected int getCPSize()
Specified by:
getCPSize in class net.obsearch.index.sorter.AbstractBucketSorter<O extends OBInt,BucketObjectInt<O extends OBInt>,OBQueryInt<O extends OBInt>,SleekBucketInt<O extends OBInt>,net.obsearch.index.perm.PermProjection,net.obsearch.index.perm.CompactPerm>

getKQuery

protected net.obsearch.query.AbstractOBQuery<O> getKQuery(O object,
                                                          int k)
                                                                 throws net.obsearch.exception.OBException,
                                                                        InstantiationException,
                                                                        IllegalAccessException
Specified by:
getKQuery in class net.obsearch.index.sorter.AbstractBucketSorter<O extends OBInt,BucketObjectInt<O extends OBInt>,OBQueryInt<O extends OBInt>,SleekBucketInt<O extends OBInt>,net.obsearch.index.perm.PermProjection,net.obsearch.index.perm.CompactPerm>
Throws:
net.obsearch.exception.OBException
InstantiationException
IllegalAccessException

getPInstance

protected Class<net.obsearch.index.perm.CompactPerm> getPInstance()
Specified by:
getPInstance in class net.obsearch.index.sorter.AbstractBucketSorter<O extends OBInt,BucketObjectInt<O extends OBInt>,OBQueryInt<O extends OBInt>,SleekBucketInt<O extends OBInt>,net.obsearch.index.perm.PermProjection,net.obsearch.index.perm.CompactPerm>

getProjection

protected net.obsearch.index.perm.PermProjection getProjection(BucketObjectInt<O> b)
                                                        throws net.obsearch.exception.OBException
Specified by:
getProjection in class net.obsearch.index.sorter.AbstractBucketSorter<O extends OBInt,BucketObjectInt<O extends OBInt>,OBQueryInt<O extends OBInt>,SleekBucketInt<O extends OBInt>,net.obsearch.index.perm.PermProjection,net.obsearch.index.perm.CompactPerm>
Throws:
net.obsearch.exception.OBException

fullMatchLite

public int[] fullMatchLite(O query,
                           boolean filterSame)
                    throws net.obsearch.exception.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 Int.MAX_VALUE

Specified by:
fullMatchLite in interface IndexInt<O extends OBInt>
Parameters:
query -
filterSame - if True we do not return objects o such that query.equals(o)
Returns:
Throws:
net.obsearch.exception.OBException
InstantiationException
IllegalAccessException

maxKEstimationAux

protected void maxKEstimationAux(O object)
                          throws net.obsearch.exception.OBException,
                                 InstantiationException,
                                 IllegalAccessException
Specified by:
maxKEstimationAux in class net.obsearch.index.sorter.AbstractBucketSorter<O extends OBInt,BucketObjectInt<O extends OBInt>,OBQueryInt<O extends OBInt>,SleekBucketInt<O extends OBInt>,net.obsearch.index.perm.PermProjection,net.obsearch.index.perm.CompactPerm>
Throws:
net.obsearch.exception.OBException
InstantiationException
IllegalAccessException

getBucket

public BucketObjectInt<O> getBucket(O object)
                                           throws net.obsearch.exception.OBException,
                                                  InstantiationException,
                                                  IllegalAccessException
Specified by:
getBucket in class net.obsearch.index.bucket.AbstractBucketIndex<O extends OBInt,BucketObjectInt<O extends OBInt>,OBQueryInt<O extends OBInt>,SleekBucketInt<O extends OBInt>>
Throws:
net.obsearch.exception.OBException
InstantiationException
IllegalAccessException

instantiateBucketContainer

protected SleekBucketInt<O> instantiateBucketContainer(byte[] data,
                                                       byte[] address)
                                                              throws InstantiationException,
                                                                     IllegalAccessException,
                                                                     net.obsearch.exception.OBException
Specified by:
instantiateBucketContainer in class net.obsearch.index.bucket.AbstractBucketIndex<O extends OBInt,BucketObjectInt<O extends OBInt>,OBQueryInt<O extends OBInt>,SleekBucketInt<O extends OBInt>>
Throws:
InstantiationException
IllegalAccessException
net.obsearch.exception.OBException

primitiveDataTypeSize

protected int primitiveDataTypeSize()
Specified by:
primitiveDataTypeSize in class net.obsearch.index.bucket.AbstractBucketIndex<O extends OBInt,BucketObjectInt<O extends OBInt>,OBQueryInt<O extends OBInt>,SleekBucketInt<O extends OBInt>>

searchOB

public void searchOB(O object,
                     int r,
                     net.obsearch.filter.Filter<O> filter,
                     OBPriorityQueueInt<O> result)
              throws net.obsearch.exception.NotFrozenException,
                     InstantiationException,
                     net.obsearch.exception.IllegalIdException,
                     IllegalAccessException,
                     net.obsearch.exception.OutOfRangeException,
                     net.obsearch.exception.OBException
Description copied from interface: IndexInt
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 IndexInt<O extends OBInt>
Parameters:
object - The object that has to be searched
r - The range to be used
result - A priority queue that will hold the result
Throws:
net.obsearch.exception.NotFrozenException - if the index has not been frozen.
InstantiationException - If there is a problem when instantiating objects O
net.obsearch.exception.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
net.obsearch.exception.OutOfRangeException - If the distance of any object to any other object exceeds the range defined by the user.
net.obsearch.exception.OBException - User generated exception

searchOB

public void searchOB(O object,
                     int r,
                     OBPriorityQueueInt<O> result)
              throws net.obsearch.exception.NotFrozenException,
                     InstantiationException,
                     net.obsearch.exception.IllegalIdException,
                     IllegalAccessException,
                     net.obsearch.exception.OutOfRangeException,
                     net.obsearch.exception.OBException
Description copied from interface: IndexInt
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 IndexInt<O extends OBInt>
Parameters:
object - The object that has to be searched
r - The range to be used
result - A priority queue that will hold the result
Throws:
net.obsearch.exception.NotFrozenException - if the index has not been frozen.
InstantiationException - If there is a problem when instantiating objects O
net.obsearch.exception.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
net.obsearch.exception.OutOfRangeException - If the distance of any object to any other object exceeds the range defined by the user.
net.obsearch.exception.OBException - User generated exception


Copyright © 2007-2011 Arnoldo Jose Muller Molina. All Rights Reserved.