|
Storm 1.14.0.1
A Modern Probabilistic Model Checker
|
#include <AbstractEquationSolver.h>
Public Types | |
| enum class | BoundType { Global , Local , Any } |
Public Member Functions | |
| AbstractEquationSolver () | |
| void | setShowProgress (bool verbose, uint64_t delay=5) |
| Configures whether this solver should show progress during iterative solving. | |
| void | setTerminationCondition (std::unique_ptr< TerminationCondition< SolutionType > > terminationCondition) |
| Sets a custom termination condition that is used together with the regular termination condition of the solver. | |
| void | resetTerminationCondition () |
| Removes a previously set custom termination condition. | |
| bool | hasCustomTerminationCondition () const |
| Retrieves whether a custom termination condition has been set. | |
| bool | terminateNow (std::vector< SolutionType > const &values, SolverGuarantee const &guarantee) const |
| Checks whether the solver can terminate wrt. | |
| bool | hasRelevantValues () const |
| Retrieves whether this solver has particularly relevant values. | |
| storm::storage::BitVector const & | getRelevantValues () const |
| Retrieves the relevant values (if there are any). | |
| boost::optional< storm::storage::BitVector > const & | getOptionalRelevantValues () const |
| void | setRelevantValues (storm::storage::BitVector &&valuesOfInterest) |
| Sets the relevant values. | |
| void | setRelevantValues (storm::storage::BitVector const &valuesOfInterest) |
| Sets the relevant values. | |
| void | clearRelevantValues () |
| Removes the values of interest (if there were any). | |
| bool | hasLowerBound (BoundType const &type=BoundType::Any) const |
| Retrieves whether this solver has a lower bound. | |
| bool | hasUpperBound (BoundType const &type=BoundType::Any) const |
| Retrieves whether this solver has an upper bound. | |
| void | setLowerBound (SolutionType const &value) |
| Sets a lower bound for the solution that can potentially be used by the solver. | |
| void | setUpperBound (SolutionType const &value) |
| Sets an upper bound for the solution that can potentially be used by the solver. | |
| void | setBounds (SolutionType const &lower, SolutionType const &upper) |
| Sets bounds for the solution that can potentially be used by the solver. | |
| SolutionType const & | getLowerBound () const |
| Retrieves the lower bound (if there is any). | |
| SolutionType const & | getLowerBound (uint64_t const &index) const |
| Retrieves the lower bound for the variable with the given index (if there is any lower bound). | |
| SolutionType | getLowerBound (bool convertLocalBounds) const |
| Retrieves the lower bound (if there is any). | |
| SolutionType const & | getUpperBound () const |
| Retrieves the upper bound (if there is any). | |
| SolutionType const & | getUpperBound (uint64_t const &index) const |
| Retrieves the upper bound for the variable with the given index (if there is any upper bound). | |
| SolutionType | getUpperBound (bool convertLocalBounds) const |
| Retrieves the upper bound (if there is any). | |
| std::vector< SolutionType > const & | getLowerBounds () const |
| Retrieves a vector containing the lower bounds (if there are any). | |
| std::vector< SolutionType > const & | getUpperBounds () const |
| Retrieves a vector containing the upper bounds (if there are any). | |
| void | setLowerBounds (std::vector< SolutionType > const &values) |
| Sets lower bounds for the solution that can potentially be used by the solver. | |
| void | setLowerBounds (std::vector< SolutionType > &&values) |
| Sets lower bounds for the solution that can potentially be used by the solver. | |
| void | setUpperBounds (std::vector< SolutionType > const &values) |
| Sets upper bounds for the solution that can potentially be used by the solver. | |
| void | setUpperBounds (std::vector< SolutionType > &&values) |
| Sets upper bounds for the solution that can potentially be used by the solver. | |
| void | setBounds (std::vector< SolutionType > const &lower, std::vector< SolutionType > const &upper) |
| Sets bounds for the solution that can potentially be used by the solver. | |
| void | setBoundsFromOtherSolver (AbstractEquationSolver< SolutionType > const &other) |
| void | clearBounds () |
| Removes all specified solution bounds. | |
| bool | hasSolutionLowerBounds () const |
| Retrieves whether the last call to this solver computed a sound lower resp. | |
| bool | hasSolutionUpperBounds () const |
| bool | hasExactSolutionBounds () const |
| Retrieves whether the bounds computed by the last call to this solver coincide. | |
| std::vector< SolutionType > const & | getSolutionLowerBounds () const |
| Retrieves sound bounds on the solution that the last call to this solver computed. | |
| std::vector< SolutionType > const & | getSolutionUpperBounds () const |
| SolutionBounds< SolutionType > const & | getSolutionBounds () const |
| Retrieves both bounds at once, either of which may be unset. | |
| bool | isShowProgressSet () const |
| Retrieves whether progress is to be shown. | |
| uint64_t | getShowProgressDelay () const |
| Retrieves the delay between progress emissions. | |
| void | startMeasureProgress (uint64_t startingIteration=0) const |
| Starts to measure progress. | |
| void | showProgressIterative (uint64_t iterations, boost::optional< uint64_t > const &bound=boost::none) const |
| Shows progress if this solver is asked to do so. | |
Protected Member Functions | |
| TerminationCondition< SolutionType > const & | getTerminationCondition () const |
| Retrieves the custom termination condition (if any was set). | |
| std::unique_ptr< TerminationCondition< SolutionType > > const & | getTerminationConditionPointer () const |
| void | setSolutionBounds (SolutionBounds< SolutionType > bounds) const |
| Stores sound bounds on the solution that were obtained while solving. | |
| void | setSolutionBoundsExact (std::vector< SolutionType > const &x) const |
| Reports the given solution as an exact one, i.e. | |
| void | finalizeSolutionBounds (std::vector< SolutionType > const &x) const |
| Settles the bounds to report once solving is over: the ones handed to this solver beforehand are folded into the ones it computed itself, and both are widened until they enclose the solution that is handed back. | |
| void | clearSolutionBounds () const |
| Discards any bounds on the solution obtained by a previous call. | |
| void | setSolutionBoundsFromPrecision (std::vector< SolutionType > const &x, SolutionType const &precision, bool relative) const |
| Turns a precision that the solving procedure is known to have achieved into sound bounds on the solution, i.e. | |
| void | createUpperBoundsVector (std::vector< SolutionType > &upperBoundsVector) const |
| void | createUpperBoundsVector (std::unique_ptr< std::vector< SolutionType > > &upperBoundsVector, uint64_t length) const |
| void | createLowerBoundsVector (std::vector< SolutionType > &lowerBoundsVector) const |
| void | reportStatus (SolverStatus status, boost::optional< uint64_t > const &iterations=boost::none) const |
| Report the current status of the solver. | |
| SolverStatus | updateStatus (SolverStatus status, std::vector< SolutionType > const &x, SolverGuarantee const &guarantee, uint64_t iterations, uint64_t maximalNumberOfIterations) const |
| Update the status of the solver with respect to convergence, early termination, abortion, etc. | |
| SolverStatus | updateStatus (SolverStatus status, bool earlyTermination, uint64_t iterations, uint64_t maximalNumberOfIterations) const |
| Update the status of the solver with respect to convergence, early termination, abortion, etc. | |
Protected Attributes | |
| std::unique_ptr< TerminationCondition< SolutionType > > | terminationCondition |
| boost::optional< storm::storage::BitVector > | relevantValues |
| boost::optional< SolutionType > | lowerBound |
| boost::optional< SolutionType > | upperBound |
| boost::optional< std::vector< SolutionType > > | lowerBounds |
| boost::optional< std::vector< SolutionType > > | upperBounds |
Definition at line 17 of file AbstractEquationSolver.h.
|
strong |
| Enumerator | |
|---|---|
| Global | |
| Local | |
| Any | |
Definition at line 79 of file AbstractEquationSolver.h.
| storm::solver::AbstractEquationSolver< SolutionType >::AbstractEquationSolver | ( | ) |
Definition at line 16 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::clearBounds | ( | ) |
Removes all specified solution bounds.
Definition at line 348 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::clearRelevantValues | ( | ) |
Removes the values of interest (if there were any).
Definition at line 87 of file AbstractEquationSolver.cpp.
|
protected |
Discards any bounds on the solution obtained by a previous call.
This must happen whenever solving starts, so that a solver that is reused does not report stale bounds.
Definition at line 343 of file AbstractEquationSolver.cpp.
|
protected |
Definition at line 356 of file AbstractEquationSolver.cpp.
|
protected |
Definition at line 378 of file AbstractEquationSolver.cpp.
|
protected |
Definition at line 368 of file AbstractEquationSolver.cpp.
|
protected |
Settles the bounds to report once solving is over: the ones handed to this solver beforehand are folded into the ones it computed itself, and both are widened until they enclose the solution that is handed back.
| x | The computed solution. |
Definition at line 314 of file AbstractEquationSolver.cpp.
| SolutionType const & storm::solver::AbstractEquationSolver< SolutionType >::getLowerBound | ( | ) | const |
Retrieves the lower bound (if there is any).
Definition at line 132 of file AbstractEquationSolver.cpp.
| SolutionType storm::solver::AbstractEquationSolver< SolutionType >::getLowerBound | ( | bool | convertLocalBounds | ) | const |
Retrieves the lower bound (if there is any).
If the given flag is true and if there are only local bounds, the minimum of the local bounds is returned.
Definition at line 152 of file AbstractEquationSolver.cpp.
| SolutionType const & storm::solver::AbstractEquationSolver< SolutionType >::getLowerBound | ( | uint64_t const & | index | ) | const |
Retrieves the lower bound for the variable with the given index (if there is any lower bound).
Definition at line 137 of file AbstractEquationSolver.cpp.
| std::vector< SolutionType > const & storm::solver::AbstractEquationSolver< SolutionType >::getLowerBounds | ( | ) | const |
Retrieves a vector containing the lower bounds (if there are any).
Definition at line 194 of file AbstractEquationSolver.cpp.
| boost::optional< storm::storage::BitVector > const & storm::solver::AbstractEquationSolver< SolutionType >::getOptionalRelevantValues | ( | ) | const |
Definition at line 72 of file AbstractEquationSolver.cpp.
| storm::storage::BitVector const & storm::solver::AbstractEquationSolver< SolutionType >::getRelevantValues | ( | ) | const |
Retrieves the relevant values (if there are any).
Definition at line 67 of file AbstractEquationSolver.cpp.
| uint64_t storm::solver::AbstractEquationSolver< SolutionType >::getShowProgressDelay | ( | ) | const |
Retrieves the delay between progress emissions.
Definition at line 398 of file AbstractEquationSolver.cpp.
| SolutionBounds< SolutionType > const & storm::solver::AbstractEquationSolver< SolutionType >::getSolutionBounds | ( | ) | const |
Retrieves both bounds at once, either of which may be unset.
Definition at line 273 of file AbstractEquationSolver.cpp.
| std::vector< SolutionType > const & storm::solver::AbstractEquationSolver< SolutionType >::getSolutionLowerBounds | ( | ) | const |
Retrieves sound bounds on the solution that the last call to this solver computed.
Definition at line 261 of file AbstractEquationSolver.cpp.
| std::vector< SolutionType > const & storm::solver::AbstractEquationSolver< SolutionType >::getSolutionUpperBounds | ( | ) | const |
Definition at line 267 of file AbstractEquationSolver.cpp.
|
protected |
Retrieves the custom termination condition (if any was set).
Definition at line 43 of file AbstractEquationSolver.cpp.
|
protected |
Definition at line 48 of file AbstractEquationSolver.cpp.
| SolutionType const & storm::solver::AbstractEquationSolver< SolutionType >::getUpperBound | ( | ) | const |
Retrieves the upper bound (if there is any).
Definition at line 163 of file AbstractEquationSolver.cpp.
| SolutionType storm::solver::AbstractEquationSolver< SolutionType >::getUpperBound | ( | bool | convertLocalBounds | ) | const |
Retrieves the upper bound (if there is any).
If the given flag is true and if there are only local bounds, the maximum of the local bounds is returned.
Definition at line 183 of file AbstractEquationSolver.cpp.
| SolutionType const & storm::solver::AbstractEquationSolver< SolutionType >::getUpperBound | ( | uint64_t const & | index | ) | const |
Retrieves the upper bound for the variable with the given index (if there is any upper bound).
Definition at line 168 of file AbstractEquationSolver.cpp.
| std::vector< SolutionType > const & storm::solver::AbstractEquationSolver< SolutionType >::getUpperBounds | ( | ) | const |
Retrieves a vector containing the upper bounds (if there are any).
Definition at line 199 of file AbstractEquationSolver.cpp.
| bool storm::solver::AbstractEquationSolver< SolutionType >::hasCustomTerminationCondition | ( | ) | const |
Retrieves whether a custom termination condition has been set.
Definition at line 38 of file AbstractEquationSolver.cpp.
| bool storm::solver::AbstractEquationSolver< SolutionType >::hasExactSolutionBounds | ( | ) | const |
Retrieves whether the bounds computed by the last call to this solver coincide.
Definition at line 256 of file AbstractEquationSolver.cpp.
| bool storm::solver::AbstractEquationSolver< SolutionType >::hasLowerBound | ( | BoundType const & | type = BoundType::Any | ) | const |
Retrieves whether this solver has a lower bound.
Definition at line 92 of file AbstractEquationSolver.cpp.
| bool storm::solver::AbstractEquationSolver< SolutionType >::hasRelevantValues | ( | ) | const |
Retrieves whether this solver has particularly relevant values.
Definition at line 62 of file AbstractEquationSolver.cpp.
| bool storm::solver::AbstractEquationSolver< SolutionType >::hasSolutionLowerBounds | ( | ) | const |
Retrieves whether the last call to this solver computed a sound lower resp.
upper bound on the solution. Only some algorithms provide these, and they need not provide both.
Definition at line 246 of file AbstractEquationSolver.cpp.
| bool storm::solver::AbstractEquationSolver< SolutionType >::hasSolutionUpperBounds | ( | ) | const |
Definition at line 251 of file AbstractEquationSolver.cpp.
| bool storm::solver::AbstractEquationSolver< SolutionType >::hasUpperBound | ( | BoundType const & | type = BoundType::Any | ) | const |
Retrieves whether this solver has an upper bound.
Definition at line 104 of file AbstractEquationSolver.cpp.
| bool storm::solver::AbstractEquationSolver< SolutionType >::isShowProgressSet | ( | ) | const |
Retrieves whether progress is to be shown.
Definition at line 393 of file AbstractEquationSolver.cpp.
|
protected |
Report the current status of the solver.
| status | Solver status. |
| iterations | Number of iterations (if solver is iterative). |
Definition at line 421 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::resetTerminationCondition | ( | ) |
Removes a previously set custom termination condition.
Definition at line 33 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::setBounds | ( | SolutionType const & | lower, |
| SolutionType const & | upper ) |
Sets bounds for the solution that can potentially be used by the solver.
Definition at line 126 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::setBounds | ( | std::vector< SolutionType > const & | lower, |
| std::vector< SolutionType > const & | upper ) |
Sets bounds for the solution that can potentially be used by the solver.
Definition at line 224 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::setBoundsFromOtherSolver | ( | AbstractEquationSolver< SolutionType > const & | other | ) |
Definition at line 230 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::setLowerBound | ( | SolutionType const & | value | ) |
Sets a lower bound for the solution that can potentially be used by the solver.
Definition at line 116 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::setLowerBounds | ( | std::vector< SolutionType > && | values | ) |
Sets lower bounds for the solution that can potentially be used by the solver.
Definition at line 209 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::setLowerBounds | ( | std::vector< SolutionType > const & | values | ) |
Sets lower bounds for the solution that can potentially be used by the solver.
Definition at line 204 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::setRelevantValues | ( | storm::storage::BitVector && | valuesOfInterest | ) |
Sets the relevant values.
Definition at line 77 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::setRelevantValues | ( | storm::storage::BitVector const & | valuesOfInterest | ) |
Sets the relevant values.
Definition at line 82 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::setShowProgress | ( | bool | verbose, |
| uint64_t | delay = 5 ) |
Configures whether this solver should show progress during iterative solving.
| verbose | If true, progress will be shown. |
| delay | The delay (in seconds) between progress emissions. |
Definition at line 21 of file AbstractEquationSolver.cpp.
|
protected |
Stores sound bounds on the solution that were obtained while solving.
Note that solving is const, so that this is as well.
Definition at line 278 of file AbstractEquationSolver.cpp.
|
protected |
Reports the given solution as an exact one, i.e.
stores it as both the lower and the upper bound.
| x | The computed solution. |
Definition at line 285 of file AbstractEquationSolver.cpp.
|
protected |
Turns a precision that the solving procedure is known to have achieved into sound bounds on the solution, i.e.
stores [x_i - d_i, x_i + d_i] where d_i is the largest deviation from x_i that is still compatible with that precision.
| x | The computed solution. |
| precision | The precision that the computation is guaranteed to have achieved. |
| relative | Whether that precision is to be read relative to the solution instead of as an absolute value. |
Definition at line 292 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::setTerminationCondition | ( | std::unique_ptr< TerminationCondition< SolutionType > > | terminationCondition | ) |
Sets a custom termination condition that is used together with the regular termination condition of the solver.
| terminationCondition | An object that can be queried whether to terminate early or not. |
Definition at line 28 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::setUpperBound | ( | SolutionType const & | value | ) |
Sets an upper bound for the solution that can potentially be used by the solver.
Definition at line 121 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::setUpperBounds | ( | std::vector< SolutionType > && | values | ) |
Sets upper bounds for the solution that can potentially be used by the solver.
Definition at line 219 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::setUpperBounds | ( | std::vector< SolutionType > const & | values | ) |
Sets upper bounds for the solution that can potentially be used by the solver.
Definition at line 214 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::showProgressIterative | ( | uint64_t | iterations, |
| boost::optional< uint64_t > const & | bound = boost::none ) const |
Shows progress if this solver is asked to do so.
Definition at line 411 of file AbstractEquationSolver.cpp.
| void storm::solver::AbstractEquationSolver< SolutionType >::startMeasureProgress | ( | uint64_t | startingIteration = 0 | ) | const |
Starts to measure progress.
Definition at line 404 of file AbstractEquationSolver.cpp.
| bool storm::solver::AbstractEquationSolver< SolutionType >::terminateNow | ( | std::vector< SolutionType > const & | values, |
| SolverGuarantee const & | guarantee ) const |
Checks whether the solver can terminate wrt.
to its termination condition. If no termination condition, this will yield false.
Definition at line 53 of file AbstractEquationSolver.cpp.
|
protected |
Update the status of the solver with respect to convergence, early termination, abortion, etc.
| status | Current status. |
| earlyTermination | Flag indicating if the solver can be terminated early. |
| iterations | Current number of iterations. |
| maximalNumberOfIterations | Maximal number of iterations. |
Definition at line 461 of file AbstractEquationSolver.cpp.
|
protected |
Update the status of the solver with respect to convergence, early termination, abortion, etc.
| status | Current status. |
| x | Vector for terminatation condition. |
| guarantee | Guarentee for termination condition. |
| iterations | Current number of iterations. |
| maximalNumberOfIterations | Maximal number of iterations. |
Definition at line 476 of file AbstractEquationSolver.cpp.
|
protected |
Definition at line 317 of file AbstractEquationSolver.h.
|
protected |
Definition at line 323 of file AbstractEquationSolver.h.
|
protected |
Definition at line 314 of file AbstractEquationSolver.h.
|
protected |
Definition at line 311 of file AbstractEquationSolver.h.
|
protected |
Definition at line 320 of file AbstractEquationSolver.h.
|
protected |
Definition at line 326 of file AbstractEquationSolver.h.