Class RunningSumExtrema

Object
RunningSumExtrema

public class RunningSumExtrema extends Object
Like a RunningSum but also remembers the mean and max across all the added values.
Author:
Owen Feehan
  • Constructor Details

    • RunningSumExtrema

      public RunningSumExtrema()
  • Method Details

    • add

      public void add(double value)
      Adds a value to the running-sum, also remembering if value is the minimum or maximum of calls to this method.
      Parameters:
      value - the value.
    • mean

      public double mean()
      Calculates the mean.
      Returns:
      the mean or NaN if add(double) was never called.
    • min

      public double min()
      The minimum across all values passed to add(double) or Double.MAX_VALUE if the method was never called.
    • max

      public double max()
      The maximum across all values passed to add(double) or Double.MIN_VALUE if the method was never called.