[Lemon-user] Using SmartArcSet and development code
Alpár Jüttner
alpar at cs.elte.hu
Wed May 6 12:41:01 CEST 2009
On Tue, 2009-05-05 at 19:15 -0400, Goldberg, Noam wrote:
> Thank you for your help.
>
> The following might be another silly question (perhaps it could become useful later for the documentation).
>
> Trying to read ArcSets from an LGF file by following the documentation of DigraphReader:
> "An application of these functions is multipass reading, which is important if two @arcs sections must be read from the file. In this case the first phase would read the node set and one of the arc sets, while the second phase would read the second arc set into an ArcSet class (SmartArcSet or ListArcSet). The previously read label node map should be passed to the useNodes() functions. "
>
> How do you obtain the label node map ?
The label node map is just a map (colunm in the .lgf file) with name
(header) "label".
You can obtain it like this:
DigraphReader<ListGraph> reader(g,"file.lgf");
ListGraph::NodeMap<int> labels(g);
reader.nodeMap("label",labels);
> The nodeMapNames of LgfContents provides a vector of strings but is not
> a Lemon Map
nodeMapNames() gives you the list of the node-map that can be found in
the .lgf file (ontly their names not their contents). For example
"label" should be amongst them.
Regards,
Alpar
More information about the Lemon-user
mailing list