Class HostEnvironmentDirectedGraph::EdgeMap
Defined in File HostEnvironmentDirectedGraph.cuh
Nested Relationships
This class is a nested type of Class HostEnvironmentDirectedGraph.
Nested Types
Class Documentation
-
class EdgeMap
A map for accessing edge storage via vertex ID
Public Functions
-
size_type size() const
- Returns:
The number of edges with a valid source/destination vertex pair
-
size_type allocated_size() const
-
- Returns:
The number of edges that memory has been allocated for
-
Edge operator[](SrcDestPair source_dest_vertex_ids)
Return a view into the edge map of the specified edge If the edge has not already been created, it will be created
- Parameters:
source_dest_vertex_ids – Identifier of the source vertex of the edge
- Throws:
exception::IDOutOfBounds – 0 is not a valid value of edge_id
exception::OutOfBoundsException – If more vertices have been created, than were allocated via HostEnvironmentDirectedGraph::setEdgeCount()
-
Edge atIndex(unsigned int index)
Return a view into the allocated edge buffer at the specified index
- Throws:
exception::OutOfBoundsException – If index exceeds the number of vertices allocated via HostEnvironmentDirectedGraph::setEdgeCount()
-
inline Iterator begin()
Returns an iterator to the first edge in the buffer that backs the edge map
Unlike a traditional C++ map iterator, this does not dereference to a key-value pair, as it returns all allocated edges including those which have not had their key (source/destination vertex) set, such IDs evaluate as ID_NOT_SET
Note
The order of edges is not stable and is likely to change when the graph is rebuilt
-
inline Iterator end()
Returns an iterator to one beyond the last edge in the buffer that backs the edge map
Unlike a traditional C++ map iterator, this does not dereference to a key-value pair, as it returns all allocated edges including those which have not had their key (source/destination vertex) set, such IDs evaluate as ID_NOT_SET
Note
The order of edges is not stable and is likely to change when the graph is rebuilt
-
class Edge
Public Functions
-
void setSourceVertexID(id_t source_vertex_id)
Set the source vertex’s id for the current edge
- Parameters:
source_vertex_id – The value to set the current edge’s source vertex id
-
void setDestinationVertexID(id_t dest_vertex_id)
Set the destination vertex’s id for the current edge
- Parameters:
dest_vertex_id – The value to set the current edge’s destination vertex id
-
void setSourceDestinationVertexID(id_t source_vertex_id, id_t dest_vertex_id)
Set the source and destination vertices’ ids for the current edge
- Parameters:
source_vertex_id – The value to set the current edge’s source vertex id
dest_vertex_id – The value to set the current edge’s destination vertex id
-
template<typename T>
void setProperty(const std::string &property_name, T property_value) Set the value of the specified property of the current edge
- Parameters:
property_name – The name of the property to set
property_value – The value to set the current edge’s property
- Template Parameters:
T – The type of the property
- Throws:
exception::InvalidArgument – If property_name does not refer to a valid edge property
-
template<typename T, flamegpu::size_type N = 0>
void setProperty(const std::string &property_name, flamegpu::size_type element_index, T property_value)
-
template<typename T, flamegpu::size_type N>
void setProperty(const std::string &property_name, const std::array<T, N> &property_value)
-
id_t getSourceVertexID() const
Returns the source vertex’s id for the current edge
-
id_t getDestinationVertexID() const
Returns the destination vertex’s id for the current edge
-
template<typename T>
T getProperty(const std::string &property_name) const Returns the value of the specified property of the current edge
- Parameters:
property_name – The name of the property to set
- Template Parameters:
T – The type of the property
- Throws:
exception::InvalidArgument – If property_name does not refer to a valid edge property
exception::InvalidGraphProperty – If a edge property with the matching name and type does not exist
-
void setSourceVertexID(id_t source_vertex_id)
-
struct Iterator
-
Unlike a traditional C++ map iterator, this does not dereference to a key-value pair, as it returns all allocated edges including those which have not had their key (source/destination vertex) set, such IDs evaluate as ID_NOT_SET
-
size_type size() const