Changes in /[206:4e22275a2b52:207:574b963d0275] in lemon-1.2

Ignore:
Files:
1 deleted
14 edited

Unmodified
Removed
• demo/arg_parser_demo.cc

 r137 int main(int argc, const char **argv) { ArgParser ap(argc,argv); // Initialize the argument parser ArgParser ap(argc, argv); int i; std::string s; double d; bool b,sil; bool g1,g2,g3; ap.refOption("n", "An integer input.", i, true) .refOption("val", "A double input.", d) .doubleOption("val2", "A double input.", d) .synonym("vals","val") .refOption("name", "A string input.", s) .refOption("f", "A switch.", b) .refOption("nohelp", "", sil) .refOption("gra","Choice A",g1) .refOption("grb","Choice B",g2) .refOption("grc","Choice C",g3) .optionGroup("gr","gra") .optionGroup("gr","grb") .optionGroup("gr","grc") .mandatoryGroup("gr") .onlyOneGroup("gr") .other("infile","The input file.") double d = 1.0; bool b, nh; bool g1, g2, g3; // Add a mandatory integer option with storage reference ap.refOption("n", "An integer input.", i, true); // Add a double option with storage reference (the default value is 1.0) ap.refOption("val", "A double input.", d); // Add a double option without storage reference (the default value is 3.14) ap.doubleOption("val2", "A double input.", 3.14); // Set synonym for -val option ap.synonym("vals", "val"); // Add a string option ap.refOption("name", "A string input.", s); // Add bool options ap.refOption("f", "A switch.", b) .refOption("nohelp", "", nh) .refOption("gra", "Choice A", g1) .refOption("grb", "Choice B", g2) .refOption("grc", "Choice C", g3); // Bundle -gr* options into a group ap.optionGroup("gr", "gra") .optionGroup("gr", "grb") .optionGroup("gr", "grc"); // Set the group mandatory ap.mandatoryGroup("gr"); // Set the options of the group exclusive (only one option can be given) ap.onlyOneGroup("gr"); // Add non-parsed arguments (e.g. input files) ap.other("infile", "The input file.") .other("..."); // Perform the parsing process // (in case of any error it terminates the program) ap.parse(); // Check each option if it has been given and print its value std::cout << "Parameters of '" << ap.commandName() << "':\n"; if(ap.given("n")) std::cout << "  Value of -n: " << i << std::endl; std::cout << "  Value of -n: " << i << std::endl; if(ap.given("val")) std::cout << "  Value of -val: " << d << std::endl; if(ap.given("val2")) { d = ap["val2"]; std::cout << "  Value of -val2: " << d << std::endl; } if(ap.given("name")) std::cout << "  Value of -name: " << s << std::endl; if(ap.given("f")) std::cout << "  -f is given\n"; if(ap.given("nohelp")) std::cout << "  Value of -nohelp: " << sil << std::endl; if(ap.given("nohelp")) std::cout << "  Value of -nohelp: " << nh << std::endl; if(ap.given("gra")) std::cout << "  -gra is given\n"; if(ap.given("grb")) std::cout << "  -grb is given\n"; if(ap.given("grc")) std::cout << "  -grc is given\n"; switch(ap.files().size()) { case 0: std::cout << "    '" << ap.files()[i] << "'\n"; return 0; }

• doc/groups.dox

 r156 @defgroup lemon_io Lemon Input-Output @ingroup io_group \brief Reading and writing LEMON format This group describes methods for reading and writing LEMON format. You can find more about this format on the \ref graph-io-page "Graph Input-Output" tutorial pages. \brief Reading and writing \ref lgf-format "Lemon Graph Format". This group describes methods for reading and writing \ref lgf-format "Lemon Graph Format". */
• doc/lgf.dox

 r162 The \c \@nodes section describes a set of nodes and associated maps. The first is a header line, it columns are the names of the maps. The first is a header line, its columns are the names of the maps appearing in the following lines. One of the maps must be called \c The \c \@arcs section is very similar to the \c \@nodes section, it again starts with a header line describing the names of the arc, it again starts with a header line describing the names of the maps, but the \c "label" map is not obligatory here. The following lines describe the arcs. The first two tokens of each line are \endcode The \c \@edges is just a synonym of \c \@arcs. The \c \@edges is just a synonym of \c \@arcs. The @arcs section can also store the edge set of an undirected graph. In such case there is a conventional method for store arc maps in the file, if two columns has the same caption with \c '+' and \c '-' prefix, then these columns can be regarded as the values of an arc map. The \c \@attributes section contains key-value pairs, each line consists of two tokens, an attribute name, and then an attribute value. consists of two tokens, an attribute name, and then an attribute value. The value of the attribute could be also a label value of a node or an edge, or even an edge label prefixed with \c '+' or \c '-', which regards to the forward or backward directed arc of the corresponding edge. \code
• lemon/Makefile.am

 r166 lemon/kruskal.h \ lemon/lgf_reader.h \ lemon/lgf_writer.h \ lemon/list_graph.h \ lemon/maps.h \ lemon/concepts/digraph.h \ lemon/concepts/graph.h \ lemon/concepts/graph_components.h \ lemon/concepts/heap.h \ lemon/concepts/maps.h \ lemon/concepts/path.h \ lemon/concepts/graph_components.h lemon/concepts/path.h

• lemon/concepts/heap.h

 r113 Item item; Prio prio; State state; item=Item(); prio=Prio(); ignore_unused_variable_warning(item); ignore_unused_variable_warning(prio); ignore_unused_variable_warning(state); OwnItem own_item; int s = heap.size(); ignore_unused_variable_warning(s); bool e = heap.empty(); ignore_unused_variable_warning(e); prio = heap.prio(); heap.clear(); state = heap.state(item); heap.state(item, state); state = heap.state(own_item); own_state = heap.state(own_item); heap.state(own_item, own_state); state = _Heap::PRE_HEAP; state = _Heap::IN_HEAP; state = _Heap::POST_HEAP; own_state = _Heap::PRE_HEAP; own_state = _Heap::IN_HEAP;
• lemon/graph_utils.h

 r169 for (typename From::ArcIt it(from); it != INVALID; ++it) { arcRefMap[it] = to.addArc(nodeRefMap[from.source(it)], nodeRefMap[from.target(it)]); nodeRefMap[from.target(it)]); } } } for (typename From::EdgeIt it(from); it != INVALID; ++it) { edgeRefMap[it] = to.addArc(nodeRefMap[from.source(it)], nodeRefMap[from.target(it)]); edgeRefMap[it] = to.addEdge(nodeRefMap[from.u(it)], nodeRefMap[from.v(it)]); } } Value operator[](const Key& key) const { bool forward = (_from.direction(key) == (_node_ref[_from.source(key)] == _to.source(_edge_ref[key]))); bool forward = _from.u(key) != _from.v(key) ? _node_ref[_from.source(key)] == _to.source(_to.direct(_edge_ref[key], true)) : _from.direction(key); return _to.direct(_edge_ref[key], forward); }
