@@ -2077,6 +2077,99 @@ The rolling count is the current number of elements in the rolling window.
20772077
20782078[endsect]
20792079
2080+ [section:rolling_max rolling_max]
2081+
2082+ The rolling sum is the sum of the last /N/ samples.
2083+
2084+ [variablelist
2085+ [[Result Type] [``_sample_type_``]]
2086+ [[Depends On] [`sorted_rolling_window`]]
2087+ [[Variants] [['none]]]
2088+ [[Initialization Parameters] [`tag::rolling_window::window_size`]]
2089+ [[Accumulator Parameters] [['none]]]
2090+ [[Extractor Parameters] [['none]]]
2091+ [[Accumulator Complexity] [O(log N), where N is the window size]]
2092+ [[Extractor Complexity] [O(1)]]
2093+ ]
2094+
2095+ [*Header]
2096+ [def _ROLLING_MAX_HPP_ [headerref boost/accumulators/statistics/rolling_max.hpp]]
2097+
2098+ #include <_ROLLING_MAX_HPP_>
2099+
2100+ [*Example]
2101+
2102+ accumulator_set<int, stats<tag::rolling_max> > acc(tag::rolling_window::window_size = 3);
2103+
2104+ acc(1);
2105+ BOOST_CHECK_EQUAL(1, rolling_max(acc));
2106+
2107+ acc(2);
2108+ BOOST_CHECK_EQUAL(2, rolling_max(acc));
2109+
2110+ acc(3);
2111+ BOOST_CHECK_EQUAL(3, rolling_max(acc));
2112+
2113+ acc(1);
2114+ BOOST_CHECK_EQUAL(3, rolling_max(acc));
2115+
2116+ acc(-1);
2117+ BOOST_CHECK_EQUAL(1, rolling_max(acc));
2118+
2119+ acc(0);
2120+ BOOST_CHECK_EQUAL(1, rolling_max(acc));
2121+
2122+ [*See also]
2123+
2124+ * [classref boost::accumulators::impl::rolling_max_impl [^rolling_max_impl]]
2125+
2126+ [endsect]
2127+
2128+ [section:rolling_min rolling_min]
2129+
2130+ The rolling sum is the sum of the last /N/ samples.
2131+
2132+ [variablelist
2133+ [[Result Type] [``_sample_type_``]]
2134+ [[Depends On] [`sorted_rolling_window`]]
2135+ [[Variants] [['none]]]
2136+ [[Initialization Parameters] [`tag::rolling_window::window_size`]]
2137+ [[Accumulator Parameters] [['none]]]
2138+ [[Extractor Parameters] [['none]]]
2139+ [[Accumulator Complexity] [O(log N), where N is the window size]]
2140+ [[Extractor Complexity] [O(1)]]
2141+ ]
2142+
2143+ [*Header]
2144+ [def _ROLLING_MIN_HPP_ [headerref boost/accumulators/statistics/rolling_min.hpp]]
2145+
2146+ #include <_ROLLING_MIN_HPP_>
2147+
2148+ [*Example]
2149+
2150+ accumulator_set<int, stats<tag::rolling_min> > acc(tag::rolling_window::window_size = 3);
2151+
2152+ acc(1);
2153+ BOOST_CHECK_EQUAL(1, rolling_min(acc));
2154+
2155+ acc(2);
2156+ BOOST_CHECK_EQUAL(1, rolling_min(acc));
2157+
2158+ acc(3);
2159+ BOOST_CHECK_EQUAL(1, rolling_min(acc));
2160+
2161+ acc(4);
2162+ BOOST_CHECK_EQUAL(2, rolling_min(acc));
2163+
2164+ acc(-1);
2165+ BOOST_CHECK_EQUAL(-1, rolling_min(acc));
2166+
2167+ [*See also]
2168+
2169+ * [classref boost::accumulators::impl::rolling_min_impl [^rolling_min_impl]]
2170+
2171+ [endsect]
2172+
20802173[section:rolling_sum rolling_sum]
20812174
20822175The rolling sum is the sum of the last /N/ samples.
0 commit comments