src/work/deba/vector_edge_map.h
author alpar
Sat, 17 Apr 2004 13:15:53 +0000
changeset 348 b63ea19e502e
permissions -rw-r--r--
A bool Edge Map with iterators that goes through the true or the false edges.
deba@262
     1
#ifndef VECTOR_EDGE_MAP_H
deba@262
     2
#define VECTOR_EDGE_MAP_H
deba@262
     3
deba@262
     4
#include <vector>
deba@262
     5
deba@262
     6
#include "edge_map_base.h"
deba@262
     7
deba@262
     8
template <typename G, typename E, typename V> 
deba@262
     9
class VectorEdgeMap : public EdgeMapBase<G, E>{
deba@262
    10
public:
deba@262
    11
	typedef V ValueType;
deba@262
    12
	
deba@262
    13
	VectorEdgeMap(Graph& g) : EdgeMapBase<G, E>(g) {}
deba@262
    14
	
deba@262
    15
	void add(const E& edge) {
deba@262
    16
		if (edge->id >= container.size()) {
deba@262
    17
			container.resize(edge->id);
deba@262
    18
		}
deba@262
    19
	}
deba@262
    20
	
deba@262
    21
	void erase(const E&) {}
deba@262
    22
deba@262
    23
private:
deba@262
    24
	typedef vector<ValueType> Container;
deba@262
    25
	
deba@262
    26
	Container container;
deba@262
    27
}
deba@262
    28
deba@262
    29
#endif