18namespace modelchecker {
21template<
typename ValueType>
23 std::vector<ValueType>
const& resultVector,
33 ValueType newEpsilon = epsilon;
35 for (
auto state : relevantPositions) {
37 newEpsilon = std::min(epsilon * storm::utility::convertNumber<ValueType>(0.1), newEpsilon);
39 ValueType relativeError = epsilon / resultVector[state];
40 if (relativeError > precision) {
41 newEpsilon = std::min(resultVector[state] * precision, newEpsilon);
45 if (newEpsilon < epsilon) {
46 STORM_LOG_INFO(
"Re-computing transient probabilities with new truncation error " << newEpsilon
47 <<
" to guarantee sound results with relative precision.");
55template<
typename ValueType>
60 std::vector<ValueType>
const& exitRates,
bool qualitative, ValueType lowerBound, ValueType upperBound) {
62 "Exact computations not possible for bounded until probabilities.");
64 uint_fast64_t numberOfStates = rateMatrix.
getRowCount();
68 return computeUntilProbabilities(env, std::move(goal), rateMatrix, backwardTransitions, exitRates, phiStates, psiStates, qualitative);
75 std::vector<ValueType> result;
89 if (goal.hasRelevantValues()) {
90 relevantValues = std::move(goal.relevantValues());
91 relevantValues &= statesWithProbabilityGreater0;
93 relevantValues = statesWithProbabilityGreater0;
97 if (!statesWithProbabilityGreater0.
empty()) {
100 result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
101 storm::utility::vector::setVectorValues<ValueType>(result, psiStates, storm::utility::one<ValueType>());
107 result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
108 storm::utility::vector::setVectorValues<ValueType>(result, psiStates, storm::utility::one<ValueType>());
109 if (!statesWithProbabilityGreater0NonPsi.
empty()) {
111 ValueType uniformizationRate = 0;
112 for (
auto state : statesWithProbabilityGreater0NonPsi) {
113 uniformizationRate = std::max(uniformizationRate, exitRates[state]);
115 uniformizationRate *= 1.02;
116 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
124 for (
auto& element : b) {
125 element /= uniformizationRate;
129 std::vector<ValueType> values(statesWithProbabilityGreater0NonPsi.
getNumberOfSetBits(), storm::utility::zero<ValueType>());
130 std::vector<ValueType> subresult =
134 }
else if (upperBound == storm::utility::infinity<ValueType>()) {
140 psiStates, qualitative);
147 ValueType uniformizationRate = 0;
148 for (
auto state : relevantStates) {
149 uniformizationRate = std::max(uniformizationRate, exitRates[state]);
151 uniformizationRate *= 1.02;
152 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
159 subResult = computeTransientProbabilities<ValueType>(env, uniformizedMatrix,
nullptr, lowerBound, uniformizationRate, subResult, epsilon);
167 if (lowerBound != upperBound) {
171 std::vector<ValueType> newSubresult(relevantStates.
getNumberOfSetBits(), storm::utility::zero<ValueType>());
173 if (!statesWithProbabilityGreater0NonPsi.
empty()) {
175 ValueType uniformizationRate = storm::utility::zero<ValueType>();
176 for (
auto state : statesWithProbabilityGreater0NonPsi) {
177 uniformizationRate = std::max(uniformizationRate, exitRates[state]);
179 uniformizationRate *= 1.02;
180 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
188 for (
auto& element : b) {
189 element /= uniformizationRate;
193 std::vector<ValueType> values(statesWithProbabilityGreater0NonPsi.
getNumberOfSetBits(), storm::utility::zero<ValueType>());
195 std::vector<ValueType> subresult =
197 epsilon / storm::utility::convertNumber<ValueType>(2.0));
203 ValueType uniformizationRate = storm::utility::zero<ValueType>();
204 for (
auto state : relevantStates) {
205 uniformizationRate = std::max(uniformizationRate, exitRates[state]);
207 uniformizationRate *= 1.02;
208 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
213 newSubresult = computeTransientProbabilities<ValueType>(env, uniformizedMatrix,
nullptr, lowerBound, uniformizationRate, newSubresult,
214 epsilon / storm::utility::convertNumber<ValueType>(2.0));
217 result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
223 std::vector<ValueType> newSubresult = std::vector<ValueType>(statesWithProbabilityGreater0.
getNumberOfSetBits());
228 ValueType uniformizationRate = storm::utility::zero<ValueType>();
229 for (
auto state : statesWithProbabilityGreater0) {
230 uniformizationRate = std::max(uniformizationRate, exitRates[state]);
232 uniformizationRate *= 1.02;
233 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
239 computeTransientProbabilities<ValueType>(env, uniformizedMatrix,
nullptr, lowerBound, uniformizationRate, newSubresult, epsilon);
242 result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
249 result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
255template<
typename ValueType>
262 backwardTransitions, phiStates, psiStates, qualitative);
265template<
typename ValueType>
268 std::vector<ValueType>
const& exitRateVector,
273 initialStates, phiStates, psiStates);
276template<
typename ValueType>
278 std::vector<ValueType>
const& exitRateVector,
283template<
typename ValueType,
typename RewardModelType>
287 std::vector<ValueType>
const& exitRateVector, RewardModelType
const& rewardModel,
288 ValueType timeBound) {
290 STORM_LOG_THROW(rewardModel.hasStateRewards(), storm::exceptions::InvalidPropertyException,
291 "Computing instantaneous rewards for a reward model that does not define any state-rewards. The result is trivially 0.");
293 uint_fast64_t numberOfStates = rateMatrix.
getRowCount();
296 std::vector<ValueType> result(rewardModel.getStateRewardVector());
309 ValueType uniformizationRate = 0;
310 for (
auto const& rate : exitRateVector) {
311 uniformizationRate = std::max(uniformizationRate, rate);
313 uniformizationRate *= 1.02;
314 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
323 epsilon *= std::min(storm::utility::one<ValueType>(), maxValue);
326 epsilon /= std::max(storm::utility::one<ValueType>(), maxValue);
330 if (goal.hasRelevantValues()) {
331 relevantValues = std::move(goal.relevantValues());
338 result = computeTransientProbabilities<ValueType>(env, uniformizedMatrix,
nullptr, timeBound, uniformizationRate, result, epsilon);
344template<
typename ValueType,
typename RewardModelType>
348 std::vector<ValueType>
const& exitRateVector, RewardModelType
const& rewardModel,
349 ValueType timeBound) {
351 "Exact computations not possible for cumulative expected rewards.");
354 STORM_LOG_THROW(!rewardModel.empty(), storm::exceptions::InvalidPropertyException,
"Missing reward model for formula. Skipping formula.");
356 uint_fast64_t numberOfStates = rateMatrix.
getRowCount();
359 if (timeBound == 0) {
360 return std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
366 ValueType uniformizationRate = 0;
367 for (
auto const& rate : exitRateVector) {
368 uniformizationRate = std::max(uniformizationRate, rate);
370 uniformizationRate *= 1.02;
371 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
377 std::vector<ValueType> totalRewardVector = rewardModel.getTotalRewardVector(rateMatrix, exitRateVector);
382 return std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
389 epsilon *= std::min(storm::utility::one<ValueType>(), maxReward);
392 epsilon /= std::max(storm::utility::one<ValueType>(), maxReward * timeBound);
396 if (goal.hasRelevantValues()) {
397 relevantValues = std::move(goal.relevantValues());
403 std::vector<ValueType> result;
405 result = computeTransientProbabilities<ValueType, true>(env, uniformizedMatrix,
nullptr, timeBound, uniformizationRate, totalRewardVector, epsilon);
411template<
typename ValueType>
415 std::vector<ValueType>
const& exitRateVector,
421 std::vector<ValueType> totalRewardVector;
422 for (
size_t i = 0; i < exitRateVector.size(); ++i) {
425 totalRewardVector.push_back(storm::utility::zero<ValueType>());
428 totalRewardVector.push_back(storm::utility::one<ValueType>() / exitRateVector[i]);
433 env, std::move(goal), probabilityMatrix, backwardTransitions, totalRewardVector, targetStates, qualitative);
436template<
typename ValueType,
typename RewardModelType>
440 std::vector<ValueType>
const& exitRateVector, RewardModelType
const& rewardModel,
442 STORM_LOG_THROW(!rewardModel.empty(), storm::exceptions::InvalidPropertyException,
"Missing reward model for formula. Skipping formula.");
446 std::vector<ValueType> totalRewardVector;
447 if (rewardModel.hasStateRewards()) {
448 totalRewardVector = rewardModel.getStateRewardVector();
449 typename std::vector<ValueType>::const_iterator it2 = exitRateVector.begin();
450 for (
typename std::vector<ValueType>::iterator it1 = totalRewardVector.begin(), ite1 = totalRewardVector.end(); it1 != ite1; ++it1, ++it2) {
453 if (rewardModel.hasStateActionRewards()) {
456 if (rewardModel.hasTransitionRewards()) {
460 }
else if (rewardModel.hasTransitionRewards()) {
462 if (rewardModel.hasStateActionRewards()) {
466 totalRewardVector = rewardModel.getStateActionRewardVector();
470 env, std::move(goal), probabilityMatrix, backwardTransitions, totalRewardVector, targetStates, qualitative);
473template<
typename ValueType,
typename RewardModelType>
477 std::vector<ValueType>
const& exitRateVector, RewardModelType
const& rewardModel,
479 STORM_LOG_THROW(!rewardModel.empty(), storm::exceptions::InvalidPropertyException,
"Missing reward model for formula. Skipping formula.");
483 std::vector<ValueType> totalRewardVector;
484 if (rewardModel.hasStateRewards()) {
485 totalRewardVector = rewardModel.getStateRewardVector();
486 typename std::vector<ValueType>::const_iterator it2 = exitRateVector.begin();
487 for (
typename std::vector<ValueType>::iterator it1 = totalRewardVector.begin(), ite1 = totalRewardVector.end(); it1 != ite1; ++it1, ++it2) {
490 if (rewardModel.hasStateActionRewards()) {
493 if (rewardModel.hasTransitionRewards()) {
497 }
else if (rewardModel.hasTransitionRewards()) {
499 if (rewardModel.hasStateActionRewards()) {
503 totalRewardVector = rewardModel.getStateActionRewardVector();
506 RewardModelType dtmcRewardModel(std::move(totalRewardVector));
508 dtmcRewardModel, qualitative);
511template<
typename ValueType>
517 std::vector<ValueType>
const& exitRates, ValueType timeBound) {
520 uint_fast64_t numberOfStates = rateMatrix.
getRowCount();
523 std::vector<ValueType> result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
527 std::vector<ValueType> newRates = exitRates;
528 for (
auto state : psiStates) {
529 newRates[state] = storm::utility::one<ValueType>();
540 if (!relevantStates.
empty()) {
542 ValueType uniformizationRate = 0;
543 for (
auto state : relevantStates) {
544 uniformizationRate = std::max(uniformizationRate, newRates[state]);
546 uniformizationRate *= 1.02;
547 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
549 transposedMatrix = transposedMatrix.
transpose();
563 "Computation of transient probabilities with relative precision not supported. Using absolute precision instead.");
564 std::vector<ValueType> values(relevantStates.
getNumberOfSetBits(), storm::utility::zero<ValueType>());
567 ValueType initDist = storm::utility::one<ValueType>() / initialStates.
getNumberOfSetBits();
568 for (
auto state : relevantStates) {
569 if (initialStates.
get(state)) {
570 values[i] = initDist;
575 std::vector<ValueType> subresult =
576 computeTransientProbabilities<ValueType>(env, uniformizedMatrix,
nullptr, timeBound, uniformizationRate, values, epsilon);
584template<
typename ValueType>
588 ValueType uniformizationRate, std::vector<ValueType>
const& exitRates) {
589 STORM_LOG_DEBUG(
"Computing uniformized matrix using uniformization rate " << uniformizationRate <<
".");
599 uint_fast64_t currentRow = 0;
600 for (
auto state : maybeStates) {
601 for (
auto& element : uniformizedMatrix.
getRow(currentRow)) {
602 if (element.getColumn() == currentRow) {
603 element.setValue((element.getValue() - exitRates[state]) / uniformizationRate + storm::utility::one<ValueType>());
605 element.setValue(element.getValue() / uniformizationRate);
611 return uniformizedMatrix;
614template<
typename ValueType,
bool useMixedPoissonProbabilities>
618 std::vector<ValueType>
const* addVector, ValueType timeBound,
619 ValueType uniformizationRate, std::vector<ValueType> values, ValueType epsilon) {
621 "Very low truncation error " << epsilon <<
" requested. Numerical inaccuracies are possible.");
622 ValueType lambda = timeBound * uniformizationRate;
635 if (useMixedPoissonProbabilities) {
641 uint64_t l{0ull}, r{foxGlynnResult.
weights.size() - 1};
642 ValueType sumLeft{storm::utility::zero<ValueType>()}, sumRight{storm::utility::zero<ValueType>()};
645 sumLeft += foxGlynnResult.
weights[l];
646 foxGlynnResult.
weights[l] = (foxGlynnResult.
totalWeight - sumLeft) / uniformizationRate;
649 auto const tmp = foxGlynnResult.
weights[r];
650 foxGlynnResult.
weights[r] = sumRight / uniformizationRate;
659 auto const relDiff = storm::utility::abs<ValueType>(foxGlynnResult.
totalWeight - (sumLeft + sumRight)) / foxGlynnResult.
totalWeight;
661 "Numerical instability when adjusting the FoxGlynn weights. Relative Difference: " << relDiff <<
".");
667 std::vector<ValueType> result;
668 uint_fast64_t startingIteration = foxGlynnResult.
left;
669 if (startingIteration == 0) {
674 if (useMixedPoissonProbabilities) {
675 result = std::vector<ValueType>(values.size());
676 std::function<ValueType(ValueType
const&)> scaleWithUniformizationRate = [&uniformizationRate](ValueType
const& a) -> ValueType {
677 return a / uniformizationRate;
681 result = std::vector<ValueType>(values.size());
686 if (!useMixedPoissonProbabilities && foxGlynnResult.
left > 1) {
688 multiplier->repeatedMultiply(env, values, addVector, foxGlynnResult.
left - 1);
689 }
else if (useMixedPoissonProbabilities) {
690 std::function<ValueType(ValueType
const&, ValueType
const&)> addAndScale = [&uniformizationRate](ValueType
const& a, ValueType
const& b) {
691 return a + b / uniformizationRate;
695 for (uint_fast64_t index = 1; index < startingIteration; ++index) {
696 multiplier->multiply(env, values,
nullptr, values);
702 if (foxGlynnResult.
left > 0) {
703 storm::utility::vector::scaleVectorInPlace<ValueType, ValueType>(result, foxGlynnResult.
totalWeight);
709 ValueType weight = 0;
710 std::function<ValueType(ValueType
const&, ValueType
const&)> addAndScale = [&weight](ValueType
const& a, ValueType
const& b) {
return a + weight * b; };
711 for (uint_fast64_t index = startingIteration; index <= foxGlynnResult.
right; ++index) {
712 multiplier->multiply(env, values, addVector, values);
714 weight = foxGlynnResult.
weights[index - foxGlynnResult.
left];
719 storm::utility::vector::scaleVectorInPlace<ValueType, ValueType>(result, storm::utility::one<ValueType>() / foxGlynnResult.
totalWeight);
723template<
typename ValueType>
725 std::vector<ValueType>
const& exitRates) {
728 for (uint_fast64_t row = 0; row < result.
getRowCount(); ++row) {
729 for (
auto& entry : result.
getRow(row)) {
730 entry.setValue(entry.getValue() / exitRates[row]);
736template<
typename ValueType>
738 std::vector<ValueType>
const& exitRates) {
742 for (uint_fast64_t row = 0; row < generatorMatrix.
getRowCount(); ++row) {
743 for (
auto& entry : generatorMatrix.
getRow(row)) {
744 if (entry.getColumn() == row) {
745 entry.setValue(-exitRates[row] + entry.getValue());
750 return generatorMatrix;
756 std::vector<double>
const& exitRates,
bool qualitative,
double lowerBound,
double upperBound);
761 std::vector<double>
const& exitRateVector,
767 std::vector<double>
const& exitRateVector,
773 std::vector<double>
const& exitRateVector,
778 std::vector<double>
const& exitRateVector,
785 std::vector<double>
const& exitRateVector,
791 std::vector<double>
const& exitRateVector,
798 std::vector<double>
const& exitRateVector,
803 std::vector<double>
const& exitRateVector,
813 double uniformizationRate, std::vector<double>
const& exitRates);
817 std::vector<double>
const* addVector,
double timeBound,
818 double uniformizationRate, std::vector<double> values,
double epsilon);
840 std::vector<storm::RationalNumber>
const& exitRateVector,
874 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 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 > 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 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 ::SupportsExponential 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, ValueType lowerBound, ValueType upperBound)
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 ::SupportsExponential 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 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 ::SupportsExponential 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, ValueType timeBound)
static ::SupportsExponential 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 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 ::SupportsExponential 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, ValueType timeBound)
static ::SupportsExponential 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, ValueType timeBound)
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 > 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 > 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.
uint64_t getNumberOfSetBits() const
Returns the number of bits that are set to true in this bit vector.
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 makeRowsAbsorbing(storm::storage::BitVector const &rows, bool dropZeroEntries=false)
This function makes the given rows absorbing.
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< 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...
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