|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmessif.algorithms.Algorithm
mtree.MTree
public class MTree
Nested Class Summary |
---|
Nested classes/interfaces inherited from class messif.algorithms.Algorithm |
---|
messif.algorithms.Algorithm.AlgorithmConstructor |
Nested classes/interfaces inherited from interface messif.buckets.split.SplittableAlgorithm |
---|
messif.buckets.split.SplittableAlgorithm.SplittableAlgorithmResult |
Field Summary | |
---|---|
protected messif.buckets.BucketDispatcher |
bucketDispatcher
dispatcher of all leaf buckets |
protected java.util.Map<java.lang.Object,SearchQueue<java.io.Serializable>> |
incManager
map keeps IDs of operations for the incremental nearest neighbor search algorithm |
protected float |
insRadius
radius for multiway insertion of a new object |
protected long |
intNodeCap
maximum internal node capacity |
protected long |
intNodeCapInBucketAlgorithm
maximum internal node capacity of the tree stored in every bucket (when using of an algorithm in the buckets) |
protected boolean |
isAlgorithmInBucket
indicates the using of M-tree algorithm in the buckets |
protected long |
leafCap
maximum leaf capacity |
protected long |
leafCapInBucketAlgorithm
maximum leaf capacity of the tree stored in every bucket (when using of an algorithm in the buckets) |
protected int |
maxSpanningTree
maximum number of objects which are selected by splitNode_SlimDown method to build a minimum spanning tree |
protected boolean |
multiwayInsertion
indicates whether a new object is inserted by multiway algorithm |
protected int |
nhr
|
protected int |
npd
|
protected messif.objects.LocalAbstractObject[] |
pivots
fixed array of pivots |
protected Node |
root
root of the tree |
Fields inherited from class messif.algorithms.Algorithm |
---|
log, maximalConcurrentOperations |
Constructor Summary | |
---|---|
MTree(long intNodeCap,
long leafCap)
Creates M-tree algorithm. |
|
MTree(long intNodeCap,
long leafCap,
float insRadius,
int maxSpanningTree,
boolean isAlgorithmInBucket,
long intNodeCapInBucketAlgorithm,
long leafCapInBucketAlgorithm)
Creates M-tree algorithm. |
|
MTree(long intNodeCap,
long leafCap,
int pivotCount,
messif.objects.util.AbstractObjectIterator<messif.objects.LocalAbstractObject> pivotIterator,
int npd,
int nhr)
Creates M-tree algorithm. |
|
MTree(long intNodeCap,
long leafCap,
int pivotCount,
messif.objects.util.AbstractObjectIterator<messif.objects.LocalAbstractObject> pivotIterator,
int npd,
int nhr,
float insRadius,
int maxSpanningTree,
boolean isAlgorithmInBucket,
long intNodeCapInBucketAlgorithm,
long leafCapInBucketAlgorithm)
Creates M-tree algorithm. |
|
MTree(long intNodeCap,
long leafCap,
int pivotCount,
messif.objects.util.AbstractObjectIterator<messif.objects.LocalAbstractObject> pivotIterator,
int npd,
int nhr,
float insRadius,
int maxSpanningTree,
boolean isAlgorithmInBucket,
long intNodeCapInBucketAlgorithm,
long leafCapInBucketAlgorithm,
java.lang.Class<? extends messif.buckets.LocalBucket> bucketClass,
java.util.Map<java.lang.String,java.lang.Object> bucketClassParams)
|
|
MTree(long intNodeCap,
long leafCap,
messif.objects.LocalAbstractObject[] pivots,
int npd,
int nhr,
float insRadius,
int maxSpanningTree,
boolean isAlgorithmInBucket,
long intNodeCapInBucketAlgorithm,
long leafCapInBucketAlgorithm)
|
|
MTree(long intNodeCap,
long leafCap,
messif.objects.LocalAbstractObject[] pivots,
int npd,
int nhr,
float insRadius,
int maxSpanningTree,
boolean isAlgorithmInBucket,
long intNodeCapInBucketAlgorithm,
long leafCapInBucketAlgorithm,
java.lang.Class<? extends messif.buckets.LocalBucket> bucketClass,
java.util.Map<java.lang.String,java.lang.Object> bucketClassParams)
Creates M-tree algorithm. |
Method Summary | |
---|---|
messif.buckets.BucketErrorCode |
addObject(messif.objects.LocalAbstractObject object)
Inserts a new object into the tree. |
boolean |
approxKNN(messif.operations.query.ApproxKNNQueryOperation kNNOper)
Approximates the evaluation of k nearest neighbors query. |
MTree |
clone()
Clones the tree (along with all stored objects) exloiting the process of serialization. |
MTree |
cloneWithoutObjects()
Creates new empty M-tree with same a structure (parameters) as current this, but without stored objects. |
void |
clonningSplit(messif.buckets.split.SplitPolicy sp,
boolean include)
Removes all irrelevant objects from this tree according to the given splitNode_SlimDown policy. |
boolean |
deleteObject(messif.operations.data.DeleteOperation delOper)
Deletes the specific object from the tree. |
void |
deletingSplit(messif.buckets.split.SplitPolicy sp,
messif.buckets.split.SplittableAlgorithm.SplittableAlgorithmResult result)
Splits this tree into two trees according to the given splitNode_SlimDown policy. |
void |
finalize()
|
java.util.Collection<messif.buckets.LocalBucket> |
getAllBuckets()
Returns a list of all buckets of the tree. |
java.util.List<LeafNode> |
getAllLeaves()
Returns a list of all leaves of the tree. |
messif.objects.util.AbstractObjectIterator<messif.objects.LocalAbstractObject> |
getAllObjects()
Looks for all objects stored in the tree. |
void |
getAllObjectsQueryOperation(messif.operations.query.GetAllObjectsQueryOperation qo)
Looks for all objects stored in the tree. |
messif.buckets.BucketDispatcher |
getBucketDispatcher()
Returns the bucket dispatcher of the tree. |
void |
getObjectByLocatorOperation(messif.operations.query.GetObjectByLocatorOperation qo)
Random-access query for SAPIR API. |
java.lang.Class<? extends messif.objects.LocalAbstractObject> |
getObjectClass()
Returns the class of objects indexed by this algorithm. |
int |
getObjectCount()
Returns the number of objects stored in the tree. |
void |
getObjectsByLocatorsOperation(messif.operations.query.GetObjectsByLocatorsOperation qo)
Random-access query for SAPIR API. |
messif.objects.LocalAbstractObject[] |
getPivots()
Returns the copy of fixed array of pivots. |
Node |
getRoot()
Returns the root of the tree. |
boolean |
incrementalNN(messif.operations.query.IncrementalNNQueryOperation incOper)
Incremental nearest neighbor search. |
boolean |
insert(messif.operations.data.InsertOperation insOper)
Inserts a new object into the tree. |
boolean |
kNN(messif.operations.query.KNNQueryOperation kNNOper)
k-NN search operation Performs the k-nearest neighbor search operation with given KNNQueryOperation object. |
static MTree |
loadFromFile(java.lang.String fileName)
Loads the M-tree from a file specified by filename. |
protected void |
print(Node n)
Recursive method for printTree. |
void |
printStatistics()
Prints the statistics of the tree (the number of internal nodes, the number of leaves, the number of all objects and the number of slim nodes - nodes with only one stored object). |
void |
printTree()
Prints a structure of the whole tree (all nodes with their objects). |
protected void |
processNode(InternalNode node,
SearchQueue queue,
java.util.Map<messif.objects.LocalAbstractObject,java.lang.Float> pd,
messif.objects.LocalAbstractObject queryObject,
float radius)
Process an internal node from M-Tree queue. |
protected void |
processNode(LeafNode node,
java.util.Map<messif.objects.LocalAbstractObject,java.lang.Float> pd,
messif.operations.query.KNNQueryOperation kNNOper)
Process a leaf node from M-Tree queue. |
protected void |
processNode(LeafNode node,
SearchQueue<java.io.Serializable> queue,
messif.objects.LocalAbstractObject queryObject)
Process a leaf node from M-Tree queue. |
void |
saveToFile(java.lang.String fileName)
Saves the tree into a file specified by filename. |
void |
setMultiwayInsertion(boolean multiwayInsertion)
Sets the type of inserting algorithm (singleway or multiway insertion). |
void |
split(messif.buckets.split.SplitPolicy sp,
messif.buckets.split.SplittableAlgorithm.SplittableAlgorithmResult result,
int whoStays)
Splits this tree into two trees according to the given splitNode_SlimDown policy. |
java.lang.String |
toString()
Overrided class Object |
Methods inherited from class messif.algorithms.Algorithm |
---|
backgroundExecute, backgroundExecuteOperation, backgroundExecuteOperation, destroy, execute, executeOperation, getAnnotatedConstructors, getAnnotatedConstructorsArray, getConstructorArgumentDescriptions, getConstructorDescription, getConstructorDescriptionSimple, getExecutorParamClasses, getFirstSupportedOperation, getName, getOperationStatistics, getQueryAnswer, getQueryAnswer, getRunningOperationsCount, getSupportedOperations, getSupportedOperations, resetOperationStatistics, restoreFromFile, restoreFromFile, statisticsAfterOperation, statisticsBeforeOperation, storeToFile, waitBackgroundExecuteOperation, waitBackgroundExecuteOperation |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final long intNodeCap
protected final long leafCap
protected final messif.objects.LocalAbstractObject[] pivots
protected final int npd
protected final int nhr
protected Node root
protected messif.buckets.BucketDispatcher bucketDispatcher
protected boolean multiwayInsertion
protected float insRadius
protected int maxSpanningTree
protected final boolean isAlgorithmInBucket
protected final long intNodeCapInBucketAlgorithm
protected final long leafCapInBucketAlgorithm
protected java.util.Map<java.lang.Object,SearchQueue<java.io.Serializable>> incManager
Constructor Detail |
---|
public MTree(long intNodeCap, long leafCap) throws messif.algorithms.AlgorithmMethodException, java.lang.InstantiationException
intNodeCap
- internal node capacityleafCap
- leaf capacity
messif.algorithms.AlgorithmMethodException
java.lang.InstantiationException
public MTree(long intNodeCap, long leafCap, float insRadius, int maxSpanningTree, boolean isAlgorithmInBucket, long intNodeCapInBucketAlgorithm, long leafCapInBucketAlgorithm) throws messif.algorithms.AlgorithmMethodException, java.lang.InstantiationException
intNodeCap
- internal node capacityleafCap
- leaf capacityinsRadius
- multi-way insertion radiusmaxSpanningTree
- maximum number of objects creating spanning treeisAlgorithmInBucket
- using of M-tree algorithm in the bucketsintNodeCapInBucketAlgorithm
- maximum internal node capacity of the tree stored in every bucketleafCapInBucketAlgorithm
- maximum leaf capacity of the tree stored in every bucket
messif.algorithms.AlgorithmMethodException
java.lang.InstantiationException
public MTree(long intNodeCap, long leafCap, int pivotCount, messif.objects.util.AbstractObjectIterator<messif.objects.LocalAbstractObject> pivotIterator, int npd, int nhr) throws messif.algorithms.AlgorithmMethodException, java.lang.InstantiationException
intNodeCap
- internal node capacityleafCap
- leaf capacitypivotCount
- number of pivots to readpivotIterator
- object iterator for pivotsnpd
- number of pivots used in leavesnhr
- number of pivots used in internal nodes
messif.algorithms.AlgorithmMethodException
java.lang.InstantiationException
public MTree(long intNodeCap, long leafCap, int pivotCount, messif.objects.util.AbstractObjectIterator<messif.objects.LocalAbstractObject> pivotIterator, int npd, int nhr, float insRadius, int maxSpanningTree, boolean isAlgorithmInBucket, long intNodeCapInBucketAlgorithm, long leafCapInBucketAlgorithm) throws java.lang.InstantiationException, messif.algorithms.AlgorithmMethodException
intNodeCap
- internal node capacityleafCap
- leaf capacitypivotCount
- number of pivots to readpivotIterator
- object iterator for pivotsnpd
- number of pivots used in leavesnhr
- number of pivots used in internal nodesinsRadius
- multi-way insertion radiusmaxSpanningTree
- maximum number of objects creating spanning treeisAlgorithmInBucket
- using of M-tree algorithm in the bucketsintNodeCapInBucketAlgorithm
- maximum internal node capacity of the tree stored in every bucketleafCapInBucketAlgorithm
- maximum leaf capacity of the tree stored in every bucket
java.lang.InstantiationException
messif.algorithms.AlgorithmMethodException
public MTree(long intNodeCap, long leafCap, messif.objects.LocalAbstractObject[] pivots, int npd, int nhr, float insRadius, int maxSpanningTree, boolean isAlgorithmInBucket, long intNodeCapInBucketAlgorithm, long leafCapInBucketAlgorithm) throws messif.algorithms.AlgorithmMethodException, java.lang.InstantiationException
messif.algorithms.AlgorithmMethodException
java.lang.InstantiationException
public MTree(long intNodeCap, long leafCap, int pivotCount, messif.objects.util.AbstractObjectIterator<messif.objects.LocalAbstractObject> pivotIterator, int npd, int nhr, float insRadius, int maxSpanningTree, boolean isAlgorithmInBucket, long intNodeCapInBucketAlgorithm, long leafCapInBucketAlgorithm, java.lang.Class<? extends messif.buckets.LocalBucket> bucketClass, java.util.Map<java.lang.String,java.lang.Object> bucketClassParams) throws java.lang.InstantiationException, messif.algorithms.AlgorithmMethodException
java.lang.InstantiationException
messif.algorithms.AlgorithmMethodException
public MTree(long intNodeCap, long leafCap, messif.objects.LocalAbstractObject[] pivots, int npd, int nhr, float insRadius, int maxSpanningTree, boolean isAlgorithmInBucket, long intNodeCapInBucketAlgorithm, long leafCapInBucketAlgorithm, java.lang.Class<? extends messif.buckets.LocalBucket> bucketClass, java.util.Map<java.lang.String,java.lang.Object> bucketClassParams) throws messif.algorithms.AlgorithmMethodException, java.lang.InstantiationException
intNodeCap
- internal node capacityleafCap
- leaf capacitypivots
- array of pivotsnpd
- number of pivots used in leavesnhr
- number of pivots used in internal nodesinsRadius
- multi-way insertion radiusmaxSpanningTree
- maximum number of objects creating spanning treeisAlgorithmInBucket
- using of M-tree algorithm in the bucketsintNodeCapInBucketAlgorithm
- maximum internal node capacity of the tree stored in every bucketleafCapInBucketAlgorithm
- maximum leaf capacity of the tree stored in every bucket
messif.algorithms.AlgorithmMethodException
java.lang.InstantiationException
Method Detail |
---|
public Node getRoot()
public messif.objects.LocalAbstractObject[] getPivots()
public messif.buckets.BucketDispatcher getBucketDispatcher()
public void setMultiwayInsertion(boolean multiwayInsertion)
multiwayInsertion
- indicates whether new objects will be inserted
by multiway algorithmpublic java.util.List<LeafNode> getAllLeaves()
public java.util.Collection<messif.buckets.LocalBucket> getAllBuckets()
public MTree cloneWithoutObjects()
public java.lang.Class<? extends messif.objects.LocalAbstractObject> getObjectClass()
getObjectClass
in class messif.algorithms.Algorithm
public void clonningSplit(messif.buckets.split.SplitPolicy sp, boolean include) throws messif.buckets.BucketStorageException
messif.buckets.BucketStorageException
public void deletingSplit(messif.buckets.split.SplitPolicy sp, messif.buckets.split.SplittableAlgorithm.SplittableAlgorithmResult result) throws messif.buckets.BucketStorageException, java.lang.InstantiationException
messif.buckets.BucketStorageException
java.lang.InstantiationException
public void getAllObjectsQueryOperation(messif.operations.query.GetAllObjectsQueryOperation qo)
public void getObjectsByLocatorsOperation(messif.operations.query.GetObjectsByLocatorsOperation qo)
public void getObjectByLocatorOperation(messif.operations.query.GetObjectByLocatorOperation qo)
public boolean deleteObject(messif.operations.data.DeleteOperation delOper)
public boolean kNN(messif.operations.query.KNNQueryOperation kNNOper)
kNNOper
- kNN query operation which carries the query object and k as well as the response list.
true
protected void processNode(LeafNode node, java.util.Map<messif.objects.LocalAbstractObject,java.lang.Float> pd, messif.operations.query.KNNQueryOperation kNNOper)
node
- the leaf node to be processedpd
- precomputed distances to specific objectskNNOper
- the kNN operation processed on the leafprotected void processNode(LeafNode node, SearchQueue<java.io.Serializable> queue, messif.objects.LocalAbstractObject queryObject)
node
- the leaf node to be processedqueue
- the queue to add the objects toqueryObject
- the query object used for computing distancesprotected void processNode(InternalNode node, SearchQueue queue, java.util.Map<messif.objects.LocalAbstractObject,java.lang.Float> pd, messif.objects.LocalAbstractObject queryObject, float radius)
node
- the internal node to be processedqueue
- the queue into which to add nodespd
- precomputed distances to specific objectsqueryObject
- the query object used for filteringradius
- the radius used for filteringpublic boolean incrementalNN(messif.operations.query.IncrementalNNQueryOperation incOper)
the minimum number of nearest neighbors
specified in the operation.
incOper
- Incremental nearest neighbor query operation which carries the query object
true
public boolean approxKNN(messif.operations.query.ApproxKNNQueryOperation kNNOper)
kNNOper
- the operation which specifies the query object and the number of neighbors to retrieve
true
public boolean insert(messif.operations.data.InsertOperation insOper)
public void split(messif.buckets.split.SplitPolicy sp, messif.buckets.split.SplittableAlgorithm.SplittableAlgorithmResult result, int whoStays) throws messif.buckets.BucketStorageException
split
in interface messif.buckets.split.SplittableAlgorithm
whoStays
- identification of a partition whose objects stay in this bucket.
messif.buckets.BucketStorageException
public messif.buckets.BucketErrorCode addObject(messif.objects.LocalAbstractObject object)
public int getObjectCount()
public messif.objects.util.AbstractObjectIterator<messif.objects.LocalAbstractObject> getAllObjects()
public MTree clone()
clone
in class java.lang.Object
public void saveToFile(java.lang.String fileName)
fileName
- the file name into which the tree is savedpublic static MTree loadFromFile(java.lang.String fileName)
fileName
- the file name from which the tree is loaded
public void printStatistics()
public void printTree()
protected void print(Node n)
public java.lang.String toString()
toString
in class java.lang.Object
public void finalize() throws java.lang.Throwable
finalize
in class messif.algorithms.Algorithm
java.lang.Throwable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |