diff options
author | Patrick Simianer <p@simianer.de> | 2014-07-22 00:34:01 +0200 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2014-07-22 00:34:01 +0200 |
commit | 4b7b2693e829166ccec8707b59fb2bc26179551b (patch) | |
tree | 1c103865488aa8cefabf9714cd571066135b8ca4 /fast/hypergraph.hh | |
parent | 02bbe0c6bc69283a988caf8f0ab3dadb5d9d72b5 (diff) |
simple sparse vector type
Diffstat (limited to 'fast/hypergraph.hh')
-rw-r--r-- | fast/hypergraph.hh | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/fast/hypergraph.hh b/fast/hypergraph.hh index ea940ad..86b9069 100644 --- a/fast/hypergraph.hh +++ b/fast/hypergraph.hh @@ -31,18 +31,17 @@ struct Edge { Node* head; vector<Node*> tails; score_t score; - string rule; //FIXME - DummyVector f; //FIXME + string rule; // FIXME unsigned int arity = 0; unsigned int mark = 0; inline bool is_marked() { return mark >= arity; } - friend std::ostream& operator<<(std::ostream& os, const Edge& s); + friend ostream& operator<<(ostream& os, const Edge& s); size_t head_id_; vector<size_t> tails_ids_; // node ids - MSGPACK_DEFINE(head_id_, tails_ids_, score, f, arity); + MSGPACK_DEFINE(head_id_, tails_ids_, rule, score, arity); }; struct Node { @@ -56,7 +55,7 @@ struct Node { unsigned int mark; inline bool is_marked() { return mark >= incoming.size(); }; - friend std::ostream& operator<<(std::ostream& os, const Node& n); + friend ostream& operator<<(ostream& os, const Node& n); MSGPACK_DEFINE(id, symbol, left, right, score); }; @@ -66,8 +65,6 @@ struct Hypergraph { vector<Edge*> edges; unordered_map<size_t, Node*> nodes_by_id; unsigned int arity; - - void add_node(Node* n) { nodes.push_back(n); nodes_by_id[n->id] = n; } }; void |