src/work/deba/vector_edge_map.h
author marci
Wed, 31 Mar 2004 17:57:15 +0000
changeset 272 6179d85566e4
permissions -rw-r--r--
Nehany folyamalgoritmus futasi ideje, azzal a kozponti kerdessel, hogy a sok dereferalas
hasznalata/kerulese
optimalizalassal/optimalizalas nelkul
kulonbozo gepeken Celeron 600/karp
milyen futasi idoket eredmenyez.
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