|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r52139 - in trunk/boost/graph: . detail
From: jewillco_at_[hidden]
Date: 2009-04-02 14:49:31
Author: jewillco
Date: 2009-04-02 14:49:28 EDT (Thu, 02 Apr 2009)
New Revision: 52139
URL: http://svn.boost.org/trac/boost/changeset/52139
Log:
Removed tabs
Text files modified:
trunk/boost/graph/betweenness_centrality.hpp | 12 +-
trunk/boost/graph/detail/d_ary_heap.hpp | 2
trunk/boost/graph/dimacs.hpp | 16 ++--
trunk/boost/graph/graph_stats.hpp | 4
trunk/boost/graph/graph_utility.hpp | 2
trunk/boost/graph/mesh_graph_generator.hpp | 128 ++++++++++++++++++++--------------------
trunk/boost/graph/ssca_graph_generator.hpp | 126 +++++++++++++++++++-------------------
trunk/boost/graph/vertex_and_edge_range.hpp | 40 ++++++------
8 files changed, 165 insertions(+), 165 deletions(-)
Modified: trunk/boost/graph/betweenness_centrality.hpp
==============================================================================
--- trunk/boost/graph/betweenness_centrality.hpp (original)
+++ trunk/boost/graph/betweenness_centrality.hpp 2009-04-02 14:49:28 EDT (Thu, 02 Apr 2009)
@@ -371,7 +371,7 @@
DependencyMap dependency, // delta
PathCountMap path_count, // sigma
VertexIndexMap vertex_index
- BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph,vertex_list_graph_tag))
+ BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph,vertex_list_graph_tag))
{
detail::graph::brandes_unweighted_shortest_paths shortest_paths;
@@ -397,7 +397,7 @@
PathCountMap path_count, // sigma
VertexIndexMap vertex_index,
WeightMap weight_map
- BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph,vertex_list_graph_tag))
+ BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph,vertex_list_graph_tag))
{
detail::graph::brandes_dijkstra_shortest_paths<WeightMap>
shortest_paths(weight_map);
@@ -518,7 +518,7 @@
void
brandes_betweenness_centrality(const Graph& g,
const bgl_named_params<Param,Tag,Rest>& params
- BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph,vertex_list_graph_tag))
+ BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph,vertex_list_graph_tag))
{
typedef bgl_named_params<Param,Tag,Rest> named_params;
@@ -536,7 +536,7 @@
template<typename Graph, typename CentralityMap>
void
brandes_betweenness_centrality(const Graph& g, CentralityMap centrality
- BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph,vertex_list_graph_tag))
+ BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph,vertex_list_graph_tag))
{
detail::graph::brandes_betweenness_centrality_dispatch2(
g, centrality, dummy_property_map(), get(vertex_index, g));
@@ -546,7 +546,7 @@
void
brandes_betweenness_centrality(const Graph& g, CentralityMap centrality,
EdgeCentralityMap edge_centrality_map
- BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph,vertex_list_graph_tag))
+ BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph,vertex_list_graph_tag))
{
detail::graph::brandes_betweenness_centrality_dispatch2(
g, centrality, edge_centrality_map, get(vertex_index, g));
@@ -577,7 +577,7 @@
template<typename Graph, typename CentralityMap>
typename property_traits<CentralityMap>::value_type
central_point_dominance(const Graph& g, CentralityMap centrality
- BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph,vertex_list_graph_tag))
+ BOOST_GRAPH_ENABLE_IF_MODELS_PARM(Graph,vertex_list_graph_tag))
{
using std::max;
Modified: trunk/boost/graph/detail/d_ary_heap.hpp
==============================================================================
--- trunk/boost/graph/detail/d_ary_heap.hpp (original)
+++ trunk/boost/graph/detail/d_ary_heap.hpp 2009-04-02 14:49:28 EDT (Thu, 02 Apr 2009)
@@ -81,7 +81,7 @@
// the operations used probably require that it is std::vector<Value>).
//
template <typename Value,
- std::size_t Arity,
+ std::size_t Arity,
typename IndexInHeapPropertyMap,
typename DistanceMap,
typename Compare = std::less<Value>,
Modified: trunk/boost/graph/dimacs.hpp
==============================================================================
--- trunk/boost/graph/dimacs.hpp (original)
+++ trunk/boost/graph/dimacs.hpp 2009-04-02 14:49:28 EDT (Thu, 02 Apr 2009)
@@ -29,7 +29,7 @@
typedef double vertex_weight_type;
typedef double edge_weight_type;
typedef std::pair<vertices_size_type,
- vertices_size_type> edge_type;
+ vertices_size_type> edge_type;
enum incr_mode {edge, edge_weight};
dimacs_basic_reader( std::istream& in, bool want_weights = true ) :
@@ -51,7 +51,7 @@
//for a past the end iterator
dimacs_basic_reader() : inpt( std::cin ), num_vertices( 0 ),
- num_edges( 0 ), seen_edges( 0 ), want_weights(false) {}
+ num_edges( 0 ), seen_edges( 0 ), want_weights(false) {}
edge_type edge_deref() {
assert( !read_edges.empty() );
@@ -79,7 +79,7 @@
}
if( (mode == edge && read_edges.empty()) ||
- (mode == edge_weight && read_edge_weights.empty() )) {
+ (mode == edge_weight && read_edge_weights.empty() )) {
if( seen_edges > num_edges ) {
boost::throw_exception(dimacs_exception());
@@ -94,7 +94,7 @@
seen_edges++;
source--;
dest--;
-
+
read_edges.push( edge_type( source, dest ) );
if (want_weights) {
read_edge_weights.push( weight );
@@ -202,10 +202,10 @@
typedef dimacs_basic_reader::incr_mode incr_mode;
typedef std::input_iterator_tag iterator_category;
- typedef edge_type value_type;
- typedef value_type reference;
- typedef edge_type* pointer;
- typedef std::ptrdiff_t difference_type;
+ typedef edge_type value_type;
+ typedef value_type reference;
+ typedef edge_type* pointer;
+ typedef std::ptrdiff_t difference_type;
dimacs_edge_iterator( T& reader ) :
reader( reader ) {}
Modified: trunk/boost/graph/graph_stats.hpp
==============================================================================
--- trunk/boost/graph/graph_stats.hpp (original)
+++ trunk/boost/graph/graph_stats.hpp 2009-04-02 14:49:28 EDT (Thu, 02 Apr 2009)
@@ -78,7 +78,7 @@
std::list<vertex_type> front_neighbors;
a_iterator_type a_iter, a_end;
for( tie( a_iter, a_end ) = adjacent_vertices( v, g );
- a_iter != a_end; ++a_iter ) {
+ a_iter != a_end; ++a_iter ) {
front_neighbors.push_back( *a_iter );
}
@@ -116,7 +116,7 @@
BGL_FORALL_VERTICES_T( v, g, Graph ) {
edge_weight_type tmp = 0;
BGL_FORALL_OUTEDGES_T( v, e, g, Graph ) {
- tmp += em[e];
+ tmp += em[e];
}
n[out_degree( v, g )] += 1.;
dist[out_degree( v, g )] += tmp;
Modified: trunk/boost/graph/graph_utility.hpp
==============================================================================
--- trunk/boost/graph/graph_utility.hpp (original)
+++ trunk/boost/graph/graph_utility.hpp 2009-04-02 14:49:28 EDT (Thu, 02 Apr 2009)
@@ -431,7 +431,7 @@
template <typename Edge>
void operator() (Edge stay, Edge away)
{
- put(ep, stay, get(ep, stay) + get(ep, away));
+ put(ep, stay, get(ep, stay) + get(ep, away));
}
EdgeProperty ep;
};
Modified: trunk/boost/graph/mesh_graph_generator.hpp
==============================================================================
--- trunk/boost/graph/mesh_graph_generator.hpp (original)
+++ trunk/boost/graph/mesh_graph_generator.hpp 2009-04-02 14:49:28 EDT (Thu, 02 Apr 2009)
@@ -44,9 +44,9 @@
// Vertices are numbered in row-major order
// Assumes directed
mesh_iterator(vertices_size_type x, vertices_size_type y,
- bool toroidal = true)
+ bool toroidal = true)
: x(x), y(y), n(x*y), source(0), target(1), current(0,1),
- toroidal(toroidal), done(false)
+ toroidal(toroidal), done(false)
{ assert(x > 1 && y > 1); }
reference operator*() const { return current; }
@@ -55,69 +55,69 @@
mesh_iterator& operator++()
{
if (is_undirected) {
- if (!toroidal) {
- if (target == source + 1)
- if (source < x * (y - 1))
- target = source + x;
- else {
- source++;
- target = (source % x) < x - 1 ? source + 1 : source + x;
- if (target > n)
- done = true;
- }
- else if (target == source + x) {
- source++;
- target = (source % x) < x - 1 ? source + 1 : source + x;
- }
- } else {
- if (target == source + 1 || target == source - (source % x))
- target = (source + x) % n;
- else if (target == (source + x) % n) {
- if (source == n - 1)
- done = true;
- else {
- source++;
- target = (source % x) < (x - 1) ? source + 1 : source - (source % x);
- }
- }
- }
+ if (!toroidal) {
+ if (target == source + 1)
+ if (source < x * (y - 1))
+ target = source + x;
+ else {
+ source++;
+ target = (source % x) < x - 1 ? source + 1 : source + x;
+ if (target > n)
+ done = true;
+ }
+ else if (target == source + x) {
+ source++;
+ target = (source % x) < x - 1 ? source + 1 : source + x;
+ }
+ } else {
+ if (target == source + 1 || target == source - (source % x))
+ target = (source + x) % n;
+ else if (target == (source + x) % n) {
+ if (source == n - 1)
+ done = true;
+ else {
+ source++;
+ target = (source % x) < (x - 1) ? source + 1 : source - (source % x);
+ }
+ }
+ }
} else { // Directed
- if ( !toroidal ) {
- if (target == source - x)
- target = source % x > 0 ? source - 1 : source + 1;
- else if (target == source - 1)
- if ((source % x) < (x - 1))
- target = source + 1;
- else if (source < x * (y - 1))
- target = source + x;
- else {
- done = true;
- }
- else if (target == source + 1)
- if (source < x * (y - 1))
- target = source + x;
- else {
- source++;
- target = source - x;
- }
- else if (target == source + x) {
- source++;
- target = (source >= x) ? source - x : source - 1;
- }
- } else {
- if (source == n - 1 && target == (source + x) % n)
- done = true;
- else if (target == source - 1 || target == source + x - 1)
- target = (source + x) % n;
- else if (target == source + 1 || target == source - (source % x))
- target = (source - x + n) % n;
- else if (target == (source - x + n) % n)
- target = (source % x > 0) ? source - 1 : source + x - 1;
- else if (target == (source + x) % n) {
- source++;
- target = (source % x) < (x - 1) ? source + 1 : source - (source % x);
- }
- }
+ if ( !toroidal ) {
+ if (target == source - x)
+ target = source % x > 0 ? source - 1 : source + 1;
+ else if (target == source - 1)
+ if ((source % x) < (x - 1))
+ target = source + 1;
+ else if (source < x * (y - 1))
+ target = source + x;
+ else {
+ done = true;
+ }
+ else if (target == source + 1)
+ if (source < x * (y - 1))
+ target = source + x;
+ else {
+ source++;
+ target = source - x;
+ }
+ else if (target == source + x) {
+ source++;
+ target = (source >= x) ? source - x : source - 1;
+ }
+ } else {
+ if (source == n - 1 && target == (source + x) % n)
+ done = true;
+ else if (target == source - 1 || target == source + x - 1)
+ target = (source + x) % n;
+ else if (target == source + 1 || target == source - (source % x))
+ target = (source - x + n) % n;
+ else if (target == (source - x + n) % n)
+ target = (source % x > 0) ? source - 1 : source + x - 1;
+ else if (target == (source + x) % n) {
+ source++;
+ target = (source % x) < (x - 1) ? source + 1 : source - (source % x);
+ }
+ }
}
current.first = source;
Modified: trunk/boost/graph/ssca_graph_generator.hpp
==============================================================================
--- trunk/boost/graph/ssca_graph_generator.hpp (original)
+++ trunk/boost/graph/ssca_graph_generator.hpp 2009-04-02 14:49:28 EDT (Thu, 02 Apr 2009)
@@ -42,12 +42,12 @@
// Initialize for edge generation
ssca_iterator(RandomGenerator& gen, vertices_size_type totVertices,
- vertices_size_type maxCliqueSize, double probUnidirectional,
- int maxParallelEdges, double probIntercliqueEdges)
+ vertices_size_type maxCliqueSize, double probUnidirectional,
+ int maxParallelEdges, double probIntercliqueEdges)
: gen(&gen), totVertices(totVertices), maxCliqueSize(maxCliqueSize),
- probUnidirectional(probUnidirectional), maxParallelEdges(maxParallelEdges),
- probIntercliqueEdges(probIntercliqueEdges), currentClique(0),
- verticesRemaining(totVertices)
+ probUnidirectional(probUnidirectional), maxParallelEdges(maxParallelEdges),
+ probIntercliqueEdges(probIntercliqueEdges), currentClique(0),
+ verticesRemaining(totVertices)
{
cliqueNum = std::vector<int>(totVertices, -1);
current = std::make_pair(0,0);
@@ -59,68 +59,68 @@
ssca_iterator& operator++()
{
while (values.empty() && verticesRemaining > 0) { // If there are no values left, generate a new clique
- uniform_int<vertices_size_type> clique_size(1, maxCliqueSize);
- uniform_int<vertices_size_type> rand_vertex(0, totVertices-1);
- uniform_int<int> num_parallel_edges(1, maxParallelEdges);
- uniform_int<short> direction(0,1);
- uniform_01<RandomGenerator> prob(*gen);
- std::vector<vertices_size_type> cliqueVertices;
-
- cliqueVertices.clear();
- vertices_size_type size = std::min(clique_size(*gen), verticesRemaining);
- while (cliqueVertices.size() < size) {
- vertices_size_type v = rand_vertex(*gen);
- if (cliqueNum[v] == -1) {
- cliqueNum[v] = currentClique;
- cliqueVertices.push_back(v);
- verticesRemaining--;
- }
- } // Nick: This is inefficient when only a few vertices remain...
- // I should probably just select the remaining vertices
- // in order when only a certain fraction remain.
-
- typename std::vector<vertices_size_type>::iterator first, second;
- for (first = cliqueVertices.begin(); first != cliqueVertices.end(); ++first)
- for (second = first+1; second != cliqueVertices.end(); ++second) {
- Direction d;
- int edges;
-
- d = prob() < probUnidirectional ? (direction(*gen) == 0 ? FORWARD : BACKWARD) : BOTH;
-
- if (d & FORWARD) {
- edges = num_parallel_edges(*gen);
- for (int i = 0; i < edges; ++i)
- values.push(std::make_pair(*first, *second));
- }
-
- if (d & BACKWARD) {
- edges = num_parallel_edges(*gen);
- for (int i = 0; i < edges; ++i)
- values.push(std::make_pair(*second, *first));
- }
- }
-
- if (verticesRemaining == 0) {
- // Generate interclique edges
- for (vertices_size_type i = 0; i < totVertices; ++i) {
- double p = probIntercliqueEdges;
- for (vertices_size_type d = 2; d < totVertices/2; d *= 2, p/= 2) {
- vertices_size_type j = (i+d) % totVertices;
- if (cliqueNum[j] != cliqueNum[i] && prob() < p) {
- int edges = num_parallel_edges(*gen);
- for (int i = 0; i < edges; ++i)
- values.push(std::make_pair(i, j));
- }
- }
- }
- }
+ uniform_int<vertices_size_type> clique_size(1, maxCliqueSize);
+ uniform_int<vertices_size_type> rand_vertex(0, totVertices-1);
+ uniform_int<int> num_parallel_edges(1, maxParallelEdges);
+ uniform_int<short> direction(0,1);
+ uniform_01<RandomGenerator> prob(*gen);
+ std::vector<vertices_size_type> cliqueVertices;
+
+ cliqueVertices.clear();
+ vertices_size_type size = std::min(clique_size(*gen), verticesRemaining);
+ while (cliqueVertices.size() < size) {
+ vertices_size_type v = rand_vertex(*gen);
+ if (cliqueNum[v] == -1) {
+ cliqueNum[v] = currentClique;
+ cliqueVertices.push_back(v);
+ verticesRemaining--;
+ }
+ } // Nick: This is inefficient when only a few vertices remain...
+ // I should probably just select the remaining vertices
+ // in order when only a certain fraction remain.
+
+ typename std::vector<vertices_size_type>::iterator first, second;
+ for (first = cliqueVertices.begin(); first != cliqueVertices.end(); ++first)
+ for (second = first+1; second != cliqueVertices.end(); ++second) {
+ Direction d;
+ int edges;
+
+ d = prob() < probUnidirectional ? (direction(*gen) == 0 ? FORWARD : BACKWARD) : BOTH;
+
+ if (d & FORWARD) {
+ edges = num_parallel_edges(*gen);
+ for (int i = 0; i < edges; ++i)
+ values.push(std::make_pair(*first, *second));
+ }
+
+ if (d & BACKWARD) {
+ edges = num_parallel_edges(*gen);
+ for (int i = 0; i < edges; ++i)
+ values.push(std::make_pair(*second, *first));
+ }
+ }
+
+ if (verticesRemaining == 0) {
+ // Generate interclique edges
+ for (vertices_size_type i = 0; i < totVertices; ++i) {
+ double p = probIntercliqueEdges;
+ for (vertices_size_type d = 2; d < totVertices/2; d *= 2, p/= 2) {
+ vertices_size_type j = (i+d) % totVertices;
+ if (cliqueNum[j] != cliqueNum[i] && prob() < p) {
+ int edges = num_parallel_edges(*gen);
+ for (int i = 0; i < edges; ++i)
+ values.push(std::make_pair(i, j));
+ }
+ }
+ }
+ }
- currentClique++;
+ currentClique++;
}
if (!values.empty()) { // If we're not done return a value
- current = values.front();
- values.pop();
+ current = values.front();
+ values.pop();
}
return *this;
Modified: trunk/boost/graph/vertex_and_edge_range.hpp
==============================================================================
--- trunk/boost/graph/vertex_and_edge_range.hpp (original)
+++ trunk/boost/graph/vertex_and_edge_range.hpp 2009-04-02 14:49:28 EDT (Thu, 02 Apr 2009)
@@ -49,22 +49,22 @@
{ return traits_type::null_vertex(); }
vertex_and_edge_range(const Graph& g,
- VertexIterator first_v, VertexIterator last_v,
- vertices_size_type n,
- EdgeIterator first_e, EdgeIterator last_e,
- edges_size_type m)
+ VertexIterator first_v, VertexIterator last_v,
+ vertices_size_type n,
+ EdgeIterator first_e, EdgeIterator last_e,
+ edges_size_type m)
: g(&g),
- first_vertex(first_v), last_vertex(last_v), m_num_vertices(n),
- first_edge(first_e), last_edge(last_e), m_num_edges(m)
+ first_vertex(first_v), last_vertex(last_v), m_num_vertices(n),
+ first_edge(first_e), last_edge(last_e), m_num_edges(m)
{
}
vertex_and_edge_range(const Graph& g,
- VertexIterator first_v, VertexIterator last_v,
- EdgeIterator first_e, EdgeIterator last_e)
+ VertexIterator first_v, VertexIterator last_v,
+ EdgeIterator first_e, EdgeIterator last_e)
: g(&g),
- first_vertex(first_v), last_vertex(last_v),
- first_edge(first_e), last_edge(last_e)
+ first_vertex(first_v), last_vertex(last_v),
+ first_edge(first_e), last_edge(last_e)
{
m_num_vertices = std::distance(first_v, last_v);
m_num_edges = std::distance(first_e, last_e);
@@ -88,7 +88,7 @@
inline typename vertex_and_edge_range<Graph, VertexIterator, EdgeIterator>
::vertices_size_type
num_vertices(const vertex_and_edge_range<Graph, VertexIterator,
- EdgeIterator>& g)
+ EdgeIterator>& g)
{ return g.m_num_vertices; }
template<typename Graph, typename VertexIterator, typename EdgeIterator>
@@ -100,32 +100,32 @@
inline typename vertex_and_edge_range<Graph, VertexIterator, EdgeIterator>
::edges_size_type
num_edges(const vertex_and_edge_range<Graph, VertexIterator,
- EdgeIterator>& g)
+ EdgeIterator>& g)
{ return g.m_num_edges; }
template<typename Graph, typename VertexIterator, typename EdgeIterator>
inline typename vertex_and_edge_range<Graph, VertexIterator, EdgeIterator>
::vertex_descriptor
source(typename vertex_and_edge_range<Graph, VertexIterator, EdgeIterator>
- ::edge_descriptor e,
- const vertex_and_edge_range<Graph, VertexIterator,
- EdgeIterator>& g)
+ ::edge_descriptor e,
+ const vertex_and_edge_range<Graph, VertexIterator,
+ EdgeIterator>& g)
{ return source(e, *g.g); }
template<typename Graph, typename VertexIterator, typename EdgeIterator>
inline typename vertex_and_edge_range<Graph, VertexIterator, EdgeIterator>
::vertex_descriptor
target(typename vertex_and_edge_range<Graph, VertexIterator, EdgeIterator>
- ::edge_descriptor e,
- const vertex_and_edge_range<Graph, VertexIterator,
- EdgeIterator>& g)
+ ::edge_descriptor e,
+ const vertex_and_edge_range<Graph, VertexIterator,
+ EdgeIterator>& g)
{ return target(e, *g.g); }
template<typename Graph, typename VertexIterator, typename EdgeIterator>
inline vertex_and_edge_range<Graph, VertexIterator, EdgeIterator>
make_vertex_and_edge_range(const Graph& g,
- VertexIterator first_v, VertexIterator last_v,
- EdgeIterator first_e, EdgeIterator last_e)
+ VertexIterator first_v, VertexIterator last_v,
+ EdgeIterator first_e, EdgeIterator last_e)
{
typedef vertex_and_edge_range<Graph, VertexIterator, EdgeIterator>
result_type;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk