org.encog.ml.data.basic

## Class BasicMLDataCentroid

- java.lang.Object
- - org.encog.ml.data.basic.BasicMLDataCentroid

- All Implemented Interfaces:
    Cloneable, Centroid<MLData>

      public class BasicMLDataCentroid
      extends Object
      implements Centroid<MLData>, Cloneable

  A basic implementation of a centroid.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicMLDataCentroid(MLData o)` Construct the centroid.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(MLData d)` Add an element to the centroid.
    `double` | `distance(MLData d)` The distance between this centroid and an element.
    `void` | `remove(MLData d)` Remove an element from the centroid.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BasicMLDataCentroid

          public BasicMLDataCentroid(MLData o)

      Construct the centroid.
      Parameters:
        `o` - The object to base the centroid on.

  - ### Method Detail

    - #### add

          public void add(MLData d)

      Add an element to the centroid.
      Specified by:
        `add` in interface `Centroid<MLData>`
      Parameters:
        `d` - The element to add.

    - #### remove

          public void remove(MLData d)

      Remove an element from the centroid.
      Specified by:
        `remove` in interface `Centroid<MLData>`
      Parameters:
        `d` - The element to remove.

    - #### distance

          public double distance(MLData d)

      The distance between this centroid and an element.
      Specified by:
        `distance` in interface `Centroid<MLData>`
      Parameters:
        `d` - The element.
      Returns:
        The distance.

Copyright © 2014. All Rights Reserved.