Package elki.data
Class ModifiableHyperBoundingBox
- java.lang.Object
-
- elki.data.HyperBoundingBox
-
- elki.data.ModifiableHyperBoundingBox
-
- All Implemented Interfaces:
SpatialComparable
,java.io.Externalizable
,java.io.Serializable
public class ModifiableHyperBoundingBox extends HyperBoundingBox
MBR class allowing modifications (as opposed toHyperBoundingBox
).- Since:
- 0.3
- Author:
- Marisa Thoma
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
Serial version.-
Fields inherited from class elki.data.HyperBoundingBox
max, min
-
-
Constructor Summary
Constructors Constructor Description ModifiableHyperBoundingBox()
Constructor.ModifiableHyperBoundingBox(double[] min, double[] max)
Creates a ModifiableHyperBoundingBox for the given hyper points.ModifiableHyperBoundingBox(int dim, double min, double max)
Create a ModifiableHyperBoundingBox with given min and max.ModifiableHyperBoundingBox(SpatialComparable hbb)
Derive a bounding box from a spatial object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
extend(SpatialComparable obj)
Extend the bounding box by some other spatial object.double[]
getMaxRef()
Returns the reference to the maximum hyper point.double[]
getMinRef()
Returns a reference to the minimum hyper point.void
set(SpatialComparable obj)
Set the bounding box to the same as some other spatial object.void
setMax(int dimension, double value)
Set the maximum bound in dimensiondimension
to valuevalue
.void
setMin(int dimension, double value)
Set the minimum bound in dimensiondimension
to valuevalue
.-
Methods inherited from class elki.data.HyperBoundingBox
equals, getDimensionality, getMax, getMin, hashCode, readExternal, toString, toString, writeExternal
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
Serial version.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ModifiableHyperBoundingBox
public ModifiableHyperBoundingBox()
Constructor.
-
ModifiableHyperBoundingBox
public ModifiableHyperBoundingBox(SpatialComparable hbb)
Derive a bounding box from a spatial object.- Parameters:
hbb
- existing hyperboundingbox
-
ModifiableHyperBoundingBox
public ModifiableHyperBoundingBox(double[] min, double[] max)
Creates a ModifiableHyperBoundingBox for the given hyper points.- Parameters:
min
- - the coordinates of the minimum hyper pointmax
- - the coordinates of the maximum hyper point
-
ModifiableHyperBoundingBox
public ModifiableHyperBoundingBox(int dim, double min, double max)
Create a ModifiableHyperBoundingBox with given min and max.- Parameters:
dim
- Dimensionalitymin
- Minimum in each dimensionmax
- Maximum in each dimension
-
-
Method Detail
-
setMax
public void setMax(int dimension, double value)
Set the maximum bound in dimensiondimension
to valuevalue
.- Parameters:
dimension
- the dimension for which the coordinate should be set, where 1 ≤ dimension ≤this.getDimensionality()
value
- the coordinate to set as upper bound for dimensiondimension
-
setMin
public void setMin(int dimension, double value)
Set the minimum bound in dimensiondimension
to valuevalue
.- Parameters:
dimension
- the dimension for which the lower bound should be set, where 1 ≤ dimension ≤this.getDimensionality()
value
- the coordinate to set as lower bound for dimensiondimension
-
getMinRef
public double[] getMinRef()
Returns a reference to the minimum hyper point.- Returns:
- the minimum hyper point
-
getMaxRef
public double[] getMaxRef()
Returns the reference to the maximum hyper point.- Returns:
- the maximum hyper point
-
set
public void set(SpatialComparable obj)
Set the bounding box to the same as some other spatial object.- Parameters:
obj
- Spatial object to set to.
-
extend
public boolean extend(SpatialComparable obj)
Extend the bounding box by some other spatial object.- Parameters:
obj
- Spatial object to extend with- Returns:
- true when the MBR changed.
-
-