com.dreizak.miniball.highdim
Class Miniball

java.lang.Object
  extended by com.dreizak.miniball.highdim.Miniball

public class Miniball
extends java.lang.Object

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.

See Also:
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

Miniball

public Miniball(PointSet pts)
Computes the miniball of the given point set. Notice that the point set 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.

Parameters:
pts - the point set
Method Detail

isEmpty

public boolean isEmpty()
Whether or not the miniball is the empty set, equivalently, whether 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={}.

Returns:
true iff

radius

public double radius()
The radius of the miniball.

Precondition: !isEmpty()

Returns:
the radius of the miniball, a number ≥ 0

squaredRadius

public double squaredRadius()
The squared radius of the miniball.

This is equivalent to radius() * radius().

Precondition: !isEmpty()

Returns:
the squared radius of the miniball

center

public double[] center()
The Euclidean coordinates of the center of the miniball.

Precondition: !isEmpty()

Returns:
an array holding the coordinates of the center of the miniball

size

public int size()
The number of input points.

Returns:
the number of points in the original point set, i.e., pts.size() where pts was the PointSet instance passed to the constructor of this instance

support

public java.util.List<java.lang.Integer> support()
TODO

Returns:

verify

public Quality verify()
Verifies that the computed ball is indeed the miniball.

This method should be called for testing purposes only; it may not be very efficient.


toString

public 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).

Overrides:
toString in class java.lang.Object


Copyright © 2013. All Rights Reserved.