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
6 changes: 3 additions & 3 deletions include/amici/abstract_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ class AbstractModel {
virtual void fdJydy(realtype *dJydy, int iy, const realtype *p,
const realtype *k, const realtype *y,
const realtype *sigmay, const realtype *my);

/**
* @brief Model-specific implementation of fdJydy colptrs
* @param dJydy sparse matrix to which colptrs will be written
Expand Down Expand Up @@ -800,15 +800,15 @@ class AbstractModel {
* @param dwdx sparse matrix to which rowvals will be written
*/
virtual void fdwdx_rowvals(SUNMatrixWrapper &dwdx);

/**
* @brief Model specific implementation of fdwdw, no w chainrule (Py)
* @param dwdw partial derivative w wrt w
* @param t timepoint
* @param x Vector with the states
* @param p parameter vector
* @param k constants vector
* @param h heavyside vector
* @param h Heaviside vector
* @param w vector with helper variables
* @param tcl Total abundances for conservation laws
*/
Expand Down
2 changes: 1 addition & 1 deletion include/amici/edata.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class ExpData {
* @brief set function that copies observed data for specific observable
*
* @param observedData observed data (dimension: nt)
* @param iy oberved data index
* @param iy observed data index
*/
void setObservedData(const std::vector<realtype> &observedData, int iy);

Expand Down
2 changes: 1 addition & 1 deletion include/amici/hdf5.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ void createAndWriteDouble3DDataset(H5::H5File const &file,
/**
* @brief Read scalar native double attribute from HDF5 object.
* @param file HDF5 file
* @param optionsObject Object to read attribute frin
* @param optionsObject Object to read attribute from
* @param attributeName Name of attribute to read
* @return Attribute value
*/
Expand Down
24 changes: 12 additions & 12 deletions include/amici/model.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ class Model : public AbstractModel {
using AbstractModel::fx0_fixedParameters;
using AbstractModel::fy;
using AbstractModel::fz;

/**
* @brief Initialize model properties.
* @param x Reference to state variables
Expand Down Expand Up @@ -597,7 +597,7 @@ class Model : public AbstractModel {
* @return Observable IDs
*/
virtual std::vector<std::string> getObservableIds() const;

/**
* @brief Checks whether the defined noise model is gaussian, i.e., the nllh is quadratic
* @return boolean flag
Expand Down Expand Up @@ -1298,13 +1298,13 @@ class Model : public AbstractModel {

/** Flag indicating Matlab- or Python-based model generation */
bool pythonGenerated;

/**
* @brief getter for dxdotdp (matlab generated)
* @return dxdotdp
*/
const AmiVectorArray &get_dxdotdp() const;

/**
* @brief getter for dxdotdp (python generated)
* @return dxdotdp
Expand Down Expand Up @@ -1642,7 +1642,7 @@ class Model : public AbstractModel {
* @param x Array with the states
*/
void fdwdx(realtype t, const realtype *x);

/**
* @brief Compute self derivative for recurring terms in xdot.
* @param t Timepoint
Expand Down Expand Up @@ -1736,7 +1736,7 @@ class Model : public AbstractModel {
* @return State vector with negative values replaced by `0` according to
* stateIsNonNegative
*/
N_Vector computeX_pos(const_N_Vector x);
const_N_Vector computeX_pos(const_N_Vector x);

/** All variables necessary for function evaluation */
ModelState state_;
Expand All @@ -1752,13 +1752,13 @@ class Model : public AbstractModel {

/** Sparse dwdx temporary storage (dimension: `ndwdx`) */
mutable SUNMatrixWrapper dwdx_;

/** Sparse dwdp temporary storage (dimension: `ndwdp`) */
mutable SUNMatrixWrapper dwdp_;

/** Dense Mass matrix (dimension: `nx_solver` x `nx_solver`) */
mutable SUNMatrixWrapper M_;

/**
* Temporary storage of `dxdotdp_full` data across functions (Python only)
* (dimension: `nplist` x `nx_solver`, nnz: dynamic,
Expand All @@ -1780,7 +1780,7 @@ class Model : public AbstractModel {
* type `CSC_MAT`)
*/
mutable SUNMatrixWrapper dxdotdp_implicit;

/**
* Temporary storage of `dxdotdx_explicit` data across functions (Python only)
* (dimension: `nplist` x `nx_solver`, nnz: 'nxdotdotdx_explicit',
Expand Down Expand Up @@ -2005,10 +2005,10 @@ class Model : public AbstractModel {

/** Sparse dwdw temporary storage (dimension: `ndwdw`) */
mutable SUNMatrixWrapper dwdw_;

/** Sparse dwdx implicit temporary storage (dimension: `ndwdx`) */
mutable std::vector<SUNMatrixWrapper> dwdx_hierarchical_;

/** Recursion */
int w_recursion_depth_ {0};
};
Expand Down
51 changes: 27 additions & 24 deletions include/amici/model_dae.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ class Model_DAE : public Model {
* @param xdot Vector with the right hand side
* @param J Matrix to which the Jacobian will be written
**/
void fJ(realtype t, realtype cj, N_Vector x, N_Vector dx, N_Vector xdot,
SUNMatrix J);
void fJ(realtype t, realtype cj, const_N_Vector x, const_N_Vector dx,
const_N_Vector xdot, SUNMatrix J);

void fJB(const realtype t, realtype cj, const AmiVector &x,
const AmiVector &dx, const AmiVector &xB, const AmiVector &dxB,
Expand All @@ -113,8 +113,8 @@ class Model_DAE : public Model {
* @param dxB Vector with the adjoint derivative states
* @param JB Matrix to which the Jacobian will be written
**/
void fJB(realtype t, realtype cj, N_Vector x, N_Vector dx, N_Vector xB,
N_Vector dxB, SUNMatrix JB);
void fJB(realtype t, realtype cj, const_N_Vector x, const_N_Vector dx,
const_N_Vector xB, const_N_Vector dxB, SUNMatrix JB);

void fJSparse(realtype t, realtype cj, const AmiVector &x,
const AmiVector &dx, const AmiVector &xdot,
Expand All @@ -128,7 +128,7 @@ class Model_DAE : public Model {
* @param dx Vector with the derivative states
* @param J Matrix to which the Jacobian will be written
*/
void fJSparse(realtype t, realtype cj, N_Vector x, N_Vector dx,
void fJSparse(realtype t, realtype cj, const_N_Vector x, const_N_Vector dx,
SUNMatrix J);

void fJSparseB(const realtype t, realtype cj, const AmiVector &x,
Expand All @@ -146,8 +146,8 @@ class Model_DAE : public Model {
* @param dxB Vector with the adjoint derivative states
* @param JB Matrix to which the Jacobian will be written
*/
void fJSparseB(realtype t, realtype cj, N_Vector x, N_Vector dx,
N_Vector xB, N_Vector dxB, SUNMatrix JB);
void fJSparseB(realtype t, realtype cj, const_N_Vector x, const_N_Vector dx,
const_N_Vector xB, const_N_Vector dxB, SUNMatrix JB);

/**
* @brief Diagonal of the Jacobian (for preconditioning)
Expand Down Expand Up @@ -175,8 +175,8 @@ class Model_DAE : public Model {
* @param Jv Vector to which the Jacobian vector product will be
* written
**/
void fJv(realtype t, N_Vector x, N_Vector dx, N_Vector v, N_Vector Jv,
realtype cj);
void fJv(realtype t, const_N_Vector x, const_N_Vector dx, const_N_Vector v,
N_Vector Jv, realtype cj);

/**
* @brief Matrix vector product of JB with a vector v (for iterative solvers)
Expand All @@ -186,13 +186,13 @@ class Model_DAE : public Model {
* @param xB Vector with the adjoint states
* @param dxB Vector with the adjoint derivative states
* @param vB Vector with which the Jacobian is multiplied
* @param JvB Vector to which the Jacobian vector product will be
*written
* @param JvB Vector to which the Jacobian vector product will be written
* @param cj scalar in Jacobian (inverse stepsize)
**/

void fJvB(realtype t, N_Vector x, N_Vector dx, N_Vector xB, N_Vector dxB,
N_Vector vB, N_Vector JvB, realtype cj);
void fJvB(realtype t, const_N_Vector x, const_N_Vector dx,
const_N_Vector xB, const_N_Vector dxB,
const_N_Vector vB, N_Vector JvB, realtype cj);

void froot(realtype t, const AmiVector &x, const AmiVector &dx,
gsl::span<realtype> root) override;
Expand All @@ -204,7 +204,7 @@ class Model_DAE : public Model {
* @param dx Vector with the derivative states
* @param root array with root function values
*/
void froot(realtype t, N_Vector x, N_Vector dx, gsl::span<realtype> root);
void froot(realtype t, const_N_Vector x, const_N_Vector dx, gsl::span<realtype> root);

void fxdot(realtype t, const AmiVector &x, const AmiVector &dx,
AmiVector &xdot) override;
Expand All @@ -216,7 +216,7 @@ class Model_DAE : public Model {
* @param dx Vector with the derivative states
* @param xdot Vector with the right hand side
*/
void fxdot(realtype t, N_Vector x, N_Vector dx, N_Vector xdot);
void fxdot(realtype t, const_N_Vector x, const_N_Vector dx, N_Vector xdot);

/**
* @brief Right hand side of differential equation for adjoint state xB
Expand All @@ -227,8 +227,8 @@ class Model_DAE : public Model {
* @param dxB Vector with the adjoint derivative states
* @param xBdot Vector with the adjoint right hand side
*/
void fxBdot(realtype t, N_Vector x, N_Vector dx, N_Vector xB, N_Vector dxB,
N_Vector xBdot);
void fxBdot(realtype t, const_N_Vector x, const_N_Vector dx,
const_N_Vector xB, const_N_Vector dxB, N_Vector xBdot);

/**
* @brief Right hand side of integral equation for quadrature states qB
Expand All @@ -239,7 +239,8 @@ class Model_DAE : public Model {
* @param dxB Vector with the adjoint derivative states
* @param qBdot Vector with the adjoint quadrature right hand side
*/
void fqBdot(realtype t, N_Vector x, N_Vector dx, N_Vector xB, N_Vector dxB,
void fqBdot(realtype t, const_N_Vector x, const_N_Vector dx,
const_N_Vector xB, const_N_Vector dxB,
N_Vector qBdot);

void fxBdot_ss(const realtype t, const AmiVector &xB,
Expand All @@ -252,7 +253,8 @@ class Model_DAE : public Model {
* @param dxB Vector with the adjoint derivative states
* @param xBdot Vector with the adjoint right hand side
*/
void fxBdot_ss(realtype t, N_Vector xB, N_Vector dxB, N_Vector xBdot) const;
void fxBdot_ss(realtype t, const_N_Vector xB, const_N_Vector dxB,
N_Vector xBdot) const;

/**
* @brief Implementation of fqBdot for steady state at the N_Vector level
Expand All @@ -261,7 +263,8 @@ class Model_DAE : public Model {
* @param dxB Vector with the adjoint derivative states
* @param qBdot Vector with the adjoint quadrature right hand side
*/
void fqBdot_ss(realtype t, N_Vector xB, N_Vector dxB, N_Vector qBdot) const;
void fqBdot_ss(realtype t, const_N_Vector xB, const_N_Vector dxB,
N_Vector qBdot) const;

/**
* @brief Sparse Jacobian function backward, steady state case
Expand Down Expand Up @@ -291,7 +294,7 @@ class Model_DAE : public Model {
* @param x Vector with the states
* @param dx Vector with the derivative states
*/
void fdxdotdp(realtype t, const N_Vector x, const N_Vector dx);
void fdxdotdp(realtype t, const const_N_Vector x, const const_N_Vector dx);
void fdxdotdp(const realtype t, const AmiVector &x,
const AmiVector &dx) override {
fdxdotdp(t, x.getNVector(), dx.getNVector());
Expand All @@ -310,15 +313,15 @@ class Model_DAE : public Model {
* @param sdx Vector with the derivative state sensitivities
* @param sxdot Vector with the sensitivity right hand side
*/
void fsxdot(realtype t, N_Vector x, N_Vector dx, int ip, N_Vector sx,
N_Vector sdx, N_Vector sxdot);
void fsxdot(realtype t, const_N_Vector x, const_N_Vector dx, int ip,
const_N_Vector sx, const_N_Vector sdx, N_Vector sxdot);

/**
* @brief Mass matrix for DAE systems
* @param t timepoint
* @param x Vector with the states
*/
void fM(realtype t, const N_Vector x);
void fM(realtype t, const_N_Vector x);

std::unique_ptr<Solver> getSolver() override;

Expand Down
Loading