32namespace modelchecker {
35template<
typename ValueType>
37 std::vector<ValueType>
const& resultVector,
47 ValueType newEpsilon = epsilon;
49 for (
auto state : relevantPositions) {
51 newEpsilon = std::min(epsilon * storm::utility::convertNumber<ValueType>(0.1), newEpsilon);
53 ValueType relativeError = epsilon / resultVector[state];
54 if (relativeError > precision) {
55 newEpsilon = std::min(resultVector[state] * precision, newEpsilon);
59 if (newEpsilon < epsilon) {
60 STORM_LOG_INFO(
"Re-computing transient probabilities with new truncation error " << newEpsilon
61 <<
" to guarantee sound results with relative precision.");
69template<typename ValueType, typename std::enable_if<storm::NumberTraits<ValueType>::SupportsExponential,
int>::type>
73 std::vector<ValueType>
const& exitRates,
bool qualitative,
double lowerBound,
double upperBound) {
75 "Exact computations not possible for bounded until probabilities.");
77 uint_fast64_t numberOfStates = rateMatrix.
getRowCount();
81 return computeUntilProbabilities(env, std::move(goal), rateMatrix, backwardTransitions, exitRates, phiStates, psiStates, qualitative);
88 std::vector<ValueType> result;
102 if (goal.hasRelevantValues()) {
103 relevantValues = std::move(goal.relevantValues());
104 relevantValues &= statesWithProbabilityGreater0;
106 relevantValues = statesWithProbabilityGreater0;
110 if (!statesWithProbabilityGreater0.
empty()) {
113 result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
114 storm::utility::vector::setVectorValues<ValueType>(result, psiStates, storm::utility::one<ValueType>());
120 result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
121 storm::utility::vector::setVectorValues<ValueType>(result, psiStates, storm::utility::one<ValueType>());
122 if (!statesWithProbabilityGreater0NonPsi.
empty()) {
124 ValueType uniformizationRate = 0;
125 for (
auto state : statesWithProbabilityGreater0NonPsi) {
126 uniformizationRate = std::max(uniformizationRate, exitRates[state]);
128 uniformizationRate *= 1.02;
129 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
137 for (
auto& element : b) {
138 element /= uniformizationRate;
142 std::vector<ValueType> values(statesWithProbabilityGreater0NonPsi.
getNumberOfSetBits(), storm::utility::zero<ValueType>());
143 std::vector<ValueType> subresult =
147 }
else if (upperBound == storm::utility::infinity<ValueType>()) {
153 psiStates, qualitative);
160 ValueType uniformizationRate = 0;
161 for (
auto state : relevantStates) {
162 uniformizationRate = std::max(uniformizationRate, exitRates[state]);
164 uniformizationRate *= 1.02;
165 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
172 subResult = computeTransientProbabilities<ValueType>(env, uniformizedMatrix,
nullptr, lowerBound, uniformizationRate, subResult, epsilon);
180 if (lowerBound != upperBound) {
184 std::vector<ValueType> newSubresult(relevantStates.
getNumberOfSetBits(), storm::utility::zero<ValueType>());
186 if (!statesWithProbabilityGreater0NonPsi.
empty()) {
188 ValueType uniformizationRate = storm::utility::zero<ValueType>();
189 for (
auto state : statesWithProbabilityGreater0NonPsi) {
190 uniformizationRate = std::max(uniformizationRate, exitRates[state]);
192 uniformizationRate *= 1.02;
193 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
201 for (
auto& element : b) {
202 element /= uniformizationRate;
206 std::vector<ValueType> values(statesWithProbabilityGreater0NonPsi.
getNumberOfSetBits(), storm::utility::zero<ValueType>());
208 std::vector<ValueType> subresult =
210 epsilon / storm::utility::convertNumber<ValueType>(2.0));
216 ValueType uniformizationRate = storm::utility::zero<ValueType>();
217 for (
auto state : relevantStates) {
218 uniformizationRate = std::max(uniformizationRate, exitRates[state]);
220 uniformizationRate *= 1.02;
221 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
226 newSubresult = computeTransientProbabilities<ValueType>(env, uniformizedMatrix,
nullptr, lowerBound, uniformizationRate, newSubresult,
227 epsilon / storm::utility::convertNumber<ValueType>(2.0));
230 result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
236 std::vector<ValueType> newSubresult = std::vector<ValueType>(statesWithProbabilityGreater0.
getNumberOfSetBits());
241 ValueType uniformizationRate = storm::utility::zero<ValueType>();
242 for (
auto state : statesWithProbabilityGreater0) {
243 uniformizationRate = std::max(uniformizationRate, exitRates[state]);
245 uniformizationRate *= 1.02;
246 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
252 computeTransientProbabilities<ValueType>(env, uniformizedMatrix,
nullptr, lowerBound, uniformizationRate, newSubresult, epsilon);
255 result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
262 result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
268template<typename ValueType, typename std::enable_if<!storm::NumberTraits<ValueType>::SupportsExponential,
int>::type>
274 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Computing bounded until probabilities is unsupported for this value type.");
277template<
typename ValueType>
284 backwardTransitions, phiStates, psiStates, qualitative);
287template<
typename ValueType>
290 std::vector<ValueType>
const& exitRateVector,
295 initialStates, phiStates, psiStates);
298template<
typename ValueType>
300 std::vector<ValueType>
const& exitRateVector,
305template<typename ValueType, typename RewardModelType, typename std::enable_if<storm::NumberTraits<ValueType>::SupportsExponential,
int>::type>
308 std::vector<ValueType>
const& exitRateVector, RewardModelType
const& rewardModel,
311 STORM_LOG_THROW(rewardModel.hasStateRewards(), storm::exceptions::InvalidPropertyException,
312 "Computing instantaneous rewards for a reward model that does not define any state-rewards. The result is trivially 0.");
314 uint_fast64_t numberOfStates = rateMatrix.
getRowCount();
317 std::vector<ValueType> result(rewardModel.getStateRewardVector());
330 ValueType uniformizationRate = 0;
331 for (
auto const& rate : exitRateVector) {
332 uniformizationRate = std::max(uniformizationRate, rate);
334 uniformizationRate *= 1.02;
335 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
344 epsilon *= std::min(storm::utility::one<ValueType>(), maxValue);
347 epsilon /= std::max(storm::utility::one<ValueType>(), maxValue);
351 if (goal.hasRelevantValues()) {
352 relevantValues = std::move(goal.relevantValues());
359 result = computeTransientProbabilities<ValueType>(env, uniformizedMatrix,
nullptr, timeBound, uniformizationRate, result, epsilon);
365template<typename ValueType, typename RewardModelType, typename std::enable_if<!storm::NumberTraits<ValueType>::SupportsExponential,
int>::type>
368 RewardModelType
const&,
double) {
369 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Computing instantaneous rewards is unsupported for this value type.");
372template<typename ValueType, typename RewardModelType, typename std::enable_if<storm::NumberTraits<ValueType>::SupportsExponential,
int>::type>
375 std::vector<ValueType>
const& exitRateVector, RewardModelType
const& rewardModel,
378 "Exact computations not possible for cumulative expected rewards.");
381 STORM_LOG_THROW(!rewardModel.empty(), storm::exceptions::InvalidPropertyException,
"Missing reward model for formula. Skipping formula.");
383 uint_fast64_t numberOfStates = rateMatrix.
getRowCount();
386 if (timeBound == 0) {
387 return std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
393 ValueType uniformizationRate = 0;
394 for (
auto const& rate : exitRateVector) {
395 uniformizationRate = std::max(uniformizationRate, rate);
397 uniformizationRate *= 1.02;
398 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
404 std::vector<ValueType> totalRewardVector = rewardModel.getTotalRewardVector(rateMatrix, exitRateVector);
409 return std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
416 epsilon *= std::min(storm::utility::one<ValueType>(), maxReward);
419 epsilon /= std::max(storm::utility::one<ValueType>(), maxReward * timeBound);
423 if (goal.hasRelevantValues()) {
424 relevantValues = std::move(goal.relevantValues());
430 std::vector<ValueType> result;
432 result = computeTransientProbabilities<ValueType, true>(env, uniformizedMatrix,
nullptr, timeBound, uniformizationRate, totalRewardVector, epsilon);
438template<typename ValueType, typename RewardModelType, typename std::enable_if<!storm::NumberTraits<ValueType>::SupportsExponential,
int>::type>
441 RewardModelType
const&,
double) {
442 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Computing cumulative rewards is unsupported for this value type.");
445template<
typename ValueType>
449 std::vector<ValueType>
const& exitRateVector,
455 std::vector<ValueType> totalRewardVector;
456 for (
size_t i = 0; i < exitRateVector.size(); ++i) {
459 totalRewardVector.push_back(storm::utility::zero<ValueType>());
462 totalRewardVector.push_back(storm::utility::one<ValueType>() / exitRateVector[i]);
467 env, std::move(goal), probabilityMatrix, backwardTransitions, totalRewardVector, targetStates, qualitative);
470template<
typename ValueType,
typename RewardModelType>
474 std::vector<ValueType>
const& exitRateVector, RewardModelType
const& rewardModel,
476 STORM_LOG_THROW(!rewardModel.empty(), storm::exceptions::InvalidPropertyException,
"Missing reward model for formula. Skipping formula.");
480 std::vector<ValueType> totalRewardVector;
481 if (rewardModel.hasStateRewards()) {
482 totalRewardVector = rewardModel.getStateRewardVector();
483 typename std::vector<ValueType>::const_iterator it2 = exitRateVector.begin();
484 for (
typename std::vector<ValueType>::iterator it1 = totalRewardVector.begin(), ite1 = totalRewardVector.end(); it1 != ite1; ++it1, ++it2) {
487 if (rewardModel.hasStateActionRewards()) {
490 if (rewardModel.hasTransitionRewards()) {
494 }
else if (rewardModel.hasTransitionRewards()) {
496 if (rewardModel.hasStateActionRewards()) {
500 totalRewardVector = rewardModel.getStateActionRewardVector();
504 env, std::move(goal), probabilityMatrix, backwardTransitions, totalRewardVector, targetStates, qualitative);
507template<
typename ValueType,
typename RewardModelType>
511 std::vector<ValueType>
const& exitRateVector, RewardModelType
const& rewardModel,
513 STORM_LOG_THROW(!rewardModel.empty(), storm::exceptions::InvalidPropertyException,
"Missing reward model for formula. Skipping formula.");
517 std::vector<ValueType> totalRewardVector;
518 if (rewardModel.hasStateRewards()) {
519 totalRewardVector = rewardModel.getStateRewardVector();
520 typename std::vector<ValueType>::const_iterator it2 = exitRateVector.begin();
521 for (
typename std::vector<ValueType>::iterator it1 = totalRewardVector.begin(), ite1 = totalRewardVector.end(); it1 != ite1; ++it1, ++it2) {
524 if (rewardModel.hasStateActionRewards()) {
527 if (rewardModel.hasTransitionRewards()) {
531 }
else if (rewardModel.hasTransitionRewards()) {
533 if (rewardModel.hasStateActionRewards()) {
537 totalRewardVector = rewardModel.getStateActionRewardVector();
540 RewardModelType dtmcRewardModel(std::move(totalRewardVector));
542 dtmcRewardModel, qualitative);
545template<typename ValueType, typename std::enable_if<storm::NumberTraits<ValueType>::SupportsExponential,
int>::type>
550 std::vector<ValueType>
const& exitRates,
double timeBound) {
553 uint_fast64_t numberOfStates = rateMatrix.
getRowCount();
556 std::vector<ValueType> result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
560 std::vector<ValueType> newRates = exitRates;
561 for (
auto state : psiStates) {
562 newRates[state] = storm::utility::one<ValueType>();
573 if (!relevantStates.
empty()) {
575 ValueType uniformizationRate = 0;
576 for (
auto state : relevantStates) {
577 uniformizationRate = std::max(uniformizationRate, newRates[state]);
579 uniformizationRate *= 1.02;
580 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
582 transposedMatrix = transposedMatrix.
transpose();
596 "Computation of transient probabilities with relative precision not supported. Using absolute precision instead.");
597 std::vector<ValueType> values(relevantStates.
getNumberOfSetBits(), storm::utility::zero<ValueType>());
600 ValueType initDist = storm::utility::one<ValueType>() / initialStates.
getNumberOfSetBits();
601 for (
auto state : relevantStates) {
602 if (initialStates.
get(state)) {
603 values[i] = initDist;
608 std::vector<ValueType> subresult =
609 computeTransientProbabilities<ValueType>(env, uniformizedMatrix,
nullptr, timeBound, uniformizationRate, values, epsilon);
617template<typename ValueType, typename std::enable_if<!storm::NumberTraits<ValueType>::SupportsExponential,
int>::type>
621 STORM_LOG_THROW(
false, storm::exceptions::InvalidOperationException,
"Computing bounded until probabilities is unsupported for this value type.");
624template<typename ValueType, typename std::enable_if<storm::NumberTraits<ValueType>::SupportsExponential,
int>::type>
627 ValueType uniformizationRate, std::vector<ValueType>
const& exitRates) {
628 STORM_LOG_DEBUG(
"Computing uniformized matrix using uniformization rate " << uniformizationRate <<
".");
638 uint_fast64_t currentRow = 0;
639 for (
auto state : maybeStates) {
640 for (
auto& element : uniformizedMatrix.
getRow(currentRow)) {
641 if (element.getColumn() == currentRow) {
642 element.setValue((element.getValue() - exitRates[state]) / uniformizationRate + storm::utility::one<ValueType>());
644 element.setValue(element.getValue() / uniformizationRate);
650 return uniformizedMatrix;
653template<typename ValueType, bool useMixedPoissonProbabilities, typename std::enable_if<storm::NumberTraits<ValueType>::SupportsExponential,
int>::type>
656 std::vector<ValueType>
const* addVector, ValueType timeBound,
657 ValueType uniformizationRate, std::vector<ValueType> values, ValueType epsilon) {
659 "Very low truncation error " << epsilon <<
" requested. Numerical inaccuracies are possible.");
660 ValueType lambda = timeBound * uniformizationRate;
673 if (useMixedPoissonProbabilities) {
679 uint64_t l{0ull}, r{foxGlynnResult.
weights.size()};
680 ValueType sumLeft{storm::utility::zero<ValueType>()}, sumRight{storm::utility::zero<ValueType>()};
683 sumLeft += foxGlynnResult.
weights[l];
684 foxGlynnResult.
weights[l] = (foxGlynnResult.
totalWeight - sumLeft) / uniformizationRate;
688 auto const tmp = foxGlynnResult.
weights[r];
689 foxGlynnResult.
weights[r] = sumRight / uniformizationRate;
693 auto const relDiff = storm::utility::abs<ValueType>(foxGlynnResult.
totalWeight - (sumLeft + sumRight)) / foxGlynnResult.
totalWeight;
695 "Numerical instability when adjusting the FoxGlynn weights. Relative Difference: " << relDiff <<
".");
701 std::vector<ValueType> result;
702 uint_fast64_t startingIteration = foxGlynnResult.
left;
703 if (startingIteration == 0) {
708 if (useMixedPoissonProbabilities) {
709 result = std::vector<ValueType>(values.size());
710 std::function<ValueType(ValueType
const&)> scaleWithUniformizationRate = [&uniformizationRate](ValueType
const& a) -> ValueType {
711 return a / uniformizationRate;
715 result = std::vector<ValueType>(values.size());
720 if (!useMixedPoissonProbabilities && foxGlynnResult.
left > 1) {
722 multiplier->repeatedMultiply(env, values, addVector, foxGlynnResult.
left - 1);
723 }
else if (useMixedPoissonProbabilities) {
724 std::function<ValueType(ValueType
const&, ValueType
const&)> addAndScale = [&uniformizationRate](ValueType
const& a, ValueType
const& b) {
725 return a + b / uniformizationRate;
729 for (uint_fast64_t index = 1; index < startingIteration; ++index) {
730 multiplier->multiply(env, values,
nullptr, values);
736 if (foxGlynnResult.
left > 0) {
737 storm::utility::vector::scaleVectorInPlace<ValueType, ValueType>(result, foxGlynnResult.
totalWeight);
743 ValueType weight = 0;
744 std::function<ValueType(ValueType
const&, ValueType
const&)> addAndScale = [&weight](ValueType
const& a, ValueType
const& b) {
return a + weight * b; };
745 for (uint_fast64_t index = startingIteration; index <= foxGlynnResult.
right; ++index) {
746 multiplier->multiply(env, values, addVector, values);
748 weight = foxGlynnResult.
weights[index - foxGlynnResult.
left];
753 storm::utility::vector::scaleVectorInPlace<ValueType, ValueType>(result, storm::utility::one<ValueType>() / foxGlynnResult.
totalWeight);
757template<
typename ValueType>
759 std::vector<ValueType>
const& exitRates) {
762 for (uint_fast64_t row = 0; row < result.
getRowCount(); ++row) {
763 for (
auto& entry : result.
getRow(row)) {
764 entry.setValue(entry.getValue() / exitRates[row]);
770template<
typename ValueType>
772 std::vector<ValueType>
const& exitRates) {
776 for (uint_fast64_t row = 0; row < generatorMatrix.
getRowCount(); ++row) {
777 for (
auto& entry : generatorMatrix.
getRow(row)) {
778 if (entry.getColumn() == row) {
779 entry.setValue(-exitRates[row] + entry.getValue());
784 return generatorMatrix;
790 std::vector<double>
const& exitRates,
bool qualitative,
double lowerBound,
double upperBound);
795 std::vector<double>
const& exitRateVector,
801 std::vector<double>
const& exitRateVector,
807 std::vector<double>
const& exitRateVector,
812 std::vector<double>
const& exitRateVector,
819 std::vector<double>
const& exitRateVector,
825 std::vector<double>
const& exitRateVector,
832 std::vector<double>
const& exitRateVector,
837 std::vector<double>
const& exitRateVector,
847 double uniformizationRate, std::vector<double>
const& exitRates);
851 std::vector<double>
const* addVector,
double timeBound,
852 double uniformizationRate, std::vector<double> values,
double epsilon);
854#ifdef STORM_HAVE_CARL
858 storm::storage::BitVector const& psiStates, std::vector<storm::RationalNumber>
const& exitRates,
bool qualitative,
double lowerBound,
double upperBound);
862 storm::storage::BitVector const& psiStates, std::vector<storm::RationalFunction>
const& exitRates,
bool qualitative,
double lowerBound,
double upperBound);
884 std::vector<storm::RationalNumber>
const& exitRateVector,
945 std::vector<double>
const& exitRates);
SolverEnvironment & solver()
bool isForceExact() const
TimeBoundedSolverEnvironment & timeBounded()
bool isForceSoundness() const
bool const & getRelativeTerminationCriterion() const
storm::RationalNumber const & getPrecision() const
static storm::storage::SparseMatrix< ValueType > computeGeneratorMatrix(storm::storage::SparseMatrix< ValueType > const &rateMatrix, std::vector< ValueType > const &exitRates)
Converts the given rate-matrix into the generator matrix.
static std::vector< ValueType > computeCumulativeRewards(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &rateMatrix, std::vector< ValueType > const &exitRateVector, RewardModelType const &rewardModel, double timeBound)
static std::vector< ValueType > computeTransientProbabilities(Environment const &env, storm::storage::SparseMatrix< ValueType > const &uniformizedMatrix, std::vector< ValueType > const *addVector, ValueType timeBound, ValueType uniformizationRate, std::vector< ValueType > values, ValueType epsilon)
Computes the transient probabilities for lambda time steps.
static storm::storage::SparseMatrix< ValueType > computeUniformizedMatrix(storm::storage::SparseMatrix< ValueType > const &rateMatrix, storm::storage::BitVector const &maybeStates, ValueType uniformizationRate, std::vector< ValueType > const &exitRates)
Computes the matrix representing the transitions of the uniformized CTMC.
static std::vector< ValueType > computeAllTransientProbabilities(Environment const &env, storm::storage::SparseMatrix< ValueType > const &rateMatrix, storm::storage::BitVector const &initialStates, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, std::vector< ValueType > const &exitRates, double timeBound)
static std::vector< ValueType > computeUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &rateMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool qualitative)
static bool checkAndUpdateTransientProbabilityEpsilon(storm::Environment const &env, ValueType &epsilon, std::vector< ValueType > const &resultVector, storm::storage::BitVector const &relevantPositions)
Checks whether the given result vector is sufficiently precise, according to the provided epsilon and...
static storm::storage::SparseMatrix< ValueType > computeProbabilityMatrix(storm::storage::SparseMatrix< ValueType > const &rateMatrix, std::vector< ValueType > const &exitRates)
Converts the given rate-matrix into a time-abstract probability matrix.
static std::vector< ValueType > computeAllUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &rateMatrix, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &initialStates, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates)
static std::vector< ValueType > computeBoundedUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &rateMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, std::vector< ValueType > const &exitRates, bool qualitative, double lowerBound, double upperBound)
static std::vector< ValueType > computeTotalRewards(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &rateMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, RewardModelType const &rewardModel, bool qualitative)
static std::vector< ValueType > computeReachabilityTimes(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &rateMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &targetStates, bool qualitative)
static std::vector< ValueType > computeInstantaneousRewards(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &rateMatrix, std::vector< ValueType > const &exitRateVector, RewardModelType const &rewardModel, double timeBound)
static std::vector< ValueType > computeReachabilityRewards(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &rateMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, RewardModelType const &rewardModel, storm::storage::BitVector const &targetStates, bool qualitative)
static std::vector< ValueType > computeNextProbabilities(Environment const &env, storm::storage::SparseMatrix< ValueType > const &rateMatrix, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &nextStates)
static std::vector< ValueType > computeNextProbabilities(Environment const &env, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::BitVector const &nextStates)
static std::vector< ValueType > computeReachabilityRewards(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, RewardModelType const &rewardModel, storm::storage::BitVector const &targetStates, bool qualitative, ModelCheckerHint const &hint=ModelCheckerHint())
static std::vector< ValueType > computeUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType > &&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, ModelCheckerHint const &hint=ModelCheckerHint())
static std::vector< ValueType > computeAllUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::BitVector const &initialStates, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates)
static std::vector< ValueType > computeTotalRewards(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, RewardModelType const &rewardModel, bool qualitative, ModelCheckerHint const &hint=ModelCheckerHint())
std::unique_ptr< Multiplier< ValueType > > 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 empty() const
Retrieves whether no bits are set to true in this bit vector.
uint_fast64_t getNumberOfSetBits() const
Returns the number of bits that are set to true in this bit vector.
bool get(uint_fast64_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 makeRowsAbsorbing(storm::storage::BitVector const &rows, bool dropZeroEntries=false)
This function makes the given rows absorbing.
std::vector< ResultValueType > getPointwiseProductRowSumVector(storm::storage::SparseMatrix< OtherValueType > const &otherMatrix) const
Performs a pointwise matrix multiplication of the matrix with the given matrix and returns a vector c...
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 ...
std::vector< value_type > getConstrainedRowSumVector(storm::storage::BitVector const &rowConstraint, storm::storage::BitVector const &columnConstraint) const
Computes a vector whose i-th entry is the sum of the entries in the i-th selected row where only thos...
index_type getColumnCount() const
Returns the number of columns of the matrix.
storm::storage::SparseMatrix< value_type > transpose(bool joinGroups=false, bool keepZeros=false) const
Transposes the matrix.
index_type getRowCount() const
Returns the number of rows of the matrix.
#define STORM_LOG_INFO(message)
#define STORM_LOG_DEBUG(message)
#define STORM_LOG_WARN_COND(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
storm::storage::BitVector performProbGreater0(storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool useStepBound, uint_fast64_t maximalSteps)
Performs a backward depth-first search trough the underlying graph structure of the given model to de...
FoxGlynnResult< ValueType > foxGlynn(ValueType lambda, ValueType epsilon)
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< T > const &values)
Sets the provided values at the provided positions in the given vector.
void selectVectorValues(std::vector< T > &vector, storm::storage::BitVector const &positions, std::vector< T > const &values)
Selects the elements from a vector at the specified positions and writes them consecutively into anot...
T maximumElementAbs(std::vector< T > const &vector)
void applyPointwise(std::vector< InValueType1 > const &firstOperand, std::vector< InValueType2 > const &secondOperand, std::vector< OutValueType > &target, Operation f=Operation())
Applies the given operation pointwise on the two given vectors and writes the result to the third vec...
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 isZero(ValueType const &a)
std::vector< ValueType > weights