Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::utility::Extremum< Dir, ValueType > Class Template Reference

Stores and manages an extremal (maximal or minimal) value. More...

#include <Extremum.h>

Public Member Functions

 Extremum ()=default
 Extremum (ValueType const &value)
 Extremum (ValueType &&value)
 Extremum (Extremum const &)=default
 Extremum (Extremum &&)=default
Extremum & operator= (Extremum const &)=default
Extremum & operator= (Extremum &&)=default
 ~Extremum ()=default
Extremum & operator= (ValueType const &value)
 Sets the extremum to the given value.
Extremum & operator= (ValueType &&value)
 Sets the extremum to the given value.
bool better (ValueType const &value) const
template<typename ExtendedType>
requires (std::is_same_v<ExtendedType, storm::utility::ExtendedValueType<ValueType>> && !std::is_same_v<storm::utility::ExtendedValueType<ValueType>, ValueType>)
bool better (ExtendedType const &value) const
bool operator&= (Extremum const &other)
 Updates the stored value, if the given extremal value is better.
bool operator&= (Extremum &&other)
 Updates the stored value, if the given extremal value is better.
bool operator&= (ValueType const &value)
 Updates the stored value, if the given value is better.
bool operator&= (ValueType &&value)
 Updates the stored value, if the given value is better.
bool empty () const
ValueType const & operator* () const
ValueType & operator* ()
std::optional< ValueType > getOptionalValue () const
storm::utility::ExtendedValueType< ValueType > const & getExtendedValue () const
template<typename ExtendedType>
requires (std::is_same_v<ExtendedType, storm::utility::ExtendedValueType<ValueType>> && !std::is_same_v<storm::utility::ExtendedValueType<ValueType>, ValueType>)
bool operator&= (ExtendedType const &value)
 Updates the stored value, if the given value is better.
void reset ()
 Forgets the extremal value so that this represents the extremum over an empty set.

Detailed Description

template<storm::OptimizationDirection Dir, typename ValueType>
class storm::utility::Extremum< Dir, ValueType >

Stores and manages an extremal (maximal or minimal) value.

Definition at line 17 of file Extremum.h.

Constructor & Destructor Documentation

◆ Extremum() [1/5]

template<storm::OptimizationDirection Dir, typename ValueType>
storm::utility::Extremum< Dir, ValueType >::Extremum ( )
default

◆ Extremum() [2/5]

template<storm::OptimizationDirection Dir, typename ValueType>
storm::utility::Extremum< Dir, ValueType >::Extremum ( ValueType const & value)

Definition at line 11 of file Extremum.cpp.

◆ Extremum() [3/5]

template<storm::OptimizationDirection Dir, typename ValueType>
storm::utility::Extremum< Dir, ValueType >::Extremum ( ValueType && value)

Definition at line 16 of file Extremum.cpp.

◆ Extremum() [4/5]

template<storm::OptimizationDirection Dir, typename ValueType>
storm::utility::Extremum< Dir, ValueType >::Extremum ( Extremum< Dir, ValueType > const & )
default

◆ Extremum() [5/5]

template<storm::OptimizationDirection Dir, typename ValueType>
storm::utility::Extremum< Dir, ValueType >::Extremum ( Extremum< Dir, ValueType > && )
default

◆ ~Extremum()

template<storm::OptimizationDirection Dir, typename ValueType>
storm::utility::Extremum< Dir, ValueType >::~Extremum ( )
default

Member Function Documentation

◆ better() [1/2]

template<storm::OptimizationDirection Dir, typename ValueType>
template<typename ExtendedType>
requires (std::is_same_v<ExtendedType, storm::utility::ExtendedValueType<ValueType>> && !std::is_same_v<storm::utility::ExtendedValueType<ValueType>, ValueType>)
bool storm::utility::Extremum< Dir, ValueType >::better ( ExtendedType const & value) const
inline
Parameters
value
Returns
True if the provided value is strictly better (larger if we maximize; smaller if we minimize) than the stored value

Definition at line 53 of file Extremum.h.

◆ better() [2/2]

template<storm::OptimizationDirection Dir, typename ValueType>
bool storm::utility::Extremum< Dir, ValueType >::better ( ValueType const & value) const
Parameters
value
Returns
True if the provided value is strictly better (larger if we maximize; smaller if we minimize) than the stored value

Definition at line 33 of file Extremum.cpp.

◆ empty()

template<storm::OptimizationDirection Dir, typename ValueType>
bool storm::utility::Extremum< Dir, ValueType >::empty ( ) const
Returns
true if the stored value is the extremum over the empty set

Definition at line 79 of file Extremum.cpp.

◆ getExtendedValue()

