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

java.lang.Object
  extended by be.ac.ulg.montefiore.run.jahmm.Observation
      extended by be.ac.ulg.montefiore.run.jahmm.ObservationVector
All Implemented Interfaces:
CentroidFactory<ObservationVector>, java.lang.Cloneable

public class ObservationVector
extends Observation
implements java.lang.Cloneable, CentroidFactory<ObservationVector>

This class holds an Observation described by a vector of reals.


Constructor Summary
ObservationVector(double[] value)
          An observation that can be described by a vector of reals.
ObservationVector(int dimension)
          An observation whose components are 0.
 
Method Summary
 ObservationVector clone()
           
 int dimension()
          Returns the dimension of this vector.
 Centroid<ObservationVector> factor()
          Returns the centroid matching this observation.
 ObservationVector minus(ObservationVector o)
          Returns a new observation that is the difference between this observation and another one.
 ObservationVector plus(ObservationVector o)
          Returns a new observation that is the sum of this observation and another one.
 ObservationVector times(double c)
          Returns a new observation that is the product of this observation by a scalar.
 java.lang.String toString(java.text.NumberFormat numberFormat)
          Formats this observation using a number formatter.
 double value(int i)
          Returns one of the values composing the observation.
 double[] values()
          Returns the values composing this observation.
 
Methods inherited from class be.ac.ulg.montefiore.run.jahmm.Observation
toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObservationVector

public ObservationVector(int dimension)
An observation whose components are 0.

Parameters:
dimension - The dimension of the resulting vector.

ObservationVector

public ObservationVector(double[] value)
An observation that can be described by a vector of reals.

Parameters:
value - The value of this observation. This array is copied.
Method Detail

dimension

public int dimension()
Returns the dimension of this vector.


values

public double[] values()
Returns the values composing this observation.

Returns:
The values of this observation. The array is copied.

value

public double value(int i)
Returns one of the values composing the observation.

Parameters:
i - The dimension of interest (0 ≤ i < dimension).
Returns:
The value of the (i+1)-th dimension of this observation.

factor

public Centroid<ObservationVector> factor()
Returns the centroid matching this observation.

Specified by:
factor in interface CentroidFactory<ObservationVector>
Returns:
The corresponding observation.

plus

public ObservationVector plus(ObservationVector o)
Returns a new observation that is the sum of this observation and another one.

Parameters:
o - The observation to sum with this one.
Returns:
An ObservationVector which is the sum of this observation and o.

times

public ObservationVector times(double c)
Returns a new observation that is the product of this observation by a scalar.

Parameters:
c - A scalar value.
Returns:
An ObservationVector which is the product of this observation and c.

minus

public ObservationVector minus(ObservationVector o)
Returns a new observation that is the difference between this observation and another one.

Parameters:
o - The observation to subtract from this one.
Returns:
An ObservationVector which is the difference between this observation and o.

toString

public java.lang.String toString(java.text.NumberFormat numberFormat)
Description copied from class: Observation
Formats this observation using a number formatter.

Specified by:
toString in class Observation
Parameters:
numberFormat - A number formatter.
Returns:
A string describing this observation.

clone

public ObservationVector clone()
Overrides:
clone in class java.lang.Object


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