From 03de79b8c5ebcc206e3450dfbc701211d9c254b0 Mon Sep 17 00:00:00 2001 From: pants Date: Fri, 9 Sep 2016 14:33:56 -0400 Subject: more refactoring --- src/update_factor.c | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 src/update_factor.c (limited to 'src/update_factor.c') 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; -} -- cgit v1.2.3-70-g09d2