diff --git a/src/utility/solver.cpp b/src/utility/solver.cpp index cae5bdb98..242078c9e 100644 --- a/src/utility/solver.cpp +++ b/src/utility/solver.cpp @@ -110,12 +110,22 @@ namespace storm { template std::unique_ptr> GmmxxLinearEquationSolverFactory::create(storm::storage::SparseMatrix const& matrix) const { - return std::unique_ptr>(new storm::solver::GmmxxLinearEquationSolver(matrix)); + return std::make_unique>(matrix); + } + + template + std::unique_ptr> GmmxxLinearEquationSolverFactory::create(storm::storage::SparseMatrix&& matrix) const { + return std::make_unique>(std::move(matrix)); } template std::unique_ptr> EigenLinearEquationSolverFactory::create(storm::storage::SparseMatrix const& matrix) const { - return std::unique_ptr>(new storm::solver::EigenLinearEquationSolver(matrix)); + return std::make_unique>(matrix); + } + + template + std::unique_ptr> EigenLinearEquationSolverFactory::create(storm::storage::SparseMatrix&& matrix) const { + return std::make_unique>(std::move(matrix)); } template @@ -131,17 +141,21 @@ namespace storm { this->method = storm::solver::NativeLinearEquationSolverSolutionMethod::SOR; break; } - omega = storm::settings::getModule().getOmega(); } template - NativeLinearEquationSolverFactory::NativeLinearEquationSolverFactory(typename storm::solver::NativeLinearEquationSolverSolutionMethod method, ValueType omega) : method(method), omega(omega) { + NativeLinearEquationSolverFactory::NativeLinearEquationSolverFactory(typename storm::solver::NativeLinearEquationSolverSolutionMethod method) : method(method) { // Intentionally left empty. } template std::unique_ptr> NativeLinearEquationSolverFactory::create(storm::storage::SparseMatrix const& matrix) const { - return std::unique_ptr>(new storm::solver::NativeLinearEquationSolver(matrix, method)); + return std::make_unique>(matrix, method); + } + + template + std::unique_ptr> NativeLinearEquationSolverFactory::create(storm::storage::SparseMatrix&& matrix) const { + return std::make_unique>(std::move(matrix), method); } template diff --git a/src/utility/solver.h b/src/utility/solver.h index bacc61e5e..a5fab02c7 100644 --- a/src/utility/solver.h +++ b/src/utility/solver.h @@ -136,25 +136,27 @@ namespace storm { class NativeLinearEquationSolverFactory : public LinearEquationSolverFactory { public: NativeLinearEquationSolverFactory(); - NativeLinearEquationSolverFactory(typename storm::solver::NativeLinearEquationSolverSolutionMethod method, ValueType omega); + NativeLinearEquationSolverFactory(storm::solver::NativeLinearEquationSolverSolutionMethod method); virtual std::unique_ptr> create(storm::storage::SparseMatrix const& matrix) const override; + virtual std::unique_ptr> create(storm::storage::SparseMatrix&& matrix) const override; private: - typename storm::solver::NativeLinearEquationSolverSolutionMethod method; - ValueType omega; + storm::solver::NativeLinearEquationSolverSolutionMethod method; }; template class GmmxxLinearEquationSolverFactory : public LinearEquationSolverFactory { public: virtual std::unique_ptr> create(storm::storage::SparseMatrix const& matrix) const override; + virtual std::unique_ptr> create(storm::storage::SparseMatrix&& matrix) const override; }; template class EigenLinearEquationSolverFactory : public LinearEquationSolverFactory { public: virtual std::unique_ptr> create(storm::storage::SparseMatrix const& matrix) const override; + virtual std::unique_ptr> create(storm::storage::SparseMatrix&& matrix) const override; }; template