Graphs¶
Refer to Developer Guide: Graphs.
Programming interface¶
All types and functions in this section are declared in the
oneapi::dal::preview
namespace and are available via inclusion of the
oneapi/dal/graph/common.hpp
header file.
Graph¶
The graph concept is represented by the types with the _graph
suffix and all of them are
reference-counted:
The instance stores pointers to the graph topology and attributes of vertices and edges.
The reference count indicates how many graph objects refer to the same implementation.
The graph increments the reference count for it to be equal to the number of graph objects sharing the same implementation.
The graph decrements the reference count when the graph goes out of the scope. If the reference count is zero, the graph frees its implementation.
The graph types are defined as templated classes:
template <typename VertexValue,
typename EdgeValue,
typename GraphValue,
typename IndexType,
typename Allocator>
class [graph_name]_graph;
Type name |
Description |
Supported types |
---|---|---|
|
The type of the vertex attribute values |
|
|
The type of the edge attribute values |
|
|
The type of the graph attribute value |
|
|
The type of the vertex indices |
|
|
The type of a graph allocator |
C++17 (ISO/IEC 14882:2017) compliant allocator |
Empty value tag structure is used to define the absence of a specified attribute of a graph.
-
struct empty_value¶
Graph class contains the default and the move constructor as well as the move assignment operator. The graph is accessed using the service functions.
|
Description |
---|---|
Default constructor |
Constructs an empty graph object |
Move constructor |
Creates a new graph instance and moves the implementation from another instance into this one |
Move assignment |
Swaps the implementation of this object and another one |
Graph traits¶
Graph traits is a data type that defines the data model and a set of types associated with the graph. Graph traits are used by processing and service functionality.
Type graph_traits is specialized for each graph by following the pattern below.
template <typename G>
struct graph_traits {
using graph_type = ...;
using allocator_type = ...;
...
};
The full list of types defined in graph_traits<G>
is in the table below:
Type, |
Description |
||
---|---|---|---|
|
The type of the graph |
|
|
|
The type of the allocator of the graph |
|
|
|
The type of the attribute of the graph |
|
|
|
The constant type of the attribute of the graph |
|
|
|
The type of the vertices in the graph |
|
|
|
The type of the vertex iterator in the graph |
|
|
|
The constant type of the vertex iterator in the graph |
|
|
|
The type of the vertex indices in the graph |
|
|
|
The type of the vertex attribute of the graph |
|
|
|
The type of edges in the graph |
|
|
|
The type of the edge iterator in the graph |
Not available |
Not available |
|
The constant type of the edge iterator in the graph |
Not available |
Not available |
|
The type of the edge indices in the graph |
|
|
|
The type of edge attribute |
|
|
|
The type of the vertex neighbors indices |
|
Not available |
|
The type of the vertex outward neighbors indices |
Not available |
|
|
The type of the vertex neighbors iterator |
|
Not available |
|
The type of the vertex neighbors constant iterator |
|
Not available |
|
The type of the vertex outward neighbors iterator |
Not available |
|
|
The type of the vertex outward neighbors constant iterator |
Not available |
|
|
The type of the range of vertex neighbors |
|
Not available |
|
The type of the constant range of vertex neighbors |
|
Not available |
|
The type of the range of vertex outward neighbors |
Not available |
|
|
The type of the constant range of vertex outward neighbors |
Not available |
|
[1] VertexValue
, EdgeValue
, GraphValue
, IndexType
, Allocator
– template parameters of graph G.
This section describes API of the specified graph types.