public class MedianDistanceFromArbitraryPoint extends BallSplitter implements TechnicalInformationHandler
@article{Uhlmann1991,
author = {Jeffrey K. Uhlmann},
journal = {Information Processing Letters},
month = {November},
number = {4},
pages = {175-179},
title = {Satisfying general proximity/similarity queries with metric trees},
volume = {40},
year = {1991}
}
@mastersthesis{Kibriya2007,
address = {Hamilton, New Zealand},
author = {Ashraf Masood Kibriya},
school = {Department of Computer Science, School of Computing and Mathematical Sciences, University of Waikato},
title = {Fast Algorithms for Nearest Neighbour Search},
year = {2007}
}
Valid options are:
-S <num> The seed value for the random number generator. (default: 17)
| Modifier and Type | Field and Description |
|---|---|
protected Random |
m_Rand
Random number generator for selecting
an abitrary (random) point.
|
protected int |
m_RandSeed
Seed for random number generator.
|
m_DistanceFunction, m_Instances, m_Instlist| Constructor and Description |
|---|
MedianDistanceFromArbitraryPoint()
Constructor.
|
MedianDistanceFromArbitraryPoint(int[] instList,
Instances insts,
EuclideanDistance e)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String[] |
getOptions()
Gets the current settings of the object.
|
int |
getRandomSeed()
Returns the seed value of random
number generator.
|
String |
getRevision()
Returns the revision string.
|
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing detailed
information about the technical background of this class, e.g., paper
reference or book this class is based on.
|
String |
globalInfo()
Returns a string describing this nearest neighbour search algorithm.
|
Enumeration |
listOptions()
Returns an enumeration describing the available options.
|
protected int |
partition(double[] array,
int[] index,
int l,
int r,
int indexStart)
Partitions the instances around a pivot.
|
String |
randomSeedTipText()
Returns the tip text for this property.
|
protected int |
select(double[] array,
int[] indices,
int left,
int right,
int indexStart,
int k)
Implements computation of the kth-smallest element according
to Manber's "Introduction to Algorithms".
|
void |
setOptions(String[] options)
Parses a given list of options.
|
void |
setRandomSeed(int seed)
Sets the seed for random number generator.
|
void |
splitNode(BallNode node,
int numNodesCreated)
Splits a ball into two.
|
correctlyInitialized, setEuclideanDistanceFunction, setInstanceList, setInstancesprotected int m_RandSeed
protected Random m_Rand
public MedianDistanceFromArbitraryPoint()
public MedianDistanceFromArbitraryPoint(int[] instList,
Instances insts,
EuclideanDistance e)
instList - The master index array.insts - The instances on which the tree
is (or is to be) built.e - The Euclidean distance function to
use for splitting.public String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation in interface TechnicalInformationHandlerpublic Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class BallSplitterpublic void setOptions(String[] options) throws Exception
-S <num> The seed value for the random number generator. (default: 17)
setOptions in interface OptionHandlersetOptions in class BallSplitteroptions - the list of options as an array of stringsException - if an option is not supportedpublic String[] getOptions()
getOptions in interface OptionHandlergetOptions in class BallSplitterpublic void setRandomSeed(int seed)
seed - The seed value to set.public int getRandomSeed()
public String randomSeedTipText()
public void splitNode(BallNode node, int numNodesCreated) throws Exception
splitNode in class BallSplitternode - The node to split.numNodesCreated - The number of nodes that so far have been
created for the tree, so that the newly created nodes are
assigned correct/meaningful node numbers/ids.Exception - If there is some problem in splitting the
given node.protected int partition(double[] array,
int[] index,
int l,
int r,
int indexStart)
array - The array of distances of the points to the
arbitrarily selected point.index - The master index array containing indices of the
instances.l - The relative begining index of the portion of master
index array that should be partitioned.r - The relative end index of the portion of master index
array that should be partitioned.indexStart - The absolute begining index of the portion
of master index array that should be partitioned.protected int select(double[] array,
int[] indices,
int left,
int right,
int indexStart,
int k)
array - Array containing the distances of points from
the arbitrarily selected.indices - The master index array containing indices of
the instances.left - The relative begining index of the portion of the
master index array in which to find the kth-smallest element.right - The relative end index of the portion of the
master index array in which to find the kth-smallest element.indexStart - The absolute begining index of the portion
of the master index array in which to find the kth-smallest
element.k - The value of kpublic String getRevision()
getRevision in interface RevisionHandlergetRevision in class BallSplitterCopyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.