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_type > | shared_from_this () |
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.
D | graph-attribute specifying Directedness (DIRECTED/UNDIRECTED). |
M | graph-attribute specifying Multiedge. (MULTIEDGES/NONMULTIEDGES). |
VertexPx | type of property for the vertex. Default is no_property. Must be default assignable, copyable and assignable. |
EdgePx | type of property for the edge. Default is no_property. Must be default assignable, copyable and assignable. |
PSx | Partition strategy that defines how to partition the original domain into subdomains. The default partition is balanced_partition. |
Mapx | Mapper that defines how to map the subdomains produced by the partition to locations. The default mapper is mapper. |
Traits | A 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. |
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.
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.
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.
n | The number of vertices |
default_value | The initial value of the vertices' properties. |
dis_policy | A distribution policy that specifies how to distribute the nested containers, in the context of containers of containers. |
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.
dims | dimensions of the internal containers. |
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.
dims | dimensions of the internal containers. |
dis_policy | A distribution policy that specifies how to distribute the nested containers, in the context of containers of containers. |
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.
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.