Browse Source

Resolved problems resulting from merge.

- gcc 4.8 (and assorted libraries) does not provide an erase(const_iterator) method for std::list but only an erase(iterator).
  This is in compliance with the c++11 draft N3337, which specifies the change from iterator to const_iterator only for "set, multiset, map [and] multimap" but not list.
  Therefore the constant list iterators were replaced by non constant iterators in MaximalEndComponentDecomposition and Vector set.
  The locations are marked with a FIXME, such that the const_iterator can be replaced back when gcc provides it.

- Fixed (completed) the stub implementation for the GurobiLpSolver in case that Gurobi is not present.
|-> Would not compile before due to missing functions and incorrect signatures.

- Switched to c++11 for gcc. Since gcc 4.8 provides full compliance to the c++11 standard.
|-> Initially hoped that it would fix the const_iterator problem, but it did not.

- Fixed the cmake warning concerning a missing whitespace between tokens in the last line of CMakeLists.txt.


Former-commit-id: f90768375e
tempestpy_adaptions
masawei 11 years ago
parent
commit
175e852956
  1. 6
      CMakeLists.txt
  2. 2
      src/counterexamples/MILPMinimalLabelSetGenerator.h
  3. 13
      src/solver/GurobiLpSolver.h
  4. 9
      src/storage/MaximalEndComponentDecomposition.cpp
  5. 2
      src/storage/SparseMatrix.cpp
  6. 2
      src/storage/VectorSet.cpp
  7. 3
      src/storage/VectorSet.h

6
CMakeLists.txt

