diff -r 666f914201fb -r 2fe1408b6811 epoc32/include/stdapis/boost/graph/random_layout.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/epoc32/include/stdapis/boost/graph/random_layout.hpp Tue Mar 16 16:12:26 2010 +0000 @@ -0,0 +1,49 @@ +// Copyright 2004 The Trustees of Indiana University. + +// 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) + +// Authors: Douglas Gregor +// Andrew Lumsdaine +#ifndef BOOST_GRAPH_RANDOM_LAYOUT_HPP +#define BOOST_GRAPH_RANDOM_LAYOUT_HPP + +#include +#include +#include +#include +#include +#include + +namespace boost { + +template +void +random_graph_layout(const Graph& g, PositionMap position_map, + Dimension minX, Dimension maxX, + Dimension minY, Dimension maxY, + RandomNumberGenerator& gen) +{ + typedef typename mpl::if_, + uniform_int, + uniform_real >::type distrib_t; + typedef typename mpl::if_, + RandomNumberGenerator&, + uniform_01 > + ::type gen_t; + + gen_t my_gen(gen); + distrib_t x(minX, maxX); + distrib_t y(minY, maxY); + typename graph_traits::vertex_iterator vi, vi_end; + for(tie(vi, vi_end) = vertices(g); vi != vi_end; ++vi) { + position_map[*vi].x = x(my_gen); + position_map[*vi].y = y(my_gen); + } +} + +} // end namespace boost + +#endif // BOOST_GRAPH_RANDOM_LAYOUT_HPP