Skip to content

Commit 2993f09

Browse files
authored
Fix Model::addAdjointQuadratureEventUpdate (#2787)
It seems like `xQB` should be passed by reference to `Model::addAdjointQuadratureEventUpdate`. So far, this was passed by value, and all updates by that function were lost. Related to #18.
1 parent 75a09ef commit 2993f09

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/amici/model.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ class Model : public AbstractModel, public ModelDimensions {
13321332
* @param xdot_old Value of residual function before event
13331333
*/
13341334
void addAdjointQuadratureEventUpdate(
1335-
AmiVector xQB, int const ie, realtype const t, AmiVector const& x,
1335+
AmiVector& xQB, int const ie, realtype const t, AmiVector const& x,
13361336
AmiVector const& xB, AmiVector const& xdot, AmiVector const& xdot_old
13371337
);
13381338

src/model.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1525,7 +1525,7 @@ void Model::addAdjointStateEventUpdate(
15251525
}
15261526

15271527
void Model::addAdjointQuadratureEventUpdate(
1528-
AmiVector xQB, int const ie, realtype const t, AmiVector const& x,
1528+
AmiVector &xQB, int const ie, realtype const t, AmiVector const& x,
15291529
AmiVector const& xB, AmiVector const& xdot, AmiVector const& xdot_old
15301530
) {
15311531
for (int ip = 0; ip < nplist(); ip++) {

0 commit comments

Comments
 (0)