Boost-Graph

 view release on metacpan or  search on metacpan

include/boost/graph/fruchterman_reingold.hpp  view on Meta::CPAN

             const Graph&) const
  {
    return k * k / d;
  }
};

template<typename T>
struct linear_cooling {
  typedef T result_type;

  linear_cooling(std::size_t iterations)
    : temp(T(iterations) / T(10)), step(0.1) { }

  linear_cooling(std::size_t iterations, T temp)
    : temp(temp), step(temp / T(iterations)) { }

  T operator()()
  {
    T old_temp = temp;
    temp -= step;
    if (temp < T(0)) temp = T(0);
    return old_temp;
  }

 private:

include/boost/graph/gursoy_atun_layout.hpp  view on Meta::CPAN

                   PositionMap position,
                   const bgl_named_params<P,T,R>& params)
{
#ifndef BOOST_NO_STDC_NAMESPACE
  using std::sqrt;
#endif

  std::pair<double, double> diam(sqrt(double(num_vertices(graph))), 1.0);
  std::pair<double, double> learn(0.8, 0.2);
  gursoy_atun_layout(graph, space, position,
                     choose_param(get_param(params, iterations_t()),
                                  num_vertices(graph)),
                     choose_param(get_param(params, diameter_range_t()), 
                                  diam).first,
                     choose_param(get_param(params, diameter_range_t()), 
                                  diam).second,
                     choose_param(get_param(params, learning_constant_range_t()), 
                                  learn).first,
                     choose_param(get_param(params, learning_constant_range_t()), 
                                  learn).second,
                     choose_const_pmap(get_param(params, vertex_index), graph,

include/boost/graph/named_function_params.hpp  view on Meta::CPAN

  struct vertex_invariant2_t { };
  struct edge_compare_t { };
  struct vertex_max_invariant_t { };
  struct orig_to_copy_t { };
  struct root_vertex_t { };
  struct attractive_force_t { };
  struct repulsive_force_t { };
  struct force_pairs_t { };
  struct cooling_t { };
  struct vertex_displacement_t { };
  struct iterations_t { };
  struct diameter_range_t { };
  struct learning_constant_range_t { };

  namespace detail {
    template <class T>
    struct wrap_ref {
      wrap_ref(T& r) : ref(r) {}
      T& ref;
    };
  }

include/boost/graph/named_function_params.hpp  view on Meta::CPAN

    }

    template <typename Cooling>
    bgl_named_params<Cooling, cooling_t, self>
    cooling(const Cooling& c) {
      typedef bgl_named_params<Cooling, cooling_t, self> Params;
      return Params(c, *this);
    }

    template <typename TP>
    bgl_named_params<TP, iterations_t, self>
    iterations(const TP& c) {
      typedef bgl_named_params<TP, iterations_t, self> Params;
      return Params(c, *this);
    }    

    template<typename TP>
    bgl_named_params<std::pair<TP, TP>, diameter_range_t, self>
    diameter_range(const std::pair<TP, TP>& c) {
      typedef bgl_named_params<std::pair<TP, TP>, diameter_range_t, self> Params;
      return Params(c, *this);
    }

include/boost/graph/named_function_params.hpp  view on Meta::CPAN

  }

  template <typename Cooling>
  bgl_named_params<Cooling, cooling_t>
  cooling(const Cooling& c) {
    typedef bgl_named_params<Cooling, cooling_t> Params;
    return Params(c);
  }

  template <typename T>
  bgl_named_params<T, iterations_t>
  iterations(const T& c) {
    typedef bgl_named_params<T, iterations_t> Params;
    return Params(c);
  }    
  
  template<typename T>
  bgl_named_params<std::pair<T, T>, diameter_range_t>
  diameter_range(const std::pair<T, T>& c) {
    typedef bgl_named_params<std::pair<T, T>, diameter_range_t> Params;
    return Params(c);
  }
  

include/boost/graph/page_rank.hpp  view on Meta::CPAN

#define BOOST_GRAPH_PAGE_RANK_HPP

#include <boost/property_map.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/properties.hpp>
#include <boost/graph/iteration_macros.hpp>
#include <vector>

namespace boost { namespace graph {

struct n_iterations
{
  explicit n_iterations(std::size_t n) : n(n) { }

  template<typename RankMap, typename Graph>
  bool 
  operator()(const RankMap&, const Graph&)
  {
    return n-- == 0;
  }

 private:
  std::size_t n;

include/boost/graph/page_rank.hpp  view on Meta::CPAN

page_rank(const Graph& g, RankMap rank_map, Done done, 
          typename property_traits<RankMap>::value_type damping = 0.85)
{
  page_rank(g, rank_map, done, damping, num_vertices(g));
}

template<typename Graph, typename RankMap>
inline void
page_rank(const Graph& g, RankMap rank_map)
{
  page_rank(g, rank_map, n_iterations(20));
}

// TBD: this could be _much_ more efficient, using a queue to store
// the vertices that should be reprocessed and keeping track of which
// vertices are in the queue with a property map. Baah, this only
// applies when we have a bidirectional graph.
template<typename MutableGraph>
void
remove_dangling_links(MutableGraph& g)
{

include/boost/regex/v4/perl_matcher.hpp  view on Meta::CPAN

      return set_->isnot ? next : ++next;
   return set_->isnot ? ++next : next;
}

template <class BidiIterator>
class repeater_count
{
   repeater_count** stack;
   repeater_count* next;
   int id;
   std::size_t count;        // the number of iterations so far
   BidiIterator start_pos;   // where the last repeat started
public:
   repeater_count(repeater_count** s)
   {
      stack = s;
      next = 0;
      id = -1;
      count = 0;
   }
   repeater_count(int i, repeater_count** s, BidiIterator start)

include/boost/spirit/utility/loops.hpp  view on Meta::CPAN


    ///////////////////////////////////////////////////////////////////////////////
    //
    //  finite_loop class
    //
    //      This class takes care of the construct:
    //
    //          repeat_p (min, max) [p]
    //
    //      where 'p' is a parser, 'min' and 'max' specifies the minimum and
    //      maximum iterations over 'p'. The parser iterates over the input
    //      at least 'min' times and at most 'max' times. The parse function
    //      fails if the parser does not match the input at least 'min' times
    //      and at most 'max' times.
    //
    //      This class is parametizable and can accept constant arguments
    //      (e.g. repeat_p (5, 10) [p]) as well as references to variables
    //      (e.g. repeat_p (ref (n1), ref (n2)) [p]).
    //
    ///////////////////////////////////////////////////////////////////////////////
    template <typename ParserT, typename MinT, typename MaxT>



( run in 1.385 second using v1.01-cache-2.11-cpan-71847e10f99 )