3#include "storm-config.h"
24template<
typename ValueType>
29template<
typename ValueType>
34template<
typename ValueType>
36 std::vector<ValueType>
const* b, std::vector<ValueType>& result, std::vector<uint_fast64_t>* choices)
const {
37 multiplyAndReduce(env, dir, this->matrix.getRowGroupIndices(), x, b, result, choices);
40template<
typename ValueType>
42 std::vector<ValueType>
const* b, std::vector<uint_fast64_t>* choices,
bool backwards)
const {
43 multiplyAndReduceGaussSeidel(env, dir, this->matrix.getRowGroupIndices(), x, b, choices, backwards);
46template<
typename ValueType>
51 for (uint64_t i = 0; i < n; ++i) {
53 multiply(env, x, b, x);
55 STORM_LOG_WARN(
"Aborting after " << i <<
" of " << n <<
" multiplications.");
61template<
typename ValueType>
63 std::vector<ValueType>
const* b, uint64_t n)
const {
67 for (uint64_t i = 0; i < n; ++i) {
68 multiplyAndReduce(env, dir, x, b, x);
70 STORM_LOG_WARN(
"Aborting after " << i <<
" of " << n <<
" multiplications");
76template<
typename ValueType>
78 ValueType& val2)
const {
79 multiplyRow(rowIndex, x1, val1);
80 multiplyRow(rowIndex, x2, val2);
83template<
typename ValueType>
91 type = MultiplierType::Gmmxx;
94 type = MultiplierType::Native;
98 "' as the multiplier type to match the selected equation solver. If you want to override this, please explicitly "
99 "specify a different multiplier type.");
103 case MultiplierType::Gmmxx:
104 if constexpr (std::is_same_v<ValueType, storm::Interval>) {
105 throw storm::exceptions::NotImplementedException() <<
"Gmm not supported with intervals.";
107 return std::make_unique<GmmxxMultiplier<ValueType>>(matrix);
108 case MultiplierType::Native:
109 return std::make_unique<NativeMultiplier<ValueType>>(matrix);
111 STORM_LOG_THROW(
false, storm::exceptions::IllegalArgumentException,
"Unknown MultiplierType");
SolverEnvironment & solver()
bool const & isTypeSetFromDefault() const
storm::solver::MultiplierType const & getType() const
MultiplierEnvironment & multiplier()
storm::solver::EquationSolverType const & getLinearEquationSolverType() const
bool isLinearEquationSolverTypeSetFromDefaultValue() const
std::unique_ptr< Multiplier< ValueType > > create(Environment const &env, storm::storage::SparseMatrix< ValueType > const &matrix)
virtual void clearCache() const
void multiplyAndReduceGaussSeidel(Environment const &env, OptimizationDirection const &dir, std::vector< ValueType > &x, std::vector< ValueType > const *b, std::vector< uint_fast64_t > *choices=nullptr, bool backwards=true) const
Performs a matrix-vector multiplication in gauss-seidel style and then minimizes/maximizes over the r...
void multiplyAndReduce(Environment const &env, OptimizationDirection const &dir, std::vector< ValueType > const &x, std::vector< ValueType > const *b, std::vector< ValueType > &result, std::vector< uint_fast64_t > *choices=nullptr) const
Performs a matrix-vector multiplication x' = A*x + b and then minimizes/maximizes over the row groups...
virtual void multiplyRow2(uint64_t const &rowIndex, std::vector< ValueType > const &x1, ValueType &val1, std::vector< ValueType > const &x2, ValueType &val2) const
Multiplies the row with the given index with x1 and x2 and adds the given offset o1 and o2,...
void repeatedMultiply(Environment const &env, std::vector< ValueType > &x, std::vector< ValueType > const *b, uint64_t n) const
Performs repeated matrix-vector multiplication, using x[0] = x and x[i + 1] = A*x[i] + b.
Multiplier(storm::storage::SparseMatrix< ValueType > const &matrix)
void repeatedMultiplyAndReduce(Environment const &env, OptimizationDirection const &dir, std::vector< ValueType > &x, std::vector< ValueType > const *b, uint64_t n) const
Performs repeated matrix-vector multiplication x' = A*x + b and then minimizes/maximizes over the row...
A class that holds a possibly non-square matrix in the compressed row storage format.
A class that provides convenience operations to display run times.
bool updateProgress(uint64_t count)
Updates the progress to the current count and prints it if the delay passed.
void setMaxCount(uint64_t maxCount)
Sets the maximal possible count.
void startNewMeasurement(uint64_t startCount)
Starts a new measurement, dropping all progress information collected so far.
#define STORM_LOG_WARN(message)
#define STORM_LOG_THROW(cond, exception, message)
#define STORM_LOG_INFO_COND(cond, message)
std::string toString(GurobiSolverMethod const &method)
Yields a string representation of the GurobiSolverMethod.
bool isTerminate()
Check whether the program should terminate (due to some abort signal).