• lemon/kruskal.h

 r167 ///\ingroup spantree ///\file ///\brief Kruskal's algorithm to compute a minimum cost tree ///\brief Kruskal's algorithm to compute a minimum cost spanning tree /// ///Kruskal's algorithm to compute a minimum cost tree. ///Kruskal's algorithm to compute a minimum cost spanning tree. /// /// \ingroup spantree /// /// \brief Kruskal's algorithm to find a minimum cost tree of a graph. /// /// This function runs Kruskal's algorithm to find a minimum cost tree. /// \brief Kruskal algorithm to find a minimum cost spanning tree of /// a graph. /// /// This function runs Kruskal's algorithm to find a minimum cost /// spanning tree. /// Due to some C++ hacking, it accepts various input and output types. /// /// undirected by disregarding the direction of the arcs. /// /// \param in This object is used to describe the arc costs. It can be one /// of the following choices. /// \param in This object is used to describe the arc/edge costs. /// It can be one of the following choices. /// - An STL compatible 'Forward Container' with /// std::pair or /// std::pair as its value_type, where /// \c X is the type of the costs. The pairs indicates the arcs /// std::pair or /// std::pair as its value_type, where /// \c X is the type of the costs. The pairs indicates the arcs/edges /// along with the assigned cost. They must be in a /// cost-ascending order. /// - Any readable Arc map. The values of the map indicate the arc costs. /// /// \retval out Here we also have a choise. /// - It can be a writable \c bool arc map.  After running the /// algorithm this will contain the found minimum cost spanning /// tree: the value of an arc will be set to \c true if it belongs /// - Any readable arc/edge map. The values of the map indicate the /// arc/edge costs. /// /// \retval out Here we also have a choice. /// - It can be a writable \c bool arc/edge map. After running the /// algorithm it will contain the found minimum cost spanning /// tree: the value of an arc/edge will be set to \c true if it belongs /// to the tree, otherwise it will be set to \c false. The value of /// each arc will be set exactly once. /// each arc/edge will be set exactly once. /// - It can also be an iteraror of an STL Container with /// GR::Edge or GR::Arc as its /// GR::Arc or GR::Edge as its /// value_type.  The algorithm copies the elements of the /// found tree into this sequence.  For example, if we know that the /// Or if we don't know in advance the size of the tree, we can /// write this. ///\code std::vector tree; ///\code /// std::vector tree; /// kruskal(g,cost,std::back_inserter(tree)); ///\endcode /// /// \return The total cost of the found tree. /// /// \warning If kruskal runs on an be consistent of using the same /// \return The total cost of the found spanning tree. /// /// \warning If Kruskal runs on an be consistent of using the same /// Arc type for input and output. ///