diff --git a/include/amici/edata.h b/include/amici/edata.h index 78bcba0fc7..5d613c6262 100644 --- a/include/amici/edata.h +++ b/include/amici/edata.h @@ -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. */ diff --git a/include/amici/model.h b/include/amici/model.h index d355ea7fee..481164afdf 100644 --- a/include/amici/model.h +++ b/include/amici/model.h @@ -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); diff --git a/include/amici/simulation_parameters.h b/include/amici/simulation_parameters.h index 55db090184..8a1c1ec23d 100644 --- a/include/amici/simulation_parameters.h +++ b/include/amici/simulation_parameters.h @@ -175,7 +175,14 @@ class SimulationParameters { */ std::vector 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}; /** diff --git a/src/edata.cpp b/src/edata.cpp index b9f95fca97..05499bb9cf 100644 --- a/src/edata.cpp +++ b/src/edata.cpp @@ -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();