Storm
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
NativeMultiplier.h
Go to the documentation of this file.
1#pragma once
2
4
6
7namespace storm {
8namespace storage {
9template<typename ValueType>
10class SparseMatrix;
11}
12
13namespace solver {
14
15template<typename ValueType>
16class NativeMultiplier : public Multiplier<ValueType> {
17 public:
19 virtual ~NativeMultiplier() = default;
20
21 virtual void multiply(Environment const& env, std::vector<ValueType> const& x, std::vector<ValueType> const* b,
22 std::vector<ValueType>& result) const override;
23 virtual void multiplyGaussSeidel(Environment const& env, std::vector<ValueType>& x, std::vector<ValueType> const* b, bool backwards = true) const override;
24 virtual void multiplyAndReduce(Environment const& env, OptimizationDirection const& dir, std::vector<uint64_t> const& rowGroupIndices,
25 std::vector<ValueType> const& x, std::vector<ValueType> const* b, std::vector<ValueType>& result,
26 std::vector<uint_fast64_t>* choices = nullptr) const override;
27 virtual void multiplyAndReduceGaussSeidel(Environment const& env, OptimizationDirection const& dir, std::vector<uint64_t> const& rowGroupIndices,
28 std::vector<ValueType>& x, std::vector<ValueType> const* b, std::vector<uint_fast64_t>* choices = nullptr,
29 bool backwards = true) const override;
30 virtual void multiplyRow(uint64_t const& rowIndex, std::vector<ValueType> const& x, ValueType& value) const override;
31 virtual void multiplyRow2(uint64_t const& rowIndex, std::vector<ValueType> const& x1, ValueType& val1, std::vector<ValueType> const& x2,
32 ValueType& val2) const override;
33
34 private:
35 bool parallelize(Environment const& env) const;
36
37 void multAdd(std::vector<ValueType> const& x, std::vector<ValueType> const* b, std::vector<ValueType>& result) const;
38
39 void multAddReduce(storm::solver::OptimizationDirection const& dir, std::vector<uint64_t> const& rowGroupIndices, std::vector<ValueType> const& x,
40 std::vector<ValueType> const* b, std::vector<ValueType>& result, std::vector<uint64_t>* choices = nullptr) const;
41
42 void multAddParallel(std::vector<ValueType> const& x, std::vector<ValueType> const* b, std::vector<ValueType>& result) const;
43 void multAddReduceParallel(storm::solver::OptimizationDirection const& dir, std::vector<uint64_t> const& rowGroupIndices, std::vector<ValueType> const& x,
44 std::vector<ValueType> const* b, std::vector<ValueType>& result, std::vector<uint64_t>* choices = nullptr) const;
45};
46
47} // namespace solver
48} // namespace storm
storm::storage::SparseMatrix< ValueType > const & matrix
Definition Multiplier.h:146
virtual void multiplyAndReduceGaussSeidel(Environment const &env, OptimizationDirection const &dir, std::vector< uint64_t > const &rowGroupIndices, std::vector< ValueType > &x, std::vector< ValueType > const *b, std::vector< uint_fast64_t > *choices=nullptr, bool backwards=true) const override
virtual void multiplyRow2(uint64_t const &rowIndex, std::vector< ValueType > const &x1, ValueType &val1, std::vector< ValueType > const &x2, ValueType &val2) const override
Multiplies the row with the given index with x1 and x2 and adds the given offset o1 and o2,...
virtual ~NativeMultiplier()=default
virtual void multiplyAndReduce(Environment const &env, OptimizationDirection const &dir, std::vector< uint64_t > const &rowGroupIndices, std::vector< ValueType > const &x, std::vector< ValueType > const *b, std::vector< ValueType > &result, std::vector< uint_fast64_t > *choices=nullptr) const override
virtual void multiplyGaussSeidel(Environment const &env, std::vector< ValueType > &x, std::vector< ValueType > const *b, bool backwards=true) const override
Performs a matrix-vector multiplication in gauss-seidel style.
virtual void multiplyRow(uint64_t const &rowIndex, std::vector< ValueType > const &x, ValueType &value) const override
Multiplies the row with the given index with x and adds the result to the provided value.
virtual void multiply(Environment const &env, std::vector< ValueType > const &x, std::vector< ValueType > const *b, std::vector< ValueType > &result) const override
Performs a matrix-vector multiplication x' = A*x + b.
A class that holds a possibly non-square matrix in the compressed row storage format.
LabParser.cpp.
Definition cli.cpp:18