00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
#ifndef LEMON_MAP_BITS_H
00018
#define LEMON_MAP_BITS_H
00019
00023
00024
namespace lemon {
00025
00026
00029
00031
template <
typename Graph,
typename KeyIt>
00032 struct KeyInfo {};
00033
00034
template <
typename Graph>
00035
struct KeyInfo<Graph, typename Graph::NodeIt> {
00036
static int maxId(
const Graph& graph) {
00037
return graph.maxNodeId();
00038 }
00039
static int id(
const Graph& graph,
const typename Graph::Node& node) {
00040
return graph.id(node);
00041 }
00042 };
00043
00044
template <
typename Graph>
00045
struct KeyInfo<Graph, typename Graph::EdgeIt> {
00046
static int maxId(
const Graph& graph) {
00047
return graph.maxEdgeId();
00048 }
00049
static int id(
const Graph& graph,
const typename Graph::Edge& edge) {
00050
return graph.id(edge);
00051 }
00052 };
00053
00054
template <
typename Graph>
00055
struct KeyInfo<Graph, typename Graph::SymEdgeIt> {
00056
static int maxId(
const Graph& graph) {
00057
return graph.maxEdgeId() >> 1;
00058 }
00059
static int id(
const Graph& graph,
const typename Graph::Edge& edge) {
00060
return graph.id(edge) >> 1;
00061 }
00062 };
00063
00065 }
00066
00067
#endif