template<storm::OptimizationDirection Dir, typename ValueType>
storm::utility::ExtendedValueType< ValueType > const & storm::utility::Extremum< Dir, ValueType >::getExtendedValue ( ) const
Returns
the stored extremal value, including an infinite one

Definition at line 121 of file Extremum.cpp.

◆ getOptionalValue()

template<storm::OptimizationDirection Dir, typename ValueType>
std::optional< ValueType > storm::utility::Extremum< Dir, ValueType >::getOptionalValue ( ) const
Returns
the stored extremal value as an optional. Returns std::nullopt if this is empty

Definition at line 113 of file Extremum.cpp.

◆ operator&=() [1/5]

template<storm::OptimizationDirection Dir, typename ValueType>
template<typename ExtendedType>
requires (std::is_same_v<ExtendedType, storm::utility::ExtendedValueType<ValueType>> && !std::is_same_v<storm::utility::ExtendedValueType<ValueType>, ValueType>)
bool storm::utility::Extremum< Dir, ValueType >::operator&= ( ExtendedType const & value)
inline

Updates the stored value, if the given value is better.

Returns
true if the extremum value of this changed

Definition at line 124 of file Extremum.h.

◆ operator&=() [2/5]

template<storm::OptimizationDirection Dir, typename ValueType>
bool storm::utility::Extremum< Dir, ValueType >::operator&= ( Extremum< Dir, ValueType > && other)

Updates the stored value, if the given extremal value is better.

Parameters
other
Returns
true if the extremum value of this changed

Definition at line 52 of file Extremum.cpp.

◆ operator&=() [3/5]

template<storm::OptimizationDirection Dir, typename ValueType>
bool storm::utility::Extremum< Dir, ValueType >::operator&= ( Extremum< Dir, ValueType > const & other)

Updates the stored value, if the given extremal value is better.

Parameters
other
Returns
true if the extremum value of this changed

Definition at line 43 of file Extremum.cpp.

◆ operator&=() [4/5]

template<storm::OptimizationDirection Dir, typename ValueType>
bool storm::utility::Extremum< Dir, ValueType >::operator&= ( ValueType && value)

Updates the stored value, if the given value is better.

Parameters
other
Returns
true if the extremum value of this changed

Definition at line 70 of file Extremum.cpp.

◆ operator&=() [5/5]

template<storm::OptimizationDirection Dir, typename ValueType>
bool storm::utility::Extremum< Dir, ValueType >::operator&= ( ValueType const & value)

Updates the stored value, if the given value is better.

Parameters
other
Returns
true if the extremum value of this changed

Definition at line 61 of file Extremum.cpp.

◆ operator*() [1/2]

template<storm::OptimizationDirection Dir, typename ValueType>
ValueType & storm::utility::Extremum< Dir, ValueType >::operator* ( )
Precondition
the extremal value is finite, i.e., not empty.
Returns
the stored extremal value

Definition at line 103 of file Extremum.cpp.

◆ operator*() [2/2]

template<storm::OptimizationDirection Dir, typename ValueType>
ValueType const & storm::utility::Extremum< Dir, ValueType >::operator* ( ) const
Precondition
the extremal value is finite, i.e., not empty.
Returns
the stored extremal value

Definition at line 93 of file Extremum.cpp.

◆ operator=() [1/4]

template<storm::OptimizationDirection Dir, typename ValueType>
Extremum & storm::utility::Extremum< Dir, ValueType >::operator= ( Extremum< Dir, ValueType > && )
default

◆ operator=() [2/4]

template<storm::OptimizationDirection Dir, typename ValueType>
Extremum & storm::utility::Extremum< Dir, ValueType >::operator= ( Extremum< Dir, ValueType > const & )
default

◆ operator=() [3/4]

template<storm::OptimizationDirection Dir, typename ValueType>
Extremum< Dir, ValueType > & storm::utility::Extremum< Dir, ValueType >::operator= ( ValueType && value)

Sets the extremum to the given value.

Returns
a reference to this

Definition at line 27 of file Extremum.cpp.

◆ operator=() [4/4]

template<storm::OptimizationDirection Dir, typename ValueType>
Extremum< Dir, ValueType > & storm::utility::Extremum< Dir, ValueType >::operator= ( ValueType const & value)

Sets the extremum to the given value.

Returns
a reference to this

Definition at line 21 of file Extremum.cpp.

◆ reset()

template<storm::OptimizationDirection Dir, typename ValueType>
void storm::utility::Extremum< Dir, ValueType >::reset ( )

Forgets the extremal value so that this represents the extremum over an empty set.

Definition at line 126 of file Extremum.cpp.


The documentation for this class was generated from the following files: