From 03de79b8c5ebcc206e3450dfbc701211d9c254b0 Mon Sep 17 00:00:00 2001 From: pants Date: Fri, 9 Sep 2016 14:33:56 -0400 Subject: more refactoring --- src/net_copy.c | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 src/net_copy.c (limited to 'src/net_copy.c') diff --git a/src/net_copy.c b/src/net_copy.c deleted file mode 100644 index dcb4080..0000000 --- a/src/net_copy.c +++ /dev/null @@ -1,35 +0,0 @@ - -#include "fracture.h" - -net_t *net_copy(const net_t *net, cholmod_common *c) { - net_t *net_copy = (net_t *)calloc(1, sizeof(net_t)); - assert(net_copy != NULL); - memcpy(net_copy, net, sizeof(net_t)); - - size_t fuses_size = (net->graph)->ne * sizeof(bool); - net_copy->fuses = (bool *)malloc(fuses_size); - assert(net_copy->fuses != NULL); - memcpy(net_copy->fuses, net->fuses, fuses_size); - - size_t thres_size = (net->graph)->ne * sizeof(double); - net_copy->thres = (double *)malloc(thres_size); - assert(net_copy->thres != NULL); - memcpy(net_copy->thres, net->thres, thres_size); - - size_t marks_size = (net->graph->break_dim) * sizeof(uint_t); - net_copy->marks = (uint_t *)malloc(marks_size); - assert(net_copy->marks != NULL); - memcpy(net_copy->marks, net->marks, marks_size); - - size_t dual_marks_size = (net->graph->dnv) * sizeof(uint_t); - net_copy->dual_marks = (uint_t *)malloc(dual_marks_size); - assert(net_copy->dual_marks != NULL); - memcpy(net_copy->dual_marks, net->dual_marks, dual_marks_size); - - net_copy->adjacency = CHOL_F(copy_sparse)(net->adjacency, c); - net_copy->boundary_cond = CHOL_F(copy_dense)(net->boundary_cond, c); - net_copy->factor = CHOL_F(copy_factor)(net->factor, c); - - return net_copy; -} - -- cgit v1.2.3-70-g09d2