1
  D   ˆl–Ãa¾”êh¥2 ¸&®6â˜´o�þZ‘§ÖnRÉÜcüÿÂ„î¼ßÁ_‹I|¥�+ýÿ¹ä³ÁÀ ?÷     //
//=======================================================================
// Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek
//
// Copyright 2009, Andrew Sutton
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//=======================================================================
//
#ifndef BOOST_GRAPH_CONCEPTS_HPP
#define BOOST_GRAPH_CONCEPTS_HPP

#include <boost/config.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
#include <boost/graph/numeric_values.hpp>
#include <boost/graph/buffer_concepts.hpp>
#include <boost/concept_check.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/mpl/not.hpp>
#include <boost/static_assert.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/concept/assert.hpp>

#include <boost/concept/detail/concept_def.hpp>
namespace boost
{
// dwa 2003/7/11 -- This clearly shouldn't be necessary, but if
// you want to use vector_as_graph, it is!  I'm sure the graph
// library leaves these out all over the place.  Probably a
// redesign involving specializing a template with a static
// member function is in order :(
//
// It is needed in order to allow us to write using boost::vertices as
// needed for ADL when using vector_as_graph below.
#if !defined(BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP) \
    && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
#define BOOST_VECTOR_AS_GRAPH_GRAPH_ADL_HACK
#endif

#ifdef BOOST_VECTOR_AS_GRAPH_GRAPH_ADL_HACK
template < class T >
typename T::ThereReallyIsNoMemberByThisNameInT vertices(T const&);
#endif

namespace concepts
{
    BOOST_concept(MultiPassInputIterator, (T)) { BOOST_CONCEPT_USAGE(
        MultiPassInputIterator) { BOOST_CONCEPT_ASSERT((InputIterator< T >));
}
};

BOOST_concept(Graph, (G))
{
    typedef typename graph_traits< G >::vertex_descriptor vertex_descriptor;
    typedef typename graph_traits< G >::edge_descriptor edge_descriptor;
    typedef typename graph_traits< G >::directed_category directed_category;
    typedef typename graph_traits< G >::edge_parallel_category
        edge_parallel_category;
    typedef typename graph_traits< G >::traversal_category traversal_category;

    BOOST_CONCEPT_USAGE(Graph)
    {
        BOOST_CONCEPT_ASSERT((DefaultConstructible< vertex_descriptor >));
        BOOST_CONCEPT_ASSERT((EqualityComparable< vertex_descriptor >));
        BOOST_CONCEPT_ASSERT((Assignable< vertex_descriptor >));
    }
    G g;
};

BOOST_concept(IncidenceGraph, (G)) : Graph< G >
{
    typedef typename graph_traits< G >::edge_descriptor edge_descriptor;
    typedef typename graph_traits< G >::out_edge_iterator out_edge_iterator;
    typedef typename graph_traits< G >::degree_size_type degree_size_type;
    typedef typename graph_traits< G >::traversal_category traversal_category;

    BOOST_STATIC_ASSERT(
        (boost::mpl::not_< boost::is_same< out_edge_iterator, void > >::value));
    BOOST_STATIC_ASSERT(
        (boost::mpl::not_< boost::is_same< degree_size_type, void > >::value));

    BOOST_CONCEPT_USAGE(IncidenceGraph)
    {
        BOOST_CONCEPT_ASSERT((MultiPassInputIterator< out_edge_iterator >));
        BOOST_CONCEPT_ASSERT((DefaultConstructible< edge_descriptor >));
        BOOST_CONCEPT_ASSERT((EqualityComparable< edge_descriptor >));
        BOOST_CONCEPT_ASSERT((Assignable< edge_descriptor >));
        BOOST_CONCEPT_ASSERT(
            (Convertible< traversal_category, incidence_graph_tag >));

        p = out_edges(u, g);
        n = out_degree(u, g);
        e = *p.first;
        u = source(e, g);
        v = target(e, g);
        const_constraints(g);
    }
    void const_constraints(const G& cg)
    {
        p = out_edges(u, cg);
        n = out_degree(u, cg);
        e = *p.first;
        u = source(e, cg);
        v = target(e, cg);
    }
    st