summaryrefslogtreecommitdiff
path: root/src/update_factor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/update_factor.c')
-rw-r--r--src/update_factor.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/update_factor.c b/src/update_factor.c
deleted file mode 100644
index debfe7b..0000000
--- a/src/update_factor.c
+++ /dev/null
@@ -1,44 +0,0 @@
-
-#include "fracture.h"
-
-bool update_factor(cholmod_factor *factor, unsigned int v1, unsigned int v2,
- cholmod_common *c) {
- int n = factor->n;
- assert(v1 < n);
- assert(v2 < n);
-
- cholmod_sparse *update_mat =
- CHOL_F(allocate_sparse)(n, n, 2, true, true, 0, CHOLMOD_REAL, c);
-
- unsigned int v3, v4;
- v3 = v1 < v2 ? v1 : v2;
- v4 = v1 > v2 ? v1 : v2;
-
- for (int i = 0; i < n; i++) {
- if (i <= v3)
- ((int_t *)update_mat->p)[i] = 0;
- else
- ((int_t *)update_mat->p)[i] = 2;
- }
- ((int_t *)update_mat->p)[n] = 2;
- ((int_t *)update_mat->i)[0] = v3;
- ((int_t *)update_mat->i)[1] = v4;
- ((double *)update_mat->x)[0] = 1;
- ((double *)update_mat->x)[1] = -1;
-
- // assert(CHOL_F(check_sparse)(update_mat, c));
-
- cholmod_sparse *perm_update_mat = CHOL_F(submatrix)(
- update_mat, factor->Perm, factor->n, NULL, -1, true, true, c);
-
- // assert(CHOL_F(check_sparse)(perm_update_mat, c));
-
- CHOL_F(updown)(false, perm_update_mat, factor, c);
-
- // assert(CHOL_F(check_factor)(factor, c));
-
- CHOL_F(free_sparse)(&perm_update_mat, c);
- CHOL_F(free_sparse)(&update_mat, c);
-
- return true;
-}