Class VectorialMean
- java.lang.Object
-
- org.apache.commons.math.stat.descriptive.moment.VectorialMean
-
- All Implemented Interfaces:
java.io.Serializable
public class VectorialMean extends java.lang.Object implements java.io.SerializableReturns the arithmetic mean of the available vectors.- Since:
- 1.2
- Version:
- $Revision: 922714 $ $Date: 2010-03-14 02:35:14 +0100 (dim. 14 mars 2010) $
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description VectorialMean(int dimension)Constructs a VectorialMean.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)longgetN()Get the number of vectors in the sample.double[]getResult()Get the mean vector.inthashCode()voidincrement(double[] v)Add a new vector to the sample.
-
-
-
Method Detail
-
increment
public void increment(double[] v) throws DimensionMismatchExceptionAdd a new vector to the sample.- Parameters:
v- vector to add- Throws:
DimensionMismatchException- if the vector does not have the right dimension
-
getResult
public double[] getResult()
Get the mean vector.- Returns:
- mean vector
-
getN
public long getN()
Get the number of vectors in the sample.- Returns:
- number of vectors in the sample
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-