18using namespace stateelimination;
21template<
typename ValueType>
26template<
typename ValueType>
31template<
typename ValueType>
36template<
typename ValueType>
43template<
typename ValueType>
45 localA = std::make_unique<storm::storage::SparseMatrix<ValueType>>(std::move(A));
46 this->A = localA.get();
50template<
typename ValueType>
52 std::vector<ValueType>
const& b)
const {
57 STORM_LOG_INFO(
"Solving linear equation system (" << x.size() <<
" rows) with elimination");
69 boost::optional<std::vector<uint_fast64_t>> distanceBasedPriorities;
73 storm::settings::getModule<storm::settings::modules::EliminationSettings>().getEliminationOrder();
84 std::shared_ptr<StatePriorityQueue> priorityQueue =
85 createStatePriorityQueue<ValueType>(distanceBasedPriorities, flexibleMatrix, flexibleBackwardTransitions, b,
storm::storage::BitVector(x.size(),
true));
91 while (priorityQueue->hasNext()) {
92 auto state = priorityQueue->pop();
99template<
typename ValueType>
104template<
typename ValueType>
106 return this->A->getRowCount();
109template<
typename ValueType>
110uint64_t EliminationLinearEquationSolver<ValueType>::getMatrixColumnCount()
const {
111 return this->A->getColumnCount();
114template<
typename ValueType>
116 return std::make_unique<storm::solver::EliminationLinearEquationSolver<ValueType>>();
119template<
typename ValueType>
121 return std::make_unique<EliminationLinearEquationSolverFactory<ValueType>>(*this);
127#ifdef STORM_HAVE_CARL
EliminationOrder
An enum that contains all available state elimination orders.
virtual std::unique_ptr< storm::solver::LinearEquationSolver< ValueType > > create(Environment const &env) const override
Creates an equation solver with the current settings, but without a matrix.
virtual std::unique_ptr< LinearEquationSolverFactory< ValueType > > clone() const override
Creates a copy of this factory.
A class that uses gaussian elimination to implement the LinearEquationSolver interface.
virtual LinearEquationSolverProblemFormat getEquationProblemFormat(Environment const &env) const override
Retrieves the format in which this solver expects to solve equations.
virtual void setMatrix(storm::storage::SparseMatrix< ValueType > const &A) override
virtual bool internalSolveEquations(Environment const &env, std::vector< ValueType > &x, std::vector< ValueType > const &b) const override
EliminationLinearEquationSolver()
void eliminateState(storm::storage::sparse::state_type state, bool removeForwardTransitions)
A bit vector that is internally represented as a vector of 64-bit values.
The flexible sparse matrix is used during state elimination.
A class that holds a possibly non-square matrix in the compressed row storage format.
storm::storage::SparseMatrix< value_type > transpose(bool joinGroups=false, bool keepZeros=false) const
Transposes the matrix.
#define STORM_LOG_INFO(message)
LinearEquationSolverProblemFormat
storm::storage::BitVector getBsccCover(storm::storage::SparseMatrix< T > const &transitionMatrix)
Retrieves a set of states that covers als BSCCs of the system in the sense that for every BSCC exactl...
bool eliminationOrderNeedsForwardDistances(storm::settings::modules::EliminationSettings::EliminationOrder const &order)
bool eliminationOrderNeedsDistances(storm::settings::modules::EliminationSettings::EliminationOrder const &order)
std::vector< uint_fast64_t > getDistanceBasedPriorities(storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &transitionMatrixTransposed, storm::storage::BitVector const &initialStates, std::vector< ValueType > const &oneStepProbabilities, bool forward, bool reverse)
bool eliminationOrderNeedsReversedDistances(storm::settings::modules::EliminationSettings::EliminationOrder const &order)