10template<storm::OptimizationDirection Dir,
typename ValueType>
15template<storm::OptimizationDirection Dir,
typename ValueType>
20template<storm::OptimizationDirection Dir,
typename ValueType>
22 extremalValue = value;
26template<storm::OptimizationDirection Dir,
typename ValueType>
28 extremalValue = std::move(value);
32template<storm::OptimizationDirection Dir,
typename ValueType>
35 return value < extremalValue;
38 return value > extremalValue;
42template<storm::OptimizationDirection Dir,
typename ValueType>
45 extremalValue = other.extremalValue;
51template<storm::OptimizationDirection Dir,
typename ValueType>
53 if (
better(other.extremalValue)) {
54 extremalValue = std::move(other.extremalValue);
60template<storm::OptimizationDirection Dir,
typename ValueType>
63 extremalValue = value;
69template<storm::OptimizationDirection Dir,
typename ValueType>
72 extremalValue = std::move(value);
78template<storm::OptimizationDirection Dir,
typename ValueType>
80 if constexpr (StoresPlainValues) {
81 return extremalValue == baseValue();
84 return extremalValue.isPositiveInfinity();
87 return extremalValue.isNegativeInfinity();
92template<storm::OptimizationDirection Dir,
typename ValueType>
95 if constexpr (StoresPlainValues) {
98 return extremalValue.getFinite();
102template<storm::OptimizationDirection Dir,
typename ValueType>
105 if constexpr (StoresPlainValues) {
106 return extremalValue;
108 return extremalValue.getFinite();
112template<storm::OptimizationDirection Dir,
typename ValueType>
120template<storm::OptimizationDirection Dir,
typename ValueType>
122 return extremalValue;
125template<storm::OptimizationDirection Dir,
typename ValueType>
127 extremalValue = baseValue();
136#if STORM_RATIONAL_NUMBER_DIFFERS_FROM_COEFFICIENT
Stores and manages an extremal (maximal or minimal) value.
bool operator&=(Extremum const &other)
Updates the stored value, if the given extremal value is better.
ValueType const & operator*() const
std::optional< ValueType > getOptionalValue() const
bool better(ValueType const &value) const
storm::utility::ExtendedValueType< ValueType > const & getExtendedValue() const
void reset()
Forgets the extremal value so that this represents the extremum over an empty set.
Extremum & operator=(Extremum const &)=default
#define STORM_LOG_ASSERT(cond, message)
bool constexpr maximize(OptimizationDirection d)
bool constexpr minimize(OptimizationDirection d)
std::conditional_t< storm::NumberTraits< ValueType >::HasInfinity, ValueType, ExtendedNumber< ValueType > > ExtendedValueType
The type to use for values that may be infinite.