00001 #ifndef __TREE_H__
00002 #define __TREE_H__
00003
00004 #ifdef __cplusplus
00005 extern "C" {
00006 #endif
00007
00008 typedef struct _tree_t{
00009 struct _tree_t **child;
00010 struct _tree_t *parent;
00011 struct _tree_t *tab_child;
00012 double val;
00013 int arity;
00014 int depth;
00015 int id;
00016 int uniq;
00017 int dumb;
00018 }tree_t;
00019
00020
00021 #define MAX_LEVELS 100
00022
00023 typedef struct {
00024 int *arity;
00025 int nb_levels;
00026 int *nb_nodes;
00027 int **node_id;
00028 }tm_topology_t;
00029
00030
00031
00032 tree_t * build_tree(double **tab,int N);
00033 tree_t * build_tree_from_topology(tm_topology_t *topology,double **tab,int N,double *obj_weight, double *comm_speed);
00034 void map_tree(tree_t *,tree_t*);
00035 void display_tab(double **tab,int N);
00036 double speed(int depth);
00037 void set_node(tree_t *node,tree_t ** child, int arity,tree_t *parent,int id,double val,tree_t *deb_tab_child);
00038 void free_tree(tree_t *tree);
00039 void free_tab_double(double**tab,int N);
00040 void free_tab_int(int**tab,int N);
00041 void update_val(double **tab,tree_t *parent,int N);
00042
00043 typedef struct _group_list_t{
00044 struct _group_list_t *next;
00045 tree_t **tab;
00046 double val;
00047 double sum_neighbour;
00048 double wg;
00049 }group_list_t;
00050
00051
00052 typedef struct{
00053 int i;
00054 int j;
00055 double val;
00056 }adjacency_t;
00057
00058
00059 #ifdef __cplusplus
00060 }
00061 #endif
00062
00063
00064 #endif
00065