Class AmiciApplication

Class Documentation

class amici::AmiciApplication

Main class for making calls to AMICI.

This class is used to provide separate AMICI contexts, for example, for use in multi-threaded applications where different threads want to use AMICI with different settings, such custom logging functions.

NOTE: For this moment, the context object needs to be set manually to any Model and Solver object. If not set, they will use the default output channel.

Public Functions

AmiciApplication() = default
std::unique_ptr<ReturnData> runAmiciSimulation(Solver &solver, const ExpData *edata, Model &model, bool rethrow = false)

Core integration routine. Initializes the solver and runs the forward and backward problem.

Return

rdata pointer to return data object

Parameters
  • solver: Solver instance

  • edata: pointer to experimental data object

  • model: model specification object

  • rethrow: rethrow integration exceptions?

std::vector<std::unique_ptr<ReturnData>> runAmiciSimulations(Solver const &solver, const std::vector<ExpData*> &edatas, Model const &model, bool failfast, int num_threads)

Same as runAmiciSimulation, but for multiple ExpData instances.

Return

vector of pointers to return data objects

Parameters
  • solver: Solver instance

  • edatas: experimental data objects

  • model: model specification object

  • failfast: flag to allow early termination

  • num_threads: number of threads for parallel execution

void warningF(const char *identifier, const char *format, ...) const

printf interface to warning()

Parameters
  • identifier: warning identifier

  • format: string with warning message printf-style format

  • ...: arguments to be formatted

void errorF(const char *identifier, const char *format, ...) const

printf interface to error()

Parameters
  • identifier: warning identifier

  • format: string with error message printf-style format

  • ...: arguments to be formatted

int checkFinite(gsl::span<const realtype> array, const char *fun)

Checks the values in an array for NaNs and Infs.

Return

AMICI_RECOVERABLE_ERROR if a NaN/Inf value was found, AMICI_SUCCESS otherwise

Parameters
  • array: array

  • fun: name of calling function

Public Members

outputFunctionType warning = printWarnMsgIdAndTxt

Function to process warnings

outputFunctionType error = printErrMsgIdAndTxt

Function to process errors