90template<storm::OptimizationDirection Dir,
bool Relative, storm::OptimizationDirection RobustDir,
bool TrackDirection>
92 uint64_t& numIterations, SolutionType
const& precision,
98 std::vector<SolutionType>* operand1{&operand};
99 std::vector<SolutionType>* operand2{&operand};
101 operand2 = &viOperator->allocateAuxiliaryVector(operand.size());
103 bool resultInAuxVector{
false};
107 bool applyResult = viOperator->template applyRobust<RobustDir>(*operand1, *operand2, offsets, backend);
110 }
else if (iterationCallback) {
111 status = iterationCallback(status);
114 std::swap(operand1, operand2);
115 resultInAuxVector = !resultInAuxVector;
119 if (resultInAuxVector) {
121 std::swap(*operand1, *operand2);
123 viOperator->freeAuxiliaryVector();
125 if (!solutionBounds.has_value()) {
128 if constexpr (TrackDirection) {
133 solutionBounds->lower = operand;
136 solutionBounds->upper = operand;
141 solutionBounds->lower = operand;
143 solutionBounds->upper = operand;
151 uint64_t& numIterations, SolutionType
const& precision,
157 bool robustUncertainty =
false;
165 if (robustUncertainty) {
166 if (trackDirection) {
167 return VI<Dir, Relative, invert(Dir), true>(operand, offsets, numIterations, precision, iterationCallback, mult, solutionBounds, guarantee);
169 return VI<Dir, Relative, invert(Dir), false>(operand, offsets, numIterations, precision, iterationCallback, mult, solutionBounds, guarantee);
171 if (trackDirection) {
172 return VI<Dir, Relative, Dir, true>(operand, offsets, numIterations, precision, iterationCallback, mult, solutionBounds, guarantee);
174 return VI<Dir, Relative, Dir, false>(operand, offsets, numIterations, precision, iterationCallback, mult, solutionBounds, guarantee);
180 std::vector<SolutionType>& operand, std::vector<ValueType>
const& offsets, uint64_t& numIterations,
bool relative, SolutionType
const& precision,
185 STORM_LOG_THROW(uncertaintyResolutionMode != UncertaintyResolutionMode::Unset, storm::exceptions::IllegalFunctionCallException,
186 "Uncertainty resolution mode must be set for uncertain (interval) models.");
187 STORM_LOG_THROW(dir.has_value() || (uncertaintyResolutionMode != UncertaintyResolutionMode::Robust &&
188 uncertaintyResolutionMode != UncertaintyResolutionMode::Cooperative),
189 storm::exceptions::IllegalFunctionCallException,
190 "Robust or cooperative nature resolution modes cannot be used if optimization direction is not set.");
193 STORM_LOG_ASSERT(TrivialRowGrouping || dir.has_value(),
"No optimization direction given!");
194 if (!dir.has_value() ||
maximize(*dir)) {
197 uncertaintyResolutionMode, solutionBounds, guarantee);
200 uncertaintyResolutionMode, solutionBounds, guarantee);
205 uncertaintyResolutionMode, solutionBounds, guarantee);
208 uncertaintyResolutionMode, solutionBounds, guarantee);
215 std::vector<SolutionType>& operand, std::vector<ValueType>
const& offsets,
bool relative, SolutionType
const& precision,
219 uint64_t numIterations = 0;
220 return VI(operand, offsets, numIterations, relative, precision, dir, iterationCallback, mult, uncertaintyResolutionMode, solutionBounds, guarantee);
SolverStatus VI(std::vector< SolutionType > &operand, std::vector< ValueType > const &offsets, uint64_t &numIterations, SolutionType const &precision, std::function< SolverStatus(SolverStatus const &)> const &iterationCallback={}, MultiplicationStyle mult=MultiplicationStyle::GaussSeidel, storm::OptionalRef< SolutionBounds< SolutionType > > solutionBounds=storm::NullRef, SolverGuarantee const &guarantee=SolverGuarantee::None) const