Storm
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
 
Extremumoperator= (Extremum const &)=default
 
Extremumoperator= (Extremum &&)=default
 
 ~Extremum ()=default
 
Extremumoperator= (ValueType const &value)
 Sets the extremum to the given value.
 
Extremumoperator= (ValueType &&value)
 Sets the extremum to the given value.
 
bool better (ValueType 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
 
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 15 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 9 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()

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 41 of file Extremum.cpp.

◆ empty()

template<storm::OptimizationDirection Dir, typename ValueType >
bool storm::utility::Extremum< Dir, ValueType >::empty ( ) const
Returns
true if this does not store any value (representing the extremum over an empty set)

Definition at line 96 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 117 of file Extremum.cpp.

◆ operator&=() [1/4]

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 64 of file Extremum.cpp.

◆ operator&=() [2/4]

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 56 of file Extremum.cpp.

◆ operator&=() [3/4]

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 84 of file Extremum.cpp.

◆ operator&=() [4/4]

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 72 of file Extremum.cpp.

◆ operator*() [1/2]

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

Definition at line 111 of file Extremum.cpp.

◆ operator*() [2/2]

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

Definition at line 105 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 32 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 23 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: