summaryrefslogtreecommitdiff
path: root/src/net_copy.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/net_copy.c')
-rw-r--r--src/net_copy.c35
1 files changed, 0 insertions, 35 deletions
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;
-}
-