#include <boost/graph/property_maps/container_property_map.hpp>
#include <boost/graph/property_maps/matrix_property_map.hpp>
-namespace boost {
-namespace detail {
+namespace boost
+{
+namespace detail
+{
// The vector matrix provides a little abstraction over vector
// types that makes matrices easier to work with.
- template <typename Value>
- struct vector_matrix
+ template < typename Value > struct vector_matrix
{
- typedef std::vector<Value> container_type;
- typedef std::vector<container_type> matrix_type;
+ typedef std::vector< Value > container_type;
+ typedef std::vector< container_type > matrix_type;
typedef container_type value_type;
typedef container_type& reference;
// Instantiate the matrix over n elements (creates an n by n matrix).
// The graph has to be passed in order to ensure the index maps
// are constructed correctly when returning indexible elements.
- inline vector_matrix(size_type n)
- : m_matrix(n, container_type(n))
- { }
+ inline vector_matrix(size_type n) : m_matrix(n, container_type(n)) {}
- inline reference operator [](size_type n)
- { return m_matrix[n]; }
+ inline reference operator[](size_type n) { return m_matrix[n]; }
- inline const_reference operator [](size_type n) const
- { return m_matrix[n]; }
+ inline const_reference operator[](size_type n) const
+ {
+ return m_matrix[n];
+ }
matrix_type m_matrix;
};
* solution should not be especially difficult, but will require an extension
* of type traits to affect the type selection.
*/
-template <typename Graph, typename Key, typename Value>
+template < typename Graph, typename Key, typename Value >
struct exterior_property
{
typedef Key key_type;
typedef Value value_type;
- typedef std::vector<Value> container_type;
- typedef container_property_map<Graph, Key, container_type> map_type;
+ typedef std::vector< Value > container_type;
+ typedef container_property_map< Graph, Key, container_type > map_type;
- typedef detail::vector_matrix<Value> matrix_type;
- typedef matrix_property_map<Graph, Key, matrix_type> matrix_map_type;
+ typedef detail::vector_matrix< Value > matrix_type;
+ typedef matrix_property_map< Graph, Key, matrix_type > matrix_map_type;
private:
- exterior_property() { }
- exterior_property(const exterior_property&) { }
+ exterior_property() {}
+ exterior_property(const exterior_property&) {}
};
/**
* vertex property for the given value type. The Graph parameter is required to
* model the VertexIndexGraph concept.
*/
-template <typename Graph, typename Value>
-struct exterior_vertex_property
+template < typename Graph, typename Value > struct exterior_vertex_property
{
- typedef exterior_property<
- Graph, typename graph_traits<Graph>::vertex_descriptor, Value
- > property_type;
+ typedef exterior_property< Graph,
+ typename graph_traits< Graph >::vertex_descriptor, Value >
+ property_type;
typedef typename property_type::key_type key_type;
typedef typename property_type::value_type value_type;
typedef typename property_type::container_type container_type;
* edge property for the given value type. The Graph parameter is required to
* model the EdgeIndexGraph concept.
*/
-template <typename Graph, typename Value>
-struct exterior_edge_property
+template < typename Graph, typename Value > struct exterior_edge_property
{
- typedef exterior_property<
- Graph, typename graph_traits<Graph>::edge_descriptor, Value
- > property_type;
+ typedef exterior_property< Graph,
+ typename graph_traits< Graph >::edge_descriptor, Value >
+ property_type;
typedef typename property_type::key_type key_type;
typedef typename property_type::value_type value_type;
typedef typename property_type::container_type container_type;