scran_graph_cluster
Graph-based clustering of cells
Loading...
Searching...
No Matches
edges_to_graph.hpp
Go to the documentation of this file.
1#ifndef SCRAN_GRAPH_CLUSTER_EDGES_TO_GRAPH_HPP
2#define SCRAN_GRAPH_CLUSTER_EDGES_TO_GRAPH_HPP
3
4#include "raiigraph/raiigraph.hpp"
5#include "igraph.h"
6
12namespace scran_graph_cluster {
13
29template<typename Vertex_>
30raiigraph::Graph edges_to_graph(size_t double_edges, const Vertex_* edges, size_t num_vertices, igraph_bool_t directed) {
31 if constexpr(std::is_same<Vertex_, igraph_integer_t>::value) {
34 return raiigraph::Graph(&edge_view, num_vertices, directed);
35 } else {
36 raiigraph::IntegerVector tmp(double_edges);
37 auto& payload = *(tmp.get());
38 for (size_t x = 0; x < double_edges; ++x) {
39 VECTOR(payload)[x] = edges[x];
40 }
41 return raiigraph::Graph(tmp, num_vertices, directed);
42 }
43}
44
45}
46
47#endif
Graph-based clustering of single-cell data.
Definition build_snn_graph.hpp:20
raiigraph::Graph edges_to_graph(size_t double_edges, const Vertex_ *edges, size_t num_vertices, igraph_bool_t directed)
Definition edges_to_graph.hpp:30
void build_snn_graph(size_t num_cells, GetNeighbors_ get_neighbors, GetIndex_ get_index, const BuildSnnGraphOptions &options, BuildSnnGraphResults< Node_, Weight_ > &output)
Definition build_snn_graph.hpp:133