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>
74 std::vector<ValueType>
const& exitRates,
bool qualitative, ValueType lowerBound, ValueType upperBound) {
76 "Exact computations not possible for bounded until probabilities.");
78 uint_fast64_t numberOfStates = rateMatrix.
getRowCount();
82 return computeUntilProbabilities(env, std::move(goal), rateMatrix, backwardTransitions, exitRates, phiStates, psiStates, qualitative);
89 std::vector<ValueType> result;
103 if (goal.hasRelevantValues()) {
104 relevantValues = std::move(goal.relevantValues());
105 relevantValues &= statesWithProbabilityGreater0;
107 relevantValues = statesWithProbabilityGreater0;
111 if (!statesWithProbabilityGreater0.
empty()) {
114 result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
115 storm::utility::vector::setVectorValues<ValueType>(result, psiStates, storm::utility::one<ValueType>());
121 result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
122 storm::utility::vector::setVectorValues<ValueType>(result, psiStates, storm::utility::one<ValueType>());
123 if (!statesWithProbabilityGreater0NonPsi.
empty()) {
125 ValueType uniformizationRate = 0;
126 for (
auto state : statesWithProbabilityGreater0NonPsi) {
127 uniformizationRate = std::max(uniformizationRate, exitRates[state]);
129 uniformizationRate *= 1.02;
130 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
138 for (
auto& element : b) {
139 element /= uniformizationRate;
143 std::vector<ValueType> values(statesWithProbabilityGreater0NonPsi.
getNumberOfSetBits(), storm::utility::zero<ValueType>());
144 std::vector<ValueType> subresult =
148 }
else if (upperBound == storm::utility::infinity<ValueType>()) {
154 psiStates, qualitative);
161 ValueType uniformizationRate = 0;
162 for (
auto state : relevantStates) {
163 uniformizationRate = std::max(uniformizationRate, exitRates[state]);
165 uniformizationRate *= 1.02;
166 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
173 subResult = computeTransientProbabilities<ValueType>(env, uniformizedMatrix,
nullptr, lowerBound, uniformizationRate, subResult, epsilon);
181 if (lowerBound != upperBound) {
185 std::vector<ValueType> newSubresult(relevantStates.
getNumberOfSetBits(), storm::utility::zero<ValueType>());
187 if (!statesWithProbabilityGreater0NonPsi.
empty()) {
189 ValueType uniformizationRate = storm::utility::zero<ValueType>();
190 for (
auto state : statesWithProbabilityGreater0NonPsi) {
191 uniformizationRate = std::max(uniformizationRate, exitRates[state]);
193 uniformizationRate *= 1.02;
194 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
202 for (
auto& element : b) {
203 element /= uniformizationRate;
207 std::vector<ValueType> values(statesWithProbabilityGreater0NonPsi.
getNumberOfSetBits(), storm::utility::zero<ValueType>());
209 std::vector<ValueType> subresult =
211 epsilon / storm::utility::convertNumber<ValueType>(2.0));
217 ValueType uniformizationRate = storm::utility::zero<ValueType>();
218 for (
auto state : relevantStates) {
219 uniformizationRate = std::max(uniformizationRate, exitRates[state]);
221 uniformizationRate *= 1.02;
222 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
227 newSubresult = computeTransientProbabilities<ValueType>(env, uniformizedMatrix,
nullptr, lowerBound, uniformizationRate, newSubresult,
228 epsilon / storm::utility::convertNumber<ValueType>(2.0));
231 result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
237 std::vector<ValueType> newSubresult = std::vector<ValueType>(statesWithProbabilityGreater0.
getNumberOfSetBits());
242 ValueType uniformizationRate = storm::utility::zero<ValueType>();
243 for (
auto state : statesWithProbabilityGreater0) {
244 uniformizationRate = std::max(uniformizationRate, exitRates[state]);
246 uniformizationRate *= 1.02;
247 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
253 computeTransientProbabilities<ValueType>(env, uniformizedMatrix,
nullptr, lowerBound, uniformizationRate, newSubresult, epsilon);
256 result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
263 result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
269template<
typename ValueType>
276 backwardTransitions, phiStates, psiStates, qualitative);
279template<
typename ValueType>
282 std::vector<ValueType>
const& exitRateVector,
287 initialStates, phiStates, psiStates);
290template<
typename ValueType>
292 std::vector<ValueType>
const& exitRateVector,
297template<
typename ValueType,
typename RewardModelType>
301 std::vector<ValueType>
const& exitRateVector, RewardModelType
const& rewardModel,
302 ValueType timeBound) {
304 STORM_LOG_THROW(rewardModel.hasStateRewards(), storm::exceptions::InvalidPropertyException,
305 "Computing instantaneous rewards for a reward model that does not define any state-rewards. The result is trivially 0.");
307 uint_fast64_t numberOfStates = rateMatrix.
getRowCount();
310 std::vector<ValueType> result(rewardModel.getStateRewardVector());
323 ValueType uniformizationRate = 0;
324 for (
auto const& rate : exitRateVector) {
325 uniformizationRate = std::max(uniformizationRate, rate);
327 uniformizationRate *= 1.02;
328 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
337 epsilon *= std::min(storm::utility::one<ValueType>(), maxValue);
340 epsilon /= std::max(storm::utility::one<ValueType>(), maxValue);
344 if (goal.hasRelevantValues()) {
345 relevantValues = std::move(goal.relevantValues());
352 result = computeTransientProbabilities<ValueType>(env, uniformizedMatrix,
nullptr, timeBound, uniformizationRate, result, epsilon);
358template<
typename ValueType,
typename RewardModelType>
362 std::vector<ValueType>
const& exitRateVector, RewardModelType
const& rewardModel,
363 ValueType timeBound) {
365 "Exact computations not possible for cumulative expected rewards.");
368 STORM_LOG_THROW(!rewardModel.empty(), storm::exceptions::InvalidPropertyException,
"Missing reward model for formula. Skipping formula.");
370 uint_fast64_t numberOfStates = rateMatrix.
getRowCount();
373 if (timeBound == 0) {
374 return std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
380 ValueType uniformizationRate = 0;
381 for (
auto const& rate : exitRateVector) {
382 uniformizationRate = std::max(uniformizationRate, rate);
384 uniformizationRate *= 1.02;
385 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
391 std::vector<ValueType> totalRewardVector = rewardModel.getTotalRewardVector(rateMatrix, exitRateVector);
396 return std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
403 epsilon *= std::min(storm::utility::one<ValueType>(), maxReward);
406 epsilon /= std::max(storm::utility::one<ValueType>(), maxReward * timeBound);
410 if (goal.hasRelevantValues()) {
411 relevantValues = std::move(goal.relevantValues());
417 std::vector<ValueType> result;
419 result = computeTransientProbabilities<ValueType, true>(env, uniformizedMatrix,
nullptr, timeBound, uniformizationRate, totalRewardVector, epsilon);
425template<
typename ValueType>
429 std::vector<ValueType>
const& exitRateVector,
435 std::vector<ValueType> totalRewardVector;
436 for (
size_t i = 0; i < exitRateVector.size(); ++i) {
439 totalRewardVector.push_back(storm::utility::zero<ValueType>());
442 totalRewardVector.push_back(storm::utility::one<ValueType>() / exitRateVector[i]);
447 env, std::move(goal), probabilityMatrix, backwardTransitions, totalRewardVector, targetStates, qualitative);
450template<
typename ValueType,
typename RewardModelType>
454 std::vector<ValueType>
const& exitRateVector, RewardModelType
const& rewardModel,
456 STORM_LOG_THROW(!rewardModel.empty(), storm::exceptions::InvalidPropertyException,
"Missing reward model for formula. Skipping formula.");
460 std::vector<ValueType> totalRewardVector;
461 if (rewardModel.hasStateRewards()) {
462 totalRewardVector = rewardModel.getStateRewardVector();
463 typename std::vector<ValueType>::const_iterator it2 = exitRateVector.begin();
464 for (
typename std::vector<ValueType>::iterator it1 = totalRewardVector.begin(), ite1 = totalRewardVector.end(); it1 != ite1; ++it1, ++it2) {
467 if (rewardModel.hasStateActionRewards()) {
470 if (rewardModel.hasTransitionRewards()) {
474 }
else if (rewardModel.hasTransitionRewards()) {
476 if (rewardModel.hasStateActionRewards()) {
480 totalRewardVector = rewardModel.getStateActionRewardVector();
484 env, std::move(goal), probabilityMatrix, backwardTransitions, totalRewardVector, targetStates, qualitative);
487template<
typename ValueType,
typename RewardModelType>
491 std::vector<ValueType>
const& exitRateVector, RewardModelType
const& rewardModel,
493 STORM_LOG_THROW(!rewardModel.empty(), storm::exceptions::InvalidPropertyException,
"Missing reward model for formula. Skipping formula.");
497 std::vector<ValueType> totalRewardVector;
498 if (rewardModel.hasStateRewards()) {
499 totalRewardVector = rewardModel.getStateRewardVector();
500 typename std::vector<ValueType>::const_iterator it2 = exitRateVector.begin();
501 for (
typename std::vector<ValueType>::iterator it1 = totalRewardVector.begin(), ite1 = totalRewardVector.end(); it1 != ite1; ++it1, ++it2) {
504 if (rewardModel.hasStateActionRewards()) {
507 if (rewardModel.hasTransitionRewards()) {
511 }
else if (rewardModel.hasTransitionRewards()) {
513 if (rewardModel.hasStateActionRewards()) {
517 totalRewardVector = rewardModel.getStateActionRewardVector();
520 RewardModelType dtmcRewardModel(std::move(totalRewardVector));
522 dtmcRewardModel, qualitative);
525template<
typename ValueType>
531 std::vector<ValueType>
const& exitRates, ValueType timeBound) {
534 uint_fast64_t numberOfStates = rateMatrix.
getRowCount();
537 std::vector<ValueType> result = std::vector<ValueType>(numberOfStates, storm::utility::zero<ValueType>());
541 std::vector<ValueType> newRates = exitRates;
542 for (
auto state : psiStates) {
543 newRates[state] = storm::utility::one<ValueType>();
554 if (!relevantStates.
empty()) {
556 ValueType uniformizationRate = 0;
557 for (
auto state : relevantStates) {
558 uniformizationRate = std::max(uniformizationRate, newRates[state]);
560 uniformizationRate *= 1.02;
561 STORM_LOG_THROW(uniformizationRate > 0, storm::exceptions::InvalidStateException,
"The uniformization rate must be positive.");
563 transposedMatrix = transposedMatrix.
transpose();
577 "Computation of transient probabilities with relative precision not supported. Using absolute precision instead.");
578 std::vector<ValueType> values(relevantStates.
getNumberOfSetBits(), storm::utility::zero<ValueType>());
581 ValueType initDist = storm::utility::one<ValueType>() / initialStates.
getNumberOfSetBits();
582 for (
auto state : relevantStates) {
583 if (initialStates.
get(state)) {
584 values[i] = initDist;
589 std::vector<ValueType> subresult =
590 computeTransientProbabilities<ValueType>(env, uniformizedMatrix,
nullptr, timeBound, uniformizationRate, values, epsilon);
598template<
typename ValueType>
602 ValueType uniformizationRate, std::vector<ValueType>
const& exitRates) {
603 STORM_LOG_DEBUG(
"Computing uniformized matrix using uniformization rate " << uniformizationRate <<
".");
613 uint_fast64_t currentRow = 0;
614 for (
auto state : maybeStates) {
615 for (
auto& element : uniformizedMatrix.
getRow(currentRow)) {
616 if (element.getColumn() == currentRow) {
617 element.setValue((element.getValue() - exitRates[state]) / uniformizationRate + storm::utility::one<ValueType>());
619 element.setValue(element.getValue() / uniformizationRate);
625 return uniformizedMatrix;
628template<
typename ValueType,
bool useMixedPoissonProbabilities>
632 std::vector<ValueType>
const* addVector, ValueType timeBound,
633 ValueType uniformizationRate, std::vector<ValueType> values, ValueType epsilon) {
635 "Very low truncation error " << epsilon <<
" requested. Numerical inaccuracies are possible.");
636 ValueType lambda = timeBound * uniformizationRate;
649 if (useMixedPoissonProbabilities) {
655 uint64_t l{0ull}, r{foxGlynnResult.
weights.size() - 1};
656 ValueType sumLeft{storm::utility::zero<ValueType>()}, sumRight{storm::utility::zero<ValueType>()};
659 sumLeft += foxGlynnResult.
weights[l];
660 foxGlynnResult.
weights[l] = (foxGlynnResult.
totalWeight - sumLeft) / uniformizationRate;
663 auto const tmp = foxGlynnResult.
weights[r];
664 foxGlynnResult.
weights[r] = sumRight / uniformizationRate;
673 auto const relDiff = storm::utility::abs<ValueType>(foxGlynnResult.
totalWeight - (sumLeft + sumRight)) / foxGlynnResult.
totalWeight;
675 "Numerical instability when adjusting the FoxGlynn weights. Relative Difference: " << relDiff <<
".");
681 std::vector<ValueType> result;
682 uint_fast64_t startingIteration = foxGlynnResult.
left;
683 if (startingIteration == 0) {
688 if (useMixedPoissonProbabilities) {
689 result = std::vector<ValueType>(values.size());
690 std::function<ValueType(ValueType
const&)> scaleWithUniformizationRate = [&uniformizationRate](ValueType
const& a) -> ValueType {
691 return a / uniformizationRate;
695 result = std::vector<ValueType>(values.size());
700 if (!useMixedPoissonProbabilities && foxGlynnResult.
left > 1) {
702 multiplier->repeatedMultiply(env, values, addVector, foxGlynnResult.
left - 1);
703 }
else if (useMixedPoissonProbabilities) {
704 std::function<ValueType(ValueType
const&, ValueType
const&)> addAndScale = [&uniformizationRate](ValueType
const& a, ValueType
const& b) {
705 return a + b / uniformizationRate;
709 for (uint_fast64_t index = 1; index < startingIteration; ++index) {
710 multiplier->multiply(env, values,
nullptr, values);
716 if (foxGlynnResult.
left > 0) {
717 storm::utility::vector::scaleVectorInPlace<ValueType, ValueType>(result, foxGlynnResult.
totalWeight);
723 ValueType weight = 0;
724 std::function<ValueType(ValueType
const&, ValueType
const&)> addAndScale = [&weight](ValueType
const& a, ValueType
const& b) {
return a + weight * b; };
725 for (uint_fast64_t index = startingIteration; index <= foxGlynnResult.
right; ++index) {
726 multiplier->multiply(env, values, addVector, values);
728 weight = foxGlynnResult.
weights[index - foxGlynnResult.
left];
733 storm::utility::vector::scaleVectorInPlace<ValueType, ValueType>(result, storm::utility::one<ValueType>() / foxGlynnResult.
totalWeight);
737template<
typename ValueType>
739 std::vector<ValueType>
const& exitRates) {
742 for (uint_fast64_t row = 0; row < result.
getRowCount(); ++row) {
743 for (
auto& entry : result.
getRow(row)) {
744 entry.setValue(entry.getValue() / exitRates[row]);
750template<
typename ValueType>
752 std::vector<ValueType>
const& exitRates) {
756 for (uint_fast64_t row = 0; row < generatorMatrix.
getRowCount(); ++row) {
757 for (
auto& entry : generatorMatrix.
getRow(row)) {
758 if (entry.getColumn() == row) {
759 entry.setValue(-exitRates[row] + entry.getValue());
764 return generatorMatrix;
770 std::vector<double>
const& exitRates,
bool qualitative,
double lowerBound,
double upperBound);
775 std::vector<double>
const& exitRateVector,
781 std::vector<double>
const& exitRateVector,
787 std::vector<double>
const& exitRateVector,
792 std::vector<double>
const& exitRateVector,
799 std::vector<double>
const& exitRateVector,
805 std::vector<double>
const& exitRateVector,
812 std::vector<double>
const& exitRateVector,
817 std::vector<double>
const& exitRateVector,
827 double uniformizationRate, std::vector<double>
const& exitRates);
831 std::vector<double>
const* addVector,
double timeBound,
832 double uniformizationRate, std::vector<double> values,
double epsilon);
834#ifdef STORM_HAVE_CARL
855 std::vector<storm::RationalNumber>
const& exitRateVector,
889 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 ::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 ::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 ::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 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 > 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 ::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 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 > 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 > 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.
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.
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