Class RunningSumCollection

Object
RunningSumCollection

public class RunningSumCollection extends Object
A collection of RunningSum where an operation is executed on all objects in the collection.
Author:
Owen Feehan
  • Constructor Details

    • RunningSumCollection

      public RunningSumCollection(int size)
      Constructor. Creates a collection with a certain number of (zeroed) RunningSum.
      Parameters:
      size - number of items in the collection.
  • Method Details

    • get

      public RunningSum get(int index)
      An individual item in the collection.
      Parameters:
      index - index of the item.
      Returns:
      the individual item.
    • reset

      public void reset()
      Resets all items to zero.
    • meanAndReset

      public double[] meanAndReset()
      Calculate the mean of each item and reset to zero.
      Returns:
      an array with a mean corresponding to each item in the collection.