alpar@202: /*! alpar@202: alpar@202: \page maps How to write maps alpar@202: alpar@202: \section read-maps Readable Maps alpar@202: alpar@202: It is quite easy to write your own readmap for the edges or nodes of a graph. alpar@202: alpar@202: You can find some example below. alpar@202: alpar@204: This simple map assigns \f$\pi\f$ to each edge. alpar@204: alpar@202: \code alpar@273: struct MyMap alpar@202: { alpar@273: typedef double ValueType; alpar@273: double operator[](Graph::EdgeIt e) const { return M_PI;} alpar@204: }; alpar@204: \endcode alpar@204: alpar@204: alpar@210: Here is a more complex example. It provides a length function which is obtained alpar@210: from a base length function modified by a potential difference. alpar@210: \todo Please improve on the english. alpar@202: alpar@202: \code alpar@202: class MyLengthMap alpar@202: { alpar@202: const Graph::EdgeMap &ol; alpar@202: const Graph::NodeMap &pot; alpar@202: alpar@273: public: alpar@273: typedef double ValueType; alpar@273: alpar@210: double operator[](Graph::EdgeIt e) const { alpar@210: return ol.get(e)-pot.get(v)-pot.get(u); alpar@210: } alpar@202: alpar@202: MyComplexMap(const Graph::EdgeMap &o,const Graph::NodeMap &p) : alpar@202: ol(o), pot(p); alpar@202: }; alpar@202: \endcode alpar@202: alpar@273: \todo Don't we need \e to \e require a 'typedef xxx KeyType' tag, as well? alpar@202: */