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
2 changes: 1 addition & 1 deletion include/amici/abstract_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class AbstractModel {
* @param dxB Vector with the adjoint derivative states
* @param xBdot Vector with the adjoint state right hand side
*/
virtual void writeSteadystateJB(
virtual void write_steady_state_JB(
realtype t, realtype cj, AmiVector const& x, AmiVector const& dx,
AmiVector const& xB, AmiVector const& dxB, AmiVector const& xBdot
) = 0;
Expand Down
4 changes: 2 additions & 2 deletions include/amici/edata.h
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ inline bool operator==(ExpData const& lhs, ExpData const& rhs) {
* @param sigmaVector vector input to be checked
* @param vectorName name of the input
*/
void checkSigmaPositivity(
void check_sigma_positivity(
std::vector<realtype> const& sigmaVector, char const* vectorName
);

Expand All @@ -517,7 +517,7 @@ void checkSigmaPositivity(
* @param sigma input to be checked
* @param sigmaName name of the input
*/
void checkSigmaPositivity(realtype sigma, char const* sigmaName);
void check_sigma_positivity(realtype sigma, char const* sigmaName);

/**
* @brief The ConditionContext class applies condition-specific amici::Model
Expand Down
2 changes: 1 addition & 1 deletion include/amici/model_dae.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ class Model_DAE : public Model {
* @param dxB Vector with the adjoint derivative states
* @param xBdot Vector with the adjoint state right hand side
*/
void writeSteadystateJB(
void write_steady_state_JB(
realtype t, realtype cj, AmiVector const& x, AmiVector const& dx,
AmiVector const& xB, AmiVector const& dxB, AmiVector const& xBdot
) override;
Expand Down
2 changes: 1 addition & 1 deletion include/amici/model_ode.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ class Model_ODE : public Model {
* @param dxB Vector with the adjoint derivative states
* @param xBdot Vector with the adjoint state right hand side
*/
void writeSteadystateJB(
void write_steady_state_JB(
realtype t, realtype cj, AmiVector const& x, AmiVector const& dx,
AmiVector const& xB, AmiVector const& dxB, AmiVector const& xBdot
) override;
Expand Down
2 changes: 1 addition & 1 deletion include/amici/rdata.h
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ class ReturnData : public ModelDimensions {
* @param quadratic_llh whether model defines a quadratic nllh and computing
* res, sres and FIM makes sense.
*/
void initializeObservablesLikelihoodReporting(bool quadratic_llh);
void initialize_observables_likelihood_reporting(bool quadratic_llh);

/**
* @brief initializes storage for residual reporting mode
Expand Down
26 changes: 13 additions & 13 deletions src/edata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ ExpData::ExpData(

realtype sigma;

checkSigmaPositivity(sigma_y, "sigma_y");
checkSigmaPositivity(sigma_z, "sigma_z");
check_sigma_positivity(sigma_y, "sigma_y");
check_sigma_positivity(sigma_z, "sigma_z");

for (int iy = 0; iy < nytrue_; ++iy) {
for (int it = 0; it < nt(); ++it) {
Expand Down Expand Up @@ -195,7 +195,7 @@ void ExpData::set_observed_data_std_dev(
std::vector<realtype> const& observedDataStdDev
) {
check_data_dimension(observedDataStdDev, "observedDataStdDev");
checkSigmaPositivity(observedDataStdDev, "observedDataStdDev");
check_sigma_positivity(observedDataStdDev, "observedDataStdDev");

if (observedDataStdDev.size() == static_cast<unsigned>(nt()) * nytrue_)
observed_data_std_dev_ = observedDataStdDev;
Expand All @@ -204,7 +204,7 @@ void ExpData::set_observed_data_std_dev(
}

void ExpData::set_observed_data_std_dev(realtype const stdDev) {
checkSigmaPositivity(stdDev, "stdDev");
check_sigma_positivity(stdDev, "stdDev");
std::ranges::fill(observed_data_std_dev_, stdDev);
}

Expand All @@ -216,15 +216,15 @@ void ExpData::set_observed_data_std_dev(
"Input observedDataStdDev did not match dimensions nt (%i), was %i",
nt(), observedDataStdDev.size()
);
checkSigmaPositivity(observedDataStdDev, "observedDataStdDev");
check_sigma_positivity(observedDataStdDev, "observedDataStdDev");

for (int it = 0; it < nt(); ++it)
observed_data_std_dev_.at(iy + it * nytrue_)
= observedDataStdDev.at(it);
}

void ExpData::set_observed_data_std_dev(realtype const stdDev, int const iy) {
checkSigmaPositivity(stdDev, "stdDev");
check_sigma_positivity(stdDev, "stdDev");
for (int it = 0; it < nt(); ++it)
observed_data_std_dev_.at(iy + it * nytrue_) = stdDev;
}
Expand Down Expand Up @@ -289,7 +289,7 @@ void ExpData::set_observed_events_std_dev(
std::vector<realtype> const& observedEventsStdDev
) {
check_events_dimension(observedEventsStdDev, "observedEventsStdDev");
checkSigmaPositivity(observedEventsStdDev, "observedEventsStdDev");
check_sigma_positivity(observedEventsStdDev, "observedEventsStdDev");

if (observedEventsStdDev.size() == (unsigned)nmaxevent_ * nztrue_)
observed_events_std_dev_ = observedEventsStdDev;
Expand All @@ -298,7 +298,7 @@ void ExpData::set_observed_events_std_dev(
}

void ExpData::set_observed_events_std_dev(realtype const stdDev) {
checkSigmaPositivity(stdDev, "stdDev");
check_sigma_positivity(stdDev, "stdDev");
std::ranges::fill(observed_events_std_dev_, stdDev);
}

Expand All @@ -311,15 +311,15 @@ void ExpData::set_observed_events_std_dev(
"(%i), was %i",
nmaxevent_, observedEventsStdDev.size()
);
checkSigmaPositivity(observedEventsStdDev, "observedEventsStdDev");
check_sigma_positivity(observedEventsStdDev, "observedEventsStdDev");

for (int ie = 0; ie < nmaxevent_; ++ie)
observed_events_std_dev_.at(iz + ie * nztrue_)
= observedEventsStdDev.at(ie);
}

void ExpData::set_observed_events_std_dev(realtype const stdDev, int const iz) {
checkSigmaPositivity(stdDev, "stdDev");
check_sigma_positivity(stdDev, "stdDev");

for (int ie = 0; ie < nmaxevent_; ++ie)
observed_events_std_dev_.at(iz + ie * nztrue_) = stdDev;
Expand Down Expand Up @@ -386,14 +386,14 @@ void ExpData::check_events_dimension(
);
}

void checkSigmaPositivity(
void check_sigma_positivity(
std::vector<realtype> const& sigmaVector, char const* vectorName
) {
for (auto&& sigma : sigmaVector)
checkSigmaPositivity(sigma, vectorName);
check_sigma_positivity(sigma, vectorName);
}

void checkSigmaPositivity(realtype const sigma, char const* sigmaName) {
void check_sigma_positivity(realtype const sigma, char const* sigmaName) {
if (sigma <= 0.0)
throw AmiException(
"Encountered sigma <= 0 in %s! value: %f", sigmaName, sigma
Expand Down
12 changes: 6 additions & 6 deletions src/hdf5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace amici::hdf5 {
* @param n
* @param model
*/
void checkMeasurementDimensionsCompatible(
void check_measurement_dimensions_compatible(
hsize_t const m, hsize_t const n, Model const& model
) {
bool compatible = true;
Expand Down Expand Up @@ -54,7 +54,7 @@ void checkMeasurementDimensionsCompatible(
* @param n
* @param model
*/
void checkEventDimensionsCompatible(
void check_event_dimensions_compatible(
hsize_t const m, hsize_t const n, Model const& model
) {
bool compatible = true;
Expand Down Expand Up @@ -126,7 +126,7 @@ std::unique_ptr<ExpData> read_exp_data_from_hdf5(
if (model.ny * model.nt() > 0) {
if (location_exists(file, hdf5Root + "/Y")) {
auto const my = get_double_2d_dataset(file, hdf5Root + "/Y", m, n);
checkMeasurementDimensionsCompatible(m, n, model);
check_measurement_dimensions_compatible(m, n, model);
edata->set_observed_data(my);
} else {
throw AmiException(
Expand All @@ -137,7 +137,7 @@ std::unique_ptr<ExpData> read_exp_data_from_hdf5(
if (location_exists(file, hdf5Root + "/Sigma_Y")) {
auto const sigmay
= get_double_2d_dataset(file, hdf5Root + "/Sigma_Y", m, n);
checkMeasurementDimensionsCompatible(m, n, model);
check_measurement_dimensions_compatible(m, n, model);
edata->set_observed_data_std_dev(sigmay);
} else {
throw AmiException(
Expand All @@ -150,7 +150,7 @@ std::unique_ptr<ExpData> read_exp_data_from_hdf5(
if (model.nz * model.n_max_event() > 0) {
if (location_exists(file, hdf5Root + "/Z")) {
auto const mz = get_double_2d_dataset(file, hdf5Root + "/Z", m, n);
checkEventDimensionsCompatible(m, n, model);
check_event_dimensions_compatible(m, n, model);
edata->set_observed_events(mz);
} else {
throw AmiException(
Expand All @@ -161,7 +161,7 @@ std::unique_ptr<ExpData> read_exp_data_from_hdf5(
if (location_exists(file, hdf5Root + "/Sigma_Z")) {
auto sigmaz
= get_double_2d_dataset(file, hdf5Root + "/Sigma_Z", m, n);
checkEventDimensionsCompatible(m, n, model);
check_event_dimensions_compatible(m, n, model);
edata->set_observed_events_std_dev(sigmaz);
} else {
throw AmiException(
Expand Down
Loading
Loading