STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Types
stapl::csr_graph< D, M, VertexPx, EdgePx, PSx, Mapx, Traitsx > Class Template Reference

Implementation for a Compressed Sparse-Row (CSR) graph.CSR graphs do not allow addition and deletion of vertices or edges once the graph has been "committed". All edges must be added before calling the commit() method, which finalizes the graph. Inherits all methods from stapl::graph and adds method to commit. More...

Public Member Functions

Constructors
 csr_graph (size_t const &n, VertexP const &default_value=VertexP())
 Creates a graph with a given size and constructs all elements with a default value for vertex property. More...
 
 csr_graph (partition_type const &ps, VertexP const &default_value=VertexP())
 Creates a graph with a given partition and default value for vertex property. More...
 
template<typename DP >
 csr_graph (size_t n, vertex_property const &default_value, DP const &dis_policy)
 Creates a graph with a given size and default value where the vertex_property may itself be a parallel container. Required for pC composition. More...
 
template<typename X , typename Y >
 csr_graph (boost::tuples::cons< X, Y > dims)
 Creates composed pContainers with a given size-specifications. Required for pC composition. More...
 
template<typename X , typename Y , typename DP >
 csr_graph (boost::tuples::cons< X, Y > dims, DP const &dis_policy)
 Creates composed pContainers with a given size-specifications. Required for pC composition. More...
 
Memory and Domain Management
void commit ()
 Commit the CSR graph. More...
 
void uncommit ()
 Uncommit the CSR graph. More...
 
boost::shared_ptr< this_typeshared_from_this ()
 

Public Types

typedef base_type::partition_type partition_type
 
typedef base_type::mapper_type mapper_type
 
typedef base_type::distribution_type distribution_type
 
typedef base_type::vertex_descriptor vertex_descriptor
 
typedef partition_type::domain_type descriptor_domain_type
 
typedef Map::domain_type map_dom_t
 
typedef base_type::vertex_property vertex_property
 

Detailed Description

template<graph_attributes D, graph_attributes M, typename VertexPx = use_default, typename EdgePx = use_default, typename PSx = use_default, typename Mapx = use_default, typename Traitsx = use_default>
class stapl::csr_graph< D, M, VertexPx, EdgePx, PSx, Mapx, Traitsx >

Implementation for a Compressed Sparse-Row (CSR) graph.

CSR graphs do not allow addition and deletion of vertices or edges once the graph has been "committed". All edges must be added before calling the commit() method, which finalizes the graph. Inherits all methods from stapl::graph and adds method to commit.

Template Parameters
Dgraph-attribute specifying Directedness (DIRECTED/UNDIRECTED).
Mgraph-attribute specifying Multiedge. (MULTIEDGES/NONMULTIEDGES).
VertexPxtype of property for the vertex. Default is no_property. Must be default assignable, copyable and assignable.
EdgePxtype of property for the edge. Default is no_property. Must be default assignable, copyable and assignable.
PSxPartition strategy that defines how to partition the original domain into subdomains. The default partition is balanced_partition.
MapxMapper that defines how to map the subdomains produced by the partition to locations. The default mapper is mapper.
TraitsA traits class that defines customizable components of graph, such as the domain type, base container type, storage, etc. The default traits class is csr_graph_traits.

Constructor & Destructor Documentation

◆ csr_graph() [1/5]

template<graph_attributes D, graph_attributes M, typename VertexPx = use_default, typename EdgePx = use_default, typename PSx = use_default, typename Mapx = use_default, typename Traitsx = use_default>
stapl::csr_graph< D, M, VertexPx, EdgePx, PSx, Mapx, Traitsx >::csr_graph ( size_t const &  n,
VertexP const &  default_value = VertexP() 
)

Creates a graph with a given size and constructs all elements with a default value for vertex property.

◆ csr_graph() [2/5]

template<graph_attributes D, graph_attributes M, typename VertexPx = use_default, typename EdgePx = use_default, typename PSx = use_default, typename Mapx = use_default, typename Traitsx = use_default>
stapl::csr_graph< D, M, VertexPx, EdgePx, PSx, Mapx, Traitsx >::csr_graph ( partition_type const &  ps,
VertexP const &  default_value = VertexP() 
)

Creates a graph with a given partition and default value for vertex property.

◆ csr_graph() [3/5]

template<graph_attributes D, graph_attributes M, typename VertexPx = use_default, typename EdgePx = use_default, typename PSx = use_default, typename Mapx = use_default, typename Traitsx = use_default>
template<typename DP >
stapl::csr_graph< D, M, VertexPx, EdgePx, PSx, Mapx, Traitsx >::csr_graph ( size_t  n,
vertex_property const &  default_value,
DP const &  dis_policy 
)

Creates a graph with a given size and default value where the vertex_property may itself be a parallel container. Required for pC composition.

Parameters
nThe number of vertices
default_valueThe initial value of the vertices' properties.
dis_policyA distribution policy that specifies how to distribute the nested containers, in the context of containers of containers.

◆ csr_graph() [4/5]

template<graph_attributes D, graph_attributes M, typename VertexPx = use_default, typename EdgePx = use_default, typename PSx = use_default, typename Mapx = use_default, typename Traitsx = use_default>
template<typename X , typename Y >
stapl::csr_graph< D, M, VertexPx, EdgePx, PSx, Mapx, Traitsx >::csr_graph ( boost::tuples::cons< X, Y >  dims)

Creates composed pContainers with a given size-specifications. Required for pC composition.

Parameters
dimsdimensions of the internal containers.

◆ csr_graph() [5/5]

template<graph_attributes D, graph_attributes M, typename VertexPx = use_default, typename EdgePx = use_default, typename PSx = use_default, typename Mapx = use_default, typename Traitsx = use_default>
template<typename X , typename Y , typename DP >
stapl::csr_graph< D, M, VertexPx, EdgePx, PSx, Mapx, Traitsx >::csr_graph ( boost::tuples::cons< X, Y >  dims,
DP const &  dis_policy 
)

Creates composed pContainers with a given size-specifications. Required for pC composition.

Parameters
dimsdimensions of the internal containers.
dis_policyA distribution policy that specifies how to distribute the nested containers, in the context of containers of containers.

Member Function Documentation

◆ commit()

template<graph_attributes D, graph_attributes M, typename VertexPx = use_default, typename EdgePx = use_default, typename PSx = use_default, typename Mapx = use_default, typename Traitsx = use_default>
void stapl::csr_graph< D, M, VertexPx, EdgePx, PSx, Mapx, Traitsx >::commit ( void  )

Commit the CSR graph.

All edges must have been added before calling this method. No further addition of edges is possible after this call until an uncommit is called.

◆ uncommit()

template<graph_attributes D, graph_attributes M, typename VertexPx = use_default, typename EdgePx = use_default, typename PSx = use_default, typename Mapx = use_default, typename Traitsx = use_default>
void stapl::csr_graph< D, M, VertexPx, EdgePx, PSx, Mapx, Traitsx >::uncommit ( )

Uncommit the CSR graph.

Place the graph in a state so that edges can be added. While the graph is uncommited, it is not possible to access its edges.


The documentation for this class was generated from the following file: