Packages

class SumQueue extends AnyRef

The SumQueue class retains the last 'q' elements as well as the running total in 'sum' and number of elements in 'size_', making it efficient to compute moving averages.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SumQueue
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new SumQueue(q: Int = 5)

    q

    the number of elements to retain in the queue

Value Members

  1. def +=(y: Double): Unit

    Enqueue the next element 'y' in the queue, removing the first element when the queue is full.

    Enqueue the next element 'y' in the queue, removing the first element when the queue is full.

    y

    the next element to place in the queue

  2. def mean: Double

    Return the mean of the elements in the queue.

  3. def size: Int

    Return the size (number of elements) in the queue.