fpmas 1.6
Public Member Functions | List of all members
fpmas::graph::DefaultDistributedNodeBuilder< T > Class Template Reference

#include <graph_builder.h>

Inheritance diagram for fpmas::graph::DefaultDistributedNodeBuilder< T >:
Inheritance graph
[legend]
Collaboration diagram for fpmas::graph::DefaultDistributedNodeBuilder< T >:
Collaboration graph
[legend]

Public Member Functions

fpmas::api::graph::DistributedNode< int > * buildNode (fpmas::api::graph::DistributedGraph< int > &graph) override
 
fpmas::api::graph::DistributedNode< int > * buildDistantNode (fpmas::api::graph::DistributedId id, int location, fpmas::api::graph::DistributedGraph< int > &graph) override
 
- Public Member Functions inherited from fpmas::graph::DistributedNodeBuilder< int >
 DistributedNodeBuilder (std::size_t node_count, fpmas::api::communication::MpiCommunicator &comm)
 
std::size_t nodeCount () override
 
std::size_t localNodeCount () override
 
- Public Member Functions inherited from fpmas::api::graph::DistributedNodeBuilder< T >
virtual std::size_t localNodeCount ()=0
 
virtual DistributedNode< T > * buildDistantNode (DistributedId id, int location, DistributedGraph< T > &graph)=0
 
- Public Member Functions inherited from fpmas::api::graph::NodeBuilder< T >
virtual std::size_t nodeCount ()=0
 
virtual DistributedNode< T > * buildNode (DistributedGraph< T > &graph)=0
 

Additional Inherited Members

- Protected Attributes inherited from fpmas::graph::DistributedNodeBuilder< int >
std::size_t local_node_count
 

Detailed Description

template<typename T>
class fpmas::graph::DefaultDistributedNodeBuilder< T >

A default DistributedNodeBuilder instance that builds fpmas::graph::DistributedNode instance containing default initialized T instances.

Template Parameters
Tnode data type

Member Function Documentation

◆ buildNode()

template<typename T >
fpmas::api::graph::DistributedNode< int > * fpmas::graph::DefaultDistributedNodeBuilder< T >::buildNode ( fpmas::api::graph::DistributedGraph< int > &  graph)
inlineoverride

Builds a node in the specified graph.

Parameters
graphgraph in which the node must be built
Returns
pointer to built node

◆ buildDistantNode()

template<typename T >
fpmas::api::graph::DistributedNode< int > * fpmas::graph::DefaultDistributedNodeBuilder< T >::buildDistantNode ( fpmas::api::graph::DistributedId  id,
int  location,
fpmas::api::graph::DistributedGraph< int > &  graph 
)
inlineoverride

Builds a distant node in the specified graph, with the provided id. The node is assumed to be currently owned by the process with rank location.

Such a node can be considered as a "temporary" node, that can be used by the underlying algorithm to build edges with nodes that are currently not located on this process.

Implementations are likely to behave as follow:

  1. Dynamically allocates a default DistributedNode
  2. Initiates its location using DistributedNode::setLocation()
  3. Inserts it into the graph using DistributedGraph::insertDistant()
Note
The node returned must be the node effectively contained in the graph at the end of the operation. Indeed, it is allowed to try to insert a DISTANT node already contained in the graph, and implementations might decide to ignore the new node or to replace the existing one, but the node finally contained in the graph must be returned. In any case, it is safe to return the result of DistributedGraph::insertDistant().

Notice that the count of nodes built using this method is not limited and is not correlated to localNodeCount() or nodeCount(), contrary to the buildNode() method.

Parameters
idid of the distant node
locationcurrent node location
graphgraph in which the distant node will be inserted

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