diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f6c9b578..89615eb3a 100644 --- a/CMakeLists.txt +++ b/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" `) diff --git a/src/counterexamples/MILPMinimalLabelSetGenerator.h b/src/counterexamples/MILPMinimalLabelSetGenerator.h index a8d1a178d..910948391 100644 --- a/src/counterexamples/MILPMinimalLabelSetGenerator.h +++ b/src/counterexamples/MILPMinimalLabelSetGenerator.h @@ -8,6 +8,8 @@ #ifndef STORM_COUNTEREXAMPLES_MILPMINIMALLABELSETGENERATOR_MDP_H_ #define STORM_COUNTEREXAMPLES_MILPMINIMALLABELSETGENERATOR_MDP_H_ +#include + #include "src/models/Mdp.h" #include "src/ir/Program.h" #include "src/exceptions/NotImplementedException.h" diff --git a/src/solver/GurobiLpSolver.h b/src/solver/GurobiLpSolver.h index cc2f2c831..0bd5cf0c9 100644 --- a/src/solver/GurobiLpSolver.h +++ b/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."; } diff --git a/src/storage/MaximalEndComponentDecomposition.cpp b/src/storage/MaximalEndComponentDecomposition.cpp index 53726ac28..773d1372f 100644 --- a/src/storage/MaximalEndComponentDecomposition.cpp +++ b/src/storage/MaximalEndComponentDecomposition.cpp @@ -55,7 +55,12 @@ namespace storm { endComponentStateSets.emplace_back(subsystem); storm::storage::BitVector statesToCheck(model.getNumberOfStates()); - for (std::list::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::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::const_iterator eraseIterator(mecIterator); + std::list::iterator eraseIterator(mecIterator); ++mecIterator; endComponentStateSets.erase(eraseIterator); } else { diff --git a/src/storage/SparseMatrix.cpp b/src/storage/SparseMatrix.cpp index 26176c0d3..24e28fa2a 100644 --- a/src/storage/SparseMatrix.cpp +++ b/src/storage/SparseMatrix.cpp @@ -902,7 +902,7 @@ namespace storage { } template - typename SparseMatrix::ValueIterator SparseMatrix::valueIteratorBegin(uint_fast64_t row = 0) { + typename SparseMatrix::ValueIterator SparseMatrix::valueIteratorBegin(uint_fast64_t row) { return &(this->valueStorage[0]) + this->rowIndications[row]; } diff --git a/src/storage/VectorSet.cpp b/src/storage/VectorSet.cpp index 4e42fc83c..b10f2673d 100644 --- a/src/storage/VectorSet.cpp +++ b/src/storage/VectorSet.cpp @@ -196,7 +196,7 @@ namespace storm { } template - typename VectorSet::iterator VectorSet::insert(typename VectorSet::const_iterator pos, ValueType const& element) { + typename VectorSet::iterator VectorSet::insert(typename VectorSet::iterator pos, ValueType const& element) { dirty = true; return data.insert(pos, element); } diff --git a/src/storage/VectorSet.h b/src/storage/VectorSet.h index 5cd68aecc..bb5de042e 100644 --- a/src/storage/VectorSet.h +++ b/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 const& other);