1#ifndef SCRAN_GRAPH_CLUSTER_CLUSTER_LEIDEN_HPP
2#define SCRAN_GRAPH_CLUSTER_CLUSTER_LEIDEN_HPP
7#include "raiigraph/raiigraph.hpp"
97 raiigraph::RNGScope rngs(options.
seed);
100 output.
status = igraph_community_leiden(
115 raiigraph::RealVector strengths(igraph_vcount(graph));
116 igraph_strength(graph, strengths, igraph_vss_all(), IGRAPH_ALL, 1, weights);
118 double total_weights = igraph_vector_sum(strengths);
119 double mod_resolution = options.
resolution / total_weights;
121 output.
status = igraph_community_leiden(
148 igraph_vector_t weight_view;
149 igraph_vector_view(&weight_view, weights.data(), weights.size());
Graph-based clustering of single-cell data.
Definition build_snn_graph.hpp:21
void cluster_leiden(const igraph_t *graph, const igraph_vector_t *weights, const ClusterLeidenOptions &options, ClusterLeidenResults &output)
Definition cluster_leiden.hpp:93
Options for cluster_leiden().
Definition cluster_leiden.hpp:20
int seed
Definition cluster_leiden.hpp:56
bool modularity
Definition cluster_leiden.hpp:46
double beta
Definition cluster_leiden.hpp:32
double resolution
Definition cluster_leiden.hpp:26
bool report_quality
Definition cluster_leiden.hpp:51
int iterations
Definition cluster_leiden.hpp:39
Result of cluster_leiden().
Definition cluster_leiden.hpp:62
int status
Definition cluster_leiden.hpp:67
igraph_real_t quality
Definition cluster_leiden.hpp:78
raiigraph::IntegerVector membership
Definition cluster_leiden.hpp:72