diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e55e10..18fd895 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ project(Yannakakis) cmake_minimum_required(VERSION 2.8) -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1y") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") find_package(Boost REQUIRED COMPONENTS iostreams program_options filesystem system serialization) include_directories(SYSTEM ${Boost_INCLUDE_DIRS}) diff --git a/lib/mealy.hpp b/lib/mealy.hpp index f5637d3..9f6d51f 100644 --- a/lib/mealy.hpp +++ b/lib/mealy.hpp @@ -17,6 +17,8 @@ */ struct mealy { struct edge { + edge() = default; + edge(state t, output o) : to(t), output(o) {} state to = state(-1); output output = size_t(-1); }; diff --git a/lib/reachability.cpp b/lib/reachability.cpp index 474463c..06b0dda 100644 --- a/lib/reachability.cpp +++ b/lib/reachability.cpp @@ -37,7 +37,7 @@ mealy reachable_submachine(const mealy& in, state start) { if (out.graph.size() < max_state) out.graph.resize(max_state); if (out.graph[s2].size() < in.input_size) out.graph[s2].resize(in.input_size); - out.graph[s2][i] = {t2, o}; + out.graph[s2][i] = mealy::edge(t2, o); if (!visited[t]) work.push(t); } diff --git a/lib/read_mealy_from_dot.cpp b/lib/read_mealy_from_dot.cpp index fbc5999..53a9fec 100644 --- a/lib/read_mealy_from_dot.cpp +++ b/lib/read_mealy_from_dot.cpp @@ -57,7 +57,7 @@ mealy read_mealy_from_dot(std::istream & in, translation & t){ m.graph.resize(max_state); auto & v = m.graph[state_indices[lh]]; v.resize(t.max_input); - v[t.input_indices[input]] = {state_indices[rh], t.output_indices[output]}; + v[t.input_indices[input]] = mealy::edge(state_indices[rh], t.output_indices[output]); } m.graph_size = max_state; diff --git a/lib/splitting_tree.cpp b/lib/splitting_tree.cpp index 6f09350..1196294 100644 --- a/lib/splitting_tree.cpp +++ b/lib/splitting_tree.cpp @@ -86,7 +86,7 @@ result create_splitting_tree(const mealy& g, options opt){ while(!work.empty()){ splitting_tree & boom = work.front(); work.pop(); - const auto depth = boom.depth; + const size_t depth = boom.depth; if(boom.states.size() == 1) continue; @@ -130,9 +130,9 @@ result create_splitting_tree(const mealy& g, options opt){ if(oboom.children.empty()) continue; // possibly a succesful split, construct the children - const auto word = concat({symbol}, oboom.seperator); + const vector word = concat(vector(1, symbol), oboom.seperator); const auto new_blocks = partition_(begin(boom.states), end(boom.states), [word, depth, &g, &update_succession](state state){ - const auto ret = apply(g, state, begin(word), end(word)); + const mealy::edge ret = apply(g, state, word.begin(), word.end()); update_succession(state, ret.to, depth); return ret.output; }, Q);