Home | Documentation | Download | Platforms | Projects | Mailing Lists | Version History

- Main Page
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# edge_map< T, Alloc > Class Template Reference

A specialized map with edges as keys. More...

Inheritance diagram for edge_map< T, Alloc >:

[legend]
Collaboration diagram for edge_map< T, Alloc >:

[legend]

List of all members.

## Public Member Functions

| edge_map ()
| edge_map (const graph &g, T t=T())

## Detailed Description

### template<class T, class Alloc = allocator<T>>
class edge_map< T, Alloc >

A specialized map with edges as keys.

A `edge_map` is a specialized and optimized map implementation with edges as keys. Using a `edge_map` is the standard way to attach user defined information to the edges of a `graph`.

An example of usage:

       graph g;

       node v1 = g.new_node();
       node v2 = g.new_node();
       edge e = g.new_edge(v1, v2);

       edge_map<string> label(g, "Default Label");

       label[e] = "An edge";

       assert(label[e] == "An edge");

The edges used as keys for a `edge_map` MUST be edges of the same graph. If you want to use edges from different graphs, use a `map<edge,T>` instead. A graph and a copy of it are considered to be different.

Most of the functionality of `edge_map` is inherited from ne_map.

See also:
  node_map

## Constructor & Destructor Documentation

template<class T, class Alloc = allocator<T>>

edge_map< T, Alloc >::edge_map | ( |  | ) | `[inline]`

Constructs an empty `edge_map` not associated with any `graph`. You may (but need not) call `ne_map::init(const graph &, T)` to associate it to a `graph`.

template<class T, class Alloc = allocator<T>>

edge_map< T, Alloc >::edge_map | ( | const graph & | g,
|  | T | t = `T()` |
| ) |  |  | `[inline, explicit]`

Constructs a `edge_map` associated to the graph `g`. The value associated to each edge in `g` is set to `t`.

University of Passau - FMI - Theoretical Computer Science

Design © 2002, 2003 Marcus Raitner, University of Passau