|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.dreizak.miniball.highdim.Miniball
public class Miniball
The smallest enclosing ball (a.k.a. miniball) of a set of points.
The miniball MB(P) of a non-empty set P of points in d-dimensional Euclidean space R^d is defined to be the smallest ball that contains all points from P.
In order to compute the miniball of a given point set, you create a PointSet instance,
pts, say, that provides the algorithm access to the Euclidean coordinates of the points.
You then pass this instance to the constructor Miniball(PointSet). The point set may be
empty (i.e., pts.size() == 0), in which case isEmpty() will return true.
Instances of class Miniball are immutable. That is, when you create a Miniball,
passing your point set to it, it computes the center and radius of the miniball and allows you to
access this information via radius(), squaredRadius(), and center().
However the Miniball instance will not reflect any subsequent changes you make to the
underlying point set.
ArrayPointSet| Constructor Summary | |
|---|---|
Miniball(PointSet pts)
Computes the miniball of the given point set. |
|
| Method Summary | |
|---|---|
double[] |
center()
The Euclidean coordinates of the center of the miniball. |
boolean |
isEmpty()
Whether or not the miniball is the empty set, equivalently, whether points.size() == 0
was true when this miniball instance was constructed. |
double |
radius()
The radius of the miniball. |
int |
size()
The number of input points. |
double |
squaredRadius()
The squared radius of the miniball. |
java.util.List<java.lang.Integer> |
support()
TODO |
java.lang.String |
toString()
Outputs information about the miniball; this includes the quality information provided by verify() (and as a consequence, toString() is expensive to call). |
Quality |
verify()
Verifies that the computed ball is indeed the miniball. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Miniball(PointSet pts)
pts is assumed to be immutable during the computation. That
is, if you add, remove, or change points in the point set, you have to create a new instance of
Miniball.
pts - the point set| Method Detail |
|---|
public boolean isEmpty()
points.size() == 0
was true when this miniball instance was constructed.
Notice that the miniball of a point set S is empty if and only if S={}.
public double radius()
Precondition: !isEmpty()
public double squaredRadius()
This is equivalent to radius() * radius().
Precondition: !isEmpty()
public double[] center()
Precondition: !isEmpty()
public int size()
pts.size() where
pts was the PointSet instance passed to the constructor of this
instancepublic java.util.List<java.lang.Integer> support()
public Quality verify()
This method should be called for testing purposes only; it may not be very efficient.
public java.lang.String toString()
verify() (and as a consequence, toString() is expensive to call).
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||