Output range to calculate the mean online. Getter for mean costs a branch to check for N == 0. This struct uses O(1) space and does *NOT* store the individual elements.
Note: This struct can implicitly convert to the value of the mean.
Allow implicit casting to double, by returning the current mean.
Adds the contents of rhs to this instance.
Simply returns this. Useful in generic programming contexts.
1 Mean summ; 2 summ.put(1); 3 summ.put(2); 4 summ.put(3); 5 summ.put(4); 6 summ.put(5); 7 assert(summ.mean == 3);
See Implementation
Output range to calculate the mean online. Getter for mean costs a branch to check for N == 0. This struct uses O(1) space and does *NOT* store the individual elements.
Note: This struct can implicitly convert to the value of the mean.