30 std::size_t num_nodes_m;
34 [[nodiscard]] std::size_t
getNumNodes()
const {
return num_nodes_m; }
44 explicit Topology(
const std::size_t num_nodes) : num_nodes_m(num_nodes) {
46 throw std::invalid_argument(
"Number of nodes must be greater than 1");
Abstract base class for archipelago topologies.
virtual internal::NodeLinks getLinks(std::size_t node) const =0
Determines the neighbors for a specific island rank.
virtual ~Topology()=default
std::size_t getNumNodes() const
Returns the total number of nodes in the topology.
Topology(const std::size_t num_nodes)
Constructs a topology for a specific number of nodes.
Represents the incoming and outgoing links for a specific node in a graph.
std::vector< std::size_t > neighbors_out
IDs of nodes that this node sends migrants to.
std::vector< std::size_t > neighbors_in
IDs of nodes that this node receives migrants from.