Changeset 1540:7d028a73d7f2 in lemon-0.x for lemon
- Timestamp:
- 07/05/05 16:36:10 (19 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@2034
- Location:
- lemon
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
lemon/dfs.h
r1536 r1540 645 645 ///\return The length of the %DFS s---t path if there exists one, 646 646 ///0 otherwise. 647 ///\note Apart from the return value, d.run(s ) is647 ///\note Apart from the return value, d.run(s,t) is 648 648 ///just a shortcut of the following code. 649 649 ///\code -
lemon/graph_reader.h
r1534 r1540 37 37 /// Before you read this documentation it might be useful to read the general 38 38 /// description of \ref graph-io-page "Graph Input-Output". 39 /// 39 40 /// If you don't need very sophisticated 40 41 /// behaviour then you can use the versions of the public function 41 42 /// \ref readGraph() to read a graph (or a max flow instance etc). 42 43 /// 43 /// The given file formatmay contain several maps and labeled nodes or44 /// The file to be read may contain several maps and labeled nodes or 44 45 /// edges. 45 46 /// … … 47 48 /// that you need. The interface of the \c GraphReader is very similar to 48 49 /// the GraphWriter but the reading method does not depend on the order the 49 /// given commands. 50 /// 51 /// The reader object suppose that each not readed value does not contain 50 /// given commands (i.e. you don't have to insist on the order in which the 51 /// maps are given in the file). 52 /// 53 /// The reader object assumes that not readed values do not contain 52 54 /// whitespaces, therefore it has some extra possibilities to control how 53 55 /// it should skip the values when the string representation contains spaces. … … 91 93 /// 92 94 /// With the \c readAttribute() functions you can read an attribute 93 /// in a variable. You can specify the reader for the attribute as95 /// into a variable. You can specify the reader for the attribute as 94 96 /// the nodemaps. 95 97 /// 96 98 /// After you give all read commands you must call the \c run() member 97 /// function, which execute all the commands.99 /// function, which executes all the commands. 98 100 /// 99 101 /// \code … … 120 122 /// 121 123 /// Construct a new GraphReader. It reads into the given graph 122 /// and it use the given reader as the default skipper.124 /// and it uses the given reader as the default skipper. 123 125 GraphReader(std::istream& _is, 124 126 typename SmartParameter<Graph>::Type _graph, … … 135 137 /// 136 138 /// Construct a new GraphReader. It reads into the given graph 137 /// and it use the given reader as the default skipper.139 /// and it uses the given reader as the default skipper. 138 140 GraphReader(const std::string& _filename, 139 141 typename SmartParameter<Graph>::Type _graph, … … 151 153 /// 152 154 /// Construct a new GraphReader. It reads into the given graph 153 /// and it use the given reader as the default skipper.155 /// and it uses the given reader as the default skipper. 154 156 GraphReader(LemonReader& _reader, 155 157 typename SmartParameter<Graph>::Type _graph, … … 171 173 } 172 174 173 /// \brief Add a new node map reader command forthe reader.174 /// 175 /// Add a new node map reader command forthe reader.175 /// \brief Give a new node map reading command to the reader. 176 /// 177 /// Give a new node map reading command to the reader. 176 178 template <typename Map> 177 179 GraphReader& readNodeMap(std::string name, Map& map) { … … 186 188 } 187 189 188 /// \brief Add a new node map reader command forthe reader.189 /// 190 /// Add a new node map reader command forthe reader.190 /// \brief Give a new node map reading command to the reader. 191 /// 192 /// Give a new node map reading command to the reader. 191 193 template <typename Reader, typename Map> 192 194 GraphReader& readNodeMap(std::string name, Map& map, … … 203 205 } 204 206 205 /// \brief Add a new node map skipper command forthe reader.206 /// 207 /// Add a new node map skipper command forthe reader.207 /// \brief Give a new node map skipping command to the reader. 208 /// 209 /// Give a new node map skipping command to the reader. 208 210 template <typename Reader> 209 211 GraphReader& skipNodeMap(std::string name, … … 213 215 } 214 216 215 /// \brief Add a new edge map reader command forthe reader.216 /// 217 /// Add a new edge map reader command forthe reader.217 /// \brief Give a new edge map reading command to the reader. 218 /// 219 /// Give a new edge map reading command to the reader. 218 220 template <typename Map> 219 221 GraphReader& readEdgeMap(std::string name, Map& map) { … … 229 231 230 232 231 /// \brief Add a new edge map reader command forthe reader.232 /// 233 /// Add a new edge map reader command forthe reader.233 /// \brief Give a new edge map reading command to the reader. 234 /// 235 /// Give a new edge map reading command to the reader. 234 236 template <typename Reader, typename Map> 235 237 GraphReader& readEdgeMap(std::string name, Map& map, … … 246 248 } 247 249 248 /// \brief Add a new edge map skipper command forthe reader.249 /// 250 /// Add a new edge map skipper command forthe reader.250 /// \brief Give a new edge map skipping command to the reader. 251 /// 252 /// Give a new edge map skipping command to the reader. 251 253 template <typename Reader> 252 254 GraphReader& skipEdgeMap(std::string name, … … 256 258 } 257 259 258 /// \brief Add a new labeled node reader forthe reader.259 /// 260 /// Add a new labeled node reader forthe reader.260 /// \brief Give a new labeled node reading command to the reader. 261 /// 262 /// Give a new labeled node reading command to the reader. 261 263 GraphReader& readNode(std::string name, Node& node) { 262 264 node_reader.readNode(name, node); … … 264 266 } 265 267 266 /// \brief Add a new labeled edge reader forthe reader.267 /// 268 /// Add a new labeled edge reader forthe reader.268 /// \brief Give a new labeled edge reading command to the reader. 269 /// 270 /// Give a new labeled edge reading command to the reader. 269 271 GraphReader& readEdge(std::string name, Edge& edge) { 270 272 edge_reader.readEdge(name, edge); … … 272 274 } 273 275 274 /// \brief Add a new attribute readercommand.275 /// 276 /// Add a new attribute readercommand.276 /// \brief Give a new attribute reading command. 277 /// 278 /// Give a new attribute reading command. 277 279 template <typename Value> 278 280 GraphReader& readAttribute(std::string name, Value& value) { … … 281 283 } 282 284 283 /// \brief Add a new attribute readercommand.284 /// 285 /// Add a new attribute readercommand.285 /// \brief Give a new attribute reading command. 286 /// 287 /// Give a new attribute reading command. 286 288 template <typename Reader, typename Value> 287 289 GraphReader& readAttribute(std::string name, Value& value, … … 293 295 /// \brief Conversion operator to LemonReader. 294 296 /// 295 /// Conversion operator to LemonReader. It make possible296 /// to access the encapsulated \e LemonReader, this way297 /// you can attach to this reader new instances of298 /// \e LemonReader::SectionReader.297 /// Conversion operator to LemonReader. It makes possible to access the 298 /// encapsulated \e LemonReader, this way you can attach to this reader 299 /// new instances of \e LemonReader::SectionReader. For more details see 300 /// the \ref rwbackground "Background of Reading and Writing". 299 301 operator LemonReader&() { 300 302 return *reader; 301 303 } 302 304 303 /// \brief Executes the read ercommands.304 /// 305 /// Executes the read ercommands.305 /// \brief Executes the reading commands. 306 /// 307 /// Executes the reading commands. 306 308 void run() { 307 309 reader->run(); … … 433 435 /// \brief The undir graph reader class. 434 436 /// 437 /// The \c UndirGraphReader class provides the graph input. 438 /// Before you read this documentation it might be useful to read the general 439 /// description of \ref graph-io-page "Graph Input-Output". 440 /// 441 /// If you don't need very sophisticated 442 /// behaviour then you can use the versions of the public function 443 /// \ref readGraph() to read a graph (or a max flow instance etc). 444 /// 435 445 /// The given file format may contain several maps and labeled nodes or 436 446 /// edges. 437 447 /// 438 448 /// If you read a graph you need not read all the maps and items just those 439 /// that you need. The interface of the \c GraphReader is very similar to440 /// t he GraphWriter but the reading method does not depend on the orderthe441 /// given commands.449 /// that you need. The interface of the \c UndirGraphReader is very similar 450 /// to the UndirGraphWriter but the reading method does not depend on the 451 /// order of the given commands. 442 452 /// 443 453 /// The reader object suppose that each not readed value does not contain … … 570 580 } 571 581 572 /// \brief Add a new node map reader command forthe reader.573 /// 574 /// Add a new node map reader command forthe reader.582 /// \brief Give a new node map reading command to the reader. 583 /// 584 /// Give a new node map reading command to the reader. 575 585 template <typename Map> 576 586 UndirGraphReader& readNodeMap(std::string name, Map& map) { … … 585 595 } 586 596 587 /// \brief Add a new node map reader command forthe reader.588 /// 589 /// Add a new node map reader command forthe reader.597 /// \brief Give a new node map reading command to the reader. 598 /// 599 /// Give a new node map reading command to the reader. 590 600 template <typename Reader, typename Map> 591 601 UndirGraphReader& readNodeMap(std::string name, Map& map, … … 602 612 } 603 613 604 /// \brief Add a new node map skipper command forthe reader.605 /// 606 /// Add a new node map skipper command forthe reader.614 /// \brief Give a new node map skipping command to the reader. 615 /// 616 /// Give a new node map skipping command to the reader. 607 617 template <typename Reader> 608 618 UndirGraphReader& skipNodeMap(std::string name, … … 612 622 } 613 623 614 /// \brief Add a new undirected edge map reader command forthe reader.615 /// 616 /// Add a new undirected edge map reader command forthe reader.624 /// \brief Give a new undirected edge map reading command to the reader. 625 /// 626 /// Give a new undirected edge map reading command to the reader. 617 627 template <typename Map> 618 628 UndirGraphReader& readUndirEdgeMap(std::string name, Map& map) { … … 628 638 629 639 630 /// \brief Add a new undirected edge map reader command forthe reader.631 /// 632 /// Add a new undirected edge map reader command forthe reader.640 /// \brief Give a new undirected edge map reading command to the reader. 641 /// 642 /// Give a new undirected edge map reading command to the reader. 633 643 template <typename Reader, typename Map> 634 644 UndirGraphReader& readUndirEdgeMap(std::string name, Map& map, … … 645 655 } 646 656 647 /// \brief Add a new undirected edge map skipper command forthe reader.648 /// 649 /// Add a new undirected edge map skipper command forthe reader.657 /// \brief Give a new undirected edge map skipping command to the reader. 658 /// 659 /// Give a new undirected edge map skipping command to the reader. 650 660 template <typename Reader> 651 661 UndirGraphReader& skipUndirEdgeMap(std::string name, … … 656 666 657 667 658 /// \brief Add a new edge map reader command forthe reader.659 /// 660 /// Add a new edge map reader command forthe reader.668 /// \brief Give a new edge map reading command to the reader. 669 /// 670 /// Give a new edge map reading command to the reader. 661 671 template <typename Map> 662 672 UndirGraphReader& readEdgeMap(std::string name, Map& map) { … … 672 682 673 683 674 /// \brief Add a new edge map reader command forthe reader.675 /// 676 /// Add a new edge map reader command forthe reader.684 /// \brief Give a new edge map reading command to the reader. 685 /// 686 /// Give a new edge map reading command to the reader. 677 687 template <typename Reader, typename Map> 678 688 UndirGraphReader& readEdgeMap(std::string name, Map& map, … … 689 699 } 690 700 691 /// \brief Add a new edge map skipper command forthe reader.692 /// 693 /// Add a new edge map skipper command forthe reader.701 /// \brief Give a new edge map skipping command to the reader. 702 /// 703 /// Give a new edge map skipping command to the reader. 694 704 template <typename Reader> 695 705 UndirGraphReader& skipEdgeMap(std::string name, … … 699 709 } 700 710 701 /// \brief Add a new labeled node reader forthe reader.702 /// 703 /// Add a new labeled node reader forthe reader.711 /// \brief Give a new labeled node reading command to the reader. 712 /// 713 /// Give a new labeled node reading command to the reader. 704 714 UndirGraphReader& readNode(std::string name, Node& node) { 705 715 node_reader.readNode(name, node); … … 707 717 } 708 718 709 /// \brief Add a new labeled edge reader forthe reader.710 /// 711 /// Add a new labeled edge reader forthe reader.719 /// \brief Give a new labeled edge reading command to the reader. 720 /// 721 /// Give a new labeled edge reading command to the reader. 712 722 UndirGraphReader& readEdge(std::string name, Edge& edge) { 713 723 undir_edge_reader.readEdge(name, edge); 714 724 } 715 725 716 /// \brief Add a new labeled undirected edge reader for the reader. 717 /// 718 /// Add a new labeled undirected edge reader for the reader. 726 /// \brief Give a new labeled undirected edge reading command to the 727 /// reader. 728 /// 729 /// Give a new labeled undirected edge reading command to the reader. 719 730 UndirGraphReader& readUndirEdge(std::string name, UndirEdge& edge) { 720 731 undir_edge_reader.readUndirEdge(name, edge); 721 732 } 722 733 723 /// \brief Add a new attribute readercommand.724 /// 725 /// Add a new attribute readercommand.734 /// \brief Give a new attribute reading command. 735 /// 736 /// Give a new attribute reading command. 726 737 template <typename Value> 727 738 UndirGraphReader& readAttribute(std::string name, Value& value) { … … 730 741 } 731 742 732 /// \brief Add a new attribute readercommand.733 /// 734 /// Add a new attribute readercommand.743 /// \brief Give a new attribute reading command. 744 /// 745 /// Give a new attribute reading command. 735 746 template <typename Reader, typename Value> 736 747 UndirGraphReader& readAttribute(std::string name, Value& value, … … 750 761 } 751 762 752 /// \brief Executes the read ercommands.753 /// 754 /// Executes the read ercommands.763 /// \brief Executes the reading commands. 764 /// 765 /// Executes the reading commands. 755 766 void run() { 756 767 reader->run(); -
lemon/graph_utils.h
r1538 r1540 31 31 ///\brief Graph utilities. 32 32 /// 33 ///\todo Please34 ///revise the documentation.35 33 /// 36 34 … … 43 41 /// \brief Function to count the items in the graph. 44 42 /// 45 /// This function counts the items in the graph.43 /// This function counts the items (nodes, edges etc) in the graph. 46 44 /// The complexity of the function is O(n) because 47 45 /// it iterates on all of the items. … … 126 124 /// This function counts the undirected edges in the graph. 127 125 /// The complexity of the function is O(e) but for some 128 /// graph structure it is specialized to run in O(1).126 /// graph structures it is specialized to run in O(1). 129 127 130 128 template <typename Graph> … … 194 192 } 195 193 196 /// \brief Copy the source map to the targetmap.197 /// 198 /// Copy the \c source map to the \c target map. It uses the given iterator199 /// to iterate on the data structure and it use the \c ref mapping to200 /// convert the source's keys to the target's keys.194 /// \brief Copy a map. 195 /// 196 /// Thsi function copies the \c source map to the \c target map. It uses the 197 /// given iterator to iterate on the data structure and it uses the \c ref 198 /// mapping to convert the source's keys to the target's keys. 201 199 template <typename Target, typename Source, 202 200 typename ItemIt, typename Ref> … … 221 219 222 220 223 /// \brief Class to copy a graph to an other graph.224 /// 225 /// Class to copy a graph to an other graph . It can be used easier226 /// with the \c copyGraph() function.221 /// \brief Class to copy a graph. 222 /// 223 /// Class to copy a graph to an other graph (duplicate a graph). The 224 /// simplest way of using it is through the \c copyGraph() function. 227 225 template <typename Target, typename Source> 228 226 class GraphCopy { … … 355 353 /// After the copy the \c nr map will contain the mapping from the 356 354 /// source graph's nodes to the target graph's nodes and the \c ecr will 357 /// contain the mapping from the target graph's edge to the source's355 /// contain the mapping from the target graph's edges to the source's 358 356 /// edges. 359 357 template <typename Target, typename Source> … … 459 457 /// Provides an immutable and unique id for each item in the graph. 460 458 461 /// The IdMap class provides a unique and immutable mapping for each item 462 /// in the graph. 459 /// The IdMap class provides a unique and immutable id for each item of the 460 /// same type (e.g. node) in the graph. This id is <ul><li>\b unique: 461 /// different items (nodes) get different ids <li>\b immutable: the id of an 462 /// item (node) does not change (even if you delete other nodes). </ul> 463 /// Through this map you get access (i.e. can read) the inner id values of 464 /// the items stored in the graph. This map can be inverted with its member 465 /// class \c InverseMap. 463 466 /// 464 467 template <typename _Graph, typename _Item> … … 488 491 public: 489 492 490 /// \brief The class represents the inverse of the map.491 /// 492 /// The class represents the inverse of the map.493 /// \brief The class represents the inverse of its owner (IdMap). 494 /// 495 /// The class represents the inverse of its owner (IdMap). 493 496 /// \see inverse() 494 497 class InverseMap { … … 518 521 /// \brief Gives back the inverse of the map. 519 522 /// 520 /// Gives back the inverse of the map.523 /// Gives back the inverse of the IdMap. 521 524 InverseMap inverse() const { return InverseMap(*graph);} 522 525 … … 526 529 /// \brief General invertable graph-map type. 527 530 528 /// This type provides simple invertable map functions.531 /// This type provides simple invertable graph-maps. 529 532 /// The InvertableMap wraps an arbitrary ReadWriteMap 530 533 /// and if a key is set to a new value then store it … … 659 662 /// item in the graph. 660 663 /// 661 /// The DescriptorMap class provides a mutable, continuous and immutable 662 /// mapping for each item in the graph. The value for an item may mutated 663 /// on each operation when the an item erased or added to graph. 664 /// The DescriptorMap class provides a unique and continuous (but mutable) 665 /// descriptor (id) for each item of the same type (e.g. node) in the 666 /// graph. This id is <ul><li>\b unique: different items (nodes) get 667 /// different ids <li>\b continuous: the range of the ids is the set of 668 /// integers between 0 and \c n-1, where \c n is the number of the items of 669 /// this type (e.g. nodes) (so the id of a node can change if you delete an 670 /// other node, i.e. this id is mutable). </ul> This map can be inverted 671 /// with its member class \c InverseMap. 664 672 /// 665 673 /// \param _Graph The graph class the \c DescriptorMap belongs to. … … 755 763 756 764 public: 757 /// \brief The inverse map type .758 /// 759 /// The inverse map type .765 /// \brief The inverse map type of DescriptorMap. 766 /// 767 /// The inverse map type of DescriptorMap. 760 768 class InverseMap { 761 769 public: … … 874 882 /// \brief Returns a \ref TargetMap class 875 883 /// 876 /// This function just returns a n\ref TargetMap class.884 /// This function just returns a \ref TargetMap class. 877 885 /// \relates TargetMap 878 886 template <typename Graph> … … 881 889 } 882 890 883 /// \brief Returns the "forward" directed edge view of undirected edge.884 /// 885 /// Returns the "forward" directed edge view of undirected edge.891 /// \brief Returns the "forward" directed edge view of an undirected edge. 892 /// 893 /// Returns the "forward" directed edge view of an undirected edge. 886 894 /// \author Balazs Dezso 887 895 template <typename Graph> … … 922 930 } 923 931 924 /// \brief Returns the "backward" directed edge view of undirected edge.925 /// 926 /// Returns the "backward" directed edge view of undirected edge.932 /// \brief Returns the "backward" directed edge view of an undirected edge. 933 /// 934 /// Returns the "backward" directed edge view of an undirected edge. 927 935 /// \author Balazs Dezso 928 936 template <typename Graph> … … 955 963 /// \brief Returns a \ref BackwardMap class 956 964 957 /// This function just returns a n\ref BackwardMap class.965 /// This function just returns a \ref BackwardMap class. 958 966 /// \relates BackwardMap 959 967 template <typename Graph> … … 976 984 /// \brief Map of the node in-degrees. 977 985 /// 978 /// This map returns the in-degree of a node. On esit is constructed,986 /// This map returns the in-degree of a node. Once it is constructed, 979 987 /// the degrees are stored in a standard NodeMap, so each query is done 980 /// in constant time. On the other hand, the values updatesautomatically988 /// in constant time. On the other hand, the values are updated automatically 981 989 /// whenever the graph changes. 982 990 /// … … 1068 1076 /// \brief Map of the node out-degrees. 1069 1077 /// 1070 /// This map returns the out-degree of a node. On e it is constructed,1078 /// This map returns the out-degree of a node. Once it is constructed, 1071 1079 /// the degrees are stored in a standard NodeMap, so each query is done 1072 /// in constant time. On the other hand, the values updatesautomatically1080 /// in constant time. On the other hand, the values are updated automatically 1073 1081 /// whenever the graph changes. 1074 1082 /// -
lemon/graph_writer.h
r1534 r1540 38 38 /// Before you read this documentation it might be useful to read the general 39 39 /// description of \ref graph-io-page "Graph Input-Output". 40 /// 40 41 /// If you don't need very sophisticated 41 42 /// behaviour then you can use the versions of the public function … … 165 166 } 166 167 168 167 169 /// \brief Issue a new node map writing command for the writer. 168 170 /// … … 239 241 /// to access the encapsulated \e LemonWriter, this way 240 242 /// you can attach to this writer new instances of 241 /// \e LemonWriter::SectionWriter. 243 /// \e LemonWriter::SectionWriter. For more details see 244 /// the \ref rwbackground "Background of Reading and Writing". 242 245 operator LemonWriter&() { 243 246 return *writer; … … 569 572 /// This function issues a new <i> undirected edge map writing 570 573 /// command</i> to the writer. 571 574 template <typename Writer, typename Map> 572 575 UndirGraphWriter& writeUndirEdgeMap(std::string name, const Map& map, 573 576 const Writer& writer = Writer()) { -
lemon/lp_glpk.cc
r1473 r1540 446 446 case LPX_D_UNDEF://Undefined (no solve has been run yet) 447 447 return UNDEFINED; 448 case LPX_D_NOFEAS://There is no feasible solution (primal, I guess)448 case LPX_D_NOFEAS://There is no dual feasible solution 449 449 // case LPX_D_INFEAS://Infeasible 450 450 return INFEASIBLE;
Note: See TracChangeset
for help on using the changeset viewer.