src/lemon/concept/undir_graph.h
author marci
Wed, 10 Nov 2004 12:51:30 +0000
changeset 975 12b9993b217c
child 986 e997802b855c
permissions -rw-r--r--
for better compatibility with gcc-3.4
klao@962
     1
/* -*- C++ -*-
klao@962
     2
 *
klao@962
     3
 * src/lemon/concept/undir_graph_component.h - Part of LEMON, a generic
klao@962
     4
 * C++ optimization library
klao@962
     5
 *
klao@962
     6
 * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi
klao@962
     7
 * Kutatocsoport (Egervary Combinatorial Optimization Research Group,
klao@962
     8
 * EGRES).
klao@962
     9
 *
klao@962
    10
 * Permission to use, modify and distribute this software is granted
klao@962
    11
 * provided that this copyright notice appears in all copies. For
klao@962
    12
 * precise terms see the accompanying LICENSE file.
klao@962
    13
 *
klao@962
    14
 * This software is provided "AS IS" with no warranty of any kind,
klao@962
    15
 * express or implied, and with no claim as to its suitability for any
klao@962
    16
 * purpose.
klao@962
    17
 *
klao@962
    18
 */
klao@962
    19
klao@962
    20
///\ingroup concept
klao@962
    21
///\file
klao@962
    22
///\brief Undirected graphs and components of.
klao@962
    23
klao@962
    24
klao@962
    25
#ifndef LEMON_CONCEPT_UNDIR_GRAPH_H
klao@962
    26
#define LEMON_CONCEPT_UNDIR_GRAPH_H
klao@962
    27
klao@962
    28
#include <lemon/concept/graph_component.h>
klao@962
    29
klao@962
    30
namespace lemon {
klao@962
    31
  namespace concept {
klao@962
    32
klao@962
    33
    /// \todo to be done
klao@962
    34
    class BaseIterableUndirGraph;
klao@962
    35
klao@962
    36
    template <typename Graph>
klao@962
    37
    struct BaseIterableUndirGraphConcept {
klao@962
    38
      typedef typename Graph::UndirEdge UndirEdge;
klao@962
    39
      typedef typename Graph::Edge Edge;
klao@962
    40
      typedef typename Graph::Node Node;
klao@962
    41
      void constraints() {
klao@962
    42
	function_requires< BaseIterableGraphComponentConcept<Graph> >();
klao@962
    43
	function_requires< GraphItemConcept<UndirEdge> >();
klao@962
    44
klao@962
    45
	/// \bug this should be base_and_derived:
klao@962
    46
	UndirEdge ue = e;
klao@962
    47
	ue = e;
klao@962
    48
klao@962
    49
	Node n;
klao@962
    50
	n = graph.head(ue);
klao@962
    51
	n = graph.tail(ue);
klao@962
    52
klao@962
    53
	graph.first(ue);
klao@962
    54
	graph.next(ue);
klao@962
    55
      }
klao@962
    56
      const Graph &graph;
klao@962
    57
      Edge e;
klao@962
    58
    };
klao@962
    59
klao@962
    60
    template <typename Graph>
klao@962
    61
    struct IterableUndirGraphConcept {
klao@962
    62
      void constraints() {
klao@962
    63
	function_requires< BaseIterableUndirGraphConcept<Graph> > ();
klao@962
    64
	function_requires< IterableGraphComponentConcept<Graph> > ();
klao@962
    65
klao@962
    66
	typedef typename Graph::UndirEdge UndirEdge;
klao@962
    67
	typedef typename Graph::UndirEdgeIt UndirEdgeIt;
klao@962
    68
klao@962
    69
	function_requires<
klao@962
    70
	  GraphIteratorConcept<UndirEdgeIt, Graph, UndirEdge> >();
klao@962
    71
      }
klao@962
    72
    };
klao@962
    73
klao@962
    74
  }
klao@962
    75
klao@962
    76
}
klao@962
    77
klao@962
    78
#endif