15template<
typename ValueType>
22template<
typename ValueType>
27template<
typename ValueType>
32template<
typename ValueType>
37template<
typename ValueType>
42template<
typename ValueType>
47template<
typename ValueType>
56template<
typename ValueType>
61template<
typename ValueType>
66template<
typename ValueType>
71template<
typename ValueType>
76template<
typename ValueType>
81template<
typename ValueType>
86template<
typename ValueType>
98template<
typename ValueType>
110template<
typename ValueType>
115template<
typename ValueType>
120template<
typename ValueType>
126template<
typename ValueType>
131template<
typename ValueType>
146template<
typename ValueType>
150 }
else if (convertLocalBounds) {
153 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"No lower bound available but some was requested.");
157template<
typename ValueType>
162template<
typename ValueType>
177template<
typename ValueType>
181 }
else if (convertLocalBounds) {
184 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"No upper bound available but some was requested.");
188template<
typename ValueType>
193template<
typename ValueType>
198template<
typename ValueType>
203template<
typename ValueType>
208template<
typename ValueType>
213template<
typename ValueType>
218template<
typename ValueType>
224template<
typename ValueType>
240template<
typename ValueType>
248template<
typename ValueType>
254 for (
auto& e : lowerBoundsVector) {
260template<
typename ValueType>
264 upperBoundsVector.assign(upperBoundsVector.size(), this->getUpperBound());
270template<
typename ValueType>
273 if (!upperBoundsVector) {
276 upperBoundsVector = std::make_unique<std::vector<ValueType>>(this->
getUpperBounds());
278 upperBoundsVector = std::make_unique<std::vector<ValueType>>(length, this->
getUpperBound());
285template<
typename ValueType>
287 return this->progressMeasurement.is_initialized();
290template<
typename ValueType>
293 return this->progressMeasurement->getShowProgressDelay();
296template<
typename ValueType>
299 this->progressMeasurement->startNewMeasurement(startingIteration);
303template<
typename ValueType>
307 this->progressMeasurement->setMaxCount(bound.get());
309 this->progressMeasurement->updateProgress(iteration);
313template<
typename ValueType>
318 STORM_LOG_TRACE(
"Iterative solver converged after " << iterations.get() <<
" iterations.");
321 STORM_LOG_TRACE(
"Iterative solver terminated early after " << iterations.get() <<
" iterations.");
324 STORM_LOG_WARN(
"Iterative solver did not converge after " << iterations.get() <<
" iterations.");
327 STORM_LOG_WARN(
"Iterative solver was aborted after " << iterations.get() <<
" iterations.");
330 STORM_LOG_THROW(
false, storm::exceptions::InvalidStateException,
"Iterative solver terminated unexpectedly.");
341 STORM_LOG_ASSERT(
false,
"Non-iterative solver should not exceed maximal number of iterations.");
348 STORM_LOG_THROW(
false, storm::exceptions::InvalidStateException,
"Solver terminated unexpectedly.");
353template<
typename ValueType>
355 uint64_t maximalNumberOfIterations)
const {
357 if (earlyTermination) {
359 }
else if (iterations >= maximalNumberOfIterations) {
368template<
typename ValueType>
370 uint64_t iterations, uint64_t maximalNumberOfIterations)
const {
372 maximalNumberOfIterations);
uint64_t getShowProgressDelay() const
Retrieves the delay between progress emissions.
std::unique_ptr< TerminationCondition< ValueType > > terminationCondition
void clearRelevantValues()
Removes the values of interest (if there were any).
void setUpperBound(ValueType const &value)
Sets an upper bound for the solution that can potentially be used by the solver.
void createLowerBoundsVector(std::vector< ValueType > &lowerBoundsVector) const
std::vector< ValueType > const & getLowerBounds() const
Retrieves a vector containing the lower bounds (if there are any).
bool hasUpperBound(BoundType const &type=BoundType::Any) const
Retrieves whether this solver has an upper bound.
bool hasLowerBound(BoundType const &type=BoundType::Any) const
Retrieves whether this solver has a lower bound.
void showProgressIterative(uint64_t iterations, boost::optional< uint64_t > const &bound=boost::none) const
Shows progress if this solver is asked to do so.
storm::storage::BitVector const & getRelevantValues() const
Retrieves the relevant values (if there are any).
std::unique_ptr< TerminationCondition< ValueType > > const & getTerminationConditionPointer() const
void setLowerBound(ValueType const &value)
Sets a lower bound for the solution that can potentially be used by the solver.
ValueType const & getUpperBound() const
Retrieves the upper bound (if there is any).
boost::optional< ValueType > lowerBound
boost::optional< ValueType > upperBound
void setUpperBounds(std::vector< ValueType > const &values)
Sets upper bounds for the solution that can potentially be used by the solver.
void setRelevantValues(storm::storage::BitVector &&valuesOfInterest)
Sets the relevant values.
bool terminateNow(std::vector< ValueType > const &values, SolverGuarantee const &guarantee) const
Checks whether the solver can terminate wrt.
void setBounds(ValueType const &lower, ValueType const &upper)
Sets bounds for the solution that can potentially be used by the solver.
void startMeasureProgress(uint64_t startingIteration=0) const
Starts to measure progress.
boost::optional< std::vector< ValueType > > upperBounds
void createUpperBoundsVector(std::vector< ValueType > &upperBoundsVector) const
void setBoundsFromOtherSolver(AbstractEquationSolver< ValueType > const &other)
void resetTerminationCondition()
Removes a previously set custom termination condition.
std::vector< ValueType > const & getUpperBounds() const
Retrieves a vector containing the upper bounds (if there are any).
bool isShowProgressSet() const
Retrieves whether progress is to be shown.
void clearBounds()
Removes all specified solution bounds.
TerminationCondition< ValueType > const & getTerminationCondition() const
Retrieves the custom termination condition (if any was set).
bool hasRelevantValues() const
Retrieves whether this solver has particularly relevant values.
bool hasCustomTerminationCondition() const
Retrieves whether a custom termination condition has been set.
boost::optional< std::vector< ValueType > > lowerBounds
boost::optional< storm::storage::BitVector > const & getOptionalRelevantValues() const
ValueType const & getLowerBound() const
Retrieves the lower bound (if there is any).
void setTerminationCondition(std::unique_ptr< TerminationCondition< ValueType > > terminationCondition)
Sets a custom termination condition that is used together with the regular termination condition of t...
SolverStatus updateStatus(SolverStatus status, std::vector< ValueType > 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,...
boost::optional< storm::storage::BitVector > relevantValues
void reportStatus(SolverStatus status, boost::optional< uint64_t > const &iterations=boost::none) const
Report the current status of the solver.
void setLowerBounds(std::vector< ValueType > const &values)
Sets lower bounds for the solution that can potentially be used by the solver.
A bit vector that is internally represented as a vector of 64-bit values.
A class that provides convenience operations to display run times.
#define STORM_LOG_WARN(message)
#define STORM_LOG_TRACE(message)
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
SettingsType const & getModule()
Get module.
@ MaximalIterationsExceeded
bool isTerminate()
Check whether the program should terminate (due to some abort signal).