geometry_op.h 1.45 KB
Newer Older
1
/**
2
 *  Copyright (c) 2019 by Contributors
3
4
 * @file geometry/geometry_op.h
 * @brief Geometry operator templates
5
6
7
8
9
10
11
12
13
14
 */
#ifndef DGL_GEOMETRY_GEOMETRY_OP_H_
#define DGL_GEOMETRY_GEOMETRY_OP_H_

#include <dgl/array.h>

namespace dgl {
namespace geometry {
namespace impl {

15
template <DGLDeviceType XPU, typename FloatType, typename IdType>
16
17
18
void FarthestPointSampler(
    NDArray array, int64_t batch_size, int64_t sample_points, NDArray dist,
    IdArray start_idx, IdArray result);
19

20
/** @brief Implementation of weighted neighbor matching process of edge
21
22
23
24
 * coarsening used in Metis and Graclus for homogeneous graph coarsening. This
 * procedure keeps picking an unmarked vertex and matching it with one its
 * unmarked neighbors (that maximizes its edge weight) until no match can be
 * done.
25
 */
26
template <DGLDeviceType XPU, typename FloatType, typename IdType>
27
28
void WeightedNeighborMatching(
    const aten::CSRMatrix &csr, const NDArray weight, IdArray result);
29

30
/** @brief Implementation of neighbor matching process of edge coarsening used
31
32
33
34
 * in Metis and Graclus for homogeneous graph coarsening. This procedure keeps
 * picking an unmarked vertex and matching it with one its unmarked neighbors
 * (that maximizes its edge weight) until no match can be done.
 */
35
template <DGLDeviceType XPU, typename IdType>
36
37
void NeighborMatching(const aten::CSRMatrix &csr, IdArray result);

38
39
40
41
42
}  // namespace impl
}  // namespace geometry
}  // namespace dgl

#endif  // DGL_GEOMETRY_GEOMETRY_OP_H_