30 #include "../DdSpec.hpp" 31 #include "../util/Graph.hpp" 36 std::map<int16_t,int16_t>,2> {
42 PathZddByStdMap(Graph
const& graph)
43 : graph(graph), n(graph.edgeSize()) {
46 int getRoot(State& mate)
const {
47 for (Graph::VertexNumber v = 1; v <= graph.vertexSize(); ++v) {
48 Graph::VertexNumber w = graph.virtualMate(v);
49 if (w >= 1) mate[v] = w;
54 int getChild(State& mate,
int level,
int take)
const {
55 Graph::EdgeInfo
const& e = graph.edgeInfo(n - level);
58 State::iterator t1 = mate.find(v1);
59 State::iterator t2 = mate.find(v2);
60 bool const u1 = (t1 == mate.end());
61 bool const u2 = (t2 == mate.end());
62 int const w1 = u1 ? v1 : t1->second;
63 int const w2 = u2 ? v2 : t2->second;
66 if (w1 == 0 || w2 == 0)
return 0;
67 if (e.v1final && u1)
return 0;
68 if (e.v2final && u2)
return 0;
72 for (State::const_iterator t = mate.begin(); t != mate.end();
74 if (t->first != v1 && t->first != v2 && t->second > 0)
return 0;
79 mate[v1] = mate[v2] = 0;
80 mate[w1] = w2, mate[w2] = w1;
83 if (e.v1final && !u1) {
84 if (mate[v1] != 0)
return 0;
88 if (e.v2final && !u2) {
89 if (mate[v2] != 0)
return 0;
96 size_t hashCode(State
const& mate)
const {
98 for (State::const_iterator t = mate.begin(); t != mate.end(); ++t) {
Abstract class of DD specifications using scalar states.