Package elki.clustering.correlation.cash
Class CASHInterval
- java.lang.Object
-
- elki.data.HyperBoundingBox
-
- elki.clustering.correlation.cash.CASHInterval
-
- All Implemented Interfaces:
SpatialComparable,java.io.Externalizable,java.io.Serializable,java.lang.Comparable<CASHInterval>
public class CASHInterval extends HyperBoundingBox implements java.lang.Comparable<CASHInterval>
Provides a unique interval represented by its id, a hyper bounding box representing the alpha intervals, an interval of the corresponding distance, and a set of objects ids associated with this interval.- Since:
- 0.1
- Author:
- Elke Achtert
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private doubled_maxThe maximum distance value.private doubled_minThe minimum distance value.private static intIDUsed for id assignment.private ModifiableDBIDsidsHolds the ids of the objects associated with this interval.private intintervalIDHolds the unique id of this interval.private CASHIntervalleftChildHolds the left child.private intlevelThe level of this interval, 0 indicates the root level.private static LoggingLOGClass logger.private intmaxSplitDimensionHolds the maximum dimension which has already been split.private CASHIntervalrightChildHolds the right child.private static longserialVersionUIDSerial version number.private CASHIntervalSplitsplitThe object to perform interval splitting.
-
Constructor Summary
Constructors Constructor Description CASHInterval()Empty constructor for Externalizable interface.CASHInterval(double[] min, double[] max, CASHIntervalSplit split, ModifiableDBIDs ids, int maxSplitDimension, int level, double d_min, double d_max)Provides a unique interval represented by its id, a hyper bounding box and a set of objects ids associated with this interval.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(CASHInterval other)booleanequals(java.lang.Object o)doublegetD_max()Returns the maximum distance value.doublegetD_min()Returns the minimum distance value.ModifiableDBIDsgetIDs()Returns the set of ids of the objects associated with this interval.CASHIntervalgetLeftChild()Returns the left child of this interval.intgetLevel()Returns the level of this interval.intgetMaxSplitDimension()Returns the maximum split dimension.CASHIntervalgetRightChild()Returns the right child of this interval.booleanhasChildren()Returns true if this interval has children.inthashCode()intnumObjects()Returns the number of objects associated with this interval.intpriority()Returns the priority of this interval (used as key in the heap).voidremoveIDs(DBIDs ids2)Removes the specified ids from this interval.voidsplit()Splits this interval into 2 children.java.lang.StringtoString()Returns a String representation of the HyperBoundingBox.-
Methods inherited from class elki.data.HyperBoundingBox
getDimensionality, getMax, getMin, readExternal, toString, writeExternal
-
-
-
-
Field Detail
-
LOG
private static final Logging LOG
Class logger.
-
serialVersionUID
private static final long serialVersionUID
Serial version number.- See Also:
- Constant Field Values
-
ID
private static int ID
Used for id assignment.
-
intervalID
private final int intervalID
Holds the unique id of this interval.
-
level
private int level
The level of this interval, 0 indicates the root level.
-
d_min
private double d_min
The minimum distance value.
-
d_max
private double d_max
The maximum distance value.
-
ids
private ModifiableDBIDs ids
Holds the ids of the objects associated with this interval.
-
maxSplitDimension
private int maxSplitDimension
Holds the maximum dimension which has already been split.
-
leftChild
private CASHInterval leftChild
Holds the left child.
-
rightChild
private CASHInterval rightChild
Holds the right child.
-
split
private CASHIntervalSplit split
The object to perform interval splitting.
-
-
Constructor Detail
-
CASHInterval
public CASHInterval()
Empty constructor for Externalizable interface.
-
CASHInterval
public CASHInterval(double[] min, double[] max, CASHIntervalSplit split, ModifiableDBIDs ids, int maxSplitDimension, int level, double d_min, double d_max)Provides a unique interval represented by its id, a hyper bounding box and a set of objects ids associated with this interval.- Parameters:
min- the coordinates of the minimum hyper pointmax- the coordinates of the maximum hyper pointsplit- the object to perform interval splittingids- the ids of the objects associated with this intervalmaxSplitDimension- the maximum dimension which has already been splitlevel- the level of this interval, 0 indicates the root leveld_min- the minimum distance valued_max- the maximum distance value
-
-
Method Detail
-
getIDs
public ModifiableDBIDs getIDs()
Returns the set of ids of the objects associated with this interval.- Returns:
- the set of ids of the objects associated with this interval
-
removeIDs
public void removeIDs(DBIDs ids2)
Removes the specified ids from this interval.- Parameters:
ids2- the set of ids to be removed
-
numObjects
public int numObjects()
Returns the number of objects associated with this interval.- Returns:
- the number of objects associated with this interval
-
toString
public java.lang.String toString()
Description copied from class:HyperBoundingBoxReturns a String representation of the HyperBoundingBox.- Overrides:
toStringin classHyperBoundingBox- Returns:
- a string representation of this hyper bounding box
-
priority
public int priority()
Returns the priority of this interval (used as key in the heap).- Returns:
- the priority of this interval (used as key in the heap)
-
getMaxSplitDimension
public int getMaxSplitDimension()
Returns the maximum split dimension.- Returns:
- the maximum split dimension
-
getLevel
public int getLevel()
Returns the level of this interval.- Returns:
- the level of this interval
-
getLeftChild
public CASHInterval getLeftChild()
Returns the left child of this interval.- Returns:
- the left child of this interval
-
getRightChild
public CASHInterval getRightChild()
Returns the right child of this interval.- Returns:
- the right child of this interval
-
getD_min
public double getD_min()
Returns the minimum distance value.- Returns:
- the minimum distance value
-
getD_max
public double getD_max()
Returns the maximum distance value.- Returns:
- the maximum distance value
-
compareTo
public int compareTo(CASHInterval other)
- Specified by:
compareToin interfacejava.lang.Comparable<CASHInterval>
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classHyperBoundingBox
-
hashCode
public int hashCode()
- Overrides:
hashCodein classHyperBoundingBox
-
hasChildren
public boolean hasChildren()
Returns true if this interval has children.- Returns:
- if this interval has children
-
split
public void split()
Splits this interval into 2 children.
-
-