#ifndef STORM_SOLVER_NATIVENONDETERMINISTICLINEAREQUATIONSOLVER_H_ #define STORM_SOLVER_NATIVENONDETERMINISTICLINEAREQUATIONSOLVER_H_ #include "src/solver/AbstractNondeterministicLinearEquationSolver.h" namespace storm { namespace solver { /*! * A class that uses the gmm++ library to implement the AbstractNondeterminsticLinearEquationSolver interface. */ template class NativeNondeterministicLinearEquationSolver : public AbstractNondeterministicLinearEquationSolver { public: /*! * Constructs a nondeterministic linear equation solver with parameters being set according to the settings * object. */ NativeNondeterministicLinearEquationSolver(); /*! * Constructs a nondeterminstic linear equation solver with the given parameters. * * @param precision The precision to use for convergence detection. * @param maximalNumberOfIterations The maximal number of iterations do perform before iteration is aborted. * @param relative If set, the relative error rather than the absolute error is considered for convergence * detection. */ NativeNondeterministicLinearEquationSolver(double precision, uint_fast64_t maximalNumberOfIterations, bool relative = true); virtual AbstractNondeterministicLinearEquationSolver* clone() const override; virtual void performMatrixVectorMultiplication(bool minimize, storm::storage::SparseMatrix const& A, std::vector& x, std::vector const& nondeterministicChoiceIndices, std::vector* b = nullptr, uint_fast64_t n = 1, std::vector* newX = nullptr) const override; virtual void solveEquationSystem(bool minimize, storm::storage::SparseMatrix const& A, std::vector& x, std::vector const& b, std::vector const& nondeterministicChoiceIndices, std::vector* multiplyResult = nullptr, std::vector* newX = nullptr) const override; private: // The required precision for the iterative methods. double precision; // Sets whether the relative or absolute error is to be considered for convergence detection. bool relative; // The maximal number of iterations to do before iteration is aborted. uint_fast64_t maximalNumberOfIterations; }; } // namespace solver } // namespace storm #endif /* STORM_SOLVER_NATIVENONDETERMINISTICLINEAREQUATIONSOLVER_H_ */