template<typename Output_, typename Value_, typename Index_>
class tatami_stats::sums::RunningDense< Output_, Value_, Index_ >
Running sums from dense data.
This considers a scenario with a set of equilength "objective" vectors \([v_1, v_2, v_3, ..., v_n]\), but data are only available for "observed" vectors \([p_1, p_2, p_3, ..., p_m]\), where the \(j\)-th element of \(p_i\) is the \(i\)-th element of \(v_j\). The idea is to repeatedly call add()
for ptr
corresponding to observed vectors from 0 to \(m - 1\), and then finally call finish()
to obtain the sum for each objective vector.
This class uses naive accumulation to obtain the sum for each objective vector. Callers should use a sufficiently high-precision Output_
such as double
to mitigate round-off errors.
- Template Parameters
-
Output_ | Type of the output data. |
Value_ | Type of the input value. |
Index_ | Type of the row/column indices. |