From caea28b2fbced7fbc65a2313745df21846e3b9d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Tue, 10 Aug 2010 07:51:22 +0000 Subject: [PATCH] Make assembling and solving the global system contingent upon pre-processor macro ASSEMBLE_AND_SOLVE_UMFPACK being defined and non-zero. --- mex_schur_comp_symm.c | 36 +++++++++++++++++++++--------------- mex_schur_comp_symm.m | 1 + 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/mex_schur_comp_symm.c b/mex_schur_comp_symm.c index d057b945..0d115780 100644 --- a/mex_schur_comp_symm.c +++ b/mex_schur_comp_symm.c @@ -1,7 +1,6 @@ #include -#include "mex.h" -#include "matrix.h" +#include #define MAT_SIZE_T mwSignedIndex #include "call_umfpack.h" @@ -126,6 +125,8 @@ get_nconn(const mxArray *M_nconn, int *nconn) } } + +#if defined(ASSEMBLE_AND_SOLVE_UMFPACK) && ASSEMBLE_AND_SOLVE_UMFPACK /* ---------------------------------------------------------------------- */ static void get_conn(const mxArray *M_conn, int *conn) @@ -154,15 +155,15 @@ static int get_number_of_faces(int nc, int *nconn, int *conn) /* ---------------------------------------------------------------------- */ { - int N = 0; - int i; + int N, i, nf; + N = 0; for (i=0; ir, &A, &b); -#if 0 - double *x = malloc(A.n * sizeof *x); + x = malloc(A.n * sizeof *x); callMWUMFPACK(A.n, A.ia, A.ja, A.sa, b, x); - int i;for(i=0; ir, ncf_tot * sizeof *ptr); @@ -252,6 +259,5 @@ mexFunction(int nlhs, mxArray *plhs[], hybsys_free(sys); deallocate_aux_arrays(nconn, src, gflux); - mxFree(conn); } } diff --git a/mex_schur_comp_symm.m b/mex_schur_comp_symm.m index 488c077b..2369248f 100644 --- a/mex_schur_comp_symm.m +++ b/mex_schur_comp_symm.m @@ -63,6 +63,7 @@ function varargout = mex_schur_comp_symm(varargin) -Wno-conversion -Wchar-subscripts -Wredundant-decls" ... ... -O -largeArrayDims -DCOMPILING_FOR_MATLAB=1 ... + -DASSEMBLE_AND_SOLVE_UMFPACK=0 ... -I/work/include/SuiteSparse/ ... -I/usr/include/suitesparse/ ... ...