|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.Hypercube
public class Hypercube
A class to specify an n-dimensional hypercube, by specifying its
lower bound and upper bound.
| Constructor Summary | |
|---|---|
Hypercube()
Default constructor. |
|
Hypercube(double[] lowerBound,
double[] upperBound)
Constructs a Hypercube with the given lower bound and upper bound. |
|
Hypercube(cern.colt.matrix.DoubleMatrix1D lowerBoundVec,
cern.colt.matrix.DoubleMatrix1D upperBoundVec)
Constructs a Hypercube with the given lower bound and upper bound. |
|
Hypercube(int inputDimension)
Constructs a Hypercube in the given number of dimensions. |
|
| Method Summary | |
|---|---|
void |
assign(Hypercube other)
Assign the properties of another Hypercube to this one. |
void |
centerOn(double[] x)
Centers this Hypercube on the given point. |
void |
centerOn(cern.colt.matrix.DoubleMatrix1D x)
Centers this Hypercube on the given point. |
boolean |
contains(double[] point)
Checks if the given point is inside this Hypercube. |
boolean |
contains(cern.colt.matrix.DoubleMatrix1D point)
Checks if the given point is inside this Hypercube. |
boolean |
equals(java.lang.Object obj)
|
int |
getInputDimension()
Returns the number of dimensions. |
static Hypercube |
getInstance(int inputDimension)
Returns an infinite Hypercube instance in the specified number of
dimensions. |
double[] |
getLowerBound()
Returns the lower bound. |
cern.colt.matrix.DoubleMatrix1D |
getLowerBoundVec()
Returns the lower bound of this Hypercube. |
double[] |
getUpperBound()
Returns the upper bound. |
cern.colt.matrix.DoubleMatrix1D |
getUpperBoundVec()
Returns the upper bound of this Hypercube. |
void |
init()
Initialization routine. |
void |
maskWith(Hypercube other)
Uses the given Hypercube as a mask for this one: only points inside both will count. |
void |
scaleBy(double factor)
Scales this Hypercube by the given factor. |
void |
scaleBy(double[] factors)
Scales this Hypercube by the factors in the given array, each
factor corresponding to one dimension. |
void |
scaleBy(cern.colt.matrix.DoubleMatrix1D factorVec)
Scales this Hypercube by the given vector of factors, each factor
corresponding to one dimension. |
void |
setInputDimension(int inputDimension)
Sets the number of dimensions. |
void |
setLowerBound(double[] lowerBound)
Sets the lower bound of this Hypercube. |
void |
setLowerBoundVec(cern.colt.matrix.DoubleMatrix1D lowerBoundVec)
Sets the lower bound of this Hypercube. |
void |
setUpperBound(double[] upperBound)
Sets the upper bound of this Hypercube. |
void |
setUpperBoundvec(cern.colt.matrix.DoubleMatrix1D upperBoundVec)
Sets the upper bound of this Hypercube. |
java.lang.String |
toString()
|
void |
translateBy(double[] amounts)
Translates this Hypercube by the given amounts. |
void |
translateBy(cern.colt.matrix.DoubleMatrix1D amountVec)
Translates this Hypercube by the given amounts. |
double |
volume()
Returns the volume of this Hypercube. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Hypercube()
public Hypercube(double[] lowerBound,
double[] upperBound)
Hypercube with the given lower bound and upper bound.
lowerBound - the given lower bound.upperBound - the given upper bound.
public Hypercube(cern.colt.matrix.DoubleMatrix1D lowerBoundVec,
cern.colt.matrix.DoubleMatrix1D upperBoundVec)
Hypercube with the given lower bound and upper bound.
lowerBoundVec - the given lower bound.upperBoundVec - the given upper bound.public Hypercube(int inputDimension)
Hypercube in the given number of dimensions.
inputDimension - the given number of dimensions.| Method Detail |
|---|
public static Hypercube getInstance(int inputDimension)
Hypercube instance in the specified number of
dimensions. To be precise, the lower DEFAULT_BOUNDS are all set to
Double.NEGATIVE_INFINITY and the upper DEFAULT_BOUNDS to
Double.POSITIVE_INFINITY.
inputDimension - the given number of dimensions
public void assign(Hypercube other)
other - the given Hypercube.public void centerOn(double[] x)
Hypercube on the given point.
x - the given center.public void centerOn(cern.colt.matrix.DoubleMatrix1D x)
Hypercube on the given point.
x - the given center.public boolean contains(double[] point)
point - the given point.
true if the point is contained in this
Hypercube.public boolean contains(cern.colt.matrix.DoubleMatrix1D point)
contains(double[])public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int getInputDimension()
public double[] getLowerBound()
public cern.colt.matrix.DoubleMatrix1D getLowerBoundVec()
Hypercube.
Hypercube.public double[] getUpperBound()
public cern.colt.matrix.DoubleMatrix1D getUpperBoundVec()
Hypercube.
Hypercube.public void init()
public void maskWith(Hypercube other)
Hypercube
into the one defined by the intersection of this Hypercube and the
given one.
other - the given Hypercube to use as a mask.public void scaleBy(double factor)
Hypercube by the given factor.
factor - the factor to scale by.public void scaleBy(double[] factors)
Hypercube by the factors in the given array, each
factor corresponding to one dimension.
factors - the given array of scaling factors.public void scaleBy(cern.colt.matrix.DoubleMatrix1D factorVec)
Hypercube by the given vector of factors, each factor
corresponding to one dimension.
factorVec - the vector of scaling factorspublic void setInputDimension(int inputDimension)
inputDimension - the given number of dimensions.public void setLowerBound(double[] lowerBound)
Hypercube.
lowerBound - the given lower bound.public void setLowerBoundVec(cern.colt.matrix.DoubleMatrix1D lowerBoundVec)
Hypercube.
lowerBoundVec - the given lower bound.public void setUpperBound(double[] upperBound)
Hypercube.
upperBound - the given upper bound.public void setUpperBoundvec(cern.colt.matrix.DoubleMatrix1D upperBoundVec)
Hypercube.
upperBoundVec - the given upper bound.public java.lang.String toString()
toString in class java.lang.Objectpublic void translateBy(double[] amounts)
Hypercube by the given amounts.
amounts - the amounts to translate by.public void translateBy(cern.colt.matrix.DoubleMatrix1D amountVec)
Hypercube by the given amounts.
amountVec - the amounts to translate by.public double volume()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||