Package elki.data.uncertain
Class AbstractUncertainObject
- java.lang.Object
-
- elki.data.uncertain.AbstractUncertainObject
-
- All Implemented Interfaces:
FeatureVector<java.lang.Double>
,SpatialComparable
,UncertainObject
- Direct Known Subclasses:
SimpleGaussianContinuousUncertainObject
,UniformContinuousUncertainObject
,UnweightedDiscreteUncertainObject
,WeightedDiscreteUncertainObject
public abstract class AbstractUncertainObject extends java.lang.Object implements UncertainObject
Abstract base implementation forUncertainObject
s, providing shared functionality such as bounding box access and random generation.- Since:
- 0.7.0
- Author:
- Alexander Koos, Erich Schubert
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface elki.data.FeatureVector
FeatureVector.Factory<V extends FeatureVector<? extends D>,D>
-
-
Field Summary
Fields Modifier and Type Field Description protected SpatialComparable
bounds
Bounding box of the object.static int
DEFAULT_TRY_LIMIT
Default retry limit for sampling, to guard against bad parameters.-
Fields inherited from interface elki.data.FeatureVector
TYPE
-
Fields inherited from interface elki.data.uncertain.UncertainObject
DISCRETE_UNCERTAIN_OBJECT, UNCERTAIN_OBJECT_FIELD
-
-
Constructor Summary
Constructors Constructor Description AbstractUncertainObject()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static HyperBoundingBox
computeBounds(NumberVector[] samples)
Compute the bounding box for some samples.abstract DoubleVector
drawSample(java.util.Random rand)
Draw a random sampled instance.abstract DoubleVector
getCenterOfMass()
Get the center of mass of the uncertain object.int
getDimensionality()
Returns the dimensionality of the object.double
getMax(int dimension)
Returns the maximum coordinate at the specified dimension.double
getMin(int dimension)
Returns the minimum coordinate at the specified dimension.java.lang.Double
getValue(int dimension)
Returns the value in the specified dimension.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface elki.data.FeatureVector
toString
-
-
-
-
Field Detail
-
DEFAULT_TRY_LIMIT
public static final int DEFAULT_TRY_LIMIT
Default retry limit for sampling, to guard against bad parameters.- See Also:
- Constant Field Values
-
bounds
protected SpatialComparable bounds
Bounding box of the object.
-
-
Method Detail
-
computeBounds
protected static HyperBoundingBox computeBounds(NumberVector[] samples)
Compute the bounding box for some samples.- Parameters:
samples
- Samples- Returns:
- Bounding box.
-
drawSample
public abstract DoubleVector drawSample(java.util.Random rand)
Description copied from interface:UncertainObject
Draw a random sampled instance.- Specified by:
drawSample
in interfaceUncertainObject
- Parameters:
rand
- Random generator- Returns:
- Sampled object.
-
getDimensionality
public int getDimensionality()
Description copied from interface:SpatialComparable
Returns the dimensionality of the object.- Specified by:
getDimensionality
in interfaceFeatureVector<java.lang.Double>
- Specified by:
getDimensionality
in interfaceSpatialComparable
- Returns:
- the dimensionality
-
getMin
public double getMin(int dimension)
Description copied from interface:SpatialComparable
Returns the minimum coordinate at the specified dimension.- Specified by:
getMin
in interfaceSpatialComparable
- Parameters:
dimension
- the dimension for which the coordinate should be returned, where 0 ≤ dimension <getDimensionality()
- Returns:
- the minimum coordinate at the specified dimension
-
getMax
public double getMax(int dimension)
Description copied from interface:SpatialComparable
Returns the maximum coordinate at the specified dimension.- Specified by:
getMax
in interfaceSpatialComparable
- Parameters:
dimension
- the dimension for which the coordinate should be returned, where 0 ≤ dimension <getDimensionality()
- Returns:
- the maximum coordinate at the specified dimension
-
getValue
public java.lang.Double getValue(int dimension)
Description copied from interface:FeatureVector
Returns the value in the specified dimension.- Specified by:
getValue
in interfaceFeatureVector<java.lang.Double>
- Parameters:
dimension
- the desired dimension, where 0 ≤ dimension ≤this.getDimensionality()-1
- Returns:
- the value in the specified dimension
-
getCenterOfMass
public abstract DoubleVector getCenterOfMass()
Description copied from interface:UncertainObject
Get the center of mass of the uncertain object.- Specified by:
getCenterOfMass
in interfaceUncertainObject
- Returns:
- Center of mass.
-
-