29 std::vector<ValueType>
const& b)
const {
30 STORM_LOG_ASSERT(x.size() == this->A->getRowGroupCount(),
"Provided x-vector has invalid size.");
31 STORM_LOG_ASSERT(b.size() == this->A->getRowCount(),
"Provided b-vector has invalid size.");
36 if (!rowGroupOrdering) {
44 auxiliaryRowVector = std::vector<ValueType>(this->
A->getRowCount());
45 auxiliaryRowGroupVector = std::vector<ValueType>(this->
A->getRowGroupCount());
48 std::vector<ValueType>* xPtr = &x;
49 std::vector<ValueType>
const* bPtr = &b;
50 if (rowGroupOrdering) {
51 STORM_LOG_ASSERT(rowGroupOrdering->size() == x.size(),
"X-vector has unexpected size.");
52 STORM_LOG_ASSERT(auxiliaryRowGroupVector->size() == x.size(),
"X-vector has unexpected size.");
53 STORM_LOG_ASSERT(auxiliaryRowVector->size() == b.size(),
"B-vector has unexpected size.");
54 for (uint64_t newGroupIndex = 0; newGroupIndex < x.size(); ++newGroupIndex) {
55 uint64_t newRow = orderedMatrix->getRowGroupIndices()[newGroupIndex];
56 uint64_t newRowGroupEnd = orderedMatrix->getRowGroupIndices()[newGroupIndex + 1];
57 uint64_t oldRow = this->
A->getRowGroupIndices()[(*rowGroupOrdering)[newGroupIndex]];
58 for (; newRow < newRowGroupEnd; ++newRow, ++oldRow) {
59 (*auxiliaryRowVector)[newRow] = b[oldRow];
62 for (
auto const& bFactor : bFactors) {
64 (*auxiliaryRowVector)[bFactor.first] *= *bFactor.second;
68 "Expected a zero b vector entry for a row with a selfloop of probability one.");
71 xPtr = &auxiliaryRowGroupVector.get();
72 bPtr = &auxiliaryRowVector.get();
76 std::vector<uint64_t>* choicesPtr =
nullptr;
83 if (rowGroupOrdering) {
84 if (auxiliaryRowGroupIndexVector) {
85 auxiliaryRowGroupIndexVector->resize(this->
A->getRowGroupCount());
87 auxiliaryRowGroupIndexVector = std::vector<uint64_t>(this->
A->getRowGroupCount());
89 choicesPtr = &(auxiliaryRowGroupIndexVector.get());
96 this->multiplier->multiplyAndReduceGaussSeidel(env, dir, *xPtr, bPtr, choicesPtr,
true);
98 if (rowGroupOrdering) {
100 for (uint64_t newGroupIndex = 0; newGroupIndex < x.size(); ++newGroupIndex) {
101 x[(*rowGroupOrdering)[newGroupIndex]] = (*xPtr)[newGroupIndex];
105 for (uint64_t newGroupIndex = 0; newGroupIndex < x.size(); ++newGroupIndex) {
106 this->
schedulerChoices.get()[(*rowGroupOrdering)[newGroupIndex]] = (*choicesPtr)[newGroupIndex];
virtual MinMaxLinearEquationSolverRequirements getRequirements(Environment const &env, boost::optional< storm::solver::OptimizationDirection > const &direction=boost::none, bool const &hasInitialScheduler=false) const override
Retrieves the requirements of this solver for solving equations with the current settings.
storm::storage::SparseMatrix< ValueType > createReorderedMatrix(storm::storage::SparseMatrix< ValueType > const &matrix, std::vector< uint64_t > const &newToOrigIndexMap, std::vector< std::pair< uint64_t, std::optional< ValueType > > > &bFactors)
reorders the row group such that the i'th row of the new matrix corresponds to the order[i]'th row of...