Browse Source

repeatedMultiply methods of MinMaxSolvers now get the b-Vector as const

main
TimQu 8 years ago
parent
commit
c5ebfb74fb
  1. 2
      src/storm/solver/MinMaxLinearEquationSolver.h
  2. 2
      src/storm/solver/StandardMinMaxLinearEquationSolver.cpp
  3. 2
      src/storm/solver/StandardMinMaxLinearEquationSolver.h
  4. 2
      src/storm/solver/TopologicalMinMaxLinearEquationSolver.cpp
  5. 2
      src/storm/solver/TopologicalMinMaxLinearEquationSolver.h

2
src/storm/solver/MinMaxLinearEquationSolver.h

@ -70,7 +70,7 @@ namespace storm {
* vector must be equal to the number of rows of A.
* @return The result of the repeated matrix-vector multiplication as the content of the vector x.
*/
virtual void repeatedMultiply(OptimizationDirection d, std::vector<ValueType>& x, std::vector<ValueType>* b, uint_fast64_t n = 1) const = 0;
virtual void repeatedMultiply(OptimizationDirection d, std::vector<ValueType>& x, std::vector<ValueType> const* b, uint_fast64_t n = 1) const = 0;
/*!
* Behaves the same as the other variant of <code>multiply</code>, with the

2
src/storm/solver/StandardMinMaxLinearEquationSolver.cpp

@ -301,7 +301,7 @@ namespace storm {
}
template<typename ValueType>
void StandardMinMaxLinearEquationSolver<ValueType>::repeatedMultiply(OptimizationDirection dir, std::vector<ValueType>& x, std::vector<ValueType>* b, uint_fast64_t n) const {
void StandardMinMaxLinearEquationSolver<ValueType>::repeatedMultiply(OptimizationDirection dir, std::vector<ValueType>& x, std::vector<ValueType> const* b, uint_fast64_t n) const {
if(!linEqSolverA) {
linEqSolverA = linearEquationSolverFactory->create(A);
linEqSolverA->setCachingEnabled(true);

2
src/storm/solver/StandardMinMaxLinearEquationSolver.h

@ -39,7 +39,7 @@ namespace storm {
StandardMinMaxLinearEquationSolver(storm::storage::SparseMatrix<ValueType>&& A, std::unique_ptr<LinearEquationSolverFactory<ValueType>>&& linearEquationSolverFactory, StandardMinMaxLinearEquationSolverSettings<ValueType> const& settings = StandardMinMaxLinearEquationSolverSettings<ValueType>());
virtual bool solveEquations(OptimizationDirection dir, std::vector<ValueType>& x, std::vector<ValueType> const& b) const override;
virtual void repeatedMultiply(OptimizationDirection dir, std::vector<ValueType>& x, std::vector<ValueType>* b, uint_fast64_t n) const override;
virtual void repeatedMultiply(OptimizationDirection dir, std::vector<ValueType>& x, std::vector<ValueType> const* b, uint_fast64_t n) const override;
StandardMinMaxLinearEquationSolverSettings<ValueType> const& getSettings() const;
void setSettings(StandardMinMaxLinearEquationSolverSettings<ValueType> const& newSettings);

2
src/storm/solver/TopologicalMinMaxLinearEquationSolver.cpp

@ -438,7 +438,7 @@ namespace storm {
}
template<typename ValueType>
void TopologicalMinMaxLinearEquationSolver<ValueType>::repeatedMultiply(OptimizationDirection dir, std::vector<ValueType>& x, std::vector<ValueType>* b, uint_fast64_t n) const {
void TopologicalMinMaxLinearEquationSolver<ValueType>::repeatedMultiply(OptimizationDirection dir, std::vector<ValueType>& x, std::vector<ValueType> const* b, uint_fast64_t n) const {
std::unique_ptr<std::vector<ValueType>> multiplyResult = std::make_unique<std::vector<ValueType>>(this->A.getRowCount());
// Now perform matrix-vector multiplication as long as we meet the bound of the formula.

2
src/storm/solver/TopologicalMinMaxLinearEquationSolver.h

@ -34,7 +34,7 @@ namespace storm {
virtual bool solveEquations(OptimizationDirection dir, std::vector<ValueType>& x, std::vector<ValueType> const& b) const override;
virtual void repeatedMultiply(OptimizationDirection dir, std::vector<ValueType>& x, std::vector<ValueType>* b, uint_fast64_t n) const override;
virtual void repeatedMultiply(OptimizationDirection dir, std::vector<ValueType>& x, std::vector<ValueType> const* b, uint_fast64_t n) const override;
virtual ValueType getPrecision() const override;
virtual bool getRelative() const override;

|||||||
100:0
Loading…
Cancel
Save