@ -110,7 +110,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
message(STATUS "StoRM - Using Compiler Configuration: GCC")
# Set standard flags for GCC
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x -Wall -pedantic")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -pedantic")
# -Werror is atm removed as this gave some problems with existing code
# May be re-set later
# (Thomas Heinemann, 2012-12-21)
@ -482,5 +482,5 @@ add_custom_target(memcheck valgrind --leak-check=full --show-reachable=yes ${PRO
add_custom_target(memcheck-functional-tests valgrind --leak-check=full --show-reachable=yes ${PROJECT_BINARY_DIR}/storm-functional-tests -v --fix-deadlocks DEPENDS storm-functional-tests)
add_custom_target(memcheck-performance-tests valgrind --leak-check=full --show-reachable=yes ${PROJECT_BINARY_DIR}/storm-performance-tests -v --fix-deadlocks DEPENDS storm-performance-tests)
set (CPPLINT_ARGS --filter=-whitespace/tab,-whitespace/line_length,-legal/copyright,-readability/streams)
add_custom_target(style python cpplint.py ${CPPLINT_ARGS} `find ./src/ -iname "*.h" -or -iname "*.cpp"`)
set(CPPLINT_ARGS --filter=-whitespace/tab,-whitespace/line_length,-legal/copyright,-readability/streams)
add_custom_target(style python cpplint.py ${CPPLINT_ARGS} `find ./src/ -iname "*.h" -or -iname "*.cpp" `)

2
src/counterexamples/MILPMinimalLabelSetGenerator.h

@ -8,6 +8,8 @@
#ifndef STORM_COUNTEREXAMPLES_MILPMINIMALLABELSETGENERATOR_MDP_H_
#define STORM_COUNTEREXAMPLES_MILPMINIMALLABELSETGENERATOR_MDP_H_
#include <chrono>
#include "src/models/Mdp.h"
#include "src/ir/Program.h"
#include "src/exceptions/NotImplementedException.h"

13
src/solver/GurobiLpSolver.h

@ -2,6 +2,7 @@
#define STORM_SOLVER_GUROBILPSOLVER
#include "src/solver/LpSolver.h"
#include "src/exceptions/NotImplementedException.h"
// To detect whether the usage of Gurobi is possible, this include is neccessary.
#include "storm-config.h"
@ -58,6 +59,16 @@ namespace storm {
#else
// If Gurobi is not available, we provide a stub implementation that emits an error if any of its methods is called.
class GurobiLpSolver : public LpSolver {
public:
GurobiLpSolver(std::string const& name) : LpSolver(MINIMIZE) {
throw storm::exceptions::NotImplementedException() << "This version of StoRM was compiled without support for Gurobi. Yet, a method was called that requires this support. Please choose a version of support with Gurobi support.";
}
virtual ~GurobiLpSolver() {
throw storm::exceptions::NotImplementedException() << "This version of StoRM was compiled without support for Gurobi. Yet, a method was called that requires this support. Please choose a version of support with Gurobi support.";
}
virtual uint_fast64_t createContinuousVariable(std::string const& name, VariableType const& variableType, double lowerBound, double upperBound, double objectiveFunctionCoefficient) override {
throw storm::exceptions::NotImplementedException() << "This version of StoRM was compiled without support for Gurobi. Yet, a method was called that requires this support. Please choose a version of support with Gurobi support.";
}
@ -66,7 +77,7 @@ namespace storm {
throw storm::exceptions::NotImplementedException() << "This version of StoRM was compiled without support for Gurobi. Yet, a method was called that requires this support. Please choose a version of support with Gurobi support.";
}
virtual uint_fast64_t createBinaryVariable(std::string const& name, double lowerBound, double upperBound, double objectiveFunctionCoefficient) override {
virtual uint_fast64_t createBinaryVariable(std::string const& name, double objectiveFunctionCoefficient) override {
throw storm::exceptions::NotImplementedException() << "This version of StoRM was compiled without support for Gurobi. Yet, a method was called that requires this support. Please choose a version of support with Gurobi support.";
}

9
src/storage/MaximalEndComponentDecomposition.cpp

@ -55,7 +55,12 @@ namespace storm {
endComponentStateSets.emplace_back(subsystem);
storm::storage::BitVector statesToCheck(model.getNumberOfStates());
for (std::list<StateBlock>::const_iterator mecIterator = endComponentStateSets.begin(); mecIterator != endComponentStateSets.end();) {
// The iterator used here should really be a const_iterator.
// However, gcc 4.8 (and assorted libraries) does not provide an erase(const_iterator) method for std::list but only an erase(iterator).
// This is in compliance with the c++11 draft N3337, which specifies the change from iterator to const_iterator only for "set, multiset, map [and] multimap".
// FIXME: As soon as gcc provides an erase(const_iterator) method, change this iterator back to a const_iterator.
for (std::list<StateBlock>::iterator mecIterator = endComponentStateSets.begin(); mecIterator != endComponentStateSets.end();) {
StateBlock const& mec = *mecIterator;
// Keep track of whether the MEC changed during this iteration.
@ -121,7 +126,7 @@ namespace storm {
}
}
std::list<StateBlock>::const_iterator eraseIterator(mecIterator);
std::list<StateBlock>::iterator eraseIterator(mecIterator);
++mecIterator;
endComponentStateSets.erase(eraseIterator);
} else {

2
src/storage/SparseMatrix.cpp

@ -902,7 +902,7 @@ namespace storage {
}
template<typename T>
typename SparseMatrix<T>::ValueIterator SparseMatrix<T>::valueIteratorBegin(uint_fast64_t row = 0) {
typename SparseMatrix<T>::ValueIterator SparseMatrix<T>::valueIteratorBegin(uint_fast64_t row) {
return &(this->valueStorage[0]) + this->rowIndications[row];
}

2
src/storage/VectorSet.cpp

@ -196,7 +196,7 @@ namespace storm {
}
template<typename ValueType>
typename VectorSet<ValueType>::iterator VectorSet<ValueType>::insert(typename VectorSet<ValueType>::const_iterator pos, ValueType const& element) {
typename VectorSet<ValueType>::iterator VectorSet<ValueType>::insert(typename VectorSet<ValueType>::iterator pos, ValueType const& element) {
dirty = true;
return data.insert(pos, element);
}

3
src/storage/VectorSet.h

@ -84,7 +84,8 @@ namespace storm {
void insert(ValueType const& element);
iterator insert(const_iterator pos, ValueType const& element);
// FIXME: As soon as gcc provides an erase(const_iterator) method, change this iterator back to a const_iterator.
iterator insert(iterator pos, ValueType const& element);
void insert(VectorSet<ValueType> const& other);

Loading…
Cancel
Save