From 4b7b2693e829166ccec8707b59fb2bc26179551b Mon Sep 17 00:00:00 2001
From: Patrick Simianer
Date: Tue, 22 Jul 2014 00:34:01 +0200
Subject: simple sparse vector type
---
fast/hypergraph.hh | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
(limited to 'fast/hypergraph.hh')
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 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 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 edges;
unordered_map nodes_by_id;
unsigned int arity;
-
- void add_node(Node* n) { nodes.push_back(n); nodes_by_id[n->id] = n; }
};
void
--
cgit v1.2.3