COIN-OR::LEMON - Graph Library

Changeset 1429:4283998fb2be in lemon-0.x for src/lemon/graph_writer.h


Ignore:
Timestamp:
05/19/05 13:49:42 (19 years ago)
Author:
Balazs Dezso
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@1903
Message:

Able to read edge from undirected edgeset
Graph reader and graph writer can resolve items by id.

It makes possible:

GraphReader?<Graph> reader(std::cin, graph);

reader.readNodeMap....

NewEdgeSetAdaptor?<Graph> edgeset(graph);
UndirEdgeSetReader?<Graph> unir_edgeset_reader(reader, edgeset, reader);

reader.run();

It reads the graph and an additional edgeset in to the edgeset.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/lemon/graph_writer.h

    r1421 r1429  
    238238      writer->run();
    239239    }
     240
     241    /// \brief Write the id of the given node.
     242    ///
     243    /// It writes the id of the given node. If there was written an "id"
     244    /// named node map then it will write the map value belongs to the node.
     245    void writeId(std::ostream& os, const Node& item) const {
     246      nodeset_writer.writeId(os, item);
     247    }
     248
     249    /// \brief Write the id of the given edge.
     250    ///
     251    /// It writes the id of the given edge. If there was written an "id"
     252    /// named edge map then it will write the map value belongs to the edge.
     253    void writeId(std::ostream& os, const Edge& item) const {
     254      edgeset_writer.writeId(os, item);
     255    }
    240256
    241257  private:
     
    548564    ///
    549565    /// Add a new labeled edge writer for the writer.
     566    UndirGraphWriter& writeEdge(std::string name, const Edge& edge) {
     567      undir_edge_writer.writeEdge(name, edge);
     568    }
     569
     570    /// \brief Add a new labeled undirected edge writer for the writer.
     571    ///
     572    /// Add a new labeled undirected edge writer for the writer.
    550573    UndirGraphWriter& writeUndirEdge(std::string name, const UndirEdge& edge) {
    551574      undir_edge_writer.writeUndirEdge(name, edge);
     
    587610      writer->run();
    588611    }
     612
     613    /// \brief Write the id of the given node.
     614    ///
     615    /// It writes the id of the given node. If there was written an "id"
     616    /// named node map then it will write the map value belongs to the node.
     617    void writeId(std::ostream& os, const Node& item) const {
     618      nodeset_writer.writeId(os, item);
     619    }
     620
     621    /// \brief Write the id of the given edge.
     622    ///
     623    /// It writes the id of the given edge. If there was written an "id"
     624    /// named edge map then it will write the map value belongs to the edge.
     625    void writeId(std::ostream& os, const Edge& item) const {
     626      undir_edgeset_writer.writeId(os, item);
     627    }
     628
     629    /// \brief Write the id of the given undirected edge.
     630    ///
     631    /// It writes the id of the given undirected edge. If there was written
     632    /// an "id" named edge map then it will write the map value belongs to
     633    /// the edge.
     634    void writeId(std::ostream& os, const UndirEdge& item) const {
     635      undir_edgeset_writer.writeId(os, item);
     636    }
     637
    589638
    590639  private:
Note: See TracChangeset for help on using the changeset viewer.