namespace eve::algo
{
template <eve::algo::relaxed_range Rng, typename Less>
std::optional<eve::value_type_t<Rng>>
max_value(Rng&& rng, Less less);
template <eve::algo::relaxed_range Rng>
std::optional<eve::value_type_t<Rng>>
max_value(Rng&& rng);
}
constexpr auto max_value
SIMD algorithm that returns maximum value in the range.
Definition: max_value.hpp:94
maximum value from the range. If the input range was empty, it's std::nullopt
.
#include <eve/module/core.hpp>
#include <eve/module/algo.hpp>
#include <tts/tts.hpp>
#include <vector>
int main()
{
std::vector<int> v{ 2, 4, -1, 4, 0, 1 };
std::cout << " -> v = "
<< tts::as_string(v)
<< "\n";
std::cout << " -> eve::algo::max_value(v) = "
std::cout << " -> eve::algo::max_element(v) - v.begin() = "
std::cout << " -> eve::algo::max_value(v, eve::is_greater) = "
std::cout << " -> eve::algo::max_value(v, eve::is_greater) - v.begin() = "
}
constexpr auto max_element
SIMD variation on std::max_element not exact match
Definition: max_element.hpp:93
constexpr auto is_greater
elementwise callable returning a logical true if and only if the element value of the first parameter...
Definition: is_greater.hpp:84