传统图函数#

void get_vertex_identifiers(vertex_t *identifiers) const#

用顶点标识符填充标识符数组。

参数:

identifiers[out] 指向设备内存的指针,用于存储顶点标识符

void degree(edge_t *degree, DegreeDirection direction) const#

计算图中所有节点的度(入度、出度、入度+出度)。

抛出:

cugraph::logic_error – 发生错误时。

参数:
  • degree[out] 大小为 V(V 是顶点数)的设备数组,初始化为零。将包含每个顶点计算出的度。

  • direction[in] IN_PLUS_OUT(入度+出度)、IN(入度)或 OUT(出度)

inline GraphCOOView(vertex_t *src_indices, vertex_t *dst_indices, weight_t *edge_data, vertex_t number_of_vertices, edge_t number_of_edges)#

将表示边列表的现有数组包装成图。

        GraphCOOView does not own the memory used to represent this
图。此函数不会分配内存。

参数:
  • source_indices – 大小为 E(边数)的数组,包含每条边的源顶点索引。索引必须在 [0, V-1] 范围内。

  • destination_indices – 大小为 E(边数)的数组,包含每条边的目标顶点索引。索引必须在 [0, V-1] 范围内。

  • edge_data – 大小为 E(边数)的数组,包含每条边的权重。此数组可以为 null,在这种情况下图被视为无权重图。

  • number_of_vertices – 图中的顶点数

  • number_of_edges – 图中的边数

void get_source_indices(vertex_t *src_indices) const#

用源顶点标识符填充数组中的标识符。

参数:

src_indices[out] 指向设备内存的指针,用于存储源顶点标识符

void degree(edge_t *degree, DegreeDirection direction) const

计算图中所有节点的度(入度、出度、入度+出度)。

抛出:

cugraph::logic_error – 发生错误时。

参数:
  • degree[out] 大小为 V(V 是顶点数)的设备数组,初始化为零。将包含每个顶点计算出的度。

  • direction[in] 指示度计算类型的整数值 0 : 入度+出度 1 : 入度 2 : 出度

inline GraphCompressedSparseBaseView(edge_t *offsets, vertex_t *indices, weight_t *edge_data, vertex_t number_of_vertices, edge_t number_of_edges)#

将表示邻接列表的现有数组包装成图。GraphCSRView 不拥有表示此图所使用的内存。此函数不会分配内存。

参数:
  • offsets – 大小为 V+1(V 是顶点数)的数组,包含每个顶点的邻接列表偏移量。偏移量必须在 [0, E](边数)范围内。

  • indices – 大小为 E 的数组,包含每条边的目标顶点索引。索引必须在 [0, V-1] 范围内。

  • edge_data – 大小为 E(边数)的数组,包含每条边的权重。此数组可以为 null,在这种情况下图被视为无权重图。

  • number_of_vertices – 图中的顶点数

  • number_of_edges – 图中的边数

inline GraphCSRView(edge_t *offsets, vertex_t *indices, weight_t *edge_data, vertex_t number_of_vertices, edge_t number_of_edges)#

将表示邻接列表的现有数组包装成图。GraphCSRView 不拥有表示此图所使用的内存。此函数不会分配内存。

参数:
  • offsets – 大小为 V+1(V 是顶点数)的数组,包含每个顶点的邻接列表偏移量。偏移量必须在 [0, E](边数)范围内。

  • indices – 大小为 E 的数组,包含每条边的目标顶点索引。索引必须在 [0, V-1] 范围内。

  • edge_data – 大小为 E(边数)的数组,包含每条边的权重。此数组可以为 null,在这种情况下图被视为无权重图。

  • number_of_vertices – 图中的顶点数

  • number_of_edges – 图中的边数

inline GraphCOO(vertex_t number_of_vertices, edge_t number_of_edges, bool has_data = false, cudaStream_t stream = nullptr, rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource())#

获取提供的 COO 格式图数组的所有权。

参数:
  • number_of_vertices – 图中的顶点数

  • number_of_edges – 图中的边数

  • has_data – 类是否包含数据,默认值为 False

  • stream – 指定 cudaStream,默认值为 null

  • mr – 指定内存资源

inline GraphCompressedSparseBase(vertex_t number_of_vertices, edge_t number_of_edges, bool has_data, cudaStream_t stream, rmm::device_async_resource_ref mr)#

获取提供的 CSR/CSC 格式图数组的所有权。

参数:
  • number_of_vertices – 图中的顶点数

  • number_of_edges – 图中的边数

  • has_data – 类是否包含数据,默认值为 False

  • stream – 指定 cudaStream,默认值为 null

  • mr – 指定内存资源

inline GraphCSR()#

默认构造函数。

