Boost logo

Boost-Commit :

From: asutton_at_[hidden]
Date: 2008-07-05 08:00:05


Author: asutton
Date: 2008-07-05 08:00:03 EDT (Sat, 05 Jul 2008)
New Revision: 47100
URL: http://svn.boost.org/trac/boost/changeset/47100

Log:
Various changes that I've probably forgotten about.

Text files modified:
   sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/edge_vector.hpp | 2 ++
   sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/placeholder.hpp | 5 +++++
   sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/undirected_graph.hpp | 25 ++++++++++++++++++++-----
   sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/vertex_vector.hpp | 8 ++++++++
   sandbox/SOC/2008/graphs/branches/placeholder/libs/graphs/Jamfile | 2 ++
   sandbox/SOC/2008/graphs/trunk/boost/graphs/descriptor.hpp | 2 +-
   sandbox/SOC/2008/graphs/trunk/boost/graphs/descriptor/common.hpp | 12 ++++++------
   sandbox/SOC/2008/graphs/trunk/libs/graphs/un.cpp | 4 +---
   8 files changed, 45 insertions(+), 15 deletions(-)

Modified: sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/edge_vector.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/edge_vector.hpp (original)
+++ sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/edge_vector.hpp 2008-07-05 08:00:03 EDT (Sat, 05 Jul 2008)
@@ -59,6 +59,8 @@
     template <typename VertexDesc, typename PropDesc>
     struct incidence_store
     {
+ // Generate a dummy incidence vector that we can use to compose a
+ // placeholder for the vertex type. Note that the property descriptor
         typedef std::pair<VertexDesc, PropDesc> incidence_pair;
         typedef FirstAlloc<incidence_pair> incidence_allocator;
         typedef incidence_vector<incidence_pair, incidence_allocator> type;

Modified: sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/placeholder.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/placeholder.hpp (original)
+++ sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/placeholder.hpp 2008-07-05 08:00:03 EDT (Sat, 05 Jul 2008)
@@ -51,4 +51,9 @@
     mutable char mem[N];
 };
 
+/** A useful metafunction for generating placeholder types. */
+template <typename T>
+struct typeholder
+{ typedef placeholder<sizeof(T)> type; }
+
 #endif

Modified: sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/undirected_graph.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/undirected_graph.hpp (original)
+++ sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/undirected_graph.hpp 2008-07-05 08:00:03 EDT (Sat, 05 Jul 2008)
@@ -19,11 +19,25 @@
 
 #include "adjacency_iterator.hpp"
 
