Skip to content

Commit

Permalink
Cleanup unused includes (#2217)
Browse files Browse the repository at this point in the history
+clang-format
  • Loading branch information
dweindl authored Dec 1, 2023
1 parent b0eedd9 commit fbb2936
Show file tree
Hide file tree
Showing 22 changed files with 8 additions and 39 deletions.
1 change: 0 additions & 1 deletion include/amici/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#endif

#include <cmath>
#include <functional>

/* Math constants in case _USE_MATH_DEFINES is not supported */
#if defined(_USE_MATH_DEFINES)
Expand Down
5 changes: 2 additions & 3 deletions include/amici/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include <algorithm>
#include <ctime>
#include <functional>
#include <memory>
#include <regex>
#include <vector>

Expand Down Expand Up @@ -291,7 +290,7 @@ class CpuTimer {
return d_milliseconds(clock::now() - start_).count();
}

static const bool uses_thread_clock = true;
static bool const uses_thread_clock = true;

private:
/** Start time */
Expand Down Expand Up @@ -330,7 +329,7 @@ class CpuTimer {
/ CLOCKS_PER_SEC;
}

static const bool uses_thread_clock = false;
static bool const uses_thread_clock = false;

private:
/** Start time */
Expand Down
1 change: 0 additions & 1 deletion include/amici/model_dae.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <sunmatrix/sunmatrix_sparse.h>

#include <numeric>
#include <utility>
#include <vector>

namespace amici {
Expand Down
1 change: 0 additions & 1 deletion include/amici/model_ode.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include <sunmatrix/sunmatrix_dense.h>
#include <sunmatrix/sunmatrix_sparse.h>

#include <utility>
#include <vector>

namespace amici {
Expand Down
5 changes: 1 addition & 4 deletions include/amici/serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
#include "amici/solver.h"
#include "amici/solver_cvodes.h"

#include <cassert>
#include <chrono>
#include <fstream>
#include <iostream>

#include <boost/archive/binary_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
Expand All @@ -35,7 +32,7 @@ template <class Archive, typename T>
void archiveVector(Archive& ar, T** p, int size) {
if (Archive::is_loading::value) {
if (*p != nullptr)
delete[] * p;
delete[] *p;
ar& size;
*p = size ? new T[size] : nullptr;
} else {
Expand Down
1 change: 0 additions & 1 deletion include/amici/spline.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#ifndef amici_spline_h
#define amici_spline_h
#include <math.h>

namespace amici {

Expand Down
1 change: 0 additions & 1 deletion include/amici/steadystateproblem.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include <nvector/nvector_serial.h>

#include <functional>
#include <memory>

namespace amici {
Expand Down
5 changes: 0 additions & 5 deletions src/amici.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@
#include <cvodes/cvodes.h> //return codes
#include <sundials/sundials_types.h> //realtype

#include <cassert>
#include <cstdarg>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <map>
#include <memory>
#include <type_traits>
Expand Down
3 changes: 0 additions & 3 deletions src/backwardproblem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
#include "amici/solver.h"
#include "amici/steadystateproblem.h"

#include <cassert>
#include <cstring>

namespace amici {

BackwardProblem::BackwardProblem(
Expand Down
1 change: 0 additions & 1 deletion src/edata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "amici/symbolic_functions.h" // getNaN

#include <algorithm>
#include <cstring>
#include <random>
#include <utility>

Expand Down
1 change: 0 additions & 1 deletion src/exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

#include <cstdarg>
#include <cstdio>
#include <cstring>

namespace amici {

Expand Down
1 change: 0 additions & 1 deletion src/forwardproblem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

#include <algorithm>
#include <cmath>
#include <cstring>

namespace amici {

Expand Down
5 changes: 2 additions & 3 deletions src/hdf5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

#include <hdf5_hl.h>


namespace amici {
namespace hdf5 {

Expand Down Expand Up @@ -1161,8 +1160,8 @@ void readModelDataFromHDF5(
model.setSteadyStateComputationMode(
static_cast<SteadyStateComputationMode>(getIntScalarAttribute(
file, datasetPath, "steadyStateComputationMode"
))
);
))
);
}

if (attributeExists(file, datasetPath, "steadyStateSensitivityMode")) {
Expand Down
2 changes: 1 addition & 1 deletion src/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <amici/symbolic_functions.h>

#include <algorithm>
#include <assert.h>
#include <cassert>
#include <cmath>
#include <cstring>
#include <numeric>
Expand Down
4 changes: 0 additions & 4 deletions src/newton_solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
#include <sunlinsol/sunlinsol_dense.h> // dense solver
#include <sunlinsol/sunlinsol_klu.h> // sparse solver

#include <cmath>
#include <cstring>
#include <ctime>

namespace amici {

NewtonSolver::NewtonSolver(Model const& model)
Expand Down
1 change: 0 additions & 1 deletion src/rdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "amici/symbolic_functions.h"

#include <cmath>
#include <cstring>

namespace amici {

Expand Down
2 changes: 0 additions & 2 deletions src/solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#include "amici/symbolic_functions.h"

#include <cstdio>
#include <cstring>
#include <ctime>
#include <memory>

namespace amici {
Expand Down
2 changes: 1 addition & 1 deletion src/splinefunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
#include "amici/amici.h"
#include "amici/defines.h"
#include "amici/exception.h"
#include "amici/vector.h"

#include <algorithm> // std::min
#include <cassert>
#include <cmath>
#include <vector>

Expand Down
1 change: 0 additions & 1 deletion src/steadystateproblem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "amici/solver.h"

#include <cmath>
#include <cstring>
#include <cvodes/cvodes.h>
#include <memory>
#include <sundials/sundials_dense.h>
Expand Down
1 change: 0 additions & 1 deletion src/sundials_linsol_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

#include <amici/exception.h>

#include <new> // bad_alloc
#include <utility>

namespace amici {
Expand Down
1 change: 0 additions & 1 deletion src/symbolic_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include <cfloat>
#include <cmath>
#include <cstdarg>
#include <cstdlib>
#if _MSC_VER && !__INTEL_COMPILER
#include <malloc.h>
#define alloca _alloca
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp/unittests/testSerialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "testfunctions.h"

#include <cmath>

#include <fstream>
#include <gtest/gtest.h>

void
Expand Down

0 comments on commit fbb2936

Please sign in to comment.