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
25 changes: 16 additions & 9 deletions include/amici/abstract_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ class AbstractModel {
* @param p parameter vector
* @param k constant vector
* @param h Heaviside vector
* @param w vector with helper variables
* @param dx time derivative of state (DAE only)
* @param tcl total abundances for conservation laws
* @param sx current state sensitivity
Expand All @@ -307,8 +308,9 @@ class AbstractModel {
*/
virtual void fstau(
realtype* stau, realtype t, realtype const* x, realtype const* p,
realtype const* k, realtype const* h, realtype const* dx,
realtype const* tcl, realtype const* sx, int ip, int ie
realtype const* k, realtype const* h, realtype const* w,
realtype const* dx, realtype const* tcl, realtype const* sx, int ip,
int ie
);

/**
Expand Down Expand Up @@ -542,6 +544,7 @@ class AbstractModel {
* @param p parameter vector
* @param k constant vector
* @param h Heaviside vector
* @param w vector with helper variables
* @param dx time derivative of state (DAE only)
* @param ie event index
* @param xdot new model right hand side
Expand All @@ -552,9 +555,10 @@ class AbstractModel {
*/
virtual void fdeltaxB(
realtype* deltaxB, realtype t, realtype const* x, realtype const* p,
realtype const* k, realtype const* h, realtype const* dx, int ie,
realtype const* xdot, realtype const* xdot_old, realtype const* x_old,
realtype const* xB, realtype const* tcl
realtype const* k, realtype const* h, realtype const* w,
realtype const* dx, int ie, realtype const* xdot,
realtype const* xdot_old, realtype const* x_old, realtype const* xB,
realtype const* tcl
);

/**
Expand All @@ -565,6 +569,7 @@ class AbstractModel {
* @param p parameter vector
* @param k constant vector
* @param h Heaviside vector
* @param w vector with helper variables
* @param dx time derivative of state (DAE only)
* @param ip sensitivity index
* @param ie event index
Expand All @@ -575,9 +580,9 @@ class AbstractModel {
*/
virtual void fdeltaqB(
realtype* deltaqB, realtype t, realtype const* x, realtype const* p,
realtype const* k, realtype const* h, realtype const* dx, int ip,
int ie, realtype const* xdot, realtype const* xdot_old,
realtype const* x_old, realtype const* xB
realtype const* k, realtype const* h, realtype const* w,
realtype const* dx, int ip, int ie, realtype const* xdot,
realtype const* xdot_old, realtype const* x_old, realtype const* xB
);

/**
Expand Down Expand Up @@ -1059,11 +1064,13 @@ class AbstractModel {
* @brief Compute explicit roots of the model.
* @param p parameter vector
* @param k constant vector
* @param w vector with helper variables
* @return A vector of length ne_solver, each containing a vector of
* explicit roots for the corresponding event.
*/
virtual std::vector<std::vector<realtype>> fexplicit_roots(
[[maybe_unused]] realtype const* p, [[maybe_unused]] realtype const* k
[[maybe_unused]] realtype const* p, [[maybe_unused]] realtype const* k,
[[maybe_unused]] realtype const* w
) = 0;
};

Expand Down
3 changes: 2 additions & 1 deletion include/amici/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -1591,7 +1591,8 @@ class Model : public AbstractModel, public ModelDimensions {
}

[[nodiscard]] std::vector<std::vector<realtype>> fexplicit_roots(
[[maybe_unused]] realtype const* p, [[maybe_unused]] realtype const* k
[[maybe_unused]] realtype const* p, [[maybe_unused]] realtype const* k,
[[maybe_unused]] realtype const* w
) override {
if (ne != ne_solver) {
throw AmiException(
Expand Down
6 changes: 4 additions & 2 deletions include/amici/model_dae.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,13 @@ class Model_DAE : public Model {
* @param p parameter vector
* @param k constants vector
* @param h Heaviside vector
* @param w vector with helper variables
* @param dx Vector with the derivative states
**/
virtual void froot(
realtype* root, realtype t, realtype const* x, double const* p,
double const* k, realtype const* h, realtype const* dx
double const* k, realtype const* h, realtype const* w,
realtype const* dx
);

/**
Expand Down Expand Up @@ -444,7 +446,7 @@ class Model_DAE : public Model {
* @param x Vector with the states
* @param p parameter vector
* @param k constants vector
* @param h heavyside vector
* @param h Heaviside vector
* @param dx Vector with the derivative states
* @param w vector with helper variables
*/
Expand Down
4 changes: 3 additions & 1 deletion include/amici/model_ode.h
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,13 @@ class Model_ODE : public Model {
* @param p parameter vector
* @param k constants vector
* @param h Heaviside vector
* @param w vector with helper variables
* @param tcl total abundances for conservation laws
**/
virtual void froot(
realtype* root, realtype t, realtype const* x, realtype const* p,
realtype const* k, realtype const* h, realtype const* tcl
realtype const* k, realtype const* h, realtype const* w,
realtype const* tcl
);

/**
Expand Down
3 changes: 2 additions & 1 deletion models/model_calvetti_py/explicit_roots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
#include <algorithm>
#include <vector>
#include "k.h"
#include "w.h"

namespace amici {
namespace model_model_calvetti_py {

std::vector<std::vector<realtype>> explicit_roots_model_calvetti_py(const realtype *p, const realtype *k){
std::vector<std::vector<realtype>> explicit_roots_model_calvetti_py(const realtype *p, const realtype *k, const realtype *w){
return {
{10},
{10},
Expand Down
20 changes: 10 additions & 10 deletions models/model_calvetti_py/model_calvetti_py.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern void dJydy_rowvals_model_calvetti_py(SUNMatrixWrapper &rowvals, int index



extern void root_model_calvetti_py(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl);
extern void root_model_calvetti_py(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl);



Expand Down Expand Up @@ -99,7 +99,7 @@ extern void x_solver_model_calvetti_py(realtype *x_solver, const realtype *x_rda
extern std::vector<HermiteSpline> create_splines_model_calvetti_py(const realtype *p, const realtype *k);


extern std::vector<std::vector<realtype>> explicit_roots_model_calvetti_py(const realtype *p, const realtype *k);
extern std::vector<std::vector<realtype>> explicit_roots_model_calvetti_py(const realtype *p, const realtype *k, const realtype *w);
/**
* @brief AMICI-generated model subclass.
*/
Expand Down Expand Up @@ -200,10 +200,10 @@ class Model_model_calvetti_py : public amici::Model_DAE {
void fdeltasx(realtype *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl, const realtype *x_old) override {}


void fdeltaxB(realtype *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *x_old, const realtype *xB, const realtype *tcl) override {}
void fdeltaxB(realtype *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dx, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *x_old, const realtype *xB, const realtype *tcl) override {}


void fdeltaqB(realtype *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *x_old, const realtype *xB) override {}
void fdeltaqB(realtype *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dx, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *x_old, const realtype *xB) override {}


void fdrzdp(realtype *drzdp, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip) override {}
Expand Down Expand Up @@ -323,8 +323,8 @@ class Model_model_calvetti_py : public amici::Model_DAE {
void fdzdx(realtype *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override {}


void froot(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl) override {
root_model_calvetti_py(root, t, x, p, k, h, tcl);
void froot(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl) override {
root_model_calvetti_py(root, t, x, p, k, h, w, tcl);
}


Expand All @@ -339,7 +339,7 @@ class Model_model_calvetti_py : public amici::Model_DAE {
void fsigmaz(realtype *sigmaz, const realtype t, const realtype *p, const realtype *k) override {}


void fstau(realtype *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const realtype *tcl, const realtype *sx, const int ip, const int ie) override {}
void fstau(realtype *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dx, const realtype *tcl, const realtype *sx, const int ip, const int ie) override {}

void fsx0(realtype *sx0, const realtype t, const realtype *x, const realtype *p, const realtype *k, const int ip) override {}

Expand Down Expand Up @@ -411,8 +411,8 @@ class Model_model_calvetti_py : public amici::Model_DAE {
void fdtotal_cldx_rdata_rowvals(SUNMatrixWrapper &rowvals) override {}


std::vector<std::vector<realtype>> fexplicit_roots(const realtype *p, const realtype *k) override {
return explicit_roots_model_calvetti_py(p, k);
std::vector<std::vector<realtype>> fexplicit_roots(const realtype *p, const realtype *k, const realtype *w) override {
return explicit_roots_model_calvetti_py(p, k, w);
}


Expand Down Expand Up @@ -557,7 +557,7 @@ class Model_model_calvetti_py : public amici::Model_DAE {
* @return AMICI git commit hash
*/
std::string get_amici_commit() const override {
return "40190b46b1b398e321314ded4169fe910b37c484";
return "3fb84cd5df12639f17b179d681e8ba4b5be8a160";
}

bool has_quadratic_llh() const override {
Expand Down
3 changes: 2 additions & 1 deletion models/model_calvetti_py/root.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
#include "x.h"
#include "k.h"
#include "h.h"
#include "w.h"

namespace amici {
namespace model_model_calvetti_py {

void root_model_calvetti_py(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl){
void root_model_calvetti_py(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl){
root[0] = t - 10;
root[1] = 10 - t;
root[2] = 12 - t;
Expand Down
3 changes: 2 additions & 1 deletion models/model_dirac_py/deltaqB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "x.h"
#include "p.h"
#include "h.h"
#include "w.h"
#include "xdot.h"
#include "xdot_old.h"
#include "x_old.h"
Expand All @@ -13,7 +14,7 @@
namespace amici {
namespace model_model_dirac_py {

void deltaqB_model_dirac_py(realtype *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *x_old, const realtype *xB){
void deltaqB_model_dirac_py(realtype *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dx, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *x_old, const realtype *xB){
switch(ie) {
case 0:
switch(ip) {
Expand Down
2 changes: 1 addition & 1 deletion models/model_dirac_py/explicit_roots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
namespace amici {
namespace model_model_dirac_py {

std::vector<std::vector<realtype>> explicit_roots_model_dirac_py(const realtype *p, const realtype *k){
std::vector<std::vector<realtype>> explicit_roots_model_dirac_py(const realtype *p, const realtype *k, const realtype *w){
return {
{p2}
};
Expand Down
28 changes: 14 additions & 14 deletions models/model_dirac_py/model_dirac_py.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extern void dJydy_rowvals_model_dirac_py(SUNMatrixWrapper &rowvals, int index);



extern void root_model_dirac_py(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl);
extern void root_model_dirac_py(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl);



Expand Down Expand Up @@ -77,11 +77,11 @@ extern void xdot_model_dirac_py(realtype *xdot, const realtype t, const realtype
extern void y_model_dirac_py(realtype *y, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w);


extern void stau_model_dirac_py(realtype *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const realtype *tcl, const realtype *sx, const int ip, const int ie);
extern void stau_model_dirac_py(realtype *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dx, const realtype *tcl, const realtype *sx, const int ip, const int ie);
extern void deltax_model_dirac_py(double *deltax, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *x_old);
extern void deltasx_model_dirac_py(realtype *deltasx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *sx, const realtype *stau, const realtype *tcl, const realtype *x_old);

extern void deltaqB_model_dirac_py(realtype *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *x_old, const realtype *xB);
extern void deltaqB_model_dirac_py(realtype *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dx, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *x_old, const realtype *xB);

extern void x_solver_model_dirac_py(realtype *x_solver, const realtype *x_rdata);

Expand All @@ -99,7 +99,7 @@ extern void x_solver_model_dirac_py(realtype *x_solver, const realtype *x_rdata)
extern std::vector<HermiteSpline> create_splines_model_dirac_py(const realtype *p, const realtype *k);


extern std::vector<std::vector<realtype>> explicit_roots_model_dirac_py(const realtype *p, const realtype *k);
extern std::vector<std::vector<realtype>> explicit_roots_model_dirac_py(const realtype *p, const realtype *k, const realtype *w);
/**
* @brief AMICI-generated model subclass.
*/
Expand Down Expand Up @@ -201,11 +201,11 @@ class Model_model_dirac_py : public amici::Model_ODE {
}


void fdeltaxB(realtype *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *x_old, const realtype *xB, const realtype *tcl) override {}
void fdeltaxB(realtype *deltaxB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dx, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *x_old, const realtype *xB, const realtype *tcl) override {}


void fdeltaqB(realtype *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *x_old, const realtype *xB) override {
deltaqB_model_dirac_py(deltaqB, t, x, p, k, h, dx, ip, ie, xdot, xdot_old, x_old, xB);
void fdeltaqB(realtype *deltaqB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dx, const int ip, const int ie, const realtype *xdot, const realtype *xdot_old, const realtype *x_old, const realtype *xB) override {
deltaqB_model_dirac_py(deltaqB, t, x, p, k, h, w, dx, ip, ie, xdot, xdot_old, x_old, xB);
}


Expand Down Expand Up @@ -314,8 +314,8 @@ class Model_model_dirac_py : public amici::Model_ODE {
void fdzdx(realtype *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h) override {}


void froot(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl) override {
root_model_dirac_py(root, t, x, p, k, h, tcl);
void froot(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl) override {
root_model_dirac_py(root, t, x, p, k, h, w, tcl);
}


Expand All @@ -330,8 +330,8 @@ class Model_model_dirac_py : public amici::Model_ODE {
void fsigmaz(realtype *sigmaz, const realtype t, const realtype *p, const realtype *k) override {}


void fstau(realtype *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const realtype *tcl, const realtype *sx, const int ip, const int ie) override {
stau_model_dirac_py(stau, t, x, p, k, h, dx, tcl, sx, ip, ie);
void fstau(realtype *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dx, const realtype *tcl, const realtype *sx, const int ip, const int ie) override {
stau_model_dirac_py(stau, t, x, p, k, h, w, dx, tcl, sx, ip, ie);
}

void fsx0(realtype *sx0, const realtype t, const realtype *x, const realtype *p, const realtype *k, const int ip) override {}
Expand Down Expand Up @@ -398,8 +398,8 @@ class Model_model_dirac_py : public amici::Model_ODE {
void fdtotal_cldx_rdata_rowvals(SUNMatrixWrapper &rowvals) override {}


std::vector<std::vector<realtype>> fexplicit_roots(const realtype *p, const realtype *k) override {
return explicit_roots_model_dirac_py(p, k);
std::vector<std::vector<realtype>> fexplicit_roots(const realtype *p, const realtype *k, const realtype *w) override {
return explicit_roots_model_dirac_py(p, k, w);
}


Expand Down Expand Up @@ -544,7 +544,7 @@ class Model_model_dirac_py : public amici::Model_ODE {
* @return AMICI git commit hash
*/
std::string get_amici_commit() const override {
return "40190b46b1b398e321314ded4169fe910b37c484";
return "3fb84cd5df12639f17b179d681e8ba4b5be8a160";
}

bool has_quadratic_llh() const override {
Expand Down
2 changes: 1 addition & 1 deletion models/model_dirac_py/root.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
namespace amici {
namespace model_model_dirac_py {

void root_model_dirac_py(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *tcl){
void root_model_dirac_py(realtype *root, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *tcl){
root[0] = -p2 + t;
}

Expand Down
2 changes: 1 addition & 1 deletion models/model_dirac_py/stau.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace amici {
namespace model_model_dirac_py {

void stau_model_dirac_py(realtype *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const realtype *tcl, const realtype *sx, const int ip, const int ie){
void stau_model_dirac_py(realtype *stau, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dx, const realtype *tcl, const realtype *sx, const int ip, const int ie){
switch(ie) {
case 0:
switch(ip) {
Expand Down
Loading
Loading