lemon/lgf_reader.h
changeset 1197 374a9519986b
parent 1194 699c7eac2c6d
child 1198 4936be66d2f5
equal deleted inserted replaced
54:749faaf425e8 55:2a971021d49d
  2951             std::ostringstream msg;
  2951             std::ostringstream msg;
  2952             msg << "Item is not red node: " << source_token;
  2952             msg << "Item is not red node: " << source_token;
  2953             throw FormatError(msg.str());
  2953             throw FormatError(msg.str());
  2954           }
  2954           }
  2955 
  2955 
  2956           e = _graph.addEdge(source, target);
  2956           // It is checked that source is red and
       
  2957           // target is blue, so this should be safe:
       
  2958           e = _graph.addEdge(_graph.asRedNodeUnsafe(source),
       
  2959                              _graph.asBlueNodeUnsafe(target));
  2957           if (label_index != -1)
  2960           if (label_index != -1)
  2958             _edge_index.insert(std::make_pair(tokens[label_index], e));
  2961             _edge_index.insert(std::make_pair(tokens[label_index], e));
  2959         } else {
  2962         } else {
  2960           if (label_index == -1)
  2963           if (label_index == -1)
  2961             throw FormatError("Label map not found");
  2964             throw FormatError("Label map not found");