Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
storm::solver::SolutionBounds< ValueType > Struct Template Reference

Sound lower and upper bounds on a solution vector. More...

#include <SolutionBounds.h>

Public Member Functions

bool hasLower () const
 Returns true if the lower bound is set.
bool hasUpper () const
 Returns true if the upper bound is set.
bool hasAny () const
 Returns true if at least one of the bounds is set.
bool encloses (std::vector< ValueType > const &values) const
 Returns true if every one of the given values lies within the bounds that are set.
bool isExact () const
 Returns true if both bounds are set and coincide.
bool isWithinPrecision (std::vector< ValueType > const &values, ValueType const &precision, bool relative) const
 Returns true if both bounds are set and neither is further from its value than the given precision allows.
void setExact (std::vector< ValueType > const &values)
 Sets both bounds to the given values, i.e.
void invertProbabilityBounds ()
 Turns bounds on a probability p into bounds on 1-p, i.e.
template<typename Function>
auto transform (Function const &function) const
 Applies the given function to whichever of the bounds are set, e.g.
void widenTo (std::vector< ValueType > const &values)
 Widens whichever bounds are set until they enclose the given values.
void clear ()
 Clears both bounds.

Public Attributes

std::optional< std::vector< ValueType > > lower
std::optional< std::vector< ValueType > > upper

Detailed Description

template<typename ValueType>
struct storm::solver::SolutionBounds< ValueType >

Sound lower and upper bounds on a solution vector.

Both have the same size as the solution. They are tracked independently, as an algorithm may establish only one of them; an unset bound means that side is not known. Soundness refers to the approximation error of the algorithm. If ValueType is not exact (e.g. double), rounding errors may occur.

Definition at line 21 of file SolutionBounds.h.

Member Function Documentation

◆ clear()

template<typename ValueType>
void storm::solver::SolutionBounds< ValueType >::clear ( )
inline

Clears both bounds.

Definition at line 155 of file SolutionBounds.h.

◆ encloses()

template<typename ValueType>
bool storm::solver::SolutionBounds< ValueType >::encloses ( std::vector< ValueType > const & values) const
inline

Returns true if every one of the given values lies within the bounds that are set.

Meant for assertions.

Definition at line 49 of file SolutionBounds.h.

◆ hasAny()

template<typename ValueType>
bool storm::solver::SolutionBounds< ValueType >::hasAny ( ) const
inline

Returns true if at least one of the bounds is set.

Definition at line 42 of file SolutionBounds.h.

◆ hasLower()

template<typename ValueType>
bool storm::solver::SolutionBounds< ValueType >::hasLower ( ) const
inline

Returns true if the lower bound is set.

Definition at line 28 of file SolutionBounds.h.

◆ hasUpper()

template<typename ValueType>
bool storm::solver::SolutionBounds< ValueType >::hasUpper ( ) const
inline

Returns true if the upper bound is set.

Definition at line 35 of file SolutionBounds.h.

◆ invertProbabilityBounds()

template<typename ValueType>
void storm::solver::SolutionBounds< ValueType >::invertProbabilityBounds ( )
inline

Turns bounds on a probability p into bounds on 1-p, i.e.

the new lower bound is one minus the old upper bound and vice versa.

Definition at line 112 of file SolutionBounds.h.

◆ isExact()

template<typename ValueType>
bool storm::solver::SolutionBounds< ValueType >::isExact ( ) const
inline

Returns true if both bounds are set and coincide.

Definition at line 70 of file SolutionBounds.h.

◆ isWithinPrecision()

template<typename ValueType>
bool storm::solver::SolutionBounds< ValueType >::isWithinPrecision ( std::vector< ValueType > const & values,
ValueType const & precision,
bool relative ) const
inline

Returns true if both bounds are set and neither is further from its value than the given precision allows.

Definition at line 77 of file SolutionBounds.h.

◆ setExact()

template<typename ValueType>
void storm::solver::SolutionBounds< ValueType >::setExact ( std::vector< ValueType > const & values)
inline

Sets both bounds to the given values, i.e.

states that these values are known exactly.

Definition at line 104 of file SolutionBounds.h.

◆ transform()

template<typename ValueType>
template<typename Function>
auto storm::solver::SolutionBounds< ValueType >::transform ( Function const & function) const
inline

Applies the given function to whichever of the bounds are set, e.g.

to carry them along a transformation of the solution vector they belong to.

Definition at line 128 of file SolutionBounds.h.

◆ widenTo()

template<typename ValueType>
void storm::solver::SolutionBounds< ValueType >::widenTo ( std::vector< ValueType > const & values)
inline

Widens whichever bounds are set until they enclose the given values.

A bound only ever moves away from the solution that way, so it stays sound.

Definition at line 143 of file SolutionBounds.h.

Member Data Documentation

◆ lower

template<typename ValueType>
std::optional<std::vector<ValueType> > storm::solver::SolutionBounds< ValueType >::lower

Definition at line 22 of file SolutionBounds.h.

◆ upper

template<typename ValueType>
std::optional<std::vector<ValueType> > storm::solver::SolutionBounds< ValueType >::upper

Definition at line 23 of file SolutionBounds.h.


The documentation for this struct was generated from the following file: