From ba9074c735f7703974b6c27734680f952e600f55 Mon Sep 17 00:00:00 2001 From: Steven Roberts Date: Wed, 15 May 2024 20:18:03 -0700 Subject: [PATCH] Fix missing statics and dead code identified with -Wmissing-declarations --- .../C_serial/ark_damped_harmonic_symplectic.c | 4 +- .../arkode/C_serial/ark_harmonic_symplectic.h | 6 +- examples/arkode/C_serial/ark_kepler.h | 11 +- src/arkode/arkode_relaxation.c | 4 +- src/arkode/arkode_sprk.c | 24 ++--- src/arkode/arkode_sprkstep_io.c | 15 --- src/ida/ida_ic.c | 2 - src/idas/idas_ic.c | 7 -- src/nvector/manyvector/nvector_manyvector.c | 3 +- src/sundials/sundials_adaptcontroller.c | 17 --- src/sundials/sundials_band.c | 61 ----------- src/sundials/sundials_dense.c | 100 ------------------ src/sundials/sundials_direct.c | 59 ----------- 13 files changed, 27 insertions(+), 286 deletions(-) diff --git a/examples/arkode/C_serial/ark_damped_harmonic_symplectic.c b/examples/arkode/C_serial/ark_damped_harmonic_symplectic.c index 8bfca224ed..ec3b797928 100644 --- a/examples/arkode/C_serial/ark_damped_harmonic_symplectic.c +++ b/examples/arkode/C_serial/ark_damped_harmonic_symplectic.c @@ -157,9 +157,9 @@ int main(int argc, char* argv[]) return 0; } -sunrealtype omega(sunrealtype t) { return cos(t / SUN_RCONST(2.0)); } +static sunrealtype omega(sunrealtype t) { return cos(t / SUN_RCONST(2.0)); } -sunrealtype F(sunrealtype t) { return SUN_RCONST(0.018) * sin(t / PI); } +static sunrealtype F(sunrealtype t) { return SUN_RCONST(0.018) * sin(t / PI); } sunrealtype Hamiltonian(N_Vector yvec, sunrealtype t) { diff --git a/examples/arkode/C_serial/ark_harmonic_symplectic.h b/examples/arkode/C_serial/ark_harmonic_symplectic.h index 816961e6e5..498c4eb0d1 100644 --- a/examples/arkode/C_serial/ark_harmonic_symplectic.h +++ b/examples/arkode/C_serial/ark_harmonic_symplectic.h @@ -34,7 +34,7 @@ typedef struct sunrealtype dt; } ProgramArgs; -void PrintHelp(void) +static void PrintHelp(void) { fprintf(stderr, "ark_harmonic_symplectic: an ARKODE example demonstrating " "the SPRKStep time-stepping module solving a simple harmonic " @@ -48,7 +48,7 @@ void PrintHelp(void) /* clang-format on */ } -int ParseArgs(int argc, char* argv[], ProgramArgs* args) +static int ParseArgs(int argc, char* argv[], ProgramArgs* args) { int argi = 0; @@ -110,7 +110,7 @@ int ParseArgs(int argc, char* argv[], ProgramArgs* args) opt == 2 means function allocates memory so check if returned NULL pointer */ -int check_retval(void* returnvalue, const char* funcname, int opt) +static int check_retval(void* returnvalue, const char* funcname, int opt) { int* retval; diff --git a/examples/arkode/C_serial/ark_kepler.h b/examples/arkode/C_serial/ark_kepler.h index 01f40f26b5..d487347466 100644 --- a/examples/arkode/C_serial/ark_kepler.h +++ b/examples/arkode/C_serial/ark_kepler.h @@ -37,11 +37,12 @@ typedef struct const char* method_name; } ProgramArgs; -int ComputeConvergence(int num_dt, sunrealtype* orders, - sunrealtype expected_order, sunrealtype a11, - sunrealtype a12, sunrealtype a21, sunrealtype a22, - sunrealtype b1, sunrealtype b2, sunrealtype* ord_avg, - sunrealtype* ord_max, sunrealtype* ord_est) +static int ComputeConvergence(int num_dt, sunrealtype* orders, + sunrealtype expected_order, sunrealtype a11, + sunrealtype a12, sunrealtype a21, sunrealtype a22, + sunrealtype b1, sunrealtype b2, + sunrealtype* ord_avg, sunrealtype* ord_max, + sunrealtype* ord_est) { /* Compute/print overall estimated convergence rate */ int i = 0; diff --git a/src/arkode/arkode_relaxation.c b/src/arkode/arkode_relaxation.c index 451fa6711a..b824bbfb9c 100644 --- a/src/arkode/arkode_relaxation.c +++ b/src/arkode/arkode_relaxation.c @@ -336,8 +336,8 @@ static int arkRelaxBrentSolve(ARKodeMem ark_mem) } /* Compute and apply relaxation parameter */ -int arkRelaxSolve(ARKodeMem ark_mem, ARKodeRelaxMem relax_mem, - sunrealtype* relax_val_out) +static int arkRelaxSolve(ARKodeMem ark_mem, ARKodeRelaxMem relax_mem, + sunrealtype* relax_val_out) { int retval; diff --git a/src/arkode/arkode_sprk.c b/src/arkode/arkode_sprk.c index 974228afd1..e48772e12f 100644 --- a/src/arkode/arkode_sprk.c +++ b/src/arkode/arkode_sprk.c @@ -23,7 +23,7 @@ #include "arkode/arkode_butcher.h" #include "arkode_impl.h" -ARKodeSPRKTable ARKodeSymplecticEuler(void) +static ARKodeSPRKTable ARKodeSymplecticEuler(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(1); if (!sprk_table) { return NULL; } @@ -43,7 +43,7 @@ ARKodeSPRKTable ARKodeSymplecticEuler(void) https://doi.org/10.1016/0021-9991(91)90299-Z. */ -ARKodeSPRKTable ARKodeSymplecticLeapfrog2(void) +static ARKodeSPRKTable ARKodeSymplecticLeapfrog2(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(2); if (!sprk_table) { return NULL; } @@ -56,7 +56,7 @@ ARKodeSPRKTable ARKodeSymplecticLeapfrog2(void) return sprk_table; } -ARKodeSPRKTable ARKodeSymplecticPseudoLeapfrog2(void) +static ARKodeSPRKTable ARKodeSymplecticPseudoLeapfrog2(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(2); if (!sprk_table) { return NULL; } @@ -69,7 +69,7 @@ ARKodeSPRKTable ARKodeSymplecticPseudoLeapfrog2(void) return sprk_table; } -ARKodeSPRKTable ARKodeSymplecticCandyRozmus4(void) +static ARKodeSPRKTable ARKodeSymplecticCandyRozmus4(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(4); if (!sprk_table) { return NULL; } @@ -108,7 +108,7 @@ ARKodeSPRKTable ARKodeSymplecticCandyRozmus4(void) https://accelconf.web.cern.ch/p83/PDF/PAC1983_2669.PDF */ -ARKodeSPRKTable ARKodeSymplecticRuth3(void) +static ARKodeSPRKTable ARKodeSymplecticRuth3(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(3); if (!sprk_table) { return NULL; } @@ -130,7 +130,7 @@ ARKodeSPRKTable ARKodeSymplecticRuth3(void) Nonlinearity. 5, 541–562 (1992). https://doi.org/10.1088/0951-7715/5/2/011 */ -ARKodeSPRKTable ARKodeSymplecticMcLachlan2(void) +static ARKodeSPRKTable ARKodeSymplecticMcLachlan2(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(2); if (!sprk_table) { return NULL; } @@ -145,7 +145,7 @@ ARKodeSPRKTable ARKodeSymplecticMcLachlan2(void) return sprk_table; } -ARKodeSPRKTable ARKodeSymplecticMcLachlan3(void) +static ARKodeSPRKTable ARKodeSymplecticMcLachlan3(void) { sunrealtype w = 0.0; sunrealtype y = 0.0; @@ -174,7 +174,7 @@ ARKodeSPRKTable ARKodeSymplecticMcLachlan3(void) return sprk_table; } -ARKodeSPRKTable ARKodeSymplecticMcLachlan4(void) +static ARKodeSPRKTable ARKodeSymplecticMcLachlan4(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(4); if (!sprk_table) { return NULL; } @@ -191,7 +191,7 @@ ARKodeSPRKTable ARKodeSymplecticMcLachlan4(void) return sprk_table; } -ARKodeSPRKTable ARKodeSymplecticMcLachlan5(void) +static ARKodeSPRKTable ARKodeSymplecticMcLachlan5(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(6); if (!sprk_table) { return NULL; } @@ -221,7 +221,7 @@ ARKodeSPRKTable ARKodeSymplecticMcLachlan5(void) */ -ARKodeSPRKTable ARKodeSymplecticYoshida6(void) +static ARKodeSPRKTable ARKodeSymplecticYoshida6(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(8); if (!sprk_table) { return NULL; } @@ -260,7 +260,7 @@ ARKodeSPRKTable ARKodeSymplecticYoshida6(void) */ -ARKodeSPRKTable ARKodeSymplecticSuzukiUmeno816(void) +static ARKodeSPRKTable ARKodeSymplecticSuzukiUmeno816(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(16); if (!sprk_table) { return NULL; } @@ -310,7 +310,7 @@ ARKodeSPRKTable ARKodeSymplecticSuzukiUmeno816(void) */ -ARKodeSPRKTable ARKodeSymplecticSofroniou10(void) +static ARKodeSPRKTable ARKodeSymplecticSofroniou10(void) { ARKodeSPRKTable sprk_table = ARKodeSPRKTable_Alloc(36); if (!sprk_table) { return NULL; } diff --git a/src/arkode/arkode_sprkstep_io.c b/src/arkode/arkode_sprkstep_io.c index f8ccd8bfb2..88378f14ca 100644 --- a/src/arkode/arkode_sprkstep_io.c +++ b/src/arkode/arkode_sprkstep_io.c @@ -414,16 +414,6 @@ int SPRKStepPrintAllStats(void* arkode_mem, FILE* outfile, SUNOutputFormat fmt) return (ARKodePrintAllStats(arkode_mem, outfile, fmt)); } -void SPRKStepPrintMem(void* arkode_mem, FILE* outfile) -{ - ARKodePrintMem(arkode_mem, outfile); -} - -int SPRKStepSetMaxNumConstrFails(void* arkode_mem, int maxfails) -{ - return (ARKodeSetMaxNumConstrFails(arkode_mem, maxfails)); -} - int SPRKStepWriteParameters(void* arkode_mem, FILE* fp) { return (ARKodeWriteParameters(arkode_mem, fp)); @@ -436,11 +426,6 @@ int SPRKStepGetStepStats(void* arkode_mem, long int* nsteps, return (ARKodeGetStepStats(arkode_mem, nsteps, hinused, hlast, hcur, tcur)); } -int SPRKStepGetNumConstrFails(void* arkode_mem, long int* nconstrfails) -{ - return (ARKodeGetNumConstrFails(arkode_mem, nconstrfails)); -} - void SPRKStepFree(void** arkode_mem) { ARKodeFree(arkode_mem); } /*=============================================================== diff --git a/src/ida/ida_ic.c b/src/ida/ida_ic.c index f1a0dacaf0..2d44eab573 100644 --- a/src/ida/ida_ic.c +++ b/src/ida/ida_ic.c @@ -58,8 +58,6 @@ */ extern int IDAInitialSetup(IDAMem IDA_mem); -extern sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, - sunbooleantype mask); static int IDAnlsIC(IDAMem IDA_mem); static int IDANewtonIC(IDAMem IDA_mem); diff --git a/src/idas/idas_ic.c b/src/idas/idas_ic.c index 783a75a3bb..c2f4d030ba 100644 --- a/src/idas/idas_ic.c +++ b/src/idas/idas_ic.c @@ -58,13 +58,6 @@ */ extern int IDAInitialSetup(IDAMem IDA_mem); -extern sunrealtype IDAWrmsNorm(IDAMem IDA_mem, N_Vector x, N_Vector w, - sunbooleantype mask); -extern sunrealtype IDASensWrmsNorm(IDAMem IDA_mem, N_Vector* xS, N_Vector* wS, - sunbooleantype mask); -extern sunrealtype IDASensWrmsNormUpdate(IDAMem IDA_mem, sunrealtype old_nrm, - N_Vector* xS, N_Vector* wS, - sunbooleantype mask); extern int IDASensEwtSet(IDAMem IDA_mem, N_Vector* yScur, N_Vector* weightS); diff --git a/src/nvector/manyvector/nvector_manyvector.c b/src/nvector/manyvector/nvector_manyvector.c index 2785ee7b91..3ce9952a6e 100644 --- a/src/nvector/manyvector/nvector_manyvector.c +++ b/src/nvector/manyvector/nvector_manyvector.c @@ -597,7 +597,8 @@ MPI_Comm N_VGetCommunicator_MPIManyVector(N_Vector v) } #else /* This function retrieves the MPI Communicator from a ManyVector object. */ -SUNComm N_VGetCommunicator_ManyVector(N_Vector v) { return SUN_COMM_NULL; } +//TODO: is this needed? +//SUNComm N_VGetCommunicator_ManyVector(N_Vector v) { return SUN_COMM_NULL; } #endif /* This function retrieves the global length of a ManyVector object. */ diff --git a/src/sundials/sundials_adaptcontroller.c b/src/sundials/sundials_adaptcontroller.c index 39a56480d0..52b3c0b3c5 100644 --- a/src/sundials/sundials_adaptcontroller.c +++ b/src/sundials/sundials_adaptcontroller.c @@ -64,23 +64,6 @@ SUNAdaptController SUNAdaptController_NewEmpty(SUNContext sunctx) return (C); } -/* ----------------------------------------------------------------- - * Free a generic SUNAdaptController (assumes content is already empty) - * ----------------------------------------------------------------- */ - -void SUNAdaptController_DestroyEmpty(SUNAdaptController C) -{ - if (C == NULL) { return; } - - /* free non-NULL ops structure */ - if (C->ops) { free(C->ops); } - C->ops = NULL; - - /* free overall SUNAdaptController object and return */ - free(C); - return; -} - /* ----------------------------------------------------------------- * Required functions in the 'ops' structure for non-NULL controller * ----------------------------------------------------------------- */ diff --git a/src/sundials/sundials_band.c b/src/sundials/sundials_band.c index e8051d80c1..d2a87ad1b4 100644 --- a/src/sundials/sundials_band.c +++ b/src/sundials/sundials_band.c @@ -38,64 +38,33 @@ sunindextype SUNDlsMat_BandGBTRF(SUNDlsMat A, sunindextype* p) return (SUNDlsMat_bandGBTRF(A->cols, A->M, A->mu, A->ml, A->s_mu, p)); } -sunindextype BandGBTRF(SUNDlsMat A, sunindextype* p) -{ - return (SUNDlsMat_bandGBTRF(A->cols, A->M, A->mu, A->ml, A->s_mu, p)); -} - void SUNDlsMat_BandGBTRS(SUNDlsMat A, sunindextype* p, sunrealtype* b) { SUNDlsMat_bandGBTRS(A->cols, A->M, A->s_mu, A->ml, p, b); } -void BandGBTRS(SUNDlsMat A, sunindextype* p, sunrealtype* b) -{ - SUNDlsMat_bandGBTRS(A->cols, A->M, A->s_mu, A->ml, p, b); -} - void SUNDlsMat_BandCopy(SUNDlsMat A, SUNDlsMat B, sunindextype copymu, sunindextype copyml) { SUNDlsMat_bandCopy(A->cols, B->cols, A->M, A->s_mu, B->s_mu, copymu, copyml); } -void BandCopy(SUNDlsMat A, SUNDlsMat B, sunindextype copymu, sunindextype copyml) -{ - SUNDlsMat_bandCopy(A->cols, B->cols, A->M, A->s_mu, B->s_mu, copymu, copyml); -} - void SUNDlsMat_BandScale(sunrealtype c, SUNDlsMat A) { SUNDlsMat_bandScale(c, A->cols, A->M, A->mu, A->ml, A->s_mu); } -void BandScale(sunrealtype c, SUNDlsMat A) -{ - SUNDlsMat_bandScale(c, A->cols, A->M, A->mu, A->ml, A->s_mu); -} - void SUNDlsMat_BandMatvec(SUNDlsMat A, sunrealtype* x, sunrealtype* y) { SUNDlsMat_bandMatvec(A->cols, x, y, A->M, A->mu, A->ml, A->s_mu); } -void BandMatvec(SUNDlsMat A, sunrealtype* x, sunrealtype* y) -{ - SUNDlsMat_bandMatvec(A->cols, x, y, A->M, A->mu, A->ml, A->s_mu); -} - /* * ----------------------------------------------------- * Functions working on sunrealtype** * ----------------------------------------------------- */ -sunindextype bandGBTRF(sunrealtype** a, sunindextype n, sunindextype mu, - sunindextype ml, sunindextype smu, sunindextype* p) -{ - return (SUNDlsMat_bandGBTRF(a, n, mu, ml, smu, p)); -} - sunindextype SUNDlsMat_bandGBTRF(sunrealtype** a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu, sunindextype* p) @@ -212,12 +181,6 @@ sunindextype SUNDlsMat_bandGBTRF(sunrealtype** a, sunindextype n, return (0); } -void bandGBTRS(sunrealtype** a, sunindextype n, sunindextype smu, - sunindextype ml, sunindextype* p, sunrealtype* b) -{ - SUNDlsMat_bandGBTRS(a, n, smu, ml, p, b); -} - void SUNDlsMat_bandGBTRS(sunrealtype** a, sunindextype n, sunindextype smu, sunindextype ml, sunindextype* p, sunrealtype* b) { @@ -252,13 +215,6 @@ void SUNDlsMat_bandGBTRS(sunrealtype** a, sunindextype n, sunindextype smu, } } -void bandCopy(sunrealtype** a, sunrealtype** b, sunindextype n, - sunindextype a_smu, sunindextype b_smu, sunindextype copymu, - sunindextype copyml) -{ - SUNDlsMat_bandCopy(a, b, n, a_smu, b_smu, copymu, copyml); -} - void SUNDlsMat_bandCopy(sunrealtype** a, sunrealtype** b, sunindextype n, sunindextype a_smu, sunindextype b_smu, sunindextype copymu, sunindextype copyml) @@ -276,12 +232,6 @@ void SUNDlsMat_bandCopy(sunrealtype** a, sunrealtype** b, sunindextype n, } } -void bandScale(sunrealtype c, sunrealtype** a, sunindextype n, sunindextype mu, - sunindextype ml, sunindextype smu) -{ - SUNDlsMat_bandScale(c, a, n, mu, ml, smu); -} - void SUNDlsMat_bandScale(sunrealtype c, sunrealtype** a, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu) { @@ -297,11 +247,6 @@ void SUNDlsMat_bandScale(sunrealtype c, sunrealtype** a, sunindextype n, } } -void bandAddIdentity(sunrealtype** a, sunindextype n, sunindextype smu) -{ - SUNDlsMat_bandAddIdentity(a, n, smu); -} - void SUNDlsMat_bandAddIdentity(sunrealtype** a, sunindextype n, sunindextype smu) { sunindextype j; @@ -309,12 +254,6 @@ void SUNDlsMat_bandAddIdentity(sunrealtype** a, sunindextype n, sunindextype smu for (j = 0; j < n; j++) { a[j][smu] += ONE; } } -void bandMatvec(sunrealtype** a, sunrealtype* x, sunrealtype* y, sunindextype n, - sunindextype mu, sunindextype ml, sunindextype smu) -{ - SUNDlsMat_bandMatvec(a, x, y, n, mu, ml, smu); -} - void SUNDlsMat_bandMatvec(sunrealtype** a, sunrealtype* x, sunrealtype* y, sunindextype n, sunindextype mu, sunindextype ml, sunindextype smu) diff --git a/src/sundials/sundials_dense.c b/src/sundials/sundials_dense.c index f022212f9c..4d7366c792 100644 --- a/src/sundials/sundials_dense.c +++ b/src/sundials/sundials_dense.c @@ -38,99 +38,47 @@ sunindextype SUNDlsMat_DenseGETRF(SUNDlsMat A, sunindextype* p) return (SUNDlsMat_denseGETRF(A->cols, A->M, A->N, p)); } -sunindextype DenseGETRF(SUNDlsMat A, sunindextype* p) -{ - return (SUNDlsMat_denseGETRF(A->cols, A->M, A->N, p)); -} - void SUNDlsMat_DenseGETRS(SUNDlsMat A, sunindextype* p, sunrealtype* b) { SUNDlsMat_denseGETRS(A->cols, A->N, p, b); } -void DenseGETRS(SUNDlsMat A, sunindextype* p, sunrealtype* b) -{ - SUNDlsMat_denseGETRS(A->cols, A->N, p, b); -} - sunindextype SUNDlsMat_DensePOTRF(SUNDlsMat A) { return (SUNDlsMat_densePOTRF(A->cols, A->M)); } -sunindextype DensePOTRF(SUNDlsMat A) -{ - return (SUNDlsMat_densePOTRF(A->cols, A->M)); -} - void SUNDlsMat_DensePOTRS(SUNDlsMat A, sunrealtype* b) { SUNDlsMat_densePOTRS(A->cols, A->M, b); } -void DensePOTRS(SUNDlsMat A, sunrealtype* b) -{ - SUNDlsMat_densePOTRS(A->cols, A->M, b); -} - int SUNDlsMat_DenseGEQRF(SUNDlsMat A, sunrealtype* beta, sunrealtype* wrk) { return (SUNDlsMat_denseGEQRF(A->cols, A->M, A->N, beta, wrk)); } -int DenseGEQRF(SUNDlsMat A, sunrealtype* beta, sunrealtype* wrk) -{ - return (SUNDlsMat_denseGEQRF(A->cols, A->M, A->N, beta, wrk)); -} - int SUNDlsMat_DenseORMQR(SUNDlsMat A, sunrealtype* beta, sunrealtype* vn, sunrealtype* vm, sunrealtype* wrk) { return (SUNDlsMat_denseORMQR(A->cols, A->M, A->N, beta, vn, vm, wrk)); } -int DenseORMQR(SUNDlsMat A, sunrealtype* beta, sunrealtype* vn, sunrealtype* vm, - sunrealtype* wrk) -{ - return (SUNDlsMat_denseORMQR(A->cols, A->M, A->N, beta, vn, vm, wrk)); -} - void SUNDlsMat_DenseCopy(SUNDlsMat A, SUNDlsMat B) { SUNDlsMat_denseCopy(A->cols, B->cols, A->M, A->N); } -void DenseCopy(SUNDlsMat A, SUNDlsMat B) -{ - SUNDlsMat_denseCopy(A->cols, B->cols, A->M, A->N); -} - void SUNDlsMat_DenseScale(sunrealtype c, SUNDlsMat A) { SUNDlsMat_denseScale(c, A->cols, A->M, A->N); } -void DenseScale(sunrealtype c, SUNDlsMat A) -{ - SUNDlsMat_denseScale(c, A->cols, A->M, A->N); -} - void SUNDlsMat_DenseMatvec(SUNDlsMat A, sunrealtype* x, sunrealtype* y) { SUNDlsMat_denseMatvec(A->cols, x, y, A->M, A->N); } -void DenseMatvec(SUNDlsMat A, sunrealtype* x, sunrealtype* y) -{ - SUNDlsMat_denseMatvec(A->cols, x, y, A->M, A->N); -} - -sunindextype denseGETRF(sunrealtype** a, sunindextype m, sunindextype n, - sunindextype* p) -{ - return (SUNDlsMat_denseGETRF(a, m, n, p)); -} - sunindextype SUNDlsMat_denseGETRF(sunrealtype** a, sunindextype m, sunindextype n, sunindextype* p) { @@ -199,11 +147,6 @@ sunindextype SUNDlsMat_denseGETRF(sunrealtype** a, sunindextype m, return (0); } -void denseGETRS(sunrealtype** a, sunindextype n, sunindextype* p, sunrealtype* b) -{ - SUNDlsMat_denseGETRS(a, n, p, b); -} - void SUNDlsMat_denseGETRS(sunrealtype** a, sunindextype n, sunindextype* p, sunrealtype* b) { @@ -246,11 +189,6 @@ void SUNDlsMat_denseGETRS(sunrealtype** a, sunindextype n, sunindextype* p, * the lower triangle of C. */ -sunindextype densePOTRF(sunrealtype** a, sunindextype m) -{ - return (SUNDlsMat_densePOTRF(a, m)); -} - sunindextype SUNDlsMat_densePOTRF(sunrealtype** a, sunindextype m) { sunrealtype *a_col_j, *a_col_k; @@ -289,11 +227,6 @@ sunindextype SUNDlsMat_densePOTRF(sunrealtype** a, sunindextype m) * */ -void densePOTRS(sunrealtype** a, sunindextype m, sunrealtype* b) -{ - SUNDlsMat_densePOTRS(a, m, b); -} - void SUNDlsMat_densePOTRS(sunrealtype** a, sunindextype m, sunrealtype* b) { sunrealtype *col_j, *col_i; @@ -334,12 +267,6 @@ void SUNDlsMat_densePOTRS(sunrealtype** a, sunindextype m, sunrealtype* b) * */ -int denseGEQRF(sunrealtype** a, sunindextype m, sunindextype n, - sunrealtype* beta, sunrealtype* v) -{ - return (SUNDlsMat_denseGEQRF(a, m, n, beta, v)); -} - int SUNDlsMat_denseGEQRF(sunrealtype** a, sunindextype m, sunindextype n, sunrealtype* beta, sunrealtype* v) { @@ -404,12 +331,6 @@ int SUNDlsMat_denseGEQRF(sunrealtype** a, sunindextype m, sunindextype n, * v (of length m) must be provided as workspace. */ -int denseORMQR(sunrealtype** a, sunindextype m, sunindextype n, sunrealtype* beta, - sunrealtype* vn, sunrealtype* vm, sunrealtype* v) -{ - return (SUNDlsMat_denseORMQR(a, m, n, beta, vn, vm, v)); -} - int SUNDlsMat_denseORMQR(sunrealtype** a, sunindextype m, sunindextype n, sunrealtype* beta, sunrealtype* vn, sunrealtype* vm, sunrealtype* v) @@ -441,11 +362,6 @@ int SUNDlsMat_denseORMQR(sunrealtype** a, sunindextype m, sunindextype n, return (0); } -void denseCopy(sunrealtype** a, sunrealtype** b, sunindextype m, sunindextype n) -{ - SUNDlsMat_denseCopy(a, b, m, n); -} - void SUNDlsMat_denseCopy(sunrealtype** a, sunrealtype** b, sunindextype m, sunindextype n) { @@ -460,11 +376,6 @@ void SUNDlsMat_denseCopy(sunrealtype** a, sunrealtype** b, sunindextype m, } } -void denseScale(sunrealtype c, sunrealtype** a, sunindextype m, sunindextype n) -{ - SUNDlsMat_denseScale(c, a, m, n); -} - void SUNDlsMat_denseScale(sunrealtype c, sunrealtype** a, sunindextype m, sunindextype n) { @@ -478,11 +389,6 @@ void SUNDlsMat_denseScale(sunrealtype c, sunrealtype** a, sunindextype m, } } -void denseAddIdentity(sunrealtype** a, sunindextype n) -{ - SUNDlsMat_denseAddIdentity(a, n); -} - void SUNDlsMat_denseAddIdentity(sunrealtype** a, sunindextype n) { sunindextype i; @@ -490,12 +396,6 @@ void SUNDlsMat_denseAddIdentity(sunrealtype** a, sunindextype n) for (i = 0; i < n; i++) { a[i][i] += ONE; } } -void denseMatvec(sunrealtype** a, sunrealtype* x, sunrealtype* y, - sunindextype m, sunindextype n) -{ - SUNDlsMat_denseMatvec(a, x, y, m, n); -} - void SUNDlsMat_denseMatvec(sunrealtype** a, sunrealtype* x, sunrealtype* y, sunindextype m, sunindextype n) { diff --git a/src/sundials/sundials_direct.c b/src/sundials/sundials_direct.c index 2bf135b9d3..02ff31d96c 100644 --- a/src/sundials/sundials_direct.c +++ b/src/sundials/sundials_direct.c @@ -23,11 +23,6 @@ #define ZERO SUN_RCONST(0.0) #define ONE SUN_RCONST(1.0) -SUNDlsMat NewDenseMat(sunindextype M, sunindextype N) -{ - return (SUNDlsMat_NewDenseMat(M, N)); -} - SUNDlsMat SUNDlsMat_NewDenseMat(sunindextype M, sunindextype N) { SUNDlsMat A; @@ -68,11 +63,6 @@ SUNDlsMat SUNDlsMat_NewDenseMat(sunindextype M, sunindextype N) return (A); } -sunrealtype** newDenseMat(sunindextype m, sunindextype n) -{ - return (SUNDlsMat_newDenseMat(m, n)); -} - sunrealtype** SUNDlsMat_newDenseMat(sunindextype m, sunindextype n) { sunindextype j; @@ -98,12 +88,6 @@ sunrealtype** SUNDlsMat_newDenseMat(sunindextype m, sunindextype n) return (a); } -SUNDlsMat NewBandMat(sunindextype N, sunindextype mu, sunindextype ml, - sunindextype smu) -{ - return (SUNDlsMat_NewBandMat(N, mu, ml, smu)); -} - SUNDlsMat SUNDlsMat_NewBandMat(sunindextype N, sunindextype mu, sunindextype ml, sunindextype smu) { @@ -151,11 +135,6 @@ SUNDlsMat SUNDlsMat_NewBandMat(sunindextype N, sunindextype mu, sunindextype ml, return (A); } -sunrealtype** newBandMat(sunindextype n, sunindextype smu, sunindextype ml) -{ - return (SUNDlsMat_newBandMat(n, smu, ml)); -} - sunrealtype** SUNDlsMat_newBandMat(sunindextype n, sunindextype smu, sunindextype ml) { @@ -183,8 +162,6 @@ sunrealtype** SUNDlsMat_newBandMat(sunindextype n, sunindextype smu, return (a); } -void DestroyMat(SUNDlsMat A) { SUNDlsMat_DestroyMat(A); } - void SUNDlsMat_DestroyMat(SUNDlsMat A) { free(A->data); @@ -194,8 +171,6 @@ void SUNDlsMat_DestroyMat(SUNDlsMat A) A = NULL; } -void destroyMat(sunrealtype** a) { SUNDlsMat_destroyMat(a); } - void SUNDlsMat_destroyMat(sunrealtype** a) { free(a[0]); @@ -204,8 +179,6 @@ void SUNDlsMat_destroyMat(sunrealtype** a) a = NULL; } -int* NewIntArray(int N) { return (SUNDlsMat_NewIntArray(N)); } - int* SUNDlsMat_NewIntArray(int N) { int* vec; @@ -218,8 +191,6 @@ int* SUNDlsMat_NewIntArray(int N) return (vec); } -int* newIntArray(int N) { return (SUNDlsMat_newIntArray(N)); } - int* SUNDlsMat_newIntArray(int n) { int* v; @@ -232,11 +203,6 @@ int* SUNDlsMat_newIntArray(int n) return (v); } -sunindextype* NewIndexArray(sunindextype N) -{ - return (SUNDlsMat_NewIndexArray(N)); -} - sunindextype* SUNDlsMat_NewIndexArray(sunindextype N) { sunindextype* vec; @@ -249,11 +215,6 @@ sunindextype* SUNDlsMat_NewIndexArray(sunindextype N) return (vec); } -sunindextype* newIndexArray(sunindextype n) -{ - return (SUNDlsMat_newIndexArray(n)); -} - sunindextype* SUNDlsMat_newIndexArray(sunindextype n) { sunindextype* v; @@ -266,11 +227,6 @@ sunindextype* SUNDlsMat_newIndexArray(sunindextype n) return (v); } -sunrealtype* NewRealArray(sunindextype N) -{ - return (SUNDlsMat_NewRealArray(N)); -} - sunrealtype* SUNDlsMat_NewRealArray(sunindextype N) { sunrealtype* vec; @@ -283,11 +239,6 @@ sunrealtype* SUNDlsMat_NewRealArray(sunindextype N) return (vec); } -sunrealtype* newRealArray(sunindextype N) -{ - return (SUNDlsMat_newRealArray(N)); -} - sunrealtype* SUNDlsMat_newRealArray(sunindextype m) { sunrealtype* v; @@ -300,24 +251,18 @@ sunrealtype* SUNDlsMat_newRealArray(sunindextype m) return (v); } -void DestroyArray(void* p) { SUNDlsMat_DestroyArray(p); } - void SUNDlsMat_DestroyArray(void* V) { free(V); V = NULL; } -void destroyArray(void* p) { SUNDlsMat_destroyArray(p); } - void SUNDlsMat_destroyArray(void* v) { free(v); v = NULL; } -void AddIdentity(SUNDlsMat A) { SUNDlsMat_AddIdentity(A); } - void SUNDlsMat_AddIdentity(SUNDlsMat A) { sunindextype i; @@ -334,8 +279,6 @@ void SUNDlsMat_AddIdentity(SUNDlsMat A) } } -void SetToZero(SUNDlsMat A) { SUNDlsMat_SetToZero(A); } - void SUNDlsMat_SetToZero(SUNDlsMat A) { sunindextype i, j, colSize; @@ -366,8 +309,6 @@ void SUNDlsMat_SetToZero(SUNDlsMat A) } } -void PrintMat(SUNDlsMat A, FILE* outfile) { SUNDlsMat_PrintMat(A, outfile); } - void SUNDlsMat_PrintMat(SUNDlsMat A, FILE* outfile) { sunindextype i, j, start, finish;