-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexploring_rnni.h
37 lines (30 loc) · 1.49 KB
/
exploring_rnni.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef EXPLORINGRNNI_H_
#define EXPLORINGRNNI_H_
#include "rnni.h"
// Random walk of length k starting at `tree` choosing neighbour uniformly in
// every step
long random_walk_distance(Tree* tree, long k);
// updates every tree in tree_array to the tree after one iteration of findpath:
// decreases the mrca of node1 and node2 in every tree until it has rank r
int first_iteration_fp(Tree_Array* tree_array, long node1, long node2, long r);
// sum of squared distances of all trees in tree_array to focal_tree
long sos(Tree_Array* tree_array, Tree* focal_tree);
// returns array with rank(mrca_{tree1}(C_i)) at position i where C_i is the
// cluster induced by node of rank i in tree2
long* mrca_array(Tree* tree1, Tree* tree2);
// Sum of differences of ranks of mrcas of all clusters of tree2 between tree1
// and tree2.
// Also add differences for parents of leaves if include_leaf_parents == 1
long mrca_differences(Tree* current_tree,
Tree* dest_tree,
int include_leaf_parents);
// return binary matrix with rows representing clusters, columns leaves:
// 0 if leaf is not in cluster, 1 if it is in cluster
long** get_clusters(Tree* tree);
// Computes sum of sizes of symmetric differences of clusters of tree1 and tree2
// for all ranks i=1,..,n-1
long sum_symmetric_cluster_diff(Tree* tree1, Tree* tree2);
// Compute symmetric difference of clusters induced by nodes of rank k in tree1
// and tree2
long symmetric_cluster_diff(Tree* tree1, Tree* tree2, long k);
#endif