1
// The graph class contains the methods necessary to draw the
2
// graph. It calls on the density server class to obtain
3
// position and density information
5
#include "DensityGrid.h"
10
// layout schedule information
11
struct layout_schedule {
24
void init_parms ( int rand_seed, float edge_cut, float real_parm );
25
void init_parms ( const igraph_layout_drl_options_t *options );
26
void read_parms ( char *parms_file );
27
void read_real ( char *real_file );
28
int read_real ( const igraph_matrix_t *real_mat,
29
const igraph_vector_bool_t *fixed);
30
void scan_int ( char *filename );
31
void read_int ( char *file_name );
32
void draw_graph ( int int_out, char *coord_file );
33
int draw_graph (igraph_matrix_t *res);
34
void write_coord ( const char *file_name );
35
void write_sim ( const char *file_name );
36
float get_tot_energy ( );
39
graph( int proc_id, int tot_procs, char *int_file );
41
graph( const igraph_t *igraph,
42
const igraph_layout_drl_options_t *options,
43
const igraph_vector_t *weights);
49
void update_nodes ( );
50
float Compute_Node_Energy ( int node_ind );
51
void Solve_Analytic ( int node_ind, float &pos_x, float &pos_y );
52
void get_positions ( vector<int> &node_indices, float return_positions[2*MAX_PROCS] );
53
void update_density ( vector<int> &node_indices,
54
float old_positions[2*MAX_PROCS],
55
float new_positions[2*MAX_PROCS] );
56
void update_node_pos ( int node_ind,
57
float old_positions[2*MAX_PROCS],
58
float new_positions[2*MAX_PROCS] );
63
// graph decomposition information
64
int num_nodes; // number of nodes in graph
65
float highest_sim; // highest sim for normalization
66
map <int, int> id_catalog; // id_catalog[file id] = internal id
67
map <int, map <int, float> > neighbors; // neighbors of nodes on this proc.
69
// graph layout information
70
vector<Node> positions;
71
DensityGrid density_server;
73
// original VxOrd information
74
int STAGE, iterations;
75
float temperature, attraction, damping_mult;
76
float min_edges, CUT_END, cut_length_end, cut_off_length, cut_rate;
77
bool first_add, fine_first_add, fineDensity;
79
// scheduling variables
80
layout_schedule liquid;
81
layout_schedule expansion;
82
layout_schedule cooldown;
83
layout_schedule crunch;
84
layout_schedule simmer;
87
time_t start_time, stop_time;
89
// online clustering information
90
int real_iterations; // number of iterations to hold .real input fixed
92
int tot_expected_iterations; // for progress bar