Changeset 854bece for src/dgp/sgraph.hh
- Timestamp:
- 01/12/15 19:07:44 (9 years ago)
- Branches:
- master
- Children:
- c03f8a5
- Parents:
- acbabee
- git-author:
- Tomasz Obrebski <obrebski@…> (01/12/15 19:07:44)
- git-committer:
- Tomasz Obrebski <obrebski@…> (01/12/15 19:07:44)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/dgp/sgraph.hh
racbabee r854bece 55 55 bool init_attached; 56 56 bool fin_attached; 57 bool visible_as_neighbour; 58 bool has_head; 57 59 58 60 FlagSet flags; … … 72 74 if(init_attached != p.init_attached) return false; 73 75 if(fin_attached != p.fin_attached) return false; 76 if(visible_as_neighbour != p.visible_as_neighbour) return false; 77 if(has_head != p.has_head) return false; 74 78 75 79 list<Boubble*>::const_iterator b,b1; … … 106 110 void NodeProp::copy(const NodeProp& p) 107 111 { 108 required=p.required; 109 forbidden=p.forbidden; 110 attached=p.attached; 111 flags=p.flags; 112 init_attached=p.init_attached; 113 fin_attached=p.fin_attached; 112 required = p.required; 113 forbidden = p.forbidden; 114 attached = p.attached; 115 flags = p.flags; 116 init_attached = p.init_attached; 117 fin_attached = p.fin_attached; 118 visible_as_neighbour = p.visible_as_neighbour; 119 has_head = p.has_head; 114 120 for(list<Boubble*>::const_iterator b = p.boubbles.begin(); b!=p.boubbles.end(); b++) 115 121 boubbles.push_back(new Boubble(**b)); … … 127 133 init_attached=false; 128 134 fin_attached=false; 135 visible_as_neighbour=true; 136 has_head=false; 129 137 clear_boubbles(); 130 138 } … … 161 169 struct SNode 162 170 { 163 164 SNode() { visible_as_neighbour = true; } 171 SNode() { prop.clear(); } 165 172 166 173 int mnode; 167 174 168 175 NodeProp prop; 169 170 176 Edge edge; 171 bool visible_as_neighbour;172 177 173 178 bitset<MAXNODES> LV; … … 179 184 vector<Arc> deps; 180 185 181 void clear(); 182 bool saturated(); 186 void clear() { prop.clear(), LV.reset(), LD.reset(), LH.reset(), heads.clear(), deps.clear(); } 187 bool saturated() { return prop.required.none(); } 188 183 189 184 190 // void edge_clear() { edge.clear(); edge_contains_self=false;} … … 191 197 }; 192 198 193 //----------------------------------------------------------------------------------------------------194 inline195 void SNode::clear()196 { prop.clear(), LV.reset(), LD.reset(), LH.reset(), heads.clear(), deps.clear(); }197 //----------------------------------------------------------------------------------------------------198 inline199 bool SNode::saturated()200 { return prop.required.none(); }201 202 199 //==================================================================================================== 203 200 // SGraph CLASS … … 219 216 void update_left(int headind, int depind); 220 217 void update_right(int headind, int depind); 221 bool visible(int left, int right); 222 bool saturated(int node); 218 bool visible(int left, int right) { return nodes[right].LV[left]; } 219 bool saturated(int node) { return nodes[node].saturated(); } 220 bool has_head(int node) { return nodes[node].prop.has_head; } 223 221 224 222 Cat cat(int i) const { return mgraph[nodes[i].mnode].cat; } … … 251 249 int sprint_node_debug(char* buf, const char* pref, int n, int anc); 252 250 }; 253 254 //----------------------------------------------------------------------------------------------------255 256 inline bool SGraph::visible(int left, int right)257 {258 return nodes[right].LV[left];259 }260 261 //----------------------------------------------------------------------------------------------------262 263 inline bool SGraph::saturated(int node)264 {265 return nodes[node].saturated();266 }267 251 268 252 //---------------------------------------------------------------------------------------------------- … … 413 397 vector<int>& spredecessors = mgraph[*mp].snodes; 414 398 for(vector<int>::iterator sp = spredecessors.begin(); sp != spredecessors.end(); ++sp ) 415 if(sgraph[*sp]. visible_as_neighbour || !strict)399 if(sgraph[*sp].prop.visible_as_neighbour || !strict) 416 400 { 417 401 push(wayup,*sp);
Note: See TracChangeset
for help on using the changeset viewer.