Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/clang-tools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
execute_process(
COMMAND
sh -c
"git ls-tree -r HEAD --name-only src/*.cpp include/amici/*.h | tr '\n' ' '"
"git ls-tree -r HEAD --name-only src/*.cpp include/amici/*.h tests/cpp/*.h tests/cpp/unittests/*.cpp | tr '\n' ' '"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE ALL_CXX_SOURCE_FILES)
# ########### clang-tidy ############
Expand Down
126 changes: 4 additions & 122 deletions include/amici/abstract_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -287,25 +287,6 @@ class AbstractModel {
*/
virtual void fdx0(AmiVector& x0, AmiVector& dx0);

/**
* @brief Model-specific implementation of fstau (MATLAB-only, DEPRECATED)
* @param stau total derivative of event timepoint
* @param t current time
* @param x current state
* @param p parameter vector
* @param k constant vector
* @param h Heaviside vector
* @param tcl total abundances for conservation laws
* @param sx current state sensitivity
* @param ip sensitivity index
* @param ie event index
*/
virtual void fstau(
realtype* stau, realtype t, realtype const* x, realtype const* p,
realtype const* k, realtype const* h, realtype const* tcl,
realtype const* sx, int ip, int ie
);

/**
* @brief Model-specific implementation of fstau
* @param stau total derivative of event timepoint
Expand Down Expand Up @@ -341,25 +322,7 @@ class AbstractModel {
realtype const* k, realtype const* h, realtype const* w);

/**
* @brief Model-specific implementation of fdydp (MATLAB-only)
* @param dydp partial derivative of observables y w.r.t. model parameters p
* @param t current time
* @param x current state
* @param p parameter vector
* @param k constant vector
* @param h Heaviside vector
* @param ip parameter index w.r.t. which the derivative is requested
* @param w repeating elements vector
* @param dwdp Recurring terms in xdot, parameter derivative
*/
virtual void fdydp(
realtype* dydp, realtype t, realtype const* x, realtype const* p,
realtype const* k, realtype const* h, int ip, realtype const* w,
realtype const* dwdp
);

/**
* @brief Model-specific implementation of fdydp (Python)
* @brief Model-specific implementation of fdydp
* @param dydp partial derivative of observables y w.r.t. model parameters p
* @param t current time
* @param x current state
Expand Down Expand Up @@ -526,25 +489,7 @@ class AbstractModel {
);

/**
* @brief Model-specific implementation of fdeltax (MATLAB-only)
* @param deltax state update
* @param t current time
* @param x current state
* @param p parameter vector
* @param k constant vector
* @param h Heaviside vector
* @param ie event index
* @param xdot new model right hand side
* @param xdot_old previous model right hand side
*/
virtual void fdeltax(
realtype* deltax, realtype t, realtype const* x, realtype const* p,
realtype const* k, realtype const* h, int ie, realtype const* xdot,
realtype const* xdot_old
);

/**
* @brief Model-specific implementation of fdeltax (Python-only)
* @brief Model-specific implementation of fdeltax
* @param deltax state update
* @param t current time
* @param x current state
Expand All @@ -563,31 +508,7 @@ class AbstractModel {
);

/**
* @brief Model-specific implementation of fdeltasx (MATLAB-only)
* @param deltasx sensitivity update
* @param t current time
* @param x current state
* @param p parameter vector
* @param k constant vector
* @param h Heaviside vector
* @param w repeating elements vector
* @param ip sensitivity index
* @param ie event index
* @param xdot new model right hand side
* @param xdot_old previous model right hand side
* @param sx state sensitivity
* @param stau event-time sensitivity
* @param tcl total abundances for conservation laws
*/
virtual void fdeltasx(
realtype* deltasx, realtype t, realtype const* x, realtype const* p,
realtype const* k, realtype const* h, realtype const* w, int ip, int ie,
realtype const* xdot, realtype const* xdot_old, realtype const* sx,
realtype const* stau, realtype const* tcl
);

/**
* @brief Model-specific implementation of fdeltasx (Python-only)
* @brief Model-specific implementation of fdeltasx
* @param deltasx sensitivity update
* @param t current time
* @param x current state
Expand Down Expand Up @@ -634,25 +555,6 @@ class AbstractModel {
realtype const* xB, realtype const* tcl
);

/**
* @brief Model-specific implementation of fdeltaxB (MATLAB-only!!)
* @param deltaxB adjoint state update
* @param t current time
* @param x current state
* @param p parameter vector
* @param k constant vector
* @param h Heaviside vector
* @param ie event index
* @param xdot new model right hand side
* @param xdot_old previous model right hand side
* @param xB current adjoint state
*/
virtual void fdeltaxB(
realtype* deltaxB, realtype t, realtype const* x, realtype const* p,
realtype const* k, realtype const* h, int ie, realtype const* xdot,
realtype const* xdot_old, realtype const* xB
);

/**
* @brief Model-specific implementation of fdeltaqB
* @param deltaqB sensitivity update
Expand All @@ -676,26 +578,6 @@ class AbstractModel {
realtype const* x_old, realtype const* xB
);

/**
* @brief Model-specific implementation of fdeltaqB (MATLAB-only!!)
* @param deltaqB sensitivity update
* @param t current time
* @param x current state
* @param p parameter vector
* @param k constant vector
* @param h Heaviside vector
* @param ip sensitivity index
* @param ie event index
* @param xdot new model right hand side
* @param xdot_old previous model right hand side
* @param xB adjoint state
*/
virtual void fdeltaqB(
realtype* deltaqB, realtype t, realtype const* x, realtype const* p,
realtype const* k, realtype const* h, int ip, int ie,
realtype const* xdot, realtype const* xdot_old, realtype const* xB
);

/**
* @brief Model-specific implementation of fsigmay
* @param sigmay standard deviation of measurements
Expand Down Expand Up @@ -1002,7 +884,7 @@ class AbstractModel {
virtual void fdwdx_rowvals(SUNMatrixWrapper& dwdx);

/**
* @brief Model-specific implementation of fdwdw, no w chainrule (Py)
* @brief Model-specific implementation of fdwdw, no w chainrule
* @param dwdw partial derivative w wrt w
* @param t timepoint
* @param x Vector with the states
Expand Down
9 changes: 1 addition & 8 deletions include/amici/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ enum class ModelQuantity {
p,
ts,
dJydy,
dJydy_matlab,
deltaqB,
dsigmaydp,
dsigmaydy,
Expand Down Expand Up @@ -1520,13 +1519,7 @@ class Model : public AbstractModel, public ModelDimensions {
[[nodiscard]] std::vector<int> const& getReinitializationStateIdxs() const;

/**
* @brief getter for dxdotdp (matlab generated)
* @return dxdotdp
*/
[[nodiscard]] AmiVectorArray const& get_dxdotdp() const;

/**
* @brief getter for dxdotdp (python generated)
* @brief getter for dxdotdp
* @return dxdotdp
*/
[[nodiscard]] SUNMatrixWrapper const& get_dxdotdp_full() const;
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 @@ -46,7 +46,6 @@ class Model_DAE : public Model {
events
) {
SUNContext sunctx = derived_state_.sunctx_;
derived_state_.M_ = SUNMatrixWrapper(nx_solver, nx_solver, sunctx);
auto const M_nnz = static_cast<sunindextype>(
std::reduce(idlist.begin(), idlist.end())
);
Expand Down
10 changes: 2 additions & 8 deletions include/amici/model_dimensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ struct ModelDimensions {
* @param nnz Number of nonzero elements in Jacobian
* @param ubw Upper matrix bandwidth in the Jacobian
* @param lbw Lower matrix bandwidth in the Jacobian
* @param pythonGenerated Flag indicating model creation from Matlab or
* Python
* @param ndxdotdp_explicit Number of nonzero elements in `dxdotdp_explicit`
* @param ndxdotdx_explicit Number of nonzero elements in `dxdotdx_explicit`
* @param w_recursion_depth Recursion depth of fw
Expand All @@ -69,8 +67,8 @@ struct ModelDimensions {
int const ndwdw, int const ndxdotdw, std::vector<int> ndJydy,
int const ndxrdatadxsolver, int const ndxrdatadtcl,
int const ndtotal_cldx_rdata, int const nnz, int const ubw,
int const lbw, bool pythonGenerated = false, int ndxdotdp_explicit = 0,
int ndxdotdx_explicit = 0, int w_recursion_depth = 0
int const lbw, int ndxdotdp_explicit = 0, int ndxdotdx_explicit = 0,
int w_recursion_depth = 0
)
: nx_rdata(nx_rdata)
, nxtrue_rdata(nxtrue_rdata)
Expand Down Expand Up @@ -99,7 +97,6 @@ struct ModelDimensions {
, nJ(nJ)
, ubw(ubw)
, lbw(lbw)
, pythonGenerated(pythonGenerated)
, ndxdotdp_explicit(ndxdotdp_explicit)
, ndxdotdx_explicit(ndxdotdx_explicit)
, w_recursion_depth(w_recursion_depth) {
Expand Down Expand Up @@ -243,9 +240,6 @@ struct ModelDimensions {
/** Lower bandwidth of the Jacobian */
int lbw{0};

/** Flag indicating model creation from Matlab or Python */
bool pythonGenerated = false;

/** Number of nonzero elements in `dxdotdx_explicit` */
int ndxdotdp_explicit = 0;

Expand Down
39 changes: 1 addition & 38 deletions include/amici/model_ode.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,24 +280,7 @@ class Model_ODE : public Model {

protected:
/**
* @brief Model specific implementation for fJSparse (Matlab)
* @param JSparse Matrix to which the Jacobian will be written
* @param t timepoint
* @param x Vector with the states
* @param p parameter vector
* @param k constants vector
* @param h Heaviside vector
* @param w vector with helper variables
* @param dwdx derivative of w wrt x
**/
virtual void fJSparse(
SUNMatrixContent_Sparse JSparse, realtype t, realtype const* x,
realtype const* p, realtype const* k, realtype const* h,
realtype const* w, realtype const* dwdx
);

/**
* @brief Model specific implementation for fJSparse, data only (Py)
* @brief Model specific implementation for fJSparse, data only
* @param JSparse Matrix to which the Jacobian will be written
* @param t timepoint
* @param x Vector with the states
Expand Down Expand Up @@ -355,28 +338,8 @@ class Model_ODE : public Model {
realtype const* k, realtype const* h, realtype const* w
) = 0;

/**
* @brief Model specific implementation of fdxdotdp, with w chainrule
* (Matlab)
* @param dxdotdp partial derivative xdot wrt p
* @param t timepoint
* @param x Vector with the states
* @param p parameter vector
* @param k constants vector
* @param h Heaviside vector
* @param ip parameter index
* @param w vector with helper variables
* @param dwdp derivative of w wrt p
*/
virtual void fdxdotdp(
realtype* dxdotdp, realtype t, realtype const* x, realtype const* p,
realtype const* k, realtype const* h, int ip, realtype const* w,
realtype const* dwdp
);

/**
* @brief Model specific implementation of fdxdotdp_explicit, no w chainrule
* (Py)
* @param dxdotdp_explicit partial derivative xdot wrt p
* @param t timepoint
* @param x Vector with the states
Expand Down
16 changes: 0 additions & 16 deletions include/amici/model_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ struct ModelStateDerived {
, dxdotdw_(other.dxdotdw_)
, dwdx_(other.dwdx_)
, dwdp_(other.dwdp_)
, M_(other.M_)
, MSparse_(other.MSparse_)
, dfdx_(other.dfdx_)
, dxdotdp_full(other.dxdotdp_full)
Expand All @@ -106,7 +105,6 @@ struct ModelStateDerived {
, dtotal_cldx_rdata(other.dtotal_cldx_rdata)
, dxdotdp(other.dxdotdp)
, dJydy_(other.dJydy_)
, dJydy_matlab_(other.dJydy_matlab_)
, dJydsigma_(other.dJydsigma_)
, dJydx_(other.dJydx_)
, dJydp_(other.dJydp_)
Expand Down Expand Up @@ -152,7 +150,6 @@ struct ModelStateDerived {
dxdotdw_.set_ctx(sunctx_);
dwdx_.set_ctx(sunctx_);
dwdp_.set_ctx(sunctx_);
M_.set_ctx(sunctx_);
MSparse_.set_ctx(sunctx_);
dfdx_.set_ctx(sunctx_);
dxdotdp_full.set_ctx(sunctx_);
Expand Down Expand Up @@ -210,13 +207,6 @@ struct ModelStateDerived {
/** Sparse dwdp temporary storage (dimension: `nw` x `np`, nnz: `ndwdp`) */
SUNMatrixWrapper dwdp_;

/**
* Dense Mass matrix (dimension: `nx_solver` x `nx_solver`)
*
* MATLAB-generated-only, DEPRECATED.
*/
SUNMatrixWrapper M_;

/**
* Sparse Mass matrix, Python-generated-only
*
Expand Down Expand Up @@ -296,12 +286,6 @@ struct ModelStateDerived {
*/
std::vector<SUNMatrixWrapper> dJydy_;

/** Observable derivative of data likelihood, only used if
* `pythonGenerated` == `false` (dimension `nJ` x `ny` x `nytrue` ,
* row-major)
*/
std::vector<realtype> dJydy_matlab_;

/** Observable sigma derivative of data likelihood
* (dimension nJ x ny x nytrue, row-major)
*/
Expand Down
1 change: 0 additions & 1 deletion include/amici/serialization.h
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ void serialize(Archive& ar, amici::Model& m, unsigned int const /*version*/) {
ar & m.sx0data_;
ar & m.nmaxevent_;
ar & m.state_is_non_negative_;
ar & m.pythonGenerated;
ar & m.min_sigma_;
ar & m.sigma_res_;
ar & m.steadystate_computation_mode_;
Expand Down
3 changes: 1 addition & 2 deletions models/model_calvetti_py/model_calvetti_py.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ class Model_model_calvetti_py : public amici::Model_DAE {
0, // nnz
6, // ubw
6, // lbw
true, // pythonGenerated
0, // ndxdotdp_explicit
5, // ndxdotdx_explicit
2 // w_recursion_depth
Expand Down Expand Up @@ -558,7 +557,7 @@ class Model_model_calvetti_py : public amici::Model_DAE {
* @return AMICI git commit hash
*/
std::string getAmiciCommit() const override {
return "b12c68a7a02f1cbd33de59d47cbc0c4d77d30d6f";
return "dcbbae0f8e9b52afd7ab8b4b7a046da36b907139";
}

bool hasQuadraticLLH() const override {
Expand Down
Loading
Loading