Cleanup #48: Move SdagConstruct::numberNodes into each subclass
[charm.git] / src / ck-ldb / tm_tree.h
blob6a209843c09f21312039cc261a673c178821c20f
1 #ifndef __TREE_H__
2 #define __TREE_H__
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
8 typedef struct _tree_t{
9 struct _tree_t **child;
10 struct _tree_t *parent;
11 struct _tree_t *tab_child; /*the pointer to be freed*/
12 double val;
13 int arity;
14 int depth;
15 int id;
16 int uniq;
17 int dumb; /* 1 if the node belongs to a dumb tree: hence has to be freed separately*/
18 }tree_t;
20 /* Maximum number of levels in the tree*/
21 #define MAX_LEVELS 100
23 typedef struct {
24 int *arity; /* arity of the nodes of each level*/
25 int nb_levels; /*number of levels of the tree*/
26 int *nb_nodes; /*nb of nodes of each level*/
27 int **node_id; /*ID of the nodes of the tree for each level*/
28 }tm_topology_t;
32 tree_t * build_tree(double **tab,int N);
33 tree_t * build_tree_from_topology(tm_topology_t *topology,double **tab,int N,double *obj_weight, double *comm_speed);
34 void map_tree(tree_t *,tree_t*);
35 void display_tab(double **tab,int N);
36 double speed(int depth);
37 void set_node(tree_t *node,tree_t ** child, int arity,tree_t *parent,int id,double val,tree_t *deb_tab_child);
38 void free_tree(tree_t *tree);
39 void free_tab_double(double**tab,int N);
40 void free_tab_int(int**tab,int N);
41 void update_val(double **tab,tree_t *parent,int N);
43 typedef struct _group_list_t{
44 struct _group_list_t *next;
45 tree_t **tab;
46 double val;
47 double sum_neighbour;
48 double wg;
49 }group_list_t;
52 typedef struct{
53 int i;
54 int j;
55 double val;
56 }adjacency_t;
59 #ifdef __cplusplus
61 #endif
64 #endif