-template <
- typename VertexProps,
- typename EdgeProps,
- typename VertexStore,
- typename EdgeStore>
+template <typename VertexProps, typename EdgeProps, typename VertexStore, typename EdgeStore>
+struct undirected_types
+{
+ // Generate a dummy vertex descriptor.
+ typedef typename VertexStore::dummy_descriptor dummy_vertex_descriptor;
+
+ // Always start with the property store because its basically independant
+ // of the other parts of the graph (except for its descriptor slots).
+ typedef typename EdgeStore::template property_store<EdgeProps>::type property_store;
+ typedef typename property_store::property_descriptor property_descriptor;
+ typedef typename property_store::size_type edges_size_type;
+
+ // Use the dummy vertex and property descriptors to generate the incidence
+ // list for the vertex.
+ typedef typename EdgeStore::template incidence_store<dummy_vertex_descriptor, property_descriptor>::type incidence_store;
+
+};
+
+template <typename VertexProps, typename EdgeProps, typename VertexStore, typename EdgeStore>
 class undirected_graph
 {
     typedef undirected_graph<VertexProps, EdgeProps, VertexStore, EdgeStore> this_type;
@@ -33,6 +47,7 @@
     typedef VertexStore vertex_store_selector;
     typedef EdgeStore edge_store_selector;
 
+
     // Generate the property store type first. We can do this first because
     // it's basically independant of everything else, but contributes to almost
     // everything in the class by virtue of the property descriptor. Use this

Modified: sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/vertex_vector.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/vertex_vector.hpp (original)
+++ sandbox/SOC/2008/graphs/branches/placeholder/boost/graphs/vertex_vector.hpp 2008-07-05 08:00:03 EDT (Sat, 05 Jul 2008)
@@ -5,6 +5,8 @@
 #include <vector>
 #include <algorithm>
 
+#include "placeholder.hpp"
+#include "descriptor.hpp"
 #include "vertex_descriptor.hpp"
 #include "vertex_iterator.hpp"
 
@@ -27,6 +29,12 @@
     typedef unused key_type;
     typedef basic_vertex_descriptor<std::size_t> descriptor_type;
 
+ // Generate some dummy information that we can use to generate fake
+ // decriptors and other types. These types will be the same size as the
+ // real descriptor and store tyes later.
+ typedef std::vector<int, Alloc<int> > dummy_vector;
+ typedef descriptor<dummy_vector> dummy_descriptor;
+
     // The store metafunction generates the type used to store vertices in
     // either a directed or undirected graph. This metafunction takes the
     // fully configured vertex type as a type parameter.

Modified: sandbox/SOC/2008/graphs/branches/placeholder/libs/graphs/Jamfile
==============================================================================
--- sandbox/SOC/2008/graphs/branches/placeholder/libs/graphs/Jamfile (original)
+++ sandbox/SOC/2008/graphs/branches/placeholder/libs/graphs/Jamfile 2008-07-05 08:00:03 EDT (Sat, 05 Jul 2008)
@@ -7,3 +7,5 @@
 exe props : props.cpp : <include>../../ <include>/usr/local/include ;
 exe edge : edge.cpp : <include>../../ <include>/usr/local/include ;
 exe desc : desc.cpp : <include>../../ <include>/usr/local/include ;
+
+exe place : place.cpp : <include>../../ <include>/usr/local/include ;

Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/descriptor.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/descriptor.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/descriptor.hpp 2008-07-05 08:00:03 EDT (Sat, 05 Jul 2008)
@@ -50,7 +50,7 @@
     descriptor()
         : descriptor_impl<Container>()
     { }
-
+
     /** Create a descriptor over the given iterator. */
     descriptor(Container& c, typename Container::iterator i)
         : descriptor_impl<Container>(c, i)

Modified: sandbox/SOC/2008/graphs/trunk/boost/graphs/descriptor/common.hpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/boost/graphs/descriptor/common.hpp (original)
+++ sandbox/SOC/2008/graphs/trunk/boost/graphs/descriptor/common.hpp 2008-07-05 08:00:03 EDT (Sat, 05 Jul 2008)
@@ -32,14 +32,14 @@
     
     inline index_type index() const
     { return &*iter; }
-
+
     inline value_type& value()
     { return *iter; }
-
+
     void reset()
     {
- cont = 0;
- iter = iterator();
+ cont = 0;
+ iter = iterator();
     }
     
     inline bool operator==(descriptor_impl const& x) const
@@ -56,10 +56,10 @@
     
     inline bool operator<=(descriptor_impl const& x) const
     { return !x.operator<(*this); }
-
+
     inline bool operator>=(descriptor_impl const& x) const
     { return !operator<(x); }
-
+
     container_type* cont;
     iterator iter;
 };

Modified: sandbox/SOC/2008/graphs/trunk/libs/graphs/un.cpp
==============================================================================
--- sandbox/SOC/2008/graphs/trunk/libs/graphs/un.cpp (original)
+++ sandbox/SOC/2008/graphs/trunk/libs/graphs/un.cpp 2008-07-05 08:00:03 EDT (Sat, 05 Jul 2008)
@@ -186,13 +186,11 @@
     g.add_edge(v, u, 2);
     g.add_edge(u, v, 3);
     g.add_edge(v, u, 4);
- cout << "done building" << endl;
 
     typename Graph::incident_edge_range x = g.incident_edges(v);
-
     typename Graph::incident_edge_iterator i = x.first;
     for(typename Graph::incident_edge_iterator i = x.first; i != x.second; ++i) {
- cout << *i << endl;
+ // cout << *i << endl;
     }
 }
 


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