Base-container manager for the stapl::graph. More...
Public Member Functions | |
template<typename Partition , typename Mapper > | |
container_manager_static_graph (Partition const &partition, Mapper const &mapper, value_type const &default_value=value_type()) | |
Creates a base-container manager with the given size, partition and mapper, constructing all vertices with the value provided. | |
container_manager_static_graph (container_manager_static_graph const &other) | |
template<typename Partition , typename Mapper > | |
void | redistribute (Partition const &partition, Mapper const &mapper, typename boost::enable_if< boost::mpl::and_< is_view_based< Partition >, is_view_based< Mapper > > >::type *=0) |
Performs redistribution of the container elements into a new set of bContainers on possibly different locations to match the distribution specified by the partition and mapper provided. More... | |
bool | contains (gid_type const &gid) const |
Returns true if the base-container managed by this base-container manager contains the element specified by the GID. | |
void | add_element (gid_type const &gid, value_type const &val) |
Adds an element with the given GID and value to the base-container. More... | |
void | remove_element (gid_type const &gid) |
Removes the element with the specified GID. More... | |
cid_type | within (gid_type const &gid) const |
Returns the ID of the base-container storing the element with the specified GID. More... | |
size_t | num_elements (void) const |
Returns the number of elements in the base-container managed. | |
size_t | num_edges (void) const |
Returns the number of edges in the base-container managed. | |
size_t | num_self_edges (void) const |
Returns the number of self edges in the base-container managed. | |
size_t | rank (base_container_type *bc) |
Return the global rank of this base container in the pContainer. | |
template<typename Functor , typename Distribution > | |
void | apply (gid_type const &gid, Functor const &f, Distribution *distribution) |
Applies a function f to the element specified by the GID and pass along a pointer to the graph distribution. More... | |
template<typename GIDs , typename Functor , typename Distribution > | |
void | aggregate_targets_apply (GIDs &&edges, Functor &&f, Distribution *distribution) |
Applies a function f to the target of edges specified in a range, and pass along a pointer to the graph distribution. More... | |
template<typename Functor > | |
bool | contains_apply_set (gid_type const &gid, Functor const &f) |
Applies an arbitrary functor to the element at position GID if the element exists at this location. More... | |
template<typename Functor , typename Distribution > | |
bool | contains_apply (gid_type const &gid, Functor const &f, Distribution *distribution) |
Applies an arbitrary functor to the element at position GID if the element exists at this location. More... | |
template<typename Functor > | |
void | apply_set (gid_type const &gid, Functor const &f) |
Applies a function f to the element specified by the GID. More... | |
template<typename ED , typename Functor > | |
void | ep_apply (ED const &ed, Functor const &f) |
Applies a function f to the property of the edge specified by the edge descriptor. More... | |
template<typename ED , typename Functor > | |
Functor::result_type | ep_apply_get (ED const &ed, Functor const &f) |
Applies a function f to the property of the edge specified by the edge descriptor and returns the result. More... | |
template<typename ED , typename Functor > | |
bool | ep_find_apply (ED const &ed, Functor const &f) |
Applies a function f to the property of the edge specified by the edge descriptor, if it exists and returns whether or not the edge exists. More... | |
template<typename Functor > | |
Functor::result_type | apply_get (gid_type const &gid, Functor const &f) |
Applies a function f to the element specified by the GID, and returns the result. More... | |
template<typename Functor > | |
Functor::result_type | apply_get (gid_type const &gid, Functor const &f) const |
Applies a function f to the element specified by the GID, and returns the result. More... | |
template<typename Functor > | |
boost::optional< typename Functor::result_type > | contains_apply_get (gid_type const &gid, Functor const &f) |
Applies an arbitrary functor to the element at position GID if the element exists at this location. More... | |
template<typename Functor > | |
boost::optional< typename Functor::result_type > | contains_apply_get (gid_type const &gid, Functor const &f) const |
Applies an arbitrary functor to the element at position GID if the element exists at this location. More... | |
template<typename C , typename... T, typename... U> | |
void | invoke (gid_type const &gid, void(C::*const &pmf)(T...), U &&... u) |
Invoke a base container method on a certain GID. The element must exist in the current base container manager. More... | |
template<typename C , typename... T, typename... U> | |
bool | contains_invoke (gid_type const &gid, void(C::*const &pmf)(T...), U &&... u) |
Invokes a base container method on the given gid if it is present on this location. More... | |
template<typename C , typename Rtn , typename... T, typename... U> | |
Rtn | invoke (gid_type const &gid, Rtn(C::*const &pmf)(T...), U &&... u) |
Invoke a base container method on a certain GID and return the result. The element must exist in the current base container manager. More... | |
template<typename C , typename Rtn , typename... T, typename... U> | |
boost::optional< Rtn > | contains_invoke (gid_type const &gid, Rtn(C::*const &pmf)(T...), U &&... u) |
Invokes a base container method on the given gid if it is present on this location. More... | |
template<typename Class , typename Rtn , typename... PMFArgs, typename... Args> | |
boost::optional< Rtn > | const_contains_invoke (gid_type const &gid, Rtn(Class::*const pmf)(PMFArgs...) const, Args &&... args) const |
Invokes a base container method on the given gid if it is present on this location. More... | |
template<typename C , typename Rtn , typename... T, typename... U> | |
Rtn | const_invoke (gid_type const &gid, Rtn(C::*const &pmf)(T...), U &&... u) const |
Invoke a const base container method on a certain GID and return the result. The element must exist in the current base container manager. More... | |
template<typename Comparator , typename C , typename... T, typename... U> | |
void | min_invoke (Comparator const &comp, void(C::*const &pmf)(T...), U &&... u) |
Invoke a base container method returning void on the base container that minimizes a user-defined comparator over the base containers. More... | |
template<typename Comparator , typename C , typename Rtn , typename... T, typename... U> | |
Rtn | min_invoke (Comparator const &comp, Rtn(C::*const &pmf)(T...), U &&... u) |
Invoke a base container method on the base container that minimizes a user-defined comparator over the base containers. More... | |
gid_set_type | make_gid_set () |
Make an empty set of GIDs associated with this container manager. | |
bitmap_gid_set_type | make_bitmap_gid_set () |
Make an empty set of GIDs associated with this container manager, stored as a bitset. | |
implied_gid_set_type | make_implied_gid_set () |
Make a set of GIDs where every element managed by this container manager is included. | |
unique_gid_set_type | make_unique_gid_set () |
Make an empty set of GIDs associated with this container manager, where only unique GIDs are stored. | |
Public Types | |
typedef BaseContainer | base_container_type |
typedef base_container_ordering | ordering_type |
typedef ordering_type::ptr_bcontainer_type | ptr_bcontainer_type |
typedef BaseContainer | component_type |
Public Attributes | |
ordering_type | m_ordering |
Handle ordering amongst base containers across all locations. | |
Protected Types | |
typedef Registry | storage_type |
Base-container manager for the stapl::graph.
BaseContainer | Type of the base-container. |
Registry | Storage class for the base containers |
void stapl::container_manager_static_graph< BaseContainer, Registry >::redistribute | ( | Partition const & | partition, |
Mapper const & | mapper, | ||
typename boost::enable_if< boost::mpl::and_< is_view_based< Partition >, is_view_based< Mapper > > >::type * | = 0 |
||
) |
Performs redistribution of the container elements into a new set of bContainers on possibly different locations to match the distribution specified by the partition and mapper provided.
partition | provides methods necessary to map element GIDs to the ids of the partitions (bContainers) that will store them. |
mapper | provides the methods necessary to map partition ids to the ids of the locations that will store the partitions. |
The method is only available when view-based partition and mapper instances are used. The distributor instance is given the partition and mapper information in the constructor. The distributor function operator is given the current set of bContainers and their ordering in order to perform the redistribution.
void stapl::container_manager_static_graph< BaseContainer, Registry >::add_element | ( | gid_type const & | gid, |
value_type const & | val | ||
) |
Adds an element with the given GID and value to the base-container.
gid | The GID of the element being added. |
val | The value of the element being added. |
void stapl::container_manager_static_graph< BaseContainer, Registry >::remove_element | ( | gid_type const & | gid | ) |
Removes the element with the specified GID.
gid | The GID of the element being removed. |
cid_type stapl::container_manager_static_graph< BaseContainer, Registry >::within | ( | gid_type const & | gid | ) | const |
Returns the ID of the base-container storing the element with the specified GID.
gid | The GID of the element. |
void stapl::container_manager_static_graph< BaseContainer, Registry >::apply | ( | gid_type const & | gid, |
Functor const & | f, | ||
Distribution * | distribution | ||
) |
Applies a function f to the element specified by the GID and pass along a pointer to the graph distribution.
gid | The GID of the element. |
f | The Functor to apply on the element. |
distribution | The graph distribution |
void stapl::container_manager_static_graph< BaseContainer, Registry >::aggregate_targets_apply | ( | GIDs && | edges, |
Functor && | f, | ||
Distribution * | distribution | ||
) |
Applies a function f to the target of edges specified in a range, and pass along a pointer to the graph distribution.
edges | A range of edges on which to apply a function |
f | The Functor to apply on each vertex. |
distribution | The graph distribution |
bool stapl::container_manager_static_graph< BaseContainer, Registry >::contains_apply_set | ( | gid_type const & | gid, |
Functor const & | f | ||
) |
Applies an arbitrary functor to the element at position GID if the element exists at this location.
gid | GID of the element on which to apply the functor. |
f | Functor to apply. |
bool stapl::container_manager_static_graph< BaseContainer, Registry >::contains_apply | ( | gid_type const & | gid, |
Functor const & | f, | ||
Distribution * | distribution | ||
) |
Applies an arbitrary functor to the element at position GID if the element exists at this location.
gid | GID of the element on which to apply the functor. |
f | Functor to apply. |
f | Distribution of the graph |
void stapl::container_manager_static_graph< BaseContainer, Registry >::apply_set | ( | gid_type const & | gid, |
Functor const & | f | ||
) |
Applies a function f to the element specified by the GID.
gid | The GID of the element. |
f | The Functor to apply on the element. |
void stapl::container_manager_static_graph< BaseContainer, Registry >::ep_apply | ( | ED const & | ed, |
Functor const & | f | ||
) |
Applies a function f to the property of the edge specified by the edge descriptor.
ed | The edge descriptor of the edge. |
f | The Functor to apply on the property of the edge. |
Functor::result_type stapl::container_manager_static_graph< BaseContainer, Registry >::ep_apply_get | ( | ED const & | ed, |
Functor const & | f | ||
) |
Applies a function f to the property of the edge specified by the edge descriptor and returns the result.
ed | The edge descriptor of the edge. |
f | The Functor to apply on the property of the edge. |
bool stapl::container_manager_static_graph< BaseContainer, Registry >::ep_find_apply | ( | ED const & | ed, |
Functor const & | f | ||
) |
Applies a function f to the property of the edge specified by the edge descriptor, if it exists and returns whether or not the edge exists.
ed | The edge descriptor of the edge. |
f | The Functor to apply on the property of the edge. |
Functor::result_type stapl::container_manager_static_graph< BaseContainer, Registry >::apply_get | ( | gid_type const & | gid, |
Functor const & | f | ||
) |
Applies a function f to the element specified by the GID, and returns the result.
gid | The GID of the element. |
f | The Functor to apply on the element. |
Functor::result_type stapl::container_manager_static_graph< BaseContainer, Registry >::apply_get | ( | gid_type const & | gid, |
Functor const & | f | ||
) | const |
Applies a function f to the element specified by the GID, and returns the result.
gid | The GID of the element. |
f | The Functor to apply on the element. |
boost::optional<typename Functor::result_type> stapl::container_manager_static_graph< BaseContainer, Registry >::contains_apply_get | ( | gid_type const & | gid, |
Functor const & | f | ||
) |
Applies an arbitrary functor to the element at position GID if the element exists at this location.
gid | GID of the element on which to apply the functor. |
f | Functor to apply. |
boost::optional<typename Functor::result_type> stapl::container_manager_static_graph< BaseContainer, Registry >::contains_apply_get | ( | gid_type const & | gid, |
Functor const & | f | ||
) | const |
Applies an arbitrary functor to the element at position GID if the element exists at this location.
gid | GID of the element on which to apply the functor. |
f | Functor to apply. |
void stapl::container_manager_static_graph< BaseContainer, Registry >::invoke | ( | gid_type const & | gid, |
void(C::*&)(T...) | pmf, | ||
U &&... | u | ||
) |
Invoke a base container method on a certain GID. The element must exist in the current base container manager.
gid | The GID of the element to invoke the method on. |
pmf | A pointer to a base container's member method. |
u | Arguments to pass to the member function. |
bool stapl::container_manager_static_graph< BaseContainer, Registry >::contains_invoke | ( | gid_type const & | gid, |
void(C::*&)(T...) | pmf, | ||
U &&... | u | ||
) |
Invokes a base container method on the given gid
if it is present on this location.
gid | The GID of the element to invoke the method on. |
memberFuncPtr | A pointer to a base container's member method. |
u | Arguments to pass to the member function. |
Rtn stapl::container_manager_static_graph< BaseContainer, Registry >::invoke | ( | gid_type const & | gid, |
Rtn(C::*&)(T...) | pmf, | ||
U &&... | u | ||
) |
Invoke a base container method on a certain GID and return the result. The element must exist in the current base container manager.
gid | The GID of the element to invoke the method on. |
pmf | A pointer to a base container's member method. |
u | Arguments to pass to the member function. |
boost::optional<Rtn> stapl::container_manager_static_graph< BaseContainer, Registry >::contains_invoke | ( | gid_type const & | gid, |
Rtn(C::*&)(T...) | pmf, | ||
U &&... | u | ||
) |
Invokes a base container method on the given gid
if it is present on this location.
gid | The GID of the element to invoke the method on. |
pmf | A pointer to a base container's member method. |
u | Arguments to pass to the member function. |
boost::optional<Rtn> stapl::container_manager_static_graph< BaseContainer, Registry >::const_contains_invoke | ( | gid_type const & | gid, |
Rtn(Class::*)(PMFArgs...) const | pmf, | ||
Args &&... | args | ||
) | const |
Invokes a base container method on the given gid
if it is present on this location.
gid | The GID of the element to invoke the method on. |
pmf | A pointer to a base container's member method. |
args | Arguments to pmf . |
Rtn stapl::container_manager_static_graph< BaseContainer, Registry >::const_invoke | ( | gid_type const & | gid, |
Rtn(C::*&)(T...) | pmf, | ||
U &&... | u | ||
) | const |
Invoke a const base container method on a certain GID and return the result. The element must exist in the current base container manager.
gid | The GID of the element to invoke the method on. |
pmf | A pointer to a base container's member method. |
u | Arguments to pass to the member function. |
void stapl::container_manager_static_graph< BaseContainer, Registry >::min_invoke | ( | Comparator const & | comp, |
void(C::*&)(T...) | pmf, | ||
U &&... | u | ||
) |
Invoke a base container method returning void on the base container that minimizes a user-defined comparator over the base containers.
comp | Comparator that receives two base containers and returns the more optimal of the two. |
pmf | A pointer to a base container's member method. |
u | Arguments to pass to the member function. |
Rtn stapl::container_manager_static_graph< BaseContainer, Registry >::min_invoke | ( | Comparator const & | comp, |
Rtn(C::*&)(T...) | pmf, | ||
U &&... | u | ||
) |
Invoke a base container method on the base container that minimizes a user-defined comparator over the base containers.
comp | Comparator that receives two base containers and returns the more optimal of the two. |
pmf | A pointer to a base container's member method. |
u | Arguments to pass to the member function. |