be.ac.ulg.montefiore.run.jahmm
Class CentroidObservationInteger

java.lang.Object
  extended by be.ac.ulg.montefiore.run.jahmm.CentroidObservationInteger
All Implemented Interfaces:
Centroid<ObservationInteger>

public class CentroidObservationInteger
extends java.lang.Object
implements Centroid<ObservationInteger>

This class represents the centroid of a set of ObservationInteger.


Constructor Summary
CentroidObservationInteger(ObservationInteger o)
           
 
Method Summary
 double distance(ObservationInteger e)
          Returns the distance from this centroid to a given element.
 void reevaluateAdd(ObservationInteger e, java.util.List<? extends ObservationInteger> v)
          Reevalue the value of this centroid, knowing that it currently is the centroid of the observations composing v and that we want it to be the centroid of v plus the value of the observation e.
 void reevaluateRemove(ObservationInteger e, java.util.List<? extends ObservationInteger> v)
          Reevalue the value of this centroid, knowing that it currently is the centroid of the observations composing v and that we want it to be the centroid of v minus the value of the observation e.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CentroidObservationInteger

public CentroidObservationInteger(ObservationInteger o)
Method Detail

reevaluateAdd

public void reevaluateAdd(ObservationInteger e,
                          java.util.List<? extends ObservationInteger> v)
Description copied from interface: Centroid
Reevalue the value of this centroid, knowing that it currently is the centroid of the observations composing v and that we want it to be the centroid of v plus the value of the observation e.

Specified by:
reevaluateAdd in interface Centroid<ObservationInteger>
Parameters:
e - An observation that must be involved in the computation of the new value of this centroid.
v - The set of observations that gave the current value of this centroid.

reevaluateRemove

public void reevaluateRemove(ObservationInteger e,
                             java.util.List<? extends ObservationInteger> v)
Description copied from interface: Centroid
Reevalue the value of this centroid, knowing that it currently is the centroid of the observations composing v and that we want it to be the centroid of v minus the value of the observation e.

Specified by:
reevaluateRemove in interface Centroid<ObservationInteger>
Parameters:
e - An observation that must not be involved in the computation of the new value of this centroid.
v - The set of observations (which holds o) that gave the current value of this centroid.

distance

public double distance(ObservationInteger e)
Returns the distance from this centroid to a given element. This distance is the absolute value of the difference between the value of this centroid and the value of the argument.

Specified by:
distance in interface Centroid<ObservationInteger>
Parameters:
e - The element, which must be an ObservationInteger.
Returns:
The distance to the centroid.


Copyright © 2004,2005 Jean-Marc François.