diff --git a/Makefile.in b/Makefile.in index dd15827..ff2e7c6 100755 --- a/Makefile.in +++ b/Makefile.in @@ -22,7 +22,7 @@ boost_libdir ?= $(prefix) # Flags, Libraries and Includes INCLUDES := -I. -I$(boost_libdir)/include -CXXFLAGS := -std=c++17 -Wall -Werror -Wno-reorder -O3 -D BOOST_PHOENIX_STL_TUPLE_H_ -D BOOST_MPL_LIMIT_LIST_SIZE=30 -D BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +CXXFLAGS := -std=c++17 -Wall -Werror -Wno-reorder -O2 -D BOOST_PHOENIX_STL_TUPLE_H_ -D BOOST_MPL_LIMIT_LIST_SIZE=30 -D BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS ifeq ($(MODE),Debug) CXXFLAGS += -ggdb endif diff --git a/eval/visitors/eval_expr.cpp b/eval/visitors/eval_expr.cpp index 23321bc..215db9a 100755 --- a/eval/visitors/eval_expr.cpp +++ b/eval/visitors/eval_expr.cpp @@ -246,15 +246,15 @@ auto connected_visitor_ = Util::Overload { }; auto matching_visitor_ = Util::Overload { - [](LIB::BaseSBG a, Util::MD_NAT b, Util::MD_NAT c, bool d) { - LIB::BaseMatch match(a.copy(b[0]), d); - return InfoBaseType(match.calculate(c[0])); + [](LIB::BaseSBG a, Util::MD_NAT b, bool c) { + LIB::BaseMatch match(a.copy(b[0]), c); + return InfoBaseType(match.calculate()); }, - [](LIB::CanonSBG a, Util::MD_NAT b, Util::MD_NAT c, bool d) { - LIB::CanonMatch match(a.copy(b[0]), d); - return InfoBaseType(match.calculate(c[0])); + [](LIB::CanonSBG a, Util::MD_NAT b, bool c) { + LIB::CanonMatch match(a.copy(b[0]), c); + return InfoBaseType(match.calculate()); }, - [](auto a, auto b, auto c, auto d) { + [](auto a, auto b, auto c) { Util::ERROR("Wrong arguments for matching"); return InfoBaseType(); } @@ -304,46 +304,46 @@ auto first_inv_visitor_ = Util::Overload { }; auto match_scc_visitor_ = Util::Overload { - [](LIB::BaseSBG a, Util::MD_NAT b, Util::MD_NAT c, bool d) { - LIB::BaseMatch match(a.copy(b[0]), d); - match.calculate(c[0]); - LIB::BaseSCC scc(buildSCCFromMatching(match), d); + [](LIB::BaseSBG a, Util::MD_NAT b, bool c) { + LIB::BaseMatch match(a.copy(b[0]), c); + match.calculate(); + LIB::BaseSCC scc(buildSCCFromMatching(match), c); return MapBaseType(scc.calculate()); }, - [](LIB::CanonSBG a, Util::MD_NAT b, Util::MD_NAT c, bool d) { - LIB::CanonMatch match(a.copy(b[0]), d); - match.calculate(c[0]); - LIB::CanonSCC scc(buildSCCFromMatching(match), d); + [](LIB::CanonSBG a, Util::MD_NAT b, bool c) { + LIB::CanonMatch match(a.copy(b[0]), c); + match.calculate(); + LIB::CanonSCC scc(buildSCCFromMatching(match), c); return MapBaseType(scc.calculate()); }, - [](auto a, auto b, auto c, auto d) { + [](auto a, auto b, auto c) { Util::ERROR("Wrong arguments for matching+scc"); return MapBaseType(); } }; auto match_scc_ts_visitor_ = Util::Overload { - [](LIB::BaseSBG a, Util::MD_NAT b, Util::MD_NAT c, bool d) { - LIB::BaseMatch match(a.copy(b[0]), d); - LIB::UnordSet match_res = match.calculate(c[0]).matched_edges(); - LIB::BaseSCC scc(buildSCCFromMatching(match), d); + [](LIB::BaseSBG a, Util::MD_NAT b, bool c) { + LIB::BaseMatch match(a.copy(b[0]), c); + LIB::UnordSet match_res = match.calculate().matched_edges(); + LIB::BaseSCC scc(buildSCCFromMatching(match), c); LIB::BasePWMap scc_res = scc.calculate(); - LIB::BaseTopSort ts(buildSortFromSCC(scc, scc_res), d); + LIB::BaseTopSort ts(buildSortFromSCC(scc, scc_res), c); LIB::BasePWMap ts_res = ts.calculate(); buildJson(match_res, scc_res, ts_res); return MapBaseType(ts_res); }, - [](LIB::CanonSBG a, Util::MD_NAT b, Util::MD_NAT c, bool d) { - LIB::CanonMatch match(a.copy(b[0]), d); - LIB::OrdSet match_res = match.calculate(c[0]).matched_edges(); - LIB::CanonSCC scc(buildSCCFromMatching(match), d); + [](LIB::CanonSBG a, Util::MD_NAT b, bool c) { + LIB::CanonMatch match(a.copy(b[0]), c); + LIB::OrdSet match_res = match.calculate().matched_edges(); + LIB::CanonSCC scc(buildSCCFromMatching(match), c); LIB::CanonPWMap scc_res = scc.calculate(); - LIB::CanonTopSort ts(buildSortFromSCC(scc, scc_res), d); + LIB::CanonTopSort ts(buildSortFromSCC(scc, scc_res), c); LIB::CanonPWMap ts_res = ts.calculate(); buildJson(match_res, scc_res, ts_res); return MapBaseType(ts_res); }, - [](auto a, auto b, auto c, auto d) { + [](auto a, auto b, auto c) { Util::ERROR("Wrong arguments for matching+scc+ts"); return MapBaseType(); } @@ -675,14 +675,13 @@ ExprBaseType EvalExpression::operator()(AST::Call v) const break; case Eval::Func::matching: - if (eval_args.size() == 3) { + if (eval_args.size() == 2) { arity_ok = true; SBGBaseType g = std::visit(EvalGraph{}, eval_args[0]); NatBaseType copies = std::visit(EvalNatBT{}, eval_args[1]); - NatBaseType k = std::visit(EvalNatBT{}, eval_args[2]); InfoBaseType result = std::visit( - matching_visitor_, g, copies, k, std::variant(debug_) + matching_visitor_, g, copies, std::variant(debug_) ); return result; } @@ -723,28 +722,26 @@ ExprBaseType EvalExpression::operator()(AST::Call v) const } case Eval::Func::match_scc: - if (eval_args.size() == 3) { + if (eval_args.size() == 2) { arity_ok = true; SBGBaseType g = std::visit(EvalGraph{}, eval_args[0]); NatBaseType copies = std::visit(EvalNatBT{}, eval_args[1]); - NatBaseType k = std::visit(EvalNatBT{}, eval_args[2]); MapBaseType result = std::visit( - match_scc_visitor_, g, copies, k, std::variant(debug_) + match_scc_visitor_, g, copies, std::variant(debug_) ); return result; } break; case Eval::Func::match_scc_ts: - if (eval_args.size() == 3) { + if (eval_args.size() == 2) { arity_ok = true; SBGBaseType g = std::visit(EvalGraph{}, eval_args[0]); NatBaseType copies = std::visit(EvalNatBT{}, eval_args[1]); - NatBaseType k = std::visit(EvalNatBT{}, eval_args[2]); MapBaseType result = std::visit( - match_scc_ts_visitor_, g, copies, k, std::variant(debug_) + match_scc_ts_visitor_, g, copies, std::variant(debug_) ); return result; } diff --git a/sbg/pw_map.cpp b/sbg/pw_map.cpp index 07e0443..407f67d 100644 --- a/sbg/pw_map.cpp +++ b/sbg/pw_map.cpp @@ -717,9 +717,10 @@ PWMap PWMap::minAdjMap(const PWMap &other2, const PWMap &other3) const PWMap ith_pw(ith); Set again = dom_res.intersection(visited); if (!again.isEmpty()) { - PWMap min_map = other3.minMap(res, ith_pw, other3); + PWMap aux_res = res.restrict(dom_res); + PWMap min_map = other3.minMap(aux_res, ith_pw, other3); res = min_map.combine(ith_pw).combine(res); - visited = visited.cup(min_map.dom()); + visited = visited.cup(ith_pw.dom()); } else { res.emplaceBack(ith); diff --git a/sbg/sbg_algorithms.cpp b/sbg/sbg_algorithms.cpp index 28ebd8e..b24276f 100644 --- a/sbg/sbg_algorithms.cpp +++ b/sbg/sbg_algorithms.cpp @@ -64,333 +64,10 @@ PWMap connectedComponents(SBGraph g) return PWMap(); } -// ----------------------------------------------------------------------------- -// Minimum reachable ----------------------------------------------------------- -// ----------------------------------------------------------------------------- - -template -PathInfo::PathInfo() : succs_(), reps_() {} -template -PathInfo::PathInfo(PWMap succs, PWMap reps) - : succs_(succs), reps_(reps) {} - -member_imp_temp(template, PathInfo, PWMap, succs); -member_imp_temp(template, PathInfo, PWMap, reps); - -template -bool eqId(const SBGMap &sbgmap) { return sbgmap.isId(); } - -template -bool notEqId(const SBGMap &sbgmap) { return !(sbgmap.isId()); } - -// Update rep iff new is less than current. Without this function, if there are -// vertices v1, v2, v3 and edges v1->v2, v1->v3 where rmap(v2) = rmap(v3) the -// algorithm could switch infinitely between those two reps. -template -PWMap updateMap(const Set &V, const PWMap &smap - , const PWMap &new_smap, const PWMap &rmap) -{ - PWMap res; - - if (!V.isEmpty()) { - PWMap vto_rep = rmap.composition(smap); - PWMap new_vto_rep = rmap.composition(new_smap); - Set not_updated = vto_rep.equalImage(new_vto_rep); - - res = smap.restrict(not_updated); - res = res.combine(new_smap); - } - - return res; -} - -template -MinReach::MinReach() : dsbg_(), debug_(false) {} -template -MinReach::MinReach(DSBGraph sbg, bool debug) - : dsbg_(sbg), debug_(debug) {} - -member_imp_temp(template, MinReach, DSBGraph, dsbg); -member_imp_temp(template, MinReach, bool, debug); - -template -PWMap MinReach::minReach1( - const Set &reach, const PW &smap, const PW &rmap -) const -{ - DSBGraph dg = dsbg_; - Set V = dg.V(); - PW mapB = dg.mapB(), mapD = dg.mapD(); - - PW auto_succs = smap.filterMap([](const SBGMap &sbgmap) { - return eqId(sbgmap); - }); - Set auto_reps = auto_succs.equalImage(rmap); - Set not_auto_succs = smap.filterMap([](const SBGMap &sbgmap) { - return notEqId(sbgmap); - }).dom(); - Set usable_verts = auto_reps.cup(not_auto_succs); - - PWMap auxB = mapB.restrict(reach), auxD = mapD.restrict(reach); - // Get minimum adjacent vertex with minimum representative - PWMap adj_smap = auxB.minAdjMap(auxD, rmap); - // Get minimum between current rep and adjacent reps - PWMap new_smap = rmap.minMap(adj_smap, smap.restrict(usable_verts), rmap); - // Update rep iff new is less than current - new_smap = updateMap(V, smap, new_smap, rmap); - new_smap = new_smap.combine(adj_smap); - new_smap = new_smap.combine(smap); - - return new_smap; -} - -// Handle recursion -template -PathInfo MinReach::recursion( - unsigned int n, const Set &ER, const Set &rv - , const PW &smap, const PW &rmap -) const -{ - PW mapB = dsbg().mapB(), mapD = dsbg().mapD() - , Vmap = dsbg().Vmap(), Emap = dsbg().Emap(), subE_map = dsbg().subE_map(); - PW ERB = mapB.restrict(ER), ERD = mapD.restrict(ER); - - Set start = ERB.image(); - start = start.difference(ERD.image()); - Set first = Vmap.image(start); - - Set ER_plus = Emap.preImage(Emap.image(ER)); - Set VR_plus = mapB.image(ER_plus).cup(mapD.image(ER_plus)); - - PW new_smap; - Set repeated = start.intersection(first); - for (unsigned int j = 0; j < n+1; ++j) { - // Vertices in the same set vertex as start - Set side = VR_plus.intersection(Vmap.preImage(Vmap.image(start))); - // Get edges orientated in the correct direction that are part of the - // recursion - Set ER_start = mapB.preImage(start).intersection(ER); - // Get edges in the same sub-set edge - Set ER_plus_start = subE_map.preImage(subE_map.image(ER_start)); - ER_plus_start = ER_plus_start.intersection(mapB.preImage(side)); - - PW sideB = mapB.restrict(ER_plus_start) - , sideD = mapD.restrict(ER_plus_start); - // Get successor in recursion - PW ith = sideD.composition(sideB.inverse()); - new_smap = ith.combine(new_smap); - - start = smap.image(start); - // Check if an already visited set-vertex is visited again - repeated = Vmap.image(start).intersection(first); - } - - // Solve recursion - Set endings = mapD.image(ER_plus).difference(mapB.image(ER_plus)); - PW smap_endings(endings); - new_smap = smap_endings.combine(new_smap); - new_smap = new_smap.restrict(VR_plus); - PW rmap_plus = rmap.composition(new_smap.mapInf(n-1)); - PW new_rmap = rmap.minMap(rmap_plus); - new_rmap = new_rmap.combine(rmap); - - return PathInfo(new_smap, new_rmap); -} - -template -PathInfo MinReach::calculate( - const Set &starts, const Set &endings -) const -{ - DSBGraph dg = dsbg(); - - if (!dg.V().isEmpty()) { - Set V = dg.V(), E = dg.E(); - PW mapB = dg.mapB(), mapD = dg.mapD(), Emap = dg.Emap(); - - PW old_semap, old_rmap; // Old vertex and edge successors maps - PW new_smap(V), new_semap(E); // New vertex and edge successors maps - PW new_rmap(V); // New vertex reps map - - Set Vc; // Vertices that changed sucessor - Set Ec; // Edges that changed successor - - // Vertices and edges that reach unmatched vertices - Set reach_vertices = endings, reach_edges; - - // If a vertex changes its successor, then a new path was found. If it is - // an augmenting one, a new matching can be obtained. That is why the loop - // iterates until Vc is empty. - do { - reach_vertices = reach_vertices.cup(new_rmap.preImage(endings)); - reach_edges = mapD.preImage(reach_vertices); - - old_rmap = new_rmap; - // Find adjacent vertex that reaches a minor vertex than the current one - new_smap = minReach1(reach_edges, new_smap.compact(), new_rmap.compact()); - new_rmap = new_rmap.minMap(new_rmap.composition(new_rmap.composition(new_smap))); - Vc = V.difference(old_rmap.equalImage(new_rmap)); - if (debug()) - Util::SBG_LOG << "minReach new_rmap: " << new_rmap << "\n\n"; - - // If the condition is met, unmatched "backward" vertices reach unmatched - // "forward" vertices - if (!new_rmap.image(starts).intersection(endings).isEmpty()) - return PathInfo(new_smap, new_rmap); - - if (!Vc.isEmpty()) { - - // Edges used in paths to reach a minimum - Set E_succ = mapD.equalImage(new_smap.composition(mapB)); - if (!E_succ.isEmpty()) { // A new path was chosen - old_semap = new_semap; - PW mapB_succ = mapB.restrict(E_succ) - , mapD_succ = mapD.restrict(E_succ); - new_semap = mapB_succ.inverse().composition(mapD_succ); - new_semap = new_semap.combine(old_semap); - - Set not_changed = new_semap.equalImage(old_semap); - Ec = E.difference(not_changed); - - if (!Ec.isEmpty()) { - Set ER; // Recursive edges that changed its successor - PW old_semap_nth, semap_nth = new_semap; //.composition(new_semap); - unsigned int j = 0; - // Look for recursions. The maximum depth is the number of SVs. - do { - // Take out edges that are self-successors - PW other = semap_nth.filterMap([](const SBGMap &sbgmap) { - return notEqId(sbgmap); - }); - // Edges that belong to the same set-edge - ER = Emap.equalImage(Emap.composition(other)); - old_semap_nth = semap_nth; - semap_nth = new_semap.composition(semap_nth); - - ++j; - } while (ER.isEmpty() && j < dg.nmbrSV() - && !(old_semap_nth == semap_nth)); - // Get new recursions - ER = ER.intersection(Ec); - ER = ER.cup(new_semap.image(ER)); - - if (!ER.isEmpty()) { // There are recursions, lets handle one of them - PathInfo res; - res = recursion( - j, ER, reach_vertices, new_smap, new_rmap - ); - new_rmap = res.reps(); - if (debug()) - Util::SBG_LOG << "recursion new_rmap: " << new_rmap << "\n\n"; - } - } - } - } - } while (!Vc.isEmpty()); - - return PathInfo(new_smap, new_rmap); - } - - return PathInfo(); -} - // ----------------------------------------------------------------------------- // Matching -------------------------------------------------------------------- // ----------------------------------------------------------------------------- -// Short path ------------------------------------------------------------------ - -template -void SBGMatching::shortPathDirection(const Set &endings, Direction dir) -{ - PW auxB = mapB().restrict(paths_edges()) - , auxD = mapD().restrict(paths_edges()); - - Set unmatched; - if (dir == forward) - unmatched = unmatched_U(); - else - unmatched = unmatched_F(); - - set_smap(PW(V_)); - set_rmap(PW(V_)); - - Set reach_end = endings; // Vertices that reach endings - Set P; // Vertices adjacent to reach_end - - unsigned int j = 0; // Current length of path - do { - // Start of edges entering reach_end - P = auxB.image(auxD.preImage(reach_end)); - P = P.difference(reach_end); // Take out vertices that are self-reps - // Edges that reach reach_end - Set reach_edges = auxB.preImage(P).intersection(auxD.preImage(reach_end)); - // Map from starts to the edges that take them to reach_end - PW starts = auxB.firstInv(reach_edges); - PW smap_reach = auxD.composition(starts); - set_smap(smap_reach.combine(smap())); - PW rmap_reach = rmap().composition(smap_reach); - set_rmap(rmap_reach.combine(rmap())); - - reach_end = reach_end.cup(P); - j++; - } while (!P.isEmpty() && P.intersection(unmatched).isEmpty() - && j < k()); - - return; -} - -template -void SBGMatching::shortPathStep() -{ - // *** Forward direction - shortPathDirection(unmatched_F(), forward); - PW rmapd = rmap(); - Set pe = edgesInPaths(); - set_paths_edges(pe); - - // *** Backward direction - PWMap auxB = mapB(); - set_mapB(mapD()); - set_mapD(auxB); - - shortPathDirection(unmatched_U(), backward); - const PW &rmaprmapd = rmap().composition(rmapd); - Set edgesb = edgesSameRepLR(rmaprmapd); - pe = pe.intersection(edgesInPaths().intersection(edgesb)); - set_paths_edges(pe); - - // *** Initial direction - set_mapD(mapB()); - set_mapB(auxB); - - // *** Update structures to reflect new matched edges - updatePaths(); - - return; -} - -template -void SBGMatching::shortPath() -{ - // Finish if all unknowns are matched or there aren't available edges - do { - set_paths_edges(E()); - shortPathStep(); - if (debug()) { - Util::SBG_LOG << "short step smap: " << smap() << "\n"; - Util::SBG_LOG << "short step matched edges: " << matched_E() << "\n"; - Util::SBG_LOG << "short step unmatched V: " << unmatched_V() << "\n\n"; - } - } while(!fullyMatchedU() && !paths_edges().isEmpty()); - - // In this case we only offset vertices here because shortPath isn't looking - // for any minimum reachable vertex - updateOffset(); - - return; -} - // Minimum reachable ----------------------------------------------------------- template @@ -598,6 +275,12 @@ void SBGMatching::minReachable() // Matching -------------------------------------------------------------------- +template +bool eqId(const SBGMap &sbgmap) { return sbgmap.isId(); } + +template +bool notEqId(const SBGMap &sbgmap) { return !(sbgmap.isId()); } + template MatchInfo::MatchInfo() : matched_edges_(), fully_matchedU_() {} template @@ -625,10 +308,10 @@ SBGMatching::SBGMatching() : sbg_(), V_(), Vmap_(), E_(), Emap_(), smap_(), rmap_(), omap_() , max_V_(), F_(), U_(), mapF_(), mapU_(), mapB_(), mapD_(), paths_edges_() , matched_E_(), unmatched_E_(), matched_V_(), unmatched_V_(), unmatched_F_() - , matched_U_(), unmatched_U_(), k_(6), debug_(false) {} + , matched_U_(), unmatched_U_(), debug_(false) {} template SBGMatching::SBGMatching(SBGraph sbg, bool debug) - : sbg_(sbg), V_(sbg.V()), Vmap_(sbg.Vmap()), Emap_(sbg.Emap()), k_(6) + : sbg_(sbg), V_(sbg.V()), Vmap_(sbg.Vmap()), Emap_(sbg.Emap()) , debug_(debug) { set_E(Emap_.dom()); @@ -688,8 +371,6 @@ member_imp_temp(template, SBGMatching, Set, unmatched_F); member_imp_temp(template, SBGMatching, Set, matched_U); member_imp_temp(template, SBGMatching, Set, unmatched_U); -member_imp_temp(template, SBGMatching, unsigned int, k); - member_imp_temp(template, SBGMatching, bool, debug); template @@ -768,49 +449,24 @@ void SBGMatching::updateOffset() } template -MatchInfo SBGMatching::calculate(unsigned int k) +MatchInfo SBGMatching::calculate() { if (debug()) Util::SBG_LOG << "Matching sbg: \n" << sbg() << "\n\n"; - set_k(k); auto begin = std::chrono::high_resolution_clock::now(); - shortPath(); + minReachable(); auto end = std::chrono::high_resolution_clock::now(); - auto duration1 = std::chrono::duration_cast( - end - begin - ); if (debug()) - Util::SBG_LOG << "shortPath: " << matched_E() << "\n\n"; - - bool mr_used = false; - if (!fullyMatchedU()) { - begin = std::chrono::high_resolution_clock::now(); - minReachable(); - end = std::chrono::high_resolution_clock::now(); - - if (debug()) - Util::SBG_LOG << "minReachable: " << matched_E() << "\n\n"; - mr_used = true; - } + Util::SBG_LOG << "minReachable: " << matched_E() << "\n\n"; Util::SBG_LOG << MatchInfo(matched_E(), fullyMatchedU()) << "\n\n"; - Util::SBG_LOG << "ShortPath exec time: " << duration1.count() << " [μs]\n"; - if (mr_used) { - auto duration2 = std::chrono::duration_cast( - end - begin - ); - Util::SBG_LOG << "MinReach exec time: " << duration2.count() << " [μs]\n"; - - auto total = std::chrono::duration_cast( - duration1 + duration2 - ); - Util::SBG_LOG << "Total match exec time: " << total.count() << " [μs]\n\n"; - } - else - Util::SBG_LOG << "Total match exec time: " << duration1.count() << " [μs]\n\n"; + auto total = std::chrono::duration_cast( + end - begin + ); + Util::SBG_LOG << "Total match exec time: " << total.count() << " [μs]\n"; return MatchInfo(matched_E(), fullyMatchedU()); } @@ -1126,12 +782,6 @@ PWMap SBGTopSort::calculate() template BasePWMap connectedComponents(BaseSBG g); template CanonPWMap connectedComponents(CanonSBG g); -template struct PathInfo; -template struct PathInfo; - -template struct MinReach; -template struct MinReach; - template struct MatchInfo; template std::ostream &operator<<( std::ostream &out, const MatchInfo &mi diff --git a/sbg/sbg_algorithms.hpp b/sbg/sbg_algorithms.hpp index 2d5ced3..642a26a 100755 --- a/sbg/sbg_algorithms.hpp +++ b/sbg/sbg_algorithms.hpp @@ -46,39 +46,6 @@ namespace LIB { template PWMap connectedComponents(SBGraph g); -// Minimum reachable ----------------------------------------------------------- - -template -struct PathInfo { - member_class(PWMap, succs); - member_class(PWMap, reps); - - PathInfo(); - PathInfo(PWMap succs, PWMap reps); -}; - -template -struct MinReach { - using PW = PWMap; - using PI = PathInfo; - - member_class(DSBGraph, dsbg); - member_class(bool, debug); - - MinReach(); - MinReach(DSBGraph dsbg, bool debug); - - PI calculate(const Set &starts, const Set &endings) const; - - private: - PW minReach1(const Set &reach, const PW &smap, const PW &rmap) const; - PI recursion(unsigned int n, const Set &ER, const Set ¬_rv - , const PW &smap, const PW &rmap) const; -}; - -typedef MinReach BaseMR; -typedef MinReach CanonMR; - // Matching -------------------------------------------------------------------- enum Direction { forward, backward }; @@ -133,7 +100,6 @@ struct SBGMatching { member_class(Set, matched_U); // Right matched vertices, mutable member_class(Set, unmatched_U); // Right unmatched vertices, mutable - member_class(unsigned int, k); // Depth of shortPath member_class(Set, cycle_edges); member_class(bool, debug); @@ -141,13 +107,9 @@ struct SBGMatching { SBGMatching(); SBGMatching(SBGraph sbg, bool debug); - MatchInfo calculate(unsigned int k); + MatchInfo calculate(); private: - void shortPathDirection(const Set &endings, Direction dir); - void shortPathStep(); - void shortPath(); - void selectSucc(DSBGraph dsbg); PW directedOffset(const PW &dir_map) const; diff --git a/test/matching1.test b/test/matching1.test index c672ded..422403a 100644 --- a/test/matching1.test +++ b/test/matching1.test @@ -1,6 +1,6 @@ // Matching test, with a simple recursion -N = 10000 +N = 10 V1 = 1 V2 = N-1+V1 @@ -10,22 +10,25 @@ E1 = 1 E2 = N-1+E1 E3 = N-1+E2 -off1d = N -off3b = N-1 -off2d = N-1 -off3d = 1 +off1b = r(V1, 1)-r(E1, 1) +off2b = r(V2, 1)-r(E2, 1) +off3b = r(V2, 1)-r(E3, 1) + +off1d = r(V3, 1)-r(E1, 1)-N+1 +off2d = r(V3, 1)-r(E2, 1)-1 +off3d = r(V3, 1)-r(E3, 1) V %= {[1:1:V1], [V1+1:1:V2], [V2+1:1:V3]}; Vmap %= <<{[1:1:V1]} -> 0*x+1, {[V1+1:1:V2]} -> 0*x+2, {[V2+1:1:V3]} -> 0*x+3>>; -map1 %= <<{[1:1:E1]} -> 1*x+0, {[E1+1:1:E2]} -> 1*x+0, {[E2+1:1:E3]} -> 1*x-off3b>>; +map1 %= <<{[1:1:E1]} -> 1*x+off1b, {[E1+1:1:E2]} -> 1*x+off2b, {[E2+1:1:E3]} -> 1*x+off3b>>; map2 %= <<{[1:1:E1]} -> 1*x+off1d, {[E1+1:1:E2]} -> 1*x+off2d, {[E2+1:1:E3]} -> 1*x+off3d>>; Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2], [E2+1:1:E3]} -> 0*x+2>>; matching( V %= {[1:1:V1], [V1+1:1:V2], [V2+1:1:V3]}; Vmap %= <<{[1:1:V1]} -> 0*x+1, {[V1+1:1:V2]} -> 0*x+2, {[V2+1:1:V3]} -> 0*x+3>>; - map1 %= <<{[1:1:E1]} -> 1*x+0, {[E1+1:1:E2]} -> 1*x+0, {[E2+1:1:E3]} -> 1*x-off3b>>; + map1 %= <<{[1:1:E1]} -> 1*x+off1b, {[E1+1:1:E2]} -> 1*x+off2b, {[E2+1:1:E3]} -> 1*x+off3b>>; map2 %= <<{[1:1:E1]} -> 1*x+off1d, {[E1+1:1:E2]} -> 1*x+off2d, {[E2+1:1:E3]} -> 1*x+off3d>>; Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2], [E2+1:1:E3]} -> 0*x+2>>; - , 1, 6 + , 1 ) diff --git a/test/matching2.test b/test/matching2.test index 9154b82..5b8fcba 100644 --- a/test/matching2.test +++ b/test/matching2.test @@ -28,5 +28,5 @@ matching( map1 %= <<{[1:1:E1]} -> 1*x+0, {[E1+1:1:E2]} -> 1*x+0, {[E2+1:1:E3]} -> 1*x-off3b>>; map2 %= <<{[1:1:E1]} -> 1*x+off1d, {[E1+1:1:E2]} -> 1*x+off2d, {[E2+1:1:E3]} -> 1*x+off3d>>; Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2], [E2+1:1:E3]} -> 0*x+2>>; - , 1, 6 + , 1 ) diff --git a/test/matching3.test b/test/matching3.test index 270aeea..0e19938 100644 --- a/test/matching3.test +++ b/test/matching3.test @@ -20,5 +20,5 @@ matching( , {[6:1:6]} -> 1*x-2, {[7:1:7]} -> 1*x-4, {[8:1:8]} -> 1*x-5, {[9:1:9]} -> 1*x-5, {[10:1:10]} -> 1*x-8>>; Emap %= <<{[1:1:1]} -> 0*x+1, {[2:1:2]} -> 0*x+2, {[3:1:3]} -> 0*x+3, {[4:1:4]} -> 0*x+4, {[5:1:5]} -> 0*x+5 , {[6:1:6]} -> 0*x+6, {[7:1:7]} -> 0*x+7, {[8:1:8]} -> 0*x+8, {[9:1:9]} -> 0*x+9, {[10:1:10]} -> 0*x+10>>; - , 1, 6 + , 1 ) diff --git a/test/performance/boost/main.cpp b/test/performance/boost/main.cpp index 226eb4e..53625ac 100644 --- a/test/performance/boost/main.cpp +++ b/test/performance/boost/main.cpp @@ -91,7 +91,7 @@ void computeTS(OG::DGraph graph) auto graph_visitor_ = SBG::Util::Overload { [](int a, SBG::LIB::BaseSBG b) { SBG::LIB::BaseMatch match(b, false); - match.calculate(6).matched_edges(); + match.calculate().matched_edges(); if (a == 0) { OG::OrdinaryGraphBuilder ordinary_graph_builder(b); @@ -118,7 +118,7 @@ auto graph_visitor_ = SBG::Util::Overload { }, [](int a, SBG::LIB::CanonSBG b) { SBG::LIB::CanonMatch match(b, false); - match.calculate(6).matched_edges(); + match.calculate().matched_edges(); if (a == 0) { OG::OrdinaryGraphBuilder ordinary_graph_builder(b); diff --git a/test/performance/boost_matching.sh b/test/performance/boost_matching.sh deleted file mode 100755 index 7f1d3db..0000000 --- a/test/performance/boost_matching.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/bash - -file=$1 -iterations=$2 -size=$3 -copies=$4 - -echo > test_values -echo > test_file - -while read line; do - if echo "$line" | grep -q "N = "; then - echo $line > eval; awk -v s=$size '{print "N = " s}' eval >> test_file; - else - echo $line >> test_file - fi -done < $file - - -for i in $(seq "$iterations"); do - echo $i - ./boost/bin/boost-performance -f test_file -c $copies - mv SBG.log SBG_${i}.log - echo - while read line; do - if echo "$line" | grep -q "Boost"; then echo $line > eval; awk '{print $7}' eval >> test_values; fi - done < "SBG_${i}.log" -done - -echo "Results:" - -cat test_values - -count=0; -total=0; - -for i in $( awk '{ print $1; }' test_values ) - do - total=$(echo $total+$i | bc ) - ((count++)) - done - -echo -echo "Average:" -echo "scale=2; $total / $count" | bc - - diff --git a/test/rc_matching.test b/test/rc_matching.test index bdad0a2..81656ec 100644 --- a/test/rc_matching.test +++ b/test/rc_matching.test @@ -104,5 +104,5 @@ matching( , {[E3+1:1:E4]} -> 0*x+4, {[E4+1:1:E5]} -> 0*x+5, {[E5+1:1:E6]} -> 0*x+6 , {[E6+1:1:E7]} -> 0*x+7, {[E7+1:1:E8a], [E8a+1:1:E8b]} -> 0*x+8, {[E8b+1:1:E9]} -> 0*x+9 , {[E9+1:1:E10]} -> 0*x+10, {[E10+1:1:E11]} -> 0*x+11>>; - , 1, 6 + , 1 ) diff --git a/test/rc_ts.test b/test/rc_ts.test index aa0132b..7131756 100644 --- a/test/rc_ts.test +++ b/test/rc_ts.test @@ -104,5 +104,5 @@ matchSCCTS( , {[E3+1:1:E4]} -> 0*x+4, {[E4+1:1:E5]} -> 0*x+5, {[E5+1:1:E6]} -> 0*x+6 , {[E6+1:1:E7]} -> 0*x+7, {[E7+1:1:E8a], [E8a+1:1:E8b]} -> 0*x+8, {[E8b+1:1:E9]} -> 0*x+9 , {[E9+1:1:E10]} -> 0*x+10, {[E10+1:1:E11]} -> 0*x+11>>; - , 1, 6 + , 1 ) diff --git a/test/rl1_matching.test b/test/rl1_matching.test index 7fd8179..3951ad5 100644 --- a/test/rl1_matching.test +++ b/test/rl1_matching.test @@ -99,5 +99,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3], [E3+1:1:E4] , {[E4+1:1:E5]} -> 0*x+4 , {[E5+1:1:E6], [E6+1:1:E7]} -> 0*x+6, {[E7+1:1:E8]} -> 0*x+7, {[E8+1:1:E9]} -> 0*x+8 , {[E9+1:1:E10]} -> 0*x+9>>; - , 1, 6 + , 1 ) diff --git a/test/rl1_scc.test b/test/rl1_scc.test index 985a938..a876130 100644 --- a/test/rl1_scc.test +++ b/test/rl1_scc.test @@ -99,5 +99,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3], [E3+1:1:E4] , {[E4+1:1:E5]} -> 0*x+4 , {[E5+1:1:E6], [E6+1:1:E7]} -> 0*x+6, {[E7+1:1:E8]} -> 0*x+7, {[E8+1:1:E9]} -> 0*x+8 , {[E9+1:1:E10]} -> 0*x+9>>; - , 1, 6 + , 1 ) diff --git a/test/rl1_ts.test b/test/rl1_ts.test index 225b190..73d06e5 100644 --- a/test/rl1_ts.test +++ b/test/rl1_ts.test @@ -99,5 +99,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3], [E3+1:1:E4] , {[E4+1:1:E5]} -> 0*x+4 , {[E5+1:1:E6], [E6+1:1:E7]} -> 0*x+6, {[E7+1:1:E8]} -> 0*x+7, {[E8+1:1:E9]} -> 0*x+8 , {[E9+1:1:E10]} -> 0*x+9>>; - , 1, 6 + , 1 ) diff --git a/test/rl2_matching.test b/test/rl2_matching.test index c4d327f..0803050 100644 --- a/test/rl2_matching.test +++ b/test/rl2_matching.test @@ -99,5 +99,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3], [E3+1:1:E4] , {[E4+1:1:E5], [E5+1:1:E6]} -> 0*x+4 , {[E6+1:1:E7]} -> 0*x+6, {[E7+1:1:E8]} -> 0*x+7, {[E8+1:1:E9]} -> 0*x+8 , {[E9+1:1:E10]} -> 0*x+9>>; - , 1, 6 + , 1 ) diff --git a/test/rl2_scc.test b/test/rl2_scc.test index 7bdc4bb..8f57bf5 100644 --- a/test/rl2_scc.test +++ b/test/rl2_scc.test @@ -99,5 +99,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3], [E3+1:1:E4] , {[E4+1:1:E5], [E5+1:1:E6]} -> 0*x+4 , {[E6+1:1:E7]} -> 0*x+6, {[E7+1:1:E8]} -> 0*x+7, {[E8+1:1:E9]} -> 0*x+8 , {[E9+1:1:E10]} -> 0*x+9>>; - , 1, 6 + , 1 ) diff --git a/test/rl2_ts.test b/test/rl2_ts.test index a340810..7b3908f 100644 --- a/test/rl2_ts.test +++ b/test/rl2_ts.test @@ -99,5 +99,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3], [E3+1:1:E4] , {[E4+1:1:E5], [E5+1:1:E6]} -> 0*x+4 , {[E6+1:1:E7]} -> 0*x+6, {[E7+1:1:E8]} -> 0*x+7, {[E8+1:1:E9]} -> 0*x+8 , {[E9+1:1:E10]} -> 0*x+9>>; - , 1, 6 + , 1 ) diff --git a/test/rl3_matching.test b/test/rl3_matching.test index f83d742..09d2c76 100644 --- a/test/rl3_matching.test +++ b/test/rl3_matching.test @@ -103,5 +103,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3], [E3+1:1:E4] , {[E4+1:1:E5], [E5+1:1:E6]} -> 0*x+4 , {[E6+1:1:E7]} -> 0*x+6, {[E7+1:1:E8]} -> 0*x+7, {[E8+1:1:E9]} -> 0*x+8 , {[E9+1:1:E10]} -> 0*x+9, {[E10+1:1:E11]} -> 0*x+10>>; -, 1, 6 +, 1 ) diff --git a/test/rl3_scc.test b/test/rl3_scc.test index e978b74..c1cffba 100644 --- a/test/rl3_scc.test +++ b/test/rl3_scc.test @@ -103,5 +103,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3], [E3+1:1:E4] , {[E4+1:1:E5], [E5+1:1:E6]} -> 0*x+4 , {[E6+1:1:E7]} -> 0*x+6, {[E7+1:1:E8]} -> 0*x+7, {[E8+1:1:E9]} -> 0*x+8 , {[E9+1:1:E10]} -> 0*x+9, {[E10+1:1:E11]} -> 0*x+10>>; -, 1, 6 +, 1 ) diff --git a/test/rl3_ts.test b/test/rl3_ts.test index 5b16c95..fe05903 100644 --- a/test/rl3_ts.test +++ b/test/rl3_ts.test @@ -103,5 +103,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3], [E3+1:1:E4] , {[E4+1:1:E5], [E5+1:1:E6]} -> 0*x+4 , {[E6+1:1:E7]} -> 0*x+6, {[E7+1:1:E8]} -> 0*x+7, {[E8+1:1:E9]} -> 0*x+8 , {[E9+1:1:E10]} -> 0*x+9, {[E10+1:1:E11]} -> 0*x+10>>; -, 1, 6 +, 1 ) diff --git a/test/rlc1_matching.test b/test/rlc1_matching.test index 7ee9567..55ec559 100644 --- a/test/rlc1_matching.test +++ b/test/rlc1_matching.test @@ -146,4 +146,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3]} -> 0*x+15 , {[E9+1:1:E10]} -> 0*x+9, {[E10+1:1:E11]} -> 0*x+10, {[E11+1:1:E12]} -> 0*x+11 , {[E12+1:1:E13], [E13+1:1:E14]} -> 0*x+12, {[E14+1:1:E15]} -> 0*x+13 , {[E15+1:1:E16]} -> 0*x+14, {[E16+1:1:E17]} -> 0*x+16>>; - , 1, 6) + , 1 +) diff --git a/test/rlc1_scc.test b/test/rlc1_scc.test index acc9e1a..d2f8745 100644 --- a/test/rlc1_scc.test +++ b/test/rlc1_scc.test @@ -146,4 +146,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3]} -> 0*x+15 , {[E9+1:1:E10]} -> 0*x+9, {[E10+1:1:E11]} -> 0*x+10, {[E11+1:1:E12]} -> 0*x+11 , {[E12+1:1:E13], [E13+1:1:E14]} -> 0*x+12, {[E14+1:1:E15]} -> 0*x+13 , {[E15+1:1:E16]} -> 0*x+14, {[E16+1:1:E17]} -> 0*x+16>>; - , 1, 6) + , 1 +) diff --git a/test/scc3.test b/test/scc3.test new file mode 100644 index 0000000..a95f9be --- /dev/null +++ b/test/scc3.test @@ -0,0 +1,49 @@ +// SCC test, where the matching is a simple recursion with two +// border conditions in the middle of the long path + +N = 9 +N2 = 3 +N3 = 6 + +V1 = 1 +V2 = 1+V1 +V3 = N-1+V2 +V4 = N+V3 + +E1 = 1 +E2 = 1+E1 +E3 = N-1+E2 +E4 = N-1+E3 + +off1b = r(V1, 1)-r(E1, 1) +off2b = r(V2, 1)-r(E2, 1) +off3b = r(V3, 1)-r(E3, 1) +off4b = r(V3, 1)-r(E4, 1) + +off1d = r(V4, 1)-r(E1, 1)-N3 +off2d = r(V4, 1)-r(E2, 1)-N2 +off3d = r(V4, 1)-r(E3, 1)-1 +off4d = r(V4, 1)-r(E4, 1) + +V %= {[1:1:V1], [V1+1:1:V2], [V2+1:1:V3], [V3+1:1:V4]}; +Vmap %= <<{[1:1:V1]} -> 0*x+1, {[V1+1:1:V2]} -> 0*x+2, {[V2+1:1:V3]} -> 0*x+3 + , {[V3+1:1:V4]} -> 0*x+4>>; +map1 %= <<{[1:1:E1]} -> 1*x+off1b, {[E1+1:1:E2]} -> 1*x+off2b, {[E2+1:1:E3]} -> 1*x+off3b + , {[E3+1:1:E4]} -> 1*x+off4b>>; +map2 %= <<{[1:1:E1]} -> 1*x+off1d, {[E1+1:1:E2]} -> 1*x+off2d, {[E2+1:1:E3]} -> 1*x+off3d + , {[E3+1:1:E4]} -> 1*x+off4d>>; +Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2 + , {[E2+1:1:E3], [E3+1:1:E4]} -> 0*x+3>>; + +matchSCC( + V %= {[1:1:V1], [V1+1:1:V2], [V2+1:1:V3], [V3+1:1:V4]}; + Vmap %= <<{[1:1:V1]} -> 0*x+1, {[V1+1:1:V2]} -> 0*x+2, {[V2+1:1:V3]} -> 0*x+3 + , {[V3+1:1:V4]} -> 0*x+4>>; + map1 %= <<{[1:1:E1]} -> 1*x+off1b, {[E1+1:1:E2]} -> 1*x+off2b, {[E2+1:1:E3]} -> 1*x+off3b + , {[E3+1:1:E4]} -> 1*x+off4b>>; + map2 %= <<{[1:1:E1]} -> 1*x+off1d, {[E1+1:1:E2]} -> 1*x+off2d, {[E2+1:1:E3]} -> 1*x+off3d + , {[E3+1:1:E4]} -> 1*x+off4d>>; + Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2 + , {[E2+1:1:E3], [E3+1:1:E4]} -> 0*x+3>>; + , 1 +) diff --git a/test/test1_matching.test b/test/test1_matching.test index 1df1891..4bc9661 100644 --- a/test/test1_matching.test +++ b/test/test1_matching.test @@ -61,5 +61,5 @@ map2 %= <<{[1:1:E1]} -> 1*x+off1b, {[E1+1:1:E2]} -> 1*x+off2b, {[E2+1:1:E3]} -> , {[E3+1:1:E4]} -> 1*x+off4b, {[E4+1:1:E5]} -> 1*x+off5b, {[E5+1:1:E6]} -> 1*x+off6b>>; Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3]} -> 0*x+3 , {[E3+1:1:E4]} -> 0*x+4, {[E4+1:1:E5]} -> 0*x+5, {[E5+1:1:E6]} -> 0*x+6>>; -, 1, 6 +, 1 ) diff --git a/test/test1_scc.test b/test/test1_scc.test index 79051d5..4ea8ede 100644 --- a/test/test1_scc.test +++ b/test/test1_scc.test @@ -61,5 +61,5 @@ map2 %= <<{[1:1:E1]} -> 1*x+off1b, {[E1+1:1:E2]} -> 1*x+off2b, {[E2+1:1:E3]} -> , {[E3+1:1:E4]} -> 1*x+off4b, {[E4+1:1:E5]} -> 1*x+off5b, {[E5+1:1:E6]} -> 1*x+off6b>>; Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3]} -> 0*x+3 , {[E3+1:1:E4]} -> 0*x+4, {[E4+1:1:E5]} -> 0*x+5, {[E5+1:1:E6]} -> 0*x+6>>; -, 1, 6 +, 1 ) diff --git a/test/test1_ts.test b/test/test1_ts.test index 236b077..94c7fea 100644 --- a/test/test1_ts.test +++ b/test/test1_ts.test @@ -75,5 +75,5 @@ map2 %= <<{[1:1:E1]} -> 1*x+off1b, {[E1+1:1:E2]} -> 1*x+off2b, {[E2+1:1:E3]} -> , {[E3+1:1:E4]} -> 1*x+off4b, {[E4+1:1:E5]} -> 1*x+off5b, {[E5+1:1:E6]} -> 1*x+off6b>>; Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3]} -> 0*x+3 , {[E3+1:1:E4]} -> 0*x+4, {[E4+1:1:E5]} -> 0*x+5, {[E5+1:1:E6]} -> 0*x+6>>; -, 1, 6 +, 1 ) diff --git a/test/test2_matching.test b/test/test2_matching.test index 71ecf94..ae04e0f 100644 --- a/test/test2_matching.test +++ b/test/test2_matching.test @@ -136,5 +136,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3], [E3+1:1:E4] , {[E9+1:1:E10]} -> 0*x+9, {[E10+1:1:E11]} -> 0*x+10, {[E11+1:1:E12]} -> 0*x+11 , {[E12+1:1:E13], [E13+1:1:E14]} -> 0*x+12, {[E14+1:1:E15]} -> 0*x+13 , {[E15+1:1:E16]} -> 0*x+14>>; -, 1, 6 +, 1 ) diff --git a/test/test2_scc.test b/test/test2_scc.test index 9939fe8..b4f84b9 100644 --- a/test/test2_scc.test +++ b/test/test2_scc.test @@ -136,5 +136,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3], [E3+1:1:E4] , {[E9+1:1:E10]} -> 0*x+9, {[E10+1:1:E11]} -> 0*x+10, {[E11+1:1:E12]} -> 0*x+11 , {[E12+1:1:E13], [E13+1:1:E14]} -> 0*x+12, {[E14+1:1:E15]} -> 0*x+13 , {[E15+1:1:E16]} -> 0*x+14>>; -, 1, 6 +, 1 ) diff --git a/test/test2_ts.test b/test/test2_ts.test index de09f3b..7cf34ce 100644 --- a/test/test2_ts.test +++ b/test/test2_ts.test @@ -155,5 +155,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3], [E3+1:1:E4] , {[E9+1:1:E10]} -> 0*x+9, {[E10+1:1:E11]} -> 0*x+10, {[E11+1:1:E12]} -> 0*x+11 , {[E12+1:1:E13], [E13+1:1:E14]} -> 0*x+12, {[E14+1:1:E15]} -> 0*x+13 , {[E15+1:1:E16]} -> 0*x+14>>; -, 1, 6 +, 1 ) diff --git a/test/test3_matching.test b/test/test3_matching.test index 7d4983c..1e7937f 100644 --- a/test/test3_matching.test +++ b/test/test3_matching.test @@ -135,5 +135,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3], [E3+1:1:E4] , {[E9+1:1:E10]} -> 0*x+9, {[E10+1:1:E11]} -> 0*x+10, {[E11+1:1:E12]} -> 0*x+11 , {[E12+1:1:E13], [E13+1:1:E14]} -> 0*x+12, {[E14+1:1:E15]} -> 0*x+13 , {[E15+1:1:E16]} -> 0*x+14>>; -, 1, 6 +, 1 ) diff --git a/test/test3_scc.test b/test/test3_scc.test index 47be7eb..ecf7430 100644 --- a/test/test3_scc.test +++ b/test/test3_scc.test @@ -135,5 +135,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3], [E3+1:1:E4] , {[E9+1:1:E10]} -> 0*x+9, {[E10+1:1:E11]} -> 0*x+10, {[E11+1:1:E12]} -> 0*x+11 , {[E12+1:1:E13], [E13+1:1:E14]} -> 0*x+12, {[E14+1:1:E15]} -> 0*x+13 , {[E15+1:1:E16]} -> 0*x+14>>; -, 1, 6 +, 1 ) diff --git a/test/test3_ts.test b/test/test3_ts.test index b2e3b36..15d7ce9 100644 --- a/test/test3_ts.test +++ b/test/test3_ts.test @@ -162,5 +162,5 @@ Emap %= <<{[1:1:E1]} -> 0*x+1, {[E1+1:1:E2]} -> 0*x+2, {[E2+1:1:E3], [E3+1:1:E4] , {[E9+1:1:E10]} -> 0*x+9, {[E10+1:1:E11]} -> 0*x+10, {[E11+1:1:E12]} -> 0*x+11 , {[E12+1:1:E13], [E13+1:1:E14]} -> 0*x+12, {[E14+1:1:E15]} -> 0*x+13 , {[E15+1:1:E16]} -> 0*x+14>>; -, 1, 6 +, 1 )