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 forUncertainObjects, 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 SpatialComparableboundsBounding box of the object.static intDEFAULT_TRY_LIMITDefault 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 HyperBoundingBoxcomputeBounds(NumberVector[] samples)Compute the bounding box for some samples.abstract DoubleVectordrawSample(java.util.Random rand)Draw a random sampled instance.abstract DoubleVectorgetCenterOfMass()Get the center of mass of the uncertain object.intgetDimensionality()Returns the dimensionality of the object.doublegetMax(int dimension)Returns the maximum coordinate at the specified dimension.doublegetMin(int dimension)Returns the minimum coordinate at the specified dimension.java.lang.DoublegetValue(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:UncertainObjectDraw a random sampled instance.- Specified by:
drawSamplein interfaceUncertainObject- Parameters:
rand- Random generator- Returns:
- Sampled object.
-
getDimensionality
public int getDimensionality()
Description copied from interface:SpatialComparableReturns the dimensionality of the object.- Specified by:
getDimensionalityin interfaceFeatureVector<java.lang.Double>- Specified by:
getDimensionalityin interfaceSpatialComparable- Returns:
- the dimensionality
-
getMin
public double getMin(int dimension)
Description copied from interface:SpatialComparableReturns the minimum coordinate at the specified dimension.- Specified by:
getMinin 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:SpatialComparableReturns the maximum coordinate at the specified dimension.- Specified by:
getMaxin 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:FeatureVectorReturns the value in the specified dimension.- Specified by:
getValuein 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:UncertainObjectGet the center of mass of the uncertain object.- Specified by:
getCenterOfMassin interfaceUncertainObject- Returns:
- Center of mass.
-
-