inline GraphCSR(vertex_t number_of_vertices_, edge_t number_of_edges_, bool has_data_ = false, cudaStream_t stream = nullptr, rmm::device_async_resource_ref mr = rmm::mr::get_current_device_resource())#

获取提供的 CSR 格式图数组的所有权。

参数:
  • number_of_vertices – 图中的顶点数

  • number_of_edges – 图中的边数

  • has_data – 类是否包含数据,默认值为 False

  • stream – 指定 cudaStream,默认值为 null

  • mr – 指定内存资源

template<typename vertex_t, typename edge_t, typename weight_t>
class GraphViewBase
#include <graph.hpp>

图的基类,除了顶点和边。

模板参数:
  • vertex_t – 顶点 ID 类型

  • edge_t – 边 ID 类型

  • weight_t – 权重类型

由以下类继承: cugraph::legacy::GraphCOOView< vertex_t, edge_t, weight_t >, cugraph::legacy::GraphCompressedSparseBaseView< vertex_t, edge_t, weight_t >

公共成员

weight_t *edge_data

边权重

template<typename vertex_t, typename edge_t, typename weight_t>
class GraphCOOView : public cugraph::legacy::GraphViewBase<vertex_t, edge_t, weight_t>
#include <graph.hpp>

存储在 COO (COOrdinate) 格式中的图。

模板参数:
  • vertex_t – 顶点 ID 类型

  • edge_t – 边 ID 类型

  • weight_t – 权重类型

公共函数

inline GraphCOOView()

默认构造函数。

公共成员

vertex_t *src_indices = {nullptr}

行索引

vertex_t *dst_indices = {nullptr}

列索引

template<typename vertex_t, typename edge_t, typename weight_t>
class GraphCompressedSparseBaseView : public cugraph::legacy::GraphViewBase<vertex_t, edge_t, weight_t>
#include <graph.hpp>

存储在 CSR (Compressed Sparse Row) 格式或 CSC (Compressed Sparse Column) 格式中的图的基类。

模板参数:
  • vertex_t – 顶点 ID 类型

  • edge_t – 边 ID 类型

  • weight_t – 权重类型

由以下类继承: cugraph::legacy::GraphCSRView< vertex_t, edge_t, weight_t >

公共成员

edge_t *offsets = {nullptr}

CSR 偏移量。

vertex_t *indices = {nullptr}

CSR 索引。

template<typename vertex_t, typename edge_t, typename weight_t>
class GraphCSRView : public cugraph::legacy::GraphCompressedSparseBaseView<vertex_t, edge_t, weight_t>
#include <graph.hpp>

存储在 CSR (Compressed Sparse Row) 格式中的图。

模板参数:
  • vertex_t – 顶点 ID 类型

  • edge_t – 边 ID 类型

  • weight_t – 权重类型

公共函数

inline GraphCSRView()

默认构造函数。

template<typename vertex_t, typename edge_t, typename weight_t>
struct GraphCOOContents
#include <graph.hpp>

TODO : 更改此处。获取提供的 COO 格式图数组的所有权。

参数 source_indices:

大小为 E(边数)的数组,包含每条边的源顶点索引。索引必须在 [0, V-1] 范围内。

参数 destination_indices:

大小为 E(边数)的数组,包含每条边的目标顶点索引。索引必须在 [0, V-1] 范围内。

参数 edge_data:

大小为 E(边数)的数组,包含每条边的权重。此数组可以为 null,在这种情况下图被视为无权重图。

参数 number_of_vertices:

图中的顶点数

参数 number_of_edges:

图中的边数

template<typename vertex_t, typename edge_t, typename weight_t>
class GraphCOO
#include <graph.hpp>

存储在 COO (COOrdinate) 格式中的已构建图。

此类将包含 src_indices 和 dst_indices (直到被移动)

模板参数:
  • vertex_t – 顶点 ID 类型

  • edge_t – 边 ID 类型

  • weight_t – 权重类型

template<typename vertex_t, typename edge_t, typename weight_t>
class GraphCompressedSparseBase
#include <graph.hpp>

存储在 CSR (Compressed Sparse Row) 格式或 CSC (Compressed Sparse Column) 格式中的已构建图的基类。

模板参数:
  • vertex_t – 顶点 ID 类型

  • edge_t – 边 ID 类型

  • weight_t – 权重类型

由以下类继承: cugraph::legacy::GraphCSR< vertex_t, edge_t, weight_t >

template<typename vertex_t, typename edge_t, typename weight_t>
class GraphCSR : public cugraph::legacy::GraphCompressedSparseBase<vertex_t, edge_t, weight_t>
#include <graph.hpp>

存储在 CSR (Compressed Sparse Row) 格式中的已构建图。

模板参数:
  • vertex_t – 顶点 ID 类型

  • edge_t – 边 ID 类型

  • weight_t – 权重类型