org.apache.commons.math.stat.univariate.summary
Class SumOfLogs

java.lang.Object
  extended byorg.apache.commons.math.stat.univariate.AbstractUnivariateStatistic
      extended byorg.apache.commons.math.stat.univariate.AbstractStorelessUnivariateStatistic
          extended byorg.apache.commons.math.stat.univariate.summary.SumOfLogs
All Implemented Interfaces:
Serializable, StorelessUnivariateStatistic, UnivariateStatistic
Direct Known Subclasses:
GeometricMean

public class SumOfLogs
extends AbstractStorelessUnivariateStatistic
implements Serializable

Version:
$Revision: 1.12 $ $Date: 2003/11/19 03:28:24 $
See Also:
Serialized Form

Constructor Summary
SumOfLogs()
           
 
Method Summary
 void clear()
          Clears all the internal state of the Statistic
 double evaluate(double[] values, int begin, int length)
          Returns the sum of the natural logs for this collection of values
 double getN()
          Returns the current state of the statistic after the last increment.
 double getResult()
          Returns the current state of the statistic after the last increment.
 void increment(double d)
          Increments the internal state of the Storagless Implementation.
 
Methods inherited from class org.apache.commons.math.stat.univariate.AbstractUnivariateStatistic
evaluate, test
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.commons.math.stat.univariate.UnivariateStatistic
evaluate
 

Constructor Detail

SumOfLogs

public SumOfLogs()
Method Detail

increment

public void increment(double d)
Description copied from interface: StorelessUnivariateStatistic
Increments the internal state of the Storagless Implementation.

Specified by:
increment in interface StorelessUnivariateStatistic
Specified by:
increment in class AbstractStorelessUnivariateStatistic
See Also:
StorelessUnivariateStatistic.increment(double)

getResult

public double getResult()
Description copied from interface: StorelessUnivariateStatistic
Returns the current state of the statistic after the last increment.

Specified by:
getResult in interface StorelessUnivariateStatistic
Specified by:
getResult in class AbstractStorelessUnivariateStatistic
See Also:
StorelessUnivariateStatistic.getResult()

getN

public double getN()
Description copied from interface: StorelessUnivariateStatistic
Returns the current state of the statistic after the last increment.

Specified by:
getN in interface StorelessUnivariateStatistic
Returns:
value of the statistic, Double.NaN if it has been cleared or just instantiated.
See Also:
StorelessUnivariateStatistic.getN()

clear

public void clear()
Description copied from interface: StorelessUnivariateStatistic
Clears all the internal state of the Statistic

Specified by:
clear in interface StorelessUnivariateStatistic
Specified by:
clear in class AbstractStorelessUnivariateStatistic
See Also:
StorelessUnivariateStatistic.clear()

evaluate

public double evaluate(double[] values,
                       int begin,
                       int length)
Returns the sum of the natural logs for this collection of values

Specified by:
evaluate in interface UnivariateStatistic
Overrides:
evaluate in class AbstractStorelessUnivariateStatistic
Parameters:
values - Is a double[] containing the values
begin - processing at this point in the array
length - processing at this point in the array
Returns:
the sumLog value or Double.NaN if the array is empty
See Also:
UnivariateStatistic.evaluate(double[], int, int)


Copyright © 2003-2004 Apache Software Foundation. All Rights Reserved.