STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Public Attributes | Protected Types
stapl::container_manager_dynamic_graph< BaseContainer, Registry > Class Template Reference

Base-container manager for the dynamic_graph. More...

Public Member Functions

template<typename Partition , typename Mapper >
 container_manager_dynamic_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.
 
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...
 
gid_set_type make_gid_set ()
 Make an empty set of GIDs associated with this container manager.
 
template<typename Promise >
void find_first (Promise const &promise)
 Returns the GID of the global first element of the pContainer, as per the ordering specified by base-container ordering. This is needed for the distributed domain.
 
template<typename Promise >
void find_last (Promise const &promise)
 Returns the GID of the global last element of the pContainer, as per the ordering specified by base-container ordering. This is needed for the distributed domain.
 
gid_type advance (gid_type const &g, long long n, bool globally=true)
 Returns the GID of the element that is the specified number of steps ahead than the provided GID, as per the ordering specified by base-container ordering. This is needed for the distributed domain. More...
 
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 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... 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>
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...
 
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::cid_type cid_type
 
typedef BaseContainer::gid_type gid_type
 
typedef BaseContainer::value_type value_type
 
typedef BaseContainer base_container_type
 
typedef base_type::iterator iterator
 
typedef base_type::const_iterator const_iterator
 
typedef base_container_ordering ordering_type
 Type for managing base container ordering.
 
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
 

Detailed Description

template<typename BaseContainer, typename Registry>
class stapl::container_manager_dynamic_graph< BaseContainer, Registry >

Base-container manager for the dynamic_graph.

Template Parameters
BaseContainerType of the base-container.

This container manager stores only one base-container per location, because it is used by unordered containers which don't need multiple base-containers.

Member Function Documentation

◆ add_element() [1/2]

template<typename BaseContainer , typename Registry >
void stapl::container_manager_dynamic_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.

Parameters
gidThe GID of the element being added.
valThe value of the element being added.

◆ remove_element() [1/2]

template<typename BaseContainer , typename Registry >
void stapl::container_manager_dynamic_graph< BaseContainer, Registry >::remove_element ( gid_type const &  gid)

Removes the element with the specified GID.

Parameters
gidThe GID of the element being removed.

◆ advance()

template<typename BaseContainer , typename Registry >
gid_type stapl::container_manager_dynamic_graph< BaseContainer, Registry >::advance ( gid_type const &  g,
long long  n,
bool  globally = true 
)

Returns the GID of the element that is the specified number of steps ahead than the provided GID, as per the ordering specified by base-container ordering. This is needed for the distributed domain.

Parameters
gThe GID of the element to start from.
nThe number of steps to advance.
globallyWhether or not to advance globally.
Returns
The GID of the element resulting from advancing the given GID by the specified number of steps.

◆ redistribute()

template<typename BaseContainer , typename Registry >
template<typename Partition , typename Mapper >
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 
)
inherited

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.

Parameters
partitionprovides methods necessary to map element GIDs to the ids of the partitions (bContainers) that will store them.
mapperprovides 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.

◆ add_element() [2/2]

template<typename BaseContainer , typename Registry >
void stapl::container_manager_static_graph< BaseContainer, Registry >::add_element ( gid_type const &  gid,
value_type const &  val 
)
inherited

Adds an element with the given GID and value to the base-container.

Parameters
gidThe GID of the element being added.
valThe value of the element being added.
Note
Adding elements to the static graph is not allowed.

◆ remove_element() [2/2]

template<typename BaseContainer , typename Registry >
void stapl::container_manager_static_graph< BaseContainer, Registry >::remove_element ( gid_type const &  gid)
inherited

Removes the element with the specified GID.

Parameters
gidThe GID of the element being removed.
Note
Removing elements from the static graph is not allowed.

◆ within()

template<typename BaseContainer , typename Registry >
cid_type stapl::container_manager_static_graph< BaseContainer, Registry >::within ( gid_type const &  gid) const
inherited

Returns the ID of the base-container storing the element with the specified GID.

Parameters
gidThe GID of the element.
Returns
The ID of the base-container.

◆ apply()

template<typename BaseContainer , typename Registry >
template<typename Functor , typename Distribution >
void stapl::container_manager_static_graph< BaseContainer, Registry >::apply ( gid_type const &  gid,
Functor const &  f,
Distribution *  distribution 
)
inherited

Applies a function f to the element specified by the GID and pass along a pointer to the graph distribution.

Parameters
gidThe GID of the element.
fThe Functor to apply on the element.
distributionThe graph distribution

◆ aggregate_targets_apply()

template<typename BaseContainer , typename Registry >
template<typename GIDs , typename Functor , typename Distribution >
void stapl::container_manager_static_graph< BaseContainer, Registry >::aggregate_targets_apply ( GIDs &&  edges,
Functor &&  f,
Distribution *  distribution 
)
inherited

Applies a function f to the target of edges specified in a range, and pass along a pointer to the graph distribution.

Parameters
edgesA range of edges on which to apply a function
fThe Functor to apply on each vertex.
distributionThe graph distribution

◆ contains_apply_set()

template<typename BaseContainer , typename Registry >
template<typename Functor >
bool stapl::container_manager_static_graph< BaseContainer, Registry >::contains_apply_set ( gid_type const &  gid,
Functor const &  f 
)
inherited

Applies an arbitrary functor to the element at position GID if the element exists at this location.

Parameters
gidGID of the element on which to apply the functor.
fFunctor to apply.

◆ contains_apply()

template<typename BaseContainer , typename Registry >
template<typename Functor , typename Distribution >
bool stapl::container_manager_static_graph< BaseContainer, Registry >::contains_apply ( gid_type const &  gid,
Functor const &  f,
Distribution *  distribution 
)
inherited

Applies an arbitrary functor to the element at position GID if the element exists at this location.

Parameters
gidGID of the element on which to apply the functor.
fFunctor to apply.
fDistribution of the graph

◆ apply_set()

template<typename BaseContainer , typename Registry >
template<typename Functor >
void stapl::container_manager_static_graph< BaseContainer, Registry >::apply_set ( gid_type const &  gid,
Functor const &  f 
)
inherited

Applies a function f to the element specified by the GID.

Parameters
gidThe GID of the element.
fThe Functor to apply on the element.

◆ ep_apply()

template<typename BaseContainer , typename Registry >
template<typename ED , typename Functor >
void stapl::container_manager_static_graph< BaseContainer, Registry >::ep_apply ( ED const &  ed,
Functor const &  f 
)
inherited

Applies a function f to the property of the edge specified by the edge descriptor.

Parameters
edThe edge descriptor of the edge.
fThe Functor to apply on the property of the edge.

◆ ep_apply_get()

template<typename BaseContainer , typename Registry >
template<typename ED , typename Functor >
Functor::result_type stapl::container_manager_static_graph< BaseContainer, Registry >::ep_apply_get ( ED const &  ed,
Functor const &  f 
)
inherited

Applies a function f to the property of the edge specified by the edge descriptor and returns the result.

Parameters
edThe edge descriptor of the edge.
fThe Functor to apply on the property of the edge.

◆ ep_find_apply()

template<typename BaseContainer , typename Registry >
template<typename ED , typename Functor >
bool stapl::container_manager_static_graph< BaseContainer, Registry >::ep_find_apply ( ED const &  ed,
Functor const &  f 
)
inherited

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.

Parameters
edThe edge descriptor of the edge.
fThe Functor to apply on the property of the edge.
Returns
True if the edge exists, false otherwise.

◆ apply_get() [1/2]

template<typename BaseContainer , typename Registry >
template<typename Functor >
Functor::result_type stapl::container_manager_static_graph< BaseContainer, Registry >::apply_get ( gid_type const &  gid,
Functor const &  f 
)
inherited

Applies a function f to the element specified by the GID, and returns the result.

Parameters
gidThe GID of the element.
fThe Functor to apply on the element.
Returns
The result of applying the functor to the element.

◆ apply_get() [2/2]

template<typename BaseContainer , typename Registry >
template<typename Functor >
Functor::result_type stapl::container_manager_static_graph< BaseContainer, Registry >::apply_get ( gid_type const &  gid,
Functor const &  f 
) const
inherited

Applies a function f to the element specified by the GID, and returns the result.

Parameters
gidThe GID of the element.
fThe Functor to apply on the element.
Returns
The result of applying the functor to the element.

◆ contains_apply_get() [1/2]

template<typename BaseContainer , typename Registry >
template<typename Functor >
boost::optional<typename Functor::result_type> stapl::container_manager_static_graph< BaseContainer, Registry >::contains_apply_get ( gid_type const &  gid,
Functor const &  f 
)
inherited

Applies an arbitrary functor to the element at position GID if the element exists at this location.

Parameters
gidGID of the element on which to apply the functor.
fFunctor to apply.

◆ contains_apply_get() [2/2]

template<typename BaseContainer , typename Registry >
template<typename Functor >
boost::optional<typename Functor::result_type> stapl::container_manager_static_graph< BaseContainer, Registry >::contains_apply_get ( gid_type const &  gid,
Functor const &  f 
) const
inherited

Applies an arbitrary functor to the element at position GID if the element exists at this location.

Parameters
gidGID of the element on which to apply the functor.
fFunctor to apply.

◆ invoke() [1/2]

template<typename BaseContainer , typename Registry >
template<typename C , typename... T, typename... U>
void stapl::container_manager_static_graph< BaseContainer, Registry >::invoke ( gid_type const &  gid,
void(C::*&)(T...)  pmf,
U &&...  u 
)
inherited

Invoke a base container method on a certain GID. The element must exist in the current base container manager.

Parameters
gidThe GID of the element to invoke the method on.
pmfA pointer to a base container's member method.
uArguments to pass to the member function.

◆ invoke() [2/2]

template<typename BaseContainer , typename Registry >
template<typename C , typename Rtn , typename... T, typename... U>
Rtn stapl::container_manager_static_graph< BaseContainer, Registry >::invoke ( gid_type const &  gid,
Rtn(C::*&)(T...)  pmf,
U &&...  u 
)
inherited

Invoke a base container method on a certain GID and return the result. The element must exist in the current base container manager.

Parameters
gidThe GID of the element to invoke the method on.
pmfA pointer to a base container's member method.
uArguments to pass to the member function.
Returns
The result of invoking the function pointer.

◆ contains_invoke() [1/2]

template<typename BaseContainer , typename Registry >
template<typename C , typename... T, typename... U>
bool stapl::container_manager_static_graph< BaseContainer, Registry >::contains_invoke ( gid_type const &  gid,
void(C::*&)(T...)  pmf,
U &&...  u 
)
inherited

Invokes a base container method on the given gid if it is present on this location.

Parameters
gidThe GID of the element to invoke the method on.
memberFuncPtrA pointer to a base container's member method.
uArguments to pass to the member function.
Returns
True if gid was found and functor applied, otherwise false.

◆ contains_invoke() [2/2]

template<typename BaseContainer , typename Registry >
template<typename C , typename Rtn , typename... T, typename... U>
boost::optional<Rtn> stapl::container_manager_static_graph< BaseContainer, Registry >::contains_invoke ( gid_type const &  gid,
Rtn(C::*&)(T...)  pmf,
U &&...  u 
)
inherited

Invokes a base container method on the given gid if it is present on this location.

Parameters
gidThe GID of the element to invoke the method on.
pmfA pointer to a base container's member method.
uArguments to pass to the member function.
Returns
boost::optional with result of invocation if element was found.

◆ const_contains_invoke()

template<typename BaseContainer , typename Registry >
template<typename Class , typename Rtn , typename... PMFArgs, typename... Args>
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
inherited

Invokes a base container method on the given gid if it is present on this location.

Parameters
gidThe GID of the element to invoke the method on.
pmfA pointer to a base container's member method.
argsArguments to pmf.
Returns
boost::optional with result of invocation if element was found.

◆ const_invoke()

template<typename BaseContainer , typename Registry >
template<typename C , typename Rtn , typename... T, typename... U>
Rtn stapl::container_manager_static_graph< BaseContainer, Registry >::const_invoke ( gid_type const &  gid,
Rtn(C::*&)(T...)  pmf,
U &&...  u 
) const
inherited

Invoke a const base container method on a certain GID and return the result. The element must exist in the current base container manager.

Parameters
gidThe GID of the element to invoke the method on.
pmfA pointer to a base container's member method.
uArguments to pass to the member function.
Returns
The result of invoking the function pointer.

◆ min_invoke() [1/2]

template<typename BaseContainer , typename Registry >
template<typename Comparator , typename C , typename... T, typename... U>
void stapl::container_manager_static_graph< BaseContainer, Registry >::min_invoke ( Comparator const &  comp,
void(C::*&)(T...)  pmf,
U &&...  u 
)
inherited

Invoke a base container method returning void on the base container that minimizes a user-defined comparator over the base containers.

Parameters
compComparator that receives two base containers and returns the more optimal of the two.
pmfA pointer to a base container's member method.
uArguments to pass to the member function.

◆ min_invoke() [2/2]

template<typename BaseContainer , typename Registry >
template<typename Comparator , typename C , typename Rtn , typename... T, typename... U>
Rtn stapl::container_manager_static_graph< BaseContainer, Registry >::min_invoke ( Comparator const &  comp,
Rtn(C::*&)(T...)  pmf,
U &&...  u 
)
inherited

Invoke a base container method on the base container that minimizes a user-defined comparator over the base containers.

Parameters
compComparator that receives two base containers and returns the more optimal of the two.
pmfA pointer to a base container's member method.
uArguments to pass to the member function.
Returns
The result of invoking the function pointer.

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