![]() |
Home | Libraries | People | FAQ | More |
boost::time_series::partial_sum — Like std::partial_sum(), time_series::partial_sum() calculates a series of sums such that the result at offset i is the sum of the input from offsets [-inf,i].
// In header: <boost/time_series/numeric/partial_sum.hpp> template<typename Series, typename Out> ordered_inserter< Out > partial_sum(Series const & series, ordered_inserter< Out > out); template<typename Series> piecewise_constant_series< typename concepts::TimeSeries< Series const >::value_type typename concepts::TimeSeries< Series const >::discretization_type > partial_sum(Series const & series);
Like std::partial_sum(), time_series::partial_sum() calculates a series of sums such that the result at offset i is the sum of the input from offsets [0,i].
This function assumes that zero value of the series does not contribute to the sums, and that the series does not have non-zero positive or negative infinite runs.
| Parameters: |
|
||||
| Requires: |
Series is a model of the TimeSeries concept. Out is a model of the OrderedInserter concept. The offset_type of the Series is integral. For variaibles x and y of the series' value_type, the expression (x+=y) must be convertible to value_type. For a variable x of the series' value_type, x == (x + range_run_storage::zero(series)). series[-inf] == range_run_storage::zero(series) series[inf] == range_run_storage::zero(series) |
||||
| Returns: | A piecewise_constant_series<> if no ordered inserter is specified; otherwise, the ordered inserter. |
||||
| Notes: | If using the version that takes an OrderedInserter, you must call .commit() on the returned OrderedInserter when you are done with it. |