Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
NativeMultiplier.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4
6
8
9namespace storm {
10namespace storage {
11template<typename ValueType>
12class SparseMatrix;
13}
14
15namespace solver {
16
17template<typename ValueType>
18class NativeMultiplier : public Multiplier<ValueType> {
19 public:
21 virtual ~NativeMultiplier() = default;
22
23 virtual void multiply(Environment const& env, std::vector<ValueType> const& x, std::vector<ValueType> const* b,
24 std::vector<ValueType>& result) const override;
25 virtual void multiplyGaussSeidel(Environment const& env, std::vector<ValueType>& x, std::vector<ValueType> const* b, bool backwards = true) const override;
26 virtual void multiplyAndReduce(Environment const& env, OptimizationDirection const& dir, std::vector<uint64_t> const& rowGroupIndices,
27 std::vector<ValueType> const& x, std::vector<ValueType> const* b, std::vector<ValueType>& result,
28 UncertaintyResolutionMode const& uncertaintyResolutionMode = UncertaintyResolutionMode::Unset,
29 std::vector<uint_fast64_t>* choices = nullptr) const override;
30 virtual void multiplyAndReduceGaussSeidel(Environment const& env, OptimizationDirection const& dir, std::vector<uint64_t> const& rowGroupIndices,
31 std::vector<ValueType>& x, std::vector<ValueType> const* b, std::vector<uint_fast64_t>* choices = nullptr,
32 bool backwards = true) const override;
39 void multiplyRow(uint64_t const& rowIndex, std::vector<ValueType> const& x, ValueType& value) const;
40
49 void multiplyRow2(uint64_t const& rowIndex, std::vector<ValueType> const& x1, ValueType& val1, std::vector<ValueType> const& x2, ValueType& val2) const;
50
51 private:
52 void multAdd(std::vector<ValueType> const& x, std::vector<ValueType> const* b, std::vector<ValueType>& result) const;
53
54 void multAddReduce(storm::solver::OptimizationDirection const& dir, std::vector<uint64_t> const& rowGroupIndices, std::vector<ValueType> const& x,
55 std::vector<ValueType> const* b, std::vector<ValueType>& result, std::vector<uint64_t>* choices = nullptr) const;
56};
57
58} // namespace solver
59} // namespace storm
Multiplier(storm::storage::SparseMatrix< ValueType > const &matrix)
storm::storage::SparseMatrix< ValueType > const & matrix
Definition Multiplier.h:169
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 ~NativeMultiplier()=default
void multiplyRow(uint64_t const &rowIndex, std::vector< ValueType > const &x, ValueType &value) const
Multiplies the row with the given index with x and adds the result to the provided value.
NativeMultiplier(storm::storage::SparseMatrix< ValueType > const &matrix)
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,...
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, UncertaintyResolutionMode const &uncertaintyResolutionMode=UncertaintyResolutionMode::Unset, 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
virtual void multiply(Environment const &env, std::vector< ValueType > const &x, std::vector< ValueType > const *b, std::vector< ValueType > &result) const override
A class that holds a possibly non-square matrix in the compressed row storage format.