Skip to content

Commit

Permalink
Merge branch 'develop' into amici_petab_problem
Browse files Browse the repository at this point in the history
  • Loading branch information
dweindl authored Jan 8, 2024
2 parents 82a9409 + 8077915 commit 886567c
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
7 changes: 7 additions & 0 deletions include/amici/edata.h
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,13 @@ class ExpData : public SimulationParameters {
*/
realtype const* getObservedEventsStdDevPtr(int ie) const;

/**
* @brief Set all observations and their standard deviations to NaN.
*
* Useful, e.g., after calling ExpData::setTimepoints.
*/
void clear_observations();

/**
* @brief Arbitrary (not necessarily unique) identifier.
*/
Expand Down
6 changes: 6 additions & 0 deletions include/amici/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,12 @@ class Model : public AbstractModel, public ModelDimensions {

/**
* @brief Set simulation start time.
*
* Output timepoints are absolute timepoints, independent of
* \f$ t_{0} \f$.
* For output timepoints \f$ t < t_{0} \f$, the initial state will be
* returned.
* @param t0 Simulation start time
*/
void setT0(double t0);
Expand Down
9 changes: 8 additions & 1 deletion include/amici/simulation_parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,14 @@ class SimulationParameters {
*/
std::vector<int> plist;

/** starting time */
/**
* @brief Starting time of the simulation.
*
* Output timepoints are absolute timepoints, independent of
* \f$ t_{start} \f$.
* For output timepoints \f$ t < t_{start} \f$, the initial state will be
* returned.
*/
realtype tstart_{0.0};

/**
Expand Down
12 changes: 12 additions & 0 deletions src/edata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,18 @@ realtype const* ExpData::getObservedEventsStdDevPtr(int ie) const {
return nullptr;
}

void ExpData::clear_observations() {
std::fill(observed_data_.begin(), observed_data_.end(), getNaN());
std::fill(
observed_data_std_dev_.begin(), observed_data_std_dev_.end(), getNaN()
);
std::fill(observed_events_.begin(), observed_events_.end(), getNaN());
std::fill(
observed_events_std_dev_.begin(), observed_events_std_dev_.end(),
getNaN()
);
}

void ExpData::applyDimensions() {
applyDataDimension();
applyEventDimension();
Expand Down

0 comments on commit 886567c

Please sign in to comment.