32template<
typename ValueType>
35 std::unique_ptr<storm::solver::MinMaxLinearEquationSolver<ValueType>>
solver;
44 solver->setHasUniqueSolution(
true);
45 solver->setHasNoEndComponents(
true);
48 solver->setCachingEnabled(
true);
49 solver->setRequirementsChecked(
true);
50 auto req =
solver->getRequirements(env, dir);
52 req.clearUniqueSolution();
56 STORM_LOG_THROW(!req.hasEnabledCriticalRequirement(), storm::exceptions::UncheckedRequirementException,
57 "The solver requirement " << req.getEnabledRequirementsAsString() <<
" has not been checked.");
62template<
typename ValueType>
67 : transitionMatrix(transitionMatrix), exitRateVector(exitRateVector), markovianStates(markovianStates) {
73 std::optional<ValueType>
const& upperTimeBound,
74 boost::optional<storm::storage::BitVector>
const& relevantStates = boost::none) {
85 if (markovianMaybeStates.
empty() || !upperTimeBound) {
87 psiStates,
false,
false)
91 boost::optional<storm::storage::BitVector> relevantMaybeStates;
94 if (!relevantStates->isSubsetOf(markovianStates)) {
96 auto const enhancedRelevantStates =
98 relevantMaybeStates = enhancedRelevantStates % maybeStates;
100 relevantMaybeStates = relevantStates.get() % maybeStates;
102 relevantMarkovianMaybeStates = relevantMaybeStates.
get() & markovianStatesModMaybeStates;
104 relevantMarkovianMaybeStates = markovianStatesModMaybeStates;
107 std::vector<ValueType> bestKnownSolution;
108 if (relevantMaybeStates) {
109 bestKnownSolution.resize(relevantMaybeStates->getNumberOfSetBits());
123 ValueType lambda = *std::max_element(markovianExitRates.begin(), markovianExitRates.end());
128 std::vector<std::pair<uint64_t, ValueType>> markovianToPsiProbabilities = getSparseOneStepProbabilities(markovianMaybeStates, psiStates);
129 for (
auto& entry : markovianToPsiProbabilities) {
130 entry.second *= markovianExitRates[entry.first] / lambda;
134 getUniformizedMarkovianTransitions(markovianExitRates, lambda, maybeStates, markovianMaybeStates);
137 transitionMatrix.
getSubmatrix(
true, probabilisticMaybeStates, probabilisticMaybeStates,
false);
140 transitionMatrix.
getSubmatrix(
true, probabilisticMaybeStates, markovianMaybeStates,
false);
142 std::vector<std::pair<uint64_t, ValueType>> probabilisticToPsiProbabilities = getSparseOneStepProbabilities(probabilisticMaybeStates, psiStates);
153 std::vector<ValueType> nextMarkovianStateValues = std::move(
155 std::vector<ValueType> nextProbabilisticStateValues(probabilisticToProbabilisticTransitions.
getRowGroupCount());
156 std::vector<ValueType> eqSysRhs(probabilisticToProbabilisticTransitions.
getRowCount());
160 uint64_t iteration = 0;
162 bool converged =
false;
163 bool abortedInnerIterations =
false;
169 auto foxGlynnResult =
180 for (
bool computeLowerBound : {
false,
true}) {
181 auto& maybeStatesValues = computeLowerBound ? maybeStatesValuesLower : maybeStatesValuesWeightedUpper;
184 "steps in iteration " + std::to_string(iteration) +
" for " + std::string(computeLowerBound ?
"lower" :
"upper") +
" bounds.",
188 bool firstIteration =
true;
191 for (--k; k >= 0; --k) {
193 if (computeLowerBound) {
195 if (
static_cast<uint64_t
>(k) > foxGlynnResult.right) {
200 uint64_t i = N - 1 - k;
201 if (i > foxGlynnResult.right) {
209 if (firstIteration) {
210 firstIteration =
false;
217 markovianToMaybeMultiplier->multiply(env, maybeStatesValues,
nullptr, nextMarkovianStateValues);
218 for (
auto const& oneStepProb : markovianToPsiProbabilities) {
219 nextMarkovianStateValues[oneStepProb.first] += oneStepProb.second * targetValue;
225 if (computeLowerBound &&
static_cast<uint64_t
>(k) >= foxGlynnResult.left) {
227 "K exceeds left bound.");
228 targetValue += foxGlynnResult.weights[k - foxGlynnResult.left];
232 probabilisticToMarkovianMultiplier->multiply(env, nextMarkovianStateValues,
nullptr, eqSysRhs);
233 for (
auto const& oneStepProb : probabilisticToPsiProbabilities) {
234 eqSysRhs[oneStepProb.first] += oneStepProb.second * targetValue;
237 solver->solveEquations(solverEnv, dir, nextProbabilisticStateValues, eqSysRhs);
247 if (!computeLowerBound) {
249 uint64_t i = N - 1 - k;
250 if (i >= foxGlynnResult.left) {
252 ValueType
const& weight = foxGlynnResult.weights[i - foxGlynnResult.left];
259 abortedInnerIterations =
true;
264 if (computeLowerBound) {
275 converged = checkConvergence(maybeStatesValuesLower, maybeStatesValuesUpper, relevantMarkovianMaybeStates, epsilon, relativePrecision, kappa);
281 if (relevantMaybeStates) {
282 auto currentSolIt = bestKnownSolution.begin();
283 for (uint64_t state : relevantMaybeStates.get()) {
285 *currentSolIt = (maybeStatesValuesLower[state] + maybeStatesValuesUpper[state]) / two;
295 ValueType oldLambda = lambda;
299 if (relativePrecision) {
302 if (relevantMaybeStates) {
305 minValue = *std::min_element(maybeStatesValuesUpper.begin(), maybeStatesValuesUpper.end());
308 kappa = std::min(kappa, minValue);
313 uniformize(markovianToMaybeTransitions, markovianToPsiProbabilities, oldLambda, lambda, markovianStatesModMaybeStates);
320 STORM_LOG_WARN(
"Aborted unif+ in iteration " << iteration <<
".");
330 if (abortedInnerIterations && iteration > 1 && relevantMaybeStates && relevantStates) {
336 "Unexpected number of Markovian maybe states.");
337 auto subStateIt = markovianStatesModMaybeStates.
begin();
338 for (uint64_t markovianState : markovianMaybeStates) {
339 result[markovianState] = (maybeStatesValuesLower[*subStateIt] + maybeStatesValuesUpper[*subStateIt]) / two;
344 uint64_t probSubState = 0;
345 for (uint64_t probabilisticState : probabilisticMaybeStates) {
346 for (
auto const probStateRow : transitionMatrix.getRowGroupIndices(probabilisticState)) {
347 eqSysRhs[probSubState] = transitionMatrix.multiplyRowWithVector(probStateRow, result);
352 solver->solveEquations(solverEnv, dir, nextProbabilisticStateValues, eqSysRhs);
363 bool checkConvergence(std::vector<ValueType>
const& lower, std::vector<ValueType>
const& upper,
storm::storage::BitVector const& relevantValues,
364 ValueType
const& epsilon,
bool relative, ValueType& kappa) {
369 ValueType truncationError = epsilon * kappa;
370 for (uint64_t
const i : relevantValues) {
371 if (lower[i] == upper[i]) {
374 if (lower[i] <= truncationError) {
377 ValueType absDiff = upper[i] - lower[i] + truncationError;
378 ValueType relDiff = absDiff / lower[i];
379 if (relDiff > epsilon) {
387 storm::storage::SparseMatrix<ValueType> getUniformizedMarkovianTransitions(std::vector<ValueType>
const& oldRates, ValueType uniformizationRate,
388 storm::storage::BitVector
const& maybeStates,
389 storm::storage::BitVector
const& markovianMaybeStates) {
394 auto submatrix = transitionMatrix.getSubmatrix(
true, markovianMaybeStates, maybeStates);
395 STORM_LOG_ASSERT(submatrix.getRowCount() == submatrix.getRowGroupCount(),
"Submatrix row count != row group count.");
398 storm::storage::SparseMatrixBuilder<ValueType> builder(submatrix.getRowCount(), submatrix.getColumnCount());
399 auto markovianStateColumns = markovianMaybeStates % maybeStates;
401 for (uint64_t selfloopColumn : markovianStateColumns) {
402 ValueType const& oldExitRate = oldRates[row];
403 bool foundSelfoop =
false;
404 for (
auto const& entry : submatrix.getRow(row)) {
405 if (entry.getColumn() == selfloopColumn) {
407 ValueType newSelfLoop = uniformizationRate - oldExitRate + entry.getValue() * oldExitRate;
408 builder.addNextValue(row, entry.getColumn(), newSelfLoop / uniformizationRate);
410 builder.addNextValue(row, entry.getColumn(), entry.getValue() * oldExitRate / uniformizationRate);
414 ValueType newSelfLoop = uniformizationRate - oldExitRate;
415 builder.addNextValue(row, selfloopColumn, newSelfLoop / uniformizationRate);
419 STORM_LOG_ASSERT(row == submatrix.getRowCount(),
"Row count mismatch for submatrix.");
421 return builder.build();
424 void uniformize(storm::storage::SparseMatrix<ValueType>& matrix, std::vector<std::pair<uint64_t, ValueType>>& oneSteps,
425 std::vector<ValueType>
const& oldRates, ValueType uniformizationRate, storm::storage::BitVector
const& selfloopColumns) {
427 for (uint64_t selfloopColumn : selfloopColumns) {
428 ValueType const& oldExitRate = oldRates[row];
429 if (oldExitRate == uniformizationRate) {
434 for (
auto& v : matrix.
getRow(row)) {
435 if (v.getColumn() == selfloopColumn) {
436 ValueType newSelfLoop = uniformizationRate - oldExitRate + v.getValue() * oldExitRate;
437 v.setValue(newSelfLoop / uniformizationRate);
439 v.setValue(v.getValue() * oldExitRate / uniformizationRate);
445 for (
auto& oneStep : oneSteps) {
446 oneStep.second *= oldRates[oneStep.first] / uniformizationRate;
452 void uniformize(storm::storage::SparseMatrix<ValueType>& matrix, std::vector<std::pair<uint64_t, ValueType>>& oneSteps, ValueType oldUniformizationRate,
453 ValueType newUniformizationRate, storm::storage::BitVector
const& selfloopColumns) {
454 if (oldUniformizationRate != newUniformizationRate) {
455 STORM_LOG_ASSERT(oldUniformizationRate < newUniformizationRate,
"Old uniformization rate must be less than new.");
456 ValueType rateDiff = newUniformizationRate - oldUniformizationRate;
457 ValueType rateFraction = oldUniformizationRate / newUniformizationRate;
459 for (uint64_t selfloopColumn : selfloopColumns) {
460 for (
auto& v : matrix.
getRow(row)) {
461 if (v.getColumn() == selfloopColumn) {
462 ValueType newSelfLoop = rateDiff + v.getValue() * oldUniformizationRate;
463 v.setValue(newSelfLoop / newUniformizationRate);
465 v.setValue(v.getValue() * rateFraction);
471 for (
auto& oneStep : oneSteps) {
472 oneStep.second *= rateFraction;
477 storm::storage::BitVector getProb0States(
OptimizationDirection dir, storm::storage::BitVector
const& phiStates,
478 storm::storage::BitVector
const& psiStates)
const {
479 if (dir == storm::solver::OptimizationDirection::Maximize) {
492 std::vector<std::pair<uint64_t, ValueType>> getSparseOneStepProbabilities(storm::storage::BitVector
const& sourceStateConstraint,
493 storm::storage::BitVector
const& targetStateConstraint)
const {
494 auto denseResult = transitionMatrix.getConstrainedRowGroupSumVector(sourceStateConstraint, targetStateConstraint);
495 std::vector<std::pair<uint64_t, ValueType>> sparseResult;
496 for (uint64_t i = 0;
i < denseResult.size(); ++
i) {
497 auto const& val = denseResult[
i];
499 sparseResult.emplace_back(i, val);
505 storm::storage::SparseMatrix<ValueType>
const& transitionMatrix;
506 std::vector<ValueType>
const& exitRateVector;
507 storm::storage::BitVector
const& markovianStates;
510template<
typename ValueType>
515 std::vector<ValueType>& probabilisticNonGoalValues, ValueType delta, uint64_t numberOfSteps) {
523 bool existProbabilisticStates = !probabilisticNonGoalStates.
empty();
527 if (existProbabilisticStates) {
528 aMarkovianToProbabilistic = transitionMatrix.
getSubmatrix(
true, markovianNonGoalStates, probabilisticNonGoalStates);
529 aProbabilistic = transitionMatrix.
getSubmatrix(
true, probabilisticNonGoalStates, probabilisticNonGoalStates);
530 aProbabilisticToMarkovian = transitionMatrix.
getSubmatrix(
true, probabilisticNonGoalStates, markovianNonGoalStates);
535 uint64_t rowIndex = 0;
536 for (uint64_t state : markovianNonGoalStates) {
537 for (
auto& element : aMarkovian.
getRow(rowIndex)) {
538 ValueType eTerm = std::exp(-exitRates[state] * delta);
539 if (element.getColumn() == rowIndex) {
549 if (existProbabilisticStates) {
551 for (uint64_t state : markovianNonGoalStates) {
552 for (
auto& element : aMarkovianToProbabilistic.
getRow(rowIndex)) {
553 element.setValue((1 - std::exp(-exitRates[state] * delta)) * element.getValue());
560 std::vector<ValueType> bProbabilistic(existProbabilisticStates ? aProbabilistic.
getRowCount() : 0);
564 std::vector<ValueType> bProbabilisticFixed;
565 if (existProbabilisticStates) {
568 std::vector<ValueType> bMarkovianFixed;
570 for (uint64_t state : markovianNonGoalStates) {
573 for (
auto& element : transitionMatrix.
getRowGroup(state)) {
574 if (goalStates.
get(element.getColumn())) {
575 bMarkovianFixed.back() += (1 - std::exp(-exitRates[state] * delta)) * element.getValue();
581 auto solverEnv = env;
591 std::vector<ValueType> markovianNonGoalValuesSwap(markovianNonGoalValues);
592 for (uint64_t currentStep = 0; currentStep < numberOfSteps; ++currentStep) {
593 if (existProbabilisticStates) {
600 solver->solveEquations(solverEnv, dir, probabilisticNonGoalValues, bProbabilistic);
611 std::swap(markovianNonGoalValues, markovianNonGoalValuesSwap);
612 if (existProbabilisticStates) {
622 if (existProbabilisticStates) {
627 solver->solveEquations(solverEnv, dir, probabilisticNonGoalValues, bProbabilistic);
634template<
typename ValueType>
639 std::pair<
double, std::optional<double>>
const& boundsPair) {
640 STORM_LOG_TRACE(
"Using IMCA's technique to compute bounded until probabilities.");
645 STORM_LOG_THROW(boundsPair.second.has_value(), storm::exceptions::NotSupportedException,
646 "IMCA's technique requires an upper time bound, but the given property has none.");
647 double lowerBound = boundsPair.first;
648 double upperBound = *boundsPair.second;
651 ValueType maxExitRate = 0;
652 for (
auto value : exitRateVector) {
653 maxExitRate = std::max(maxExitRate, value);
658 uint64_t numberOfSteps =
static_cast<uint64_t
>(std::ceil((upperBound - lowerBound) / delta));
659 STORM_LOG_INFO(
"Performing " << numberOfSteps <<
" iterations (delta=" << delta <<
") for interval [" << lowerBound <<
", " << upperBound <<
"].\n");
666 std::vector<ValueType> vProbabilistic(probabilisticNonGoalStates.
getNumberOfSetBits());
670 vMarkovian, vProbabilistic, delta, numberOfSteps);
674 std::vector<ValueType> vAllProbabilistic((~markovianStates).getNumberOfSetBits());
684 numberOfSteps =
static_cast<uint64_t
>(std::ceil(lowerBound / delta));
685 STORM_LOG_INFO(
"Performing " << numberOfSteps <<
" iterations (delta=" << delta <<
") for interval [0, " << lowerBound <<
"].\n");
689 ~markovianStates, vAllMarkovian, vAllProbabilistic, delta, numberOfSteps);
699 std::vector<ValueType> result(numberOfStates);
707template<typename ValueType, typename std::enable_if<storm::NumberTraits<ValueType>::SupportsExponential,
int>::type>
713 "Exact computations not possible for bounded until probabilities.");
717 if (method == storm::solver::MaBoundedReachabilityMethod::Imca) {
718 if (!phiStates.
full()) {
719 STORM_LOG_WARN(
"Using Unif+ method because IMCA method does not support (phi Until psi) for non-trivial phi");
720 method = storm::solver::MaBoundedReachabilityMethod::UnifPlus;
723 STORM_LOG_ASSERT(method == storm::solver::MaBoundedReachabilityMethod::UnifPlus,
"Unknown solution method.");
725 STORM_LOG_WARN(
"Using IMCA method because Unif+ does not support a lower bound > 0.");
726 method = storm::solver::MaBoundedReachabilityMethod::Imca;
730 if (method == storm::solver::MaBoundedReachabilityMethod::Imca) {
734 boost::optional<storm::storage::BitVector> relevantValues;
735 if (goal.hasRelevantValues()) {
736 relevantValues = std::move(goal.relevantValues());
738 return helper.computeBoundedUntilProbabilities(env, goal.direction(), phiStates, psiStates, boundsPair.second, relevantValues);
742template<typename ValueType, typename std::enable_if<!storm::NumberTraits<ValueType>::SupportsExponential,
int>::type>
747 std::pair<
double, std::optional<double>>
const&) {
748 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Computing bounded until probabilities is unsupported for this value type.");
751template<
typename ValueType>
755 bool qualitative,
bool produceScheduler) {
757 psiStates, qualitative, produceScheduler);
760template<
typename ValueType,
typename RewardModelType>
767 for (uint64_t markovianState : markovianStates) {
770 std::vector<ValueType> totalRewardVector = rewardModel.getTotalActionRewardVector(transitionMatrix, stateRewardWeights);
771 RewardModelType scaledRewardModel(std::nullopt, std::move(totalRewardVector));
776template<
typename ValueType,
typename RewardModelType>
783 for (uint64_t markovianState : markovianStates) {
786 std::vector<ValueType> totalRewardVector = rewardModel.getTotalActionRewardVector(transitionMatrix, stateRewardWeights);
787 RewardModelType scaledRewardModel(std::nullopt, std::move(totalRewardVector));
793template<
typename ValueType>
800 for (uint64_t markovianState : markovianStates) {
817 bool qualitative,
bool produceScheduler);
849 std::vector<storm::RationalNumber>
const& exitRateVector,
858 bool produceScheduler);
SolverEnvironment & solver()
void setMethod(storm::solver::MinMaxMethod value, bool isSetFromDefault=false)
MinMaxSolverEnvironment & minMax()
uint64_t getShowProgressDelay() const
bool isForceExact() const
TimeBoundedSolverEnvironment & timeBounded()
void setForceExact(bool value)
bool const & getRelativeTerminationCriterion() const
storm::RationalNumber const & getPrecision() const
storm::RationalNumber const & getUnifPlusKappa() const
storm::solver::MaBoundedReachabilityMethod const & getMaMethod() const
static std::vector< ValueType > computeBoundedUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, std::pair< double, std::optional< double > > const &boundsPair)
static MDPSparseModelCheckingHelperReturnType< ValueType > computeUntilProbabilities(Environment const &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool qualitative, bool produceScheduler)
static MDPSparseModelCheckingHelperReturnType< ValueType, storm::utility::ExtendedValueType< ValueType > > computeTotalRewards(Environment const &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates, RewardModelType const &rewardModel, bool produceScheduler)
static MDPSparseModelCheckingHelperReturnType< ValueType, storm::utility::ExtendedValueType< ValueType > > computeReachabilityTimes(Environment const &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates, storm::storage::BitVector const &psiStates, bool produceScheduler)
static MDPSparseModelCheckingHelperReturnType< ValueType, storm::utility::ExtendedValueType< ValueType > > computeReachabilityRewards(Environment const &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates, RewardModelType const &rewardModel, storm::storage::BitVector const &psiStates, bool produceScheduler)
static ExtendedReturnType computeReachabilityRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, RewardModelType const &rewardModel, storm::storage::BitVector const &targetStates, bool qualitative, bool produceScheduler, ModelCheckerHint const &hint=ModelCheckerHint())
static ExtendedReturnType computeTotalRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, RewardModelType const &rewardModel, bool qualitative, bool produceScheduler, ModelCheckerHint const &hint=ModelCheckerHint())
static MDPSparseModelCheckingHelperReturnType< SolutionType > computeUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool qualitative, bool produceScheduler, ModelCheckerHint const &hint=ModelCheckerHint())
std::vector< ValueType > computeBoundedUntilProbabilities(storm::Environment const &env, OptimizationDirection dir, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, std::optional< ValueType > const &upperTimeBound, boost::optional< storm::storage::BitVector > const &relevantStates=boost::none)
UnifPlusHelper(storm::storage::SparseMatrix< ValueType > const &transitionMatrix, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates)
virtual std::unique_ptr< MinMaxLinearEquationSolver< ValueType, SolutionType > > create(Environment const &env) const override
std::unique_ptr< Multiplier< ValueType, SolutionType > > create(Environment const &env, storm::storage::SparseMatrix< ValueType > const &matrix)
A bit vector that is internally represented as a vector of 64-bit values.
bool full() const
Retrieves whether all bits are set in this bit vector.
bool empty() const
Retrieves whether no bits are set to true in this bit vector.
uint64_t getNumberOfSetBits() const
Returns the number of bits that are set to true in this bit vector.
const_iterator begin() const
Returns an iterator to the indices of the set bits in the bit vector.
size_t size() const
Retrieves the number of bits this bit vector can store.
bool get(uint64_t index) const
Retrieves the truth value of the bit at the given index and performs a bound check.
A class that holds a possibly non-square matrix in the compressed row storage format.
const_rows getRow(index_type row) const
Returns an object representing the given row.
void multiplyWithVector(std::vector< value_type > const &vector, std::vector< value_type > &result, std::vector< value_type > const *summand=nullptr) const
Multiplies the matrix with the given vector and writes the result to the given result vector.
SparseMatrix getSubmatrix(bool useGroups, storm::storage::BitVector const &rowConstraint, storm::storage::BitVector const &columnConstraint, bool insertDiagonalEntries=false, storm::storage::BitVector const &makeZeroColumns=storm::storage::BitVector()) const
Creates a submatrix of the current matrix by dropping all rows and columns whose bits are not set to ...
const_rows getRowGroup(index_type rowGroup) const
Returns an object representing the given row group.
index_type getRowGroupCount() const
Returns the number of row groups in the matrix.
std::vector< index_type > const & getRowGroupIndices() const
Returns the grouping of rows of this matrix.
std::vector< value_type > getConstrainedRowGroupSumVector(storm::storage::BitVector const &rowGroupConstraint, storm::storage::BitVector const &columnConstraint) const
Computes a vector whose entries represent the sums of selected columns for all rows in selected row g...
index_type getRowCount() const
Returns the number of rows of the matrix.
index_type getNonzeroEntryCount() const
Returns the cached number of nonzero entries in the matrix.
A class that provides convenience operations to display run times.
bool updateProgress(uint64_t count)
Updates the progress to the current count and logs it (on the progress log channel) if the delay pass...
void setMaxCount(uint64_t maxCount)
Sets the maximal possible count.
void startNewMeasurement(uint64_t startCount)
Starts a new measurement, dropping all progress information collected so far.
#define STORM_LOG_INFO(message)
#define STORM_LOG_WARN(message)
#define STORM_LOG_DEBUG(message)
#define STORM_LOG_TRACE(message)
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
SFTBDDChecker::ValueType ValueType
void computeBoundedReachabilityProbabilitiesImca(Environment const &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, std::vector< ValueType > const &exitRates, storm::storage::BitVector const &goalStates, storm::storage::BitVector const &markovianNonGoalStates, storm::storage::BitVector const &probabilisticNonGoalStates, std::vector< ValueType > &markovianNonGoalValues, std::vector< ValueType > &probabilisticNonGoalValues, ValueType delta, uint64_t numberOfSteps)
std::unique_ptr< storm::solver::MinMaxLinearEquationSolver< ValueType > > setUpProbabilisticStatesSolver(storm::Environment &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitions)
std::vector< ValueType > computeBoundedUntilProbabilitiesImca(Environment const &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates, storm::storage::BitVector const &psiStates, std::pair< double, std::optional< double > > const &boundsPair)
storm::storage::BitVector getReachableStates(storm::storage::SparseMatrix< T > const &transitionMatrix, storm::storage::BitVector const &initialStates, storm::storage::BitVector const &constraintStates, storm::storage::BitVector const &targetStates, bool useStepBound, uint_fast64_t maximalSteps, boost::optional< storm::storage::BitVector > const &choiceFilter)
Performs a forward depth-first search through the underlying graph structure to identify the states t...
bool hasCycle(storm::storage::SparseMatrix< T > const &transitionMatrix, boost::optional< storm::storage::BitVector > const &subsystem)
Returns true if the graph represented by the given matrix has a cycle.
storm::storage::BitVector performProb0A(storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates)
storm::storage::BitVector performProb0E(storm::models::sparse::NondeterministicModel< T, RM > const &model, storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates)
Computes the sets of states that have probability 0 of satisfying phi until psi under at least one po...
FoxGlynnResult< ValueType > foxGlynn(ValueType lambda, ValueType epsilon)
bool isTerminate()
Check whether the program should terminate (due to some abort signal).
VT min_if(std::vector< VT > const &values, storm::storage::BitVector const &filter)
Computes the minimum of the entries from the values that are selected by the (non-empty) filter.
void addVectors(std::vector< InValueType1 > const &firstOperand, std::vector< InValueType2 > const &secondOperand, std::vector< OutValueType > &target)
Adds the two given vectors and writes the result to the target vector.
void setVectorValues(std::vector< T > &vector, storm::storage::BitVector const &positions, std::vector< S > const &values)
Sets the provided values at the provided positions in the given vector.
bool equalModuloPrecision(T const &val1, T const &val2, T const &precision, bool relativeError=true)
Compares the given elements and determines whether they are equal modulo the given precision.
void reduceVectorMinOrMax(storm::solver::OptimizationDirection dir, std::vector< T > const &source, std::vector< T > &target, std::vector< uint_fast64_t > const &rowGrouping, std::vector< uint_fast64_t > *choices=nullptr)
Reduces the given source vector by selecting either the smallest or the largest out of each row group...
void addScaledVector(std::vector< InValueType1 > &firstOperand, std::vector< InValueType2 > const &secondOperand, InValueType3 const &factor)
Computes x:= x + a*y, i.e., adds each element of the first vector and (the corresponding element of t...
void scaleVectorInPlace(std::vector< ValueType1 > &target, ValueType2 const &factor)
Multiplies each element of the given vector with the given factor and writes the result into the vect...
bool hasNonZeroEntry(std::vector< T > const &v)
std::vector< Type > filterVector(std::vector< Type > const &in, storm::storage::BitVector const &filter)
bool isZero(ValueType const &a)
ValueType ceil(ValueType const &number)
ValueType log(ValueType const &number)
TargetType convertNumber(SourceType const &number)
solver::OptimizationDirection OptimizationDirection