From 4c4ebb87ead363d6d6e11a8b95b07a0f93af5c88 Mon Sep 17 00:00:00 2001 From: pants Date: Tue, 6 Sep 2016 15:05:27 -0400 Subject: finished implementing embedded systems, refactored a bunch --- src/course_grain_square.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/course_grain_square.c') diff --git a/src/course_grain_square.c b/src/course_grain_square.c index 9035cf7..9c9ca6e 100644 --- a/src/course_grain_square.c +++ b/src/course_grain_square.c @@ -63,11 +63,11 @@ int main(int argc, char *argv[]) { (&c)->supernodal = CHOLMOD_SIMPLICIAL; } - fnet *network = ini_square_network(width, periodic, false, &c); - fnet *network_p = ini_square_network(width / 2, periodic, false, &c); - finst *perm_instance = create_instance(network, inf, voltage_bound, true, &c); - unsigned int c_dist_size = network->num_dual_verts; - unsigned int c_p_dist_size = network_p->num_dual_verts; + graph_t *network = ini_square_network(width, periodic, false, &c); + graph_t *network_p = ini_square_network(width / 2, periodic, false, &c); + net_t *perm_instance = create_instance(network, inf, voltage_bound, true, &c); + unsigned int c_dist_size = network->dnv; + unsigned int c_p_dist_size = network_p->dnv; // define arrays for saving cluster and avalanche distributions unsigned int *cluster_size_dist = @@ -80,11 +80,11 @@ int main(int argc, char *argv[]) { printf("\033[F\033[JCOURSEGRAIN_SQUARE: %0*d / %d\n", (int)log10(num) + 1, DUMB + 1, num); - break_data *breaking_data = NULL; - finst *instance = NULL; + data_t *breaking_data = NULL; + net_t *instance = NULL; while (breaking_data == NULL) { double *fuse_thres = gen_fuse_thres( - network->num_edges, network->edge_coords, beta, beta_scaling_flat); + network->ne, network->edge_coords, beta, beta_scaling_flat); instance = copy_instance(perm_instance, &c); breaking_data = fracture_network(instance, fuse_thres, &c, cutoff); free_instance(instance, &c); @@ -104,22 +104,22 @@ int main(int argc, char *argv[]) { break; } - finst *tmp_instance = copy_instance(perm_instance, &c); + net_t *tmp_instance = copy_instance(perm_instance, &c); for (unsigned int i = 0; i < breaking_data->num_broken; i++) { break_edge(tmp_instance, breaking_data->break_list[i], &c); } unsigned int *tmp_cluster_dist = get_cluster_dist(tmp_instance, &c); - for (unsigned int i = 0; i < network->num_dual_verts; i++) { + for (unsigned int i = 0; i < network->dnv; i++) { cluster_size_dist[i] += tmp_cluster_dist[i]; } free(tmp_cluster_dist); - finst *instance_p = coursegrain_square(tmp_instance, network_p, &c); + net_t *instance_p = coursegrain_square(tmp_instance, network_p, &c); unsigned int *tmp_cluster_p_dist = get_cluster_dist(instance_p, &c); - for (unsigned int i = 0; i < network_p->num_dual_verts; i++) { + for (unsigned int i = 0; i < network_p->dnv; i++) { cluster_p_size_dist[i] += tmp_cluster_p_dist[i]; } free(tmp_cluster_p_dist); @@ -159,8 +159,8 @@ int main(int argc, char *argv[]) { free(cluster_size_dist); free(cluster_p_size_dist); free_instance(perm_instance, &c); - free_fnet(network, &c); - free_fnet(network_p, &c); + free_net(network, &c); + free_net(network_p, &c); CHOL_F(finish)(&c); -- cgit v1.2.3-70-g09d2