Class DeviceEnvironmentDirectedGraph::InEdgeFilter
Defined in File DeviceEnvironmentDirectedGraph.cuh
Nested Relationships
This class is a nested type of Class DeviceEnvironmentDirectedGraph.
Nested Types
Class Documentation
-
class InEdgeFilter
This class is created when a vertex is provided to DeviceEnvironmentDirectedGraph::inEdges()(id_t) It provides iterator access to the subset of edges found leaving the specified vertex
Public Functions
-
__device__ inline InEdgeFilter(detail::curve::Curve::VariableHash _graph_hash, const id_t &vertex_index)
Constructor, takes the search parameters required Begin key and end key specify the [begin, end) contiguous range of bucket. (inclusive begin, exclusive end)
- Parameters:
_graph_hash – Graph hash for accessing data via curve
vertex_index – The index of the vertex to retrieve leaving edges for
-
__device__ inline iterator begin(void) const
Returns an iterator to the start of the in edge list subset joining the vertex
-
__device__ inline iterator end(void) const
Returns an iterator to the position beyond the end of the edge list subset joining the vertex
Note
This iterator is the same for all edge list subsets
-
__device__ inline unsigned int size(void) const
Returns the number of edges in the filtered bucket
-
class Edge
Provides access to a specific edge Returned by the iterator
See also
In::Filter::iterator
Public Functions
-
__device__ inline Edge(const InEdgeFilter &parent, const unsigned int &_ipbm_index)
Constructs an edge and directly initialises all of it’s member variables
Note
See member variable documentation for their purposes
-
__device__ inline bool operator==(const Edge &rhs) const
Equality operator Compares all internal member vars for equality
Note
Does not compare _parent
-
__device__ inline bool operator!=(const Edge &rhs) const
Inequality operator Returns inverse of equality operator
See also
operator==(const Edge&)
-
__device__ inline Edge &operator++()
Updates the edge to return variables from the next edge joining the vertex
- Returns:
Returns itself
-
__device__ inline unsigned int getIndex() const
Returns the index of the current edge within the graph’s full list of edges
Note
Edge indexes are not constant, they can change if edges are updated causing the graph’s CSR to be rebuilt
-
template<typename T, flamegpu::size_type N>
__device__ T getProperty(const char (&property_name)[N]) const Returns the value for the current edge attached to the named property
- Parameters:
property_name – Name of the property
- Template Parameters:
T – type of the property
N – Length of property name (this should be implicit if a string literal is passed to property_name)
- Returns:
The specified variable, else 0x0 if an error occurs
-
template<typename T, flamegpu::size_type N, unsigned int M>
__device__ T getProperty(const char (&property_name)[M], const unsigned int &index) const Returns the specified property array element from the current edge attached to the named property
- Parameters:
property_name – name used for accessing the property, this value should be a string literal e.g. “foobar”
index – Index of the element within the property array to return
- Template Parameters:
T – Type of the edge property being accessed
N – The length of the edge’s array property, as set within the model description hierarchy
M – Length of property name (this should be implicit if a string literal is passed to property_name)
- Throws:
exception::DeviceError – If name is not a valid property within the edge (flamegpu must be built with SEATBELTS enabled for device error checking)
exception::DeviceError – If T is not the type of property ‘name’ within the message (flamegpu must be built with SEATBELTS enabled for device error checking)
exception::DeviceError – If index is out of bounds for the property array specified by name (flamegpu must be built with SEATBELTS enabled for device error checking)
-
__device__ unsigned int getEdgeSource() const
Returns the source vertex indexof this edge
Note
getEdgeDestination() is not provided, as this value is required to access an edge via iteration so should already be available
-
__device__ inline Edge(const InEdgeFilter &parent, const unsigned int &_ipbm_index)
-
class iterator
Stock iterator for iterating DeviceEnvironmentDirectedGraph::Edge objects
Public Functions
-
__device__ inline iterator(const InEdgeFilter &parent, const unsigned int &cell_index)
Constructor This iterator is constructed by DeviceEnvironmentDirectedGraph::InEdgeFilter::begin()(id_t)
-
__device__ inline iterator &operator++()
Moves to the next edge (Prefix increment operator)
-
__device__ inline iterator operator++(int)
Moves to the next edge (Postfix increment operator, returns value prior to increment)
-
__device__ inline bool operator==(const iterator &rhs) const
Equality operator Compares edge
-
__device__ inline bool operator!=(const iterator &rhs) const
Inequality operator Compares edge
-
__device__ inline Edge &operator*()
Dereferences the iterator to return the edge object, for accessing variables
-
__device__ inline Edge *operator->()
Dereferences the iterator to return the edge object, for accessing variables
-
__device__ inline iterator(const InEdgeFilter &parent, const unsigned int &cell_index)
-
__device__ inline InEdgeFilter(detail::curve::Curve::VariableHash _graph_hash, const id_t &vertex_index)