src/lemon/concept/undir_graph.h
changeset 962 1a770e9f80b2
child 986 e997802b855c
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/lemon/concept/undir_graph.h	Fri Nov 05 00:31:49 2004 +0000
     1.3 @@ -0,0 +1,78 @@
     1.4 +/* -*- C++ -*-
     1.5 + *
     1.6 + * src/lemon/concept/undir_graph_component.h - Part of LEMON, a generic
     1.7 + * C++ optimization library
     1.8 + *
     1.9 + * Copyright (C) 2004 Egervary Jeno Kombinatorikus Optimalizalasi
    1.10 + * Kutatocsoport (Egervary Combinatorial Optimization Research Group,
    1.11 + * EGRES).
    1.12 + *
    1.13 + * Permission to use, modify and distribute this software is granted
    1.14 + * provided that this copyright notice appears in all copies. For
    1.15 + * precise terms see the accompanying LICENSE file.
    1.16 + *
    1.17 + * This software is provided "AS IS" with no warranty of any kind,
    1.18 + * express or implied, and with no claim as to its suitability for any
    1.19 + * purpose.
    1.20 + *
    1.21 + */
    1.22 +
    1.23 +///\ingroup concept
    1.24 +///\file
    1.25 +///\brief Undirected graphs and components of.
    1.26 +
    1.27 +
    1.28 +#ifndef LEMON_CONCEPT_UNDIR_GRAPH_H
    1.29 +#define LEMON_CONCEPT_UNDIR_GRAPH_H
    1.30 +
    1.31 +#include <lemon/concept/graph_component.h>
    1.32 +
    1.33 +namespace lemon {
    1.34 +  namespace concept {
    1.35 +
    1.36 +    /// \todo to be done
    1.37 +    class BaseIterableUndirGraph;
    1.38 +
    1.39 +    template <typename Graph>
    1.40 +    struct BaseIterableUndirGraphConcept {
    1.41 +      typedef typename Graph::UndirEdge UndirEdge;
    1.42 +      typedef typename Graph::Edge Edge;
    1.43 +      typedef typename Graph::Node Node;
    1.44 +      void constraints() {
    1.45 +	function_requires< BaseIterableGraphComponentConcept<Graph> >();
    1.46 +	function_requires< GraphItemConcept<UndirEdge> >();
    1.47 +
    1.48 +	/// \bug this should be base_and_derived:
    1.49 +	UndirEdge ue = e;
    1.50 +	ue = e;
    1.51 +
    1.52 +	Node n;
    1.53 +	n = graph.head(ue);
    1.54 +	n = graph.tail(ue);
    1.55 +
    1.56 +	graph.first(ue);
    1.57 +	graph.next(ue);
    1.58 +      }
    1.59 +      const Graph &graph;
    1.60 +      Edge e;
    1.61 +    };
    1.62 +
    1.63 +    template <typename Graph>
    1.64 +    struct IterableUndirGraphConcept {
    1.65 +      void constraints() {
    1.66 +	function_requires< BaseIterableUndirGraphConcept<Graph> > ();
    1.67 +	function_requires< IterableGraphComponentConcept<Graph> > ();
    1.68 +
    1.69 +	typedef typename Graph::UndirEdge UndirEdge;
    1.70 +	typedef typename Graph::UndirEdgeIt UndirEdgeIt;
    1.71 +
    1.72 +	function_requires<
    1.73 +	  GraphIteratorConcept<UndirEdgeIt, Graph, UndirEdge> >();
    1.74 +      }
    1.75 +    };
    1.76 +
    1.77 +  }
    1.78 +
    1.79 +}
    1.80 +
    1.81 +#endif