|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ajmm.obsearch.index.AbstractPivotIndex<O>
org.ajmm.obsearch.index.AbstractExtendedPyramidIndex<O>
O - The type of object to be stored in the Index.public abstract class AbstractExtendedPyramidIndex<O extends OB>
This Index uses the extended pyramid technique and SMAP to store arbitrary objects.
| Field Summary | |
|---|---|
protected com.sleepycat.je.Database |
cDB
The database where the pyramid values are stored. |
protected static int |
HHIGH
Used to access the second item of a two item array. |
protected static int |
HLOW
Used to access the first item of a two item array. |
protected static int |
MAX
Used to access the second item of a two item array. |
protected static int |
MIN
Used to access the first item of a two item array. |
protected float[] |
mp
Median points of the extended pyramid technique. |
| Fields inherited from class org.ajmm.obsearch.index.AbstractPivotIndex |
|---|
aDB, bDB, cache, CACHE_SIZE, databaseEnvironment, databaseEnvironmentCreation, id, ID_SIZE_BYTES, kDB, pivots, pivotsBytes, pivotsCount, pivotSelector, type |
| Fields inherited from interface org.ajmm.obsearch.Index |
|---|
SPORE_FILENAME |
| Constructor Summary | |
|---|---|
AbstractExtendedPyramidIndex(java.io.File databaseDirectory,
short pivots,
PivotSelector<O> pivotSelector,
java.lang.Class<O> type)
Constructs an extended pyramid index. |
|
| Method Summary | |
|---|---|
protected void |
calculateIndexParameters()
Calculates the pyramid's median values. |
protected void |
centerQuery(float[][] q)
Queries are aligned to the center of the space. |
protected void |
closeC()
Closes database C. |
protected void |
copyQuery(float[][] src,
float[][] dest)
Copies the contents of query src into dest. |
protected cern.colt.list.FloatArrayList[] |
createFloatHolders(int size)
|
protected hep.aida.bin.QuantileBin1D[] |
createMedianHolders(long size)
Creates pivotsCount QuantileBin1D objects that will be used to calculate the medians of the data. |
protected float |
extendedPyramidNormalization(float norm,
int i)
Normalizes a value in the given dimension. |
protected abstract float[] |
extractTuple(com.sleepycat.bind.tuple.TupleInput in)
Extracts the tuple values from in and returns a normalized vector with values ranging from 1 to 0. |
protected float[] |
generateMinArray(float[][] query)
Receives a query and returns a new array generated of calculating min() to each of the elements |
protected float |
heightOfPoint(float[] tuple,
int pyramidNumber)
For the given point and the pyramid number we return the height of that point. |
protected void |
initC()
This method will be called by the super class. |
protected boolean |
intersect(float[][] q,
int p,
float[] minArray,
float[] lowHighResult)
Returns true if the given query (min[] and max[]) intersects pyramid p. |
int |
pyramidOfPoint(float[] tuple)
Calculates the pyramid # for the given point. |
protected int |
pyramidOfPointAux(float[] tuple)
For the given tuple, returns the pyramid # for the tuple. |
float |
pyramidValue(float[] tuple)
Returns the pyramid value for the given tuple. |
int |
totalBoxes()
Returns the total number of boxes this index can hold. |
protected void |
updateFloatHolder(float[] tuple,
cern.colt.list.FloatArrayList[] medianHolder)
|
protected void |
updateMedianHolder(float[] tuple,
hep.aida.bin.QuantileBin1D[] medianHolder)
Updates each median holder with the given float tuple. |
| Methods inherited from class org.ajmm.obsearch.index.AbstractPivotIndex |
|---|
assertFrozen, close, createDefaultDatabaseConfig, createPivotsArray, databaseSize, delete, deleteAux, distance, emptyPivotsArray, freeze, getMaxId, getObject, getPivots, getPivotsCount, initCache, initializeAfterSerialization, insert, insertA, insertFromBtoC, insertFrozen, insertInB, insertInDatabase, insertObjectInDatabase, insertUnFrozen, instantiateObject, isFrozen, loadPivots, prepareFreeze, readObject, relocateInitialize, returnSelf, stats, storePivots, toXML, writeSporeFile |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.ajmm.obsearch.Index |
|---|
exists, getBox |
| Field Detail |
|---|
protected static final int MIN
protected static final int MAX
protected static final int HLOW
protected static final int HHIGH
protected float[] mp
protected transient com.sleepycat.je.Database cDB
| Constructor Detail |
|---|
public AbstractExtendedPyramidIndex(java.io.File databaseDirectory,
short pivots,
PivotSelector<O> pivotSelector,
java.lang.Class<O> type)
throws com.sleepycat.je.DatabaseException,
java.io.IOException
databaseDirectory - the database directorypivots - how many pivots will be usedpivotSelector - The pivot selector that will be used by this index.type - The class of the object O that will be used.
com.sleepycat.je.DatabaseException - If a database error occurs.
java.io.IOException - If a serialization issue occurs.| Method Detail |
|---|
protected final void initC()
throws com.sleepycat.je.DatabaseException
initC in class AbstractPivotIndex<O extends OB>com.sleepycat.je.DatabaseException - If a database error occurs.
protected void calculateIndexParameters()
throws com.sleepycat.je.DatabaseException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
OutOfRangeException,
OBException
calculateIndexParameters in class AbstractPivotIndex<O extends OB>com.sleepycat.je.DatabaseException - If a database error occurs.
java.lang.IllegalAccessException - If there is a problem when instantiating objects O
java.lang.InstantiationException - 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
protected abstract float[] extractTuple(com.sleepycat.bind.tuple.TupleInput in)
throws OutOfRangeException
in - Extracts a tuple from the given byte stream.
OutOfRangeException - If the distance of any object to any other object exceeds the
range defined by the user.
protected final void updateMedianHolder(float[] tuple,
hep.aida.bin.QuantileBin1D[] medianHolder)
tuple - TupleInput of floatsmedianHolder - an array of QuantileBin1D objects used to find an approximate
median.
protected final void updateFloatHolder(float[] tuple,
cern.colt.list.FloatArrayList[] medianHolder)
protected final hep.aida.bin.QuantileBin1D[] createMedianHolders(long size)
size - the size of the data to be processed
protected final cern.colt.list.FloatArrayList[] createFloatHolders(int size)
protected final float extendedPyramidNormalization(float norm,
int i)
norm - Normalizes the value in the given dimensioni - Dimension to use.
protected final float heightOfPoint(float[] tuple,
int pyramidNumber)
tuple - tuple to be processedpyramidNumber - which pyramid number will be processed.
public final float pyramidValue(float[] tuple)
Normalized - tuple (first pass)
public final int pyramidOfPoint(float[] tuple)
tuple - Normalized tuple (first pass)
protected final int pyramidOfPointAux(float[] tuple)
tuple - Normalized tuple (first pass)
protected final boolean intersect(float[][] q,
int p,
float[] minArray,
float[] lowHighResult)
q - A query rectangle.p - The pyramid numberlowHighResult - Where the lowHighResult will be stored.
protected final float[] generateMinArray(float[][] query)
query -
public int totalBoxes()
Index
protected final void centerQuery(float[][] q)
q - query.
protected final void closeC()
throws com.sleepycat.je.DatabaseException
closeC in class AbstractPivotIndex<O extends OB>com.sleepycat.je.DatabaseException - If something goes wrong with the DB
protected final void copyQuery(float[][] src,
float[][] dest)
src - sourcedest - destination
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||