|
|
@ -6,32 +6,35 @@ |
|
|
|
#include "storm/storage/StronglyConnectedComponentDecomposition.h" |
|
|
|
|
|
|
|
namespace storm { |
|
|
|
|
|
|
|
|
|
|
|
class Environment; |
|
|
|
|
|
|
|
|
|
|
|
namespace solver { |
|
|
|
|
|
|
|
|
|
|
|
template<typename ValueType> |
|
|
|
class TopologicalMinMaxLinearEquationSolver : public StandardMinMaxLinearEquationSolver<ValueType> { |
|
|
|
public: |
|
|
|
TopologicalMinMaxLinearEquationSolver(); |
|
|
|
TopologicalMinMaxLinearEquationSolver(storm::storage::SparseMatrix<ValueType> const& A); |
|
|
|
TopologicalMinMaxLinearEquationSolver(storm::storage::SparseMatrix<ValueType>&& A); |
|
|
|
|
|
|
|
|
|
|
|
virtual ~TopologicalMinMaxLinearEquationSolver() { |
|
|
|
} |
|
|
|
|
|
|
|
virtual void clearCache() const override; |
|
|
|
|
|
|
|
virtual MinMaxLinearEquationSolverRequirements getRequirements(Environment const& env, boost::optional<storm::solver::OptimizationDirection> const& direction = boost::none, bool const& hasInitialScheduler = false) const override ; |
|
|
|
|
|
|
|
protected: |
|
|
|
|
|
|
|
|
|
|
|
virtual bool internalSolveEquations(storm::Environment const& env, OptimizationDirection d, std::vector<ValueType>& x, std::vector<ValueType> const& b) const override; |
|
|
|
|
|
|
|
private: |
|
|
|
storm::Environment getEnvironmentForUnderlyingSolver(storm::Environment const& env, bool adaptPrecision = false) const; |
|
|
|
|
|
|
|
|
|
|
|
// Creates an SCC decomposition and sorts the SCCs according to a topological sort. |
|
|
|
void createSortedSccDecomposition(bool needLongestChainSize) const; |
|
|
|
|
|
|
|
|
|
|
|
// Solves the SCC with the given index |
|
|
|
// ... for the case that the SCC is trivial |
|
|
|
bool solveTrivialScc(uint64_t const& sccState, OptimizationDirection d, std::vector<ValueType>& globalX, std::vector<ValueType> const& globalB) const; |
|
|
|