435 multiple edgesets can be stored to the same nodeset. It can be used |
435 multiple edgesets can be stored to the same nodeset. It can be used |
436 for example as a network traffic matrix. |
436 for example as a network traffic matrix. |
437 |
437 |
438 In our example there is a network with symmetric links and there are assymetric |
438 In our example there is a network with symmetric links and there are assymetric |
439 traffic request on the network. This construction can be stored in an |
439 traffic request on the network. This construction can be stored in an |
440 undirected graph and in a directed \c NewEdgeSetAdaptor class. The example |
440 undirected graph and in a directed \c ListEdgeSet class. The example |
441 shows the input with the \ref lemon::LemonReader "LemonReader" class: |
441 shows the input with the \ref lemon::LemonReader "LemonReader" class: |
442 |
442 |
443 \code |
443 \code |
444 UndirListGraph network; |
444 UndirListGraph network; |
445 UndirListGraph::UndirEdgeMap<double> capacity; |
445 UndirListGraph::UndirEdgeMap<double> capacity; |
446 NewEdgeSetAdaptor<UndirListGraph> traffic(network); |
446 ListEdgeSet<UndirListGraph> traffic(network); |
447 NewEdgeSetAdaptor<UndirListGraph>::EdgeSet<double> request(network); |
447 ListEdgeSet<UndirListGraph>::EdgeMap<double> request(network); |
448 |
448 |
449 LemonReader reader(std::cin); |
449 LemonReader reader(std::cin); |
450 NodeSetReader<UndirListGraph> nodesetReader(reader, network); |
450 NodeSetReader<UndirListGraph> nodesetReader(reader, network); |
451 UndirEdgeSetReader<UndirListGraph> |
451 UndirEdgeSetReader<UndirListGraph> |
452 undirEdgesetReader(reader, network, nodesetReader); |
452 undirEdgesetReader(reader, network, nodesetReader); |
453 undirEdgesetReader.readEdgeMap("capacity", capacity); |
453 undirEdgesetReader.readEdgeMap("capacity", capacity); |
454 EdgeSetReader<NewEdgeSetAdaptor<UndirListGraph> > |
454 EdgeSetReader<ListEdgeSet<UndirListGraph> > |
455 edgesetReader(reader, traffic, nodesetReader); |
455 edgesetReader(reader, traffic, nodesetReader); |
456 edgesetReader.readEdgeMap("request", request); |
456 edgesetReader.readEdgeMap("request", request); |
457 |
457 |
458 reader.run(); |
458 reader.run(); |
459 \endcode |
459 \endcode |
467 |
467 |
468 |
468 |
469 \code |
469 \code |
470 UndirListGraph network; |
470 UndirListGraph network; |
471 UndirListGraph::UndirEdgeSet<double> capacity; |
471 UndirListGraph::UndirEdgeSet<double> capacity; |
472 NewEdgeSetAdaptor<UndirListGraph> traffic(network); |
472 ListEdgeSet<UndirListGraph> traffic(network); |
473 NewEdgeSetAdaptor<UndirListGraph>::EdgeSet<double> request(network); |
473 ListEdgeSet<UndirListGraph>::EdgeMap<double> request(network); |
474 |
474 |
475 UndirGraphReader reader(std::cin, network); |
475 UndirGraphReader<UndirListGraph> reader(std::cin, network); |
476 reader.readEdgeMap("capacity", capacity); |
476 reader.readEdgeMap("capacity", capacity); |
477 EdgeSetReader edgesetReader(reader, traffic, reader); |
477 EdgeSetReader<ListEdgeSet<UndirListGraph> > |
|
478 edgesetReader(reader, traffic, reader); |
478 edgesetReader.readEdgeMap("request", request); |
479 edgesetReader.readEdgeMap("request", request); |
479 |
480 |
480 reader.run(); |
481 reader.run(); |
481 \endcode |
482 \endcode |
482 |
483 |