Package moa.cluster

Class Miniball


  • public class Miniball
    extends Object
    Java Porting of the Miniball.h code of Bernd Gaertner. Look at http://www.inf.ethz.ch/personal/gaertner/miniball.html
    and related work at http://www.inf.ethz.ch/personal/gaertner/texts/own_work/esa99_final.pdf
    for reading about the algorithm and the implementation of it.

    If interested in Bounding Sphere algorithms read also published work of Emo Welzl "Smallest enclosing disks (balls and Ellipsoid)" and the work of Jack Ritter on "Efficient Bounding Spheres" at
    http://tog.acm.org/GraphicsGems/gems/BoundSphere.c?searchterm=calc

    For Licencing Info report to Bernd Gaertner's one reported below:

    Copright (C) 1999-2006, Bernd Gaertner
    $Revision: 1.3 $
    $Date: 2006/11/16 08:01:52 $

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program. If not, see <http://www.gnu.org/licenses/>.
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA,
    or download the License terms from prep.ai.mit.edu/pub/gnu/COPYING-2.0.

    Contact:
    --------
    Bernd Gaertner
    Institute of Theoretical Computer Science
    ETH Zuerich
    CAB G32.2
    CH-8092 Zuerich, Switzerland
    http://www.inf.ethz.ch/personal/gaertner
    Original Java port from Paolo Perissinotto for Jpatch Project by Sascha Ledinsky found at http://forum.jpatch.com/viewtopic.php?f=3&t=919

    Version:
    1.0 Date: 2007/11/18 21:57 used for moa for calculating most compact sphere cluster modified by Timm Jansen (moa@cs.rwth-aachen.de) to be used with high dimensional points
    Author:
    Paolo Perissinotto for Jpatch Project by Sascha Ledinsky
    • Constructor Summary

      Constructors 
      Constructor Description
      Miniball​(int dim)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void build()
      Recalculate Miniball parameter Center and Radius
      double[] center()
      Return the center of the Miniball
      void check_in​(double[] p)
      Adds a point to the list.
      Skip action on null parameter.
      void clear()
      Method clear: clears the ArrayList of the selection points.
      Use it for starting a new selection list to calculate Bounding Sphere on
      or to clear memory references to the list of objects.
      Always use at the end of a Miniball use if you want to reuse later the Miniball object
      int nr_points()
      Return the actual number of points in the list
      int nr_support_points()
      Return the number of support points (used to calculate the miniball).
      It's and internal info
      double radius()
      Return the Radius of the miniball
      double squared_radius()
      Return the sqaured Radius of the miniball
    • Constructor Detail

      • Miniball

        public Miniball​(int dim)
    • Method Detail

      • clear

        public void clear()
        Method clear: clears the ArrayList of the selection points.
        Use it for starting a new selection list to calculate Bounding Sphere on
        or to clear memory references to the list of objects.
        Always use at the end of a Miniball use if you want to reuse later the Miniball object
      • check_in

        public void check_in​(double[] p)
        Adds a point to the list.
        Skip action on null parameter.
        Parameters:
        p - The object to be added to the list
      • build

        public void build()
        Recalculate Miniball parameter Center and Radius
      • center

        public double[] center()
        Return the center of the Miniball
        Returns:
        The center (double[])
      • squared_radius

        public double squared_radius()
        Return the sqaured Radius of the miniball
        Returns:
        The square radius
      • radius

        public double radius()
        Return the Radius of the miniball
        Returns:
        The radius
      • nr_points

        public int nr_points()
        Return the actual number of points in the list
        Returns:
        the actual number of points
      • nr_support_points

        public int nr_support_points()
        Return the number of support points (used to calculate the miniball).
        It's and internal info
        Returns:
        the number of support points