22 #ifndef EDSP_STATISTICAL_MAX_HPP 23 #define EDSP_STATISTICAL_MAX_HPP 25 #include <edsp/meta/iterator.hpp> 28 namespace edsp {
namespace statistics {
37 template <
typename ForwardIt>
38 constexpr meta::value_type_t<ForwardIt>
max(ForwardIt first, ForwardIt last) {
39 return *std::max_element(first, last);
49 template <
typename ForwardIt>
50 constexpr meta::value_type_t<ForwardIt>
maxabs(ForwardIt first, ForwardIt last) {
51 using input_t = meta::value_type_t<ForwardIt>;
52 const auto comp = [](
const input_t left,
const input_t right) {
return std::abs(left) < std::abs(right); };
53 return std::abs(*std::max_element(first, last, comp));
58 #endif // EDSP_STATISTICAL_MAX_HPP constexpr meta::value_type_t< ForwardIt > max(ForwardIt first, ForwardIt last)
Computes the maximum value of the range [first, last)
Definition: max.hpp:38
constexpr meta::value_type_t< ForwardIt > maxabs(ForwardIt first, ForwardIt last)
Computes the maximum absolute value of the range [first, last)
Definition: max.hpp:50
Definition: amplifier.hpp:29