Update LGF reader to work with typesafe bipartite node sets (#69)
authorDaniel Poroszkai <poroszd@inf.elte.hu>
Sun, 05 Feb 2012 00:04:44 +0100
changeset 1197374a9519986b
parent 1196 4441b066368c
child 1198 4936be66d2f5
Update LGF reader to work with typesafe bipartite node sets (#69)
lemon/lgf_reader.h
     1.1 --- a/lemon/lgf_reader.h	Wed Jan 11 22:58:05 2012 +0100
     1.2 +++ b/lemon/lgf_reader.h	Sun Feb 05 00:04:44 2012 +0100
     1.3 @@ -2953,7 +2953,10 @@
     1.4              throw FormatError(msg.str());
     1.5            }
     1.6  
     1.7 -          e = _graph.addEdge(source, target);
     1.8 +          // It is checked that source is red and
     1.9 +          // target is blue, so this should be safe:
    1.10 +          e = _graph.addEdge(_graph.asRedNodeUnsafe(source),
    1.11 +                             _graph.asBlueNodeUnsafe(target));
    1.12            if (label_index != -1)
    1.13              _edge_index.insert(std::make_pair(tokens[label_index], e));
    1.14          } else {