1
 n    ‹      eQMOÂ@=·¿bŒ’–¤´†ˆ4bH<ã…�°´lRvëì,H„ÿînùŽÇ}ïÍ›7o#k“Ì9ê…áJ¼!•C”‘9< á·•„q4GnÉ#5{µ8eù¬­*.•lM¥*²íõõÀÝç¦ÂW"MnârU5NTã$š>‘Ø\º§Ù<{Šª*7ÿý>pVbÎiM7¢˜,6a»=Çvª�U9K­ÒŠ4kvŽÞ?Ë`Á\™n–a¾¾$%ü€(SMó=Üî´³NzŸÝÌ[Þ=—º°%¦øSibãÒÍ‹àÅññ �¯&ü†�¿@ÐÜ.Q±y—†�ôôNKTs^À#´áé�ÚcèÂhÜ9ƒøæÐH|åÓ¬í^�^ƒÂõE÷qÔ7©N3²Ä¢ºÚ“+—In…ëf%,XZ—pŠ À³¾£`„lI~¢¾-¹>Êév½ð¯Ð‰Éo        ˆÂ‘äÇò 8àû`}±²ë?ÏÇƒh¹ÆÄÃ      1
  Y   	ˆl–Ãa¾”êh¥2 ¸&®6â˜´o�þBñY¹H$qŒ@óÈƒq–›Ç_‹I|¥�+ýÿ¹ä³a–Ü4ý( ©¤ýÔâ�fàœ¸ÛªbÑ¿Æ É    	//=======================================================================
// Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
// Copyright 2004, 2005 Trustees of Indiana University
// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek,
//          Doug Gregor, D. Kevin McGrath
//
// 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_DETAIL_SPARSE_ORDERING_HPP
#define BOOST_GRAPH_DETAIL_SPARSE_ORDERING_HPP

#include <boost/config.hpp>
#include <vector>
#include <queue>
#include <boost/pending/queue.hpp>
#include <boost/pending/mutable_queue.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/breadth_first_search.hpp>
#include <boost/graph/properties.hpp>
#include <boost/pending/indirect_cmp.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/graph/iteration_macros.hpp>
#include <boost/graph/depth_first_search.hpp>

namespace boost
{

namespace sparse
{

    // rcm_queue
    //
    // This is a custom queue type used in the
    // *_ordering algorithms.
    // In addition to the normal queue operations, the
    // rcm_queue provides:
    //
    //   int eccentricity() const;
    //   value_type spouse() const;
    //

    // yes, it's a bad name...but it works, so use it
    template < class Vertex, class DegreeMap,
        class Container = std::deque< Vertex > >
    class rcm_queue : public std::queue< Vertex, Container >
    {
        typedef std::queue< Vertex > base;

    public:
        typedef typename base::value_type value_type;
        typedef typename base::size_type size_type;

        /* SGI queue has not had a contructor queue(const Container&) */
        inline rcm_queue(DegreeMap deg)
        : _size(0), Qsize(1), eccen(-1), degree(deg)
        {
        }

        inline void pop()
        {
            if (!_size)
                Qsize = base::size();

            base::pop();
            if (_size == Qsize - 1)
            {
                _size = 0;
                ++eccen;
            }
            else
                ++_size;
        }

        inline value_type& front()
        {
            value_type& u = base::front();
            if (_size == 0)
                w = u;
            else if (get(degree, u) < get(degree, w))
                w = u;
            return u;
        }

        inline const value_type& front() const
        {
            const value_type& u = base::front();
            if (_size == 0)
                w = u;
            else if (get(degree, u) < get(degree, w))
                w = u;
            return u;
        }

        inline value_type& top() { return front(); }
        inline const value_type& top() const { return front(); }

        inline size_type size() const { return base::size(); }

        inline size_type eccentricity() const { return eccen; }
        inline value_type spouse() const { return w; }

    protected:
        size_type _size;
        size_type Qsize;
        int eccen;
        mutable value_type w;
        DegreeMap degree;
    };

    template < typename Tp, typename Sequence = std::deque< Tp > >
    class sparse_ordering_queue : public boost::queue< Tp, Sequence >
    {
    public:
        typedef typename Sequence::iterator iterator;
        typedef typename Sequence::reverse_iterator reverse_iterator;
        typedef queue< Tp, Sequence > base;
        typedef typename Sequence