Skip to content

Commit edaba18

Browse files
authored
Remove unused argument dwdx in fdydx (#2967)
Remove unused and unsafe argument `dwdx` in `fdydx`. Related to #2727.
1 parent 3d46b6a commit edaba18

File tree

21 files changed

+48
-52
lines changed

21 files changed

+48
-52
lines changed

include/amici/abstract_model.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,12 +357,10 @@ class AbstractModel {
357357
* @param k constant vector
358358
* @param h Heaviside vector
359359
* @param w repeating elements vector
360-
* @param dwdx Recurring terms in xdot, state derivative
361360
*/
362361
virtual void fdydx(
363362
realtype* dydx, realtype t, realtype const* x, realtype const* p,
364-
realtype const* k, realtype const* h, realtype const* w,
365-
realtype const* dwdx
363+
realtype const* k, realtype const* h, realtype const* w
366364
);
367365

368366
/**

models/model_calvetti_py/dydx.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@
66
#include "k.h"
77
#include "h.h"
88
#include "w.h"
9-
#include "dwdx.h"
109

1110
namespace amici {
1211
namespace model_model_calvetti_py {
1312

14-
void dydx_model_calvetti_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx){
13+
void dydx_model_calvetti_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w){
1514
dydx[0] = 1;
1615
dydx[3] = std::pow(L1, 3)*(2*f1/R1 - 2*(R3*f3 + f1*(R1 + R2) + f2*(R2 + R3))/std::pow(R1, 2) + 4/std::pow(R1, 2))/std::pow(V1, 3);
1716
dydx[7] = 1;

models/model_calvetti_py/model_calvetti_py.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ extern void dxdotdw_rowvals_model_calvetti_py(SUNMatrixWrapper &rowvals);
5757
extern void dxdotdx_explicit_model_calvetti_py(realtype *dxdotdx_explicit, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *dx, const realtype *w);
5858
extern void dxdotdx_explicit_colptrs_model_calvetti_py(SUNMatrixWrapper &colptrs);
5959
extern void dxdotdx_explicit_rowvals_model_calvetti_py(SUNMatrixWrapper &rowvals);
60-
extern void dydx_model_calvetti_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx);
60+
extern void dydx_model_calvetti_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w);
6161

6262

6363

@@ -309,8 +309,8 @@ class Model_model_calvetti_py : public amici::Model_DAE {
309309
}
310310

311311

312-
void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
313-
dydx_model_calvetti_py(dydx, t, x, p, k, h, w, dwdx);
312+
void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override {
313+
dydx_model_calvetti_py(dydx, t, x, p, k, h, w);
314314
}
315315

316316

models/model_dirac_py/dydx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace amici {
1010
namespace model_model_dirac_py {
1111

12-
void dydx_model_dirac_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx){
12+
void dydx_model_dirac_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w){
1313
dydx[1] = 1;
1414
}
1515

models/model_dirac_py/model_dirac_py.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ extern void dxdotdp_explicit_rowvals_model_dirac_py(SUNMatrixWrapper &rowvals);
5757
extern void dxdotdx_explicit_model_dirac_py(realtype *dxdotdx_explicit, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w);
5858
extern void dxdotdx_explicit_colptrs_model_dirac_py(SUNMatrixWrapper &colptrs);
5959
extern void dxdotdx_explicit_rowvals_model_dirac_py(SUNMatrixWrapper &rowvals);
60-
extern void dydx_model_dirac_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx);
60+
extern void dydx_model_dirac_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w);
6161

6262

6363

@@ -300,8 +300,8 @@ class Model_model_dirac_py : public amici::Model_ODE {
300300
}
301301

302302

303-
void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
304-
dydx_model_dirac_py(dydx, t, x, p, k, h, w, dwdx);
303+
void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override {
304+
dydx_model_dirac_py(dydx, t, x, p, k, h, w);
305305
}
306306

307307

models/model_events_py/dydx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace amici {
1111
namespace model_model_events_py {
1212

13-
void dydx_model_events_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx){
13+
void dydx_model_events_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w){
1414
dydx[0] = p4;
1515
dydx[1] = p4;
1616
dydx[2] = p4;

models/model_events_py/model_events_py.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ extern void dxdotdp_explicit_rowvals_model_events_py(SUNMatrixWrapper &rowvals);
5757
extern void dxdotdx_explicit_model_events_py(realtype *dxdotdx_explicit, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w);
5858
extern void dxdotdx_explicit_colptrs_model_events_py(SUNMatrixWrapper &colptrs);
5959
extern void dxdotdx_explicit_rowvals_model_events_py(SUNMatrixWrapper &rowvals);
60-
extern void dydx_model_events_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx);
60+
extern void dydx_model_events_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w);
6161
extern void dydp_model_events_py(realtype *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *tcl, const realtype *dtcldp, const realtype *spl, const realtype *sspl);
6262
extern void dzdx_model_events_py(realtype *dzdx, const int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h);
6363

@@ -319,8 +319,8 @@ class Model_model_events_py : public amici::Model_ODE {
319319
}
320320

321321

322-
void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
323-
dydx_model_events_py(dydx, t, x, p, k, h, w, dwdx);
322+
void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override {
323+
dydx_model_events_py(dydx, t, x, p, k, h, w);
324324
}
325325

326326

models/model_jakstat_adjoint_py/dydx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace amici {
1111
namespace model_model_jakstat_adjoint_py {
1212

13-
void dydx_model_jakstat_adjoint_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx){
13+
void dydx_model_jakstat_adjoint_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w){
1414
dydx[1] = scale_tSTAT/init_STAT;
1515
dydx[3] = scale_pSTAT/init_STAT;
1616
dydx[4] = scale_tSTAT/init_STAT;

models/model_jakstat_adjoint_py/model_jakstat_adjoint_py.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ extern void dxdotdp_explicit_rowvals_model_jakstat_adjoint_py(SUNMatrixWrapper &
5757
extern void dxdotdx_explicit_model_jakstat_adjoint_py(realtype *dxdotdx_explicit, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w);
5858
extern void dxdotdx_explicit_colptrs_model_jakstat_adjoint_py(SUNMatrixWrapper &colptrs);
5959
extern void dxdotdx_explicit_rowvals_model_jakstat_adjoint_py(SUNMatrixWrapper &rowvals);
60-
extern void dydx_model_jakstat_adjoint_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx);
60+
extern void dydx_model_jakstat_adjoint_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w);
6161
extern void dydp_model_jakstat_adjoint_py(realtype *dydp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip, const realtype *w, const realtype *tcl, const realtype *dtcldp, const realtype *spl, const realtype *sspl);
6262

6363

@@ -308,8 +308,8 @@ class Model_model_jakstat_adjoint_py : public amici::Model_ODE {
308308
}
309309

310310

311-
void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx) override {
312-
dydx_model_jakstat_adjoint_py(dydx, t, x, p, k, h, w, dwdx);
311+
void fdydx(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w) override {
312+
dydx_model_jakstat_adjoint_py(dydx, t, x, p, k, h, w);
313313
}
314314

315315

models/model_nested_events_py/dydx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
namespace amici {
1010
namespace model_model_nested_events_py {
1111

12-
void dydx_model_nested_events_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w, const realtype *dwdx){
12+
void dydx_model_nested_events_py(realtype *dydx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const realtype *w){
1313
dydx[0] = 1;
1414
}
1515

0 commit comments

Comments
 (0)