Line | |
---|
1 | /*! |
---|
2 | |
---|
3 | \page maps How to write maps |
---|
4 | |
---|
5 | \section read-maps Readable Maps |
---|
6 | |
---|
7 | It is quite easy to write your own readmap for the edges or nodes of a graph. |
---|
8 | |
---|
9 | You can find some example below. |
---|
10 | |
---|
11 | \code |
---|
12 | class MyMap |
---|
13 | { |
---|
14 | double get(Graph::EdgeIt e) { return 1;} |
---|
15 | }; |
---|
16 | \endcode |
---|
17 | |
---|
18 | A more complex example |
---|
19 | |
---|
20 | \code |
---|
21 | class MyLengthMap |
---|
22 | { |
---|
23 | const Graph::EdgeMap &ol; |
---|
24 | const Graph::NodeMap &pot; |
---|
25 | |
---|
26 | double get(Graph::EdgeIt e) const { return ol.get(e)-pot.get(v)-pot.get(u);} |
---|
27 | |
---|
28 | MyComplexMap(const Graph::EdgeMap &o,const Graph::NodeMap &p) : |
---|
29 | ol(o), pot(p); |
---|
30 | }; |
---|
31 | \endcode |
---|
32 | |
---|
33 | */ |
---|
Note: See
TracBrowser
for help on using the repository browser.