|
|
|||||||||||||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.lmu.ifi.dbs.elki.utilities.HyperBoundingBox
public class HyperBoundingBox
HyperBoundingBox represents a hyperrectangle in the multidimensional space.
Field Summary | |
---|---|
private double[] |
max
The coordinates of the 'upper right' (= maximum) hyper point. |
private double[] |
min
The coordinates of the 'lower left' (= minimum) hyper point. |
private static long |
serialVersionUID
|
Constructor Summary | |
---|---|
HyperBoundingBox()
Empty constructor for Externalizable interface. |
|
HyperBoundingBox(double[] min,
double[] max)
Creates a HyperBoundingBox for the given hyper points. |
Method Summary | |
---|---|
double[] |
centroid()
Returns the centroid of this HyperBoundingBox. |
double[] |
centroid(int start,
int end)
Returns the centroid of the specified values of this HyperBoundingBox. |
boolean |
contains(double[] point)
Returns true if this HyperBoundingBox contains the given point, false otherwise. |
boolean |
contains(HyperBoundingBox box)
Returns true if this HyperBoundingBox contains the given HyperBoundingBox, false otherwise. |
boolean |
equals(Object obj)
|
int |
getDimensionality()
Returns the dimensionality of this HyperBoundingBox. |
double[] |
getMax()
Returns a clone of the maximum hyper point. |
double |
getMax(int dimension)
Returns the coordinate at the specified dimension of the maximum hyper point |
double[] |
getMin()
Returns a clone of the minimum hyper point. |
double |
getMin(int dimension)
Returns the coordinate at the specified dimension of the minimum hyper point |
int |
hashCode()
|
boolean |
intersects(HyperBoundingBox box)
Returns true if this HyperBoundingBox and the given HyperBoundingBox intersect, false otherwise. |
double |
overlap(HyperBoundingBox box)
Computes the volume of the overlapping box between this HyperBoundingBox and the given HyperBoundingBox and return the relation between the volume of the overlapping box and the volume of both HyperBoundingBoxes. |
double |
perimeter()
Computes the perimeter of this HyperBoundingBox. |
void |
readExternal(ObjectInput in)
The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. |
String |
toString()
Returns a String representation of the HyperBoundingBox. |
String |
toString(String pre,
NumberFormat nf)
Returns a String representation of the HyperBoundingBox. |
HyperBoundingBox |
union(HyperBoundingBox box)
Computes the union HyperBoundingBox of this HyperBoundingBox and the given HyperBoundingBox. |
double |
volume()
Computes the volume of this HyperBoundingBox |
void |
writeExternal(ObjectOutput out)
The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private double[] min
private double[] max
Constructor Detail |
---|
public HyperBoundingBox()
public HyperBoundingBox(double[] min, double[] max)
min
- - the coordinates of the minimum hyper pointmax
- - the coordinates of the maximum hyper pointMethod Detail |
---|
public double[] getMin()
public double getMin(int dimension)
dimension
- the dimension for which the coordinate should be returned,
where 1 ≤ dimension ≤ this.getDimensionality()
public double[] getMax()
public double getMax(int dimension)
dimension
- the dimension for which the coordinate should be returned,
where 1 ≤ dimension ≤ this.getDimensionality()
public int getDimensionality()
public boolean intersects(HyperBoundingBox box)
box
- the HyperBoundingBox to be tested for intersection
public boolean contains(HyperBoundingBox box)
box
- the HyperBoundingBox to be tested for containment
public boolean contains(double[] point)
point
- the point to be tested for containment
public double volume()
public double perimeter()
public double overlap(HyperBoundingBox box)
box
- the HyperBoundingBox for which the intersection volume with this HyperBoundingBox should be computed
public HyperBoundingBox union(HyperBoundingBox box)
box
- the HyperBoundingBox to be united with this HyperBoundingBox
public double[] centroid()
public double[] centroid(int start, int end)
start
- the start dimension to be consideredend
- the end dimension to be considered
public String toString()
toString
in class Object
public String toString(String pre, NumberFormat nf)
nf
- number format for output accuracypre
- the prefix of each line
public boolean equals(Object obj)
equals
in class Object
Object.equals(Object)
public int hashCode()
hashCode
in class Object
Object.hashCode()
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
out
- the stream to write the object to
IOException
- Includes any I/O exceptions that may occurpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal
in interface Externalizable
in
- the stream to read data from in order to restore the object
IOException
- if I/O errors occur
ClassNotFoundException
- If the class for an object being
restored cannot be found.
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |