From 7e8f6ac3906c8f18dd0a988ae21a7da77d3d44c6 Mon Sep 17 00:00:00 2001 From: Daniel Weindl Date: Wed, 21 Oct 2020 21:44:28 +0200 Subject: [PATCH 1/3] git subrepo clone (merge) --branch=v0.11.8 --force git@github.com:ICB-DCM/AMICI.git deps/AMICI subrepo: subdir: "deps/AMICI" merged: "6aa87c34" upstream: origin: "git@github.com:ICB-DCM/AMICI.git" branch: "v0.11.8" commit: "6aa87c34" git-subrepo: version: "0.4.1" origin: "https://github.com/ingydotnet/git-subrepo" commit: "a04d8c2" --- .../AMICI/.github/workflows/deploy_branch.yml | 30 + ...loy_dockerhub.yml => deploy_protected.yml} | 23 +- .../.github/workflows/deploy_release.yml | 35 + deps/AMICI/.github/workflows/deploy_sdist.yml | 33 - .../workflows/test-petab-test-suite.yml | 70 - ...l => test_benchmark_collection_models.yml} | 24 +- .../.github/workflows/test_cplusplus.yml | 107 - .../.github/workflows/test_cplusplus_osx.yml | 72 - deps/AMICI/.github/workflows/test_doc.yml | 83 + deps/AMICI/.github/workflows/test_install.yml | 82 + ...t-large-model.yml => test_performance.yml} | 25 +- .../workflows/test_petab_test_suite.yml | 84 + .../workflows/test_python_cplusplus.yml | 158 + .../workflows/test_python_ver_matrix.yml | 71 + ....yml => test_sbml_semantic_test_suite.yml} | 20 +- ...lusplus_valgrind.yml => test_valgrind.yml} | 34 +- deps/AMICI/.gitignore | 14 +- deps/AMICI/.gitrepo | 6 +- deps/AMICI/.readthedocs.yml | 4 +- deps/AMICI/.travis.yml | 144 +- deps/AMICI/CMakeLists.txt | 25 +- deps/AMICI/CODE_OF_CONDUCT.md | 76 + deps/AMICI/CONTRIBUTING.md | 8 +- deps/AMICI/INSTALL.md | 154 +- deps/AMICI/LICENSE.md | 30 +- deps/AMICI/README.md | 113 +- deps/AMICI/bu_.appveyor.yml | 41 - deps/AMICI/codecov.yml | 42 +- deps/AMICI/docker/Dockerfile | 6 +- deps/AMICI/documentation/CODE_OF_CONDUCT.md | 1 + deps/AMICI/documentation/CPP.md | 113 - deps/AMICI/documentation/CPP.rst | 9 + deps/AMICI/documentation/CPP_.md | 3 + .../ExampleEquilibrationLogic.ipynb | 1 + .../documentation/ExampleSteadystate.ipynb | 1 + deps/AMICI/documentation/FAQ.md | 69 - deps/AMICI/documentation/MATLAB.rst | 10 + .../documentation/{MATLAB.md => MATLAB_.md} | 0 deps/AMICI/documentation/PYTHON.md | 87 - deps/AMICI/documentation/PYTHON.rst | 10 + deps/AMICI/documentation/README.md | 59 +- deps/AMICI/documentation/about.rst | 59 + deps/AMICI/documentation/amici_refs.bib | 457 +-- deps/AMICI/documentation/availability.rst | 44 + deps/AMICI/documentation/background.rst | 79 + deps/AMICI/documentation/code_review_guide.md | 2 +- deps/AMICI/documentation/conf.py | 295 +- deps/AMICI/documentation/contributing.rst | 8 + deps/AMICI/documentation/cpp_installation.rst | 75 + deps/AMICI/documentation/cpp_interface.rst | 145 + deps/AMICI/documentation/development.md | 141 - deps/AMICI/documentation/development.rst | 160 + deps/AMICI/documentation/glossary.rst | 60 + deps/AMICI/documentation/how_to_cite.rst | 37 + .../implementation_discontinuities.rst | 86 + deps/AMICI/documentation/index.rst | 61 +- deps/AMICI/documentation/matlab_faq.rst | 55 + .../documentation/matlab_installation.rst | 30 + deps/AMICI/documentation/matlab_interface.rst | 510 +++ .../documentation/model_presimulation.ipynb | 1 + deps/AMICI/documentation/petab.ipynb | 1 + deps/AMICI/documentation/python_faq.rst | 28 + .../documentation/python_installation.rst | 435 +++ deps/AMICI/documentation/python_interface.rst | 231 ++ .../{modules.rst => python_modules.rst} | 11 +- .../documentation/recreate_reference_list.py | 10 +- deps/AMICI/documentation/references.md | 91 +- deps/AMICI/documentation/rtd_requirements.txt | 17 +- deps/AMICI/include/amici/abstract_model.h | 111 +- deps/AMICI/include/amici/amici.h | 2 +- deps/AMICI/include/amici/backwardproblem.h | 54 +- deps/AMICI/include/amici/defines.h | 61 +- deps/AMICI/include/amici/edata.h | 52 +- deps/AMICI/include/amici/exception.h | 18 +- deps/AMICI/include/amici/forwardproblem.h | 132 +- deps/AMICI/include/amici/hdf5.h | 202 +- deps/AMICI/include/amici/interface_matlab.h | 14 +- deps/AMICI/include/amici/misc.h | 16 +- deps/AMICI/include/amici/model.h | 1712 +++++----- deps/AMICI/include/amici/model_dae.h | 138 +- deps/AMICI/include/amici/model_ode.h | 225 +- deps/AMICI/include/amici/newton_solver.h | 73 +- deps/AMICI/include/amici/rdata.h | 39 +- deps/AMICI/include/amici/returndata_matlab.h | 32 +- deps/AMICI/include/amici/serialization.h | 251 +- deps/AMICI/include/amici/solver.h | 262 +- deps/AMICI/include/amici/solver_cvodes.h | 42 +- deps/AMICI/include/amici/solver_idas.h | 23 +- deps/AMICI/include/amici/spline.h | 2 + deps/AMICI/include/amici/steadystateproblem.h | 91 +- .../include/amici/sundials_linsol_wrapper.h | 12 +- .../include/amici/sundials_matrix_wrapper.h | 309 +- deps/AMICI/include/amici/vector.h | 61 +- deps/AMICI/matlab/@amievent/setHflag.m | 8 +- deps/AMICI/matlab/@amifun/gccode.m | 5 - deps/AMICI/matlab/@amifun/getArgs.m | 12 - deps/AMICI/matlab/@amifun/getCVar.m | 10 - deps/AMICI/matlab/@amifun/getDeps.m | 9 - deps/AMICI/matlab/@amifun/getSyms.m | 38 - deps/AMICI/matlab/@amifun/writeCcode.m | 4 - deps/AMICI/matlab/@amimodel/generateC.m | 14 +- deps/AMICI/matlab/@amimodel/parseModel.m | 4 +- deps/AMICI/matlab/@amioption/amioption.m | 85 +- deps/AMICI/matlab/amiwrap.m | 62 +- .../matlab/mtoc/config/Doxyfile.template | 2821 +++++++++++------ .../models/model_calvetti/CMakeLists.txt | 6 +- .../models/model_calvetti/model_calvetti.h | 25 +- .../model_calvetti/model_calvetti_J.cpp | 45 - .../model_calvetti/model_calvetti_JB.cpp | 45 - .../model_calvetti/model_calvetti_JDiag.cpp | 25 - .../model_calvetti_JSparseB.cpp | 79 - deps/AMICI/models/model_dirac/CMakeLists.txt | 6 +- deps/AMICI/models/model_dirac/model_dirac.h | 25 +- .../models/model_dirac/model_dirac_J.cpp | 22 - .../models/model_dirac/model_dirac_JB.cpp | 22 - .../models/model_dirac/model_dirac_JDiag.cpp | 21 - .../model_dirac/model_dirac_JSparseB.cpp | 29 - deps/AMICI/models/model_events/CMakeLists.txt | 6 +- deps/AMICI/models/model_events/model_events.h | 25 +- .../models/model_events/model_events_J.cpp | 23 - .../models/model_events/model_events_JB.cpp | 23 - .../model_events/model_events_JDiag.cpp | 22 - .../model_events/model_events_JSparseB.cpp | 32 - .../model_jakstat_adjoint/CMakeLists.txt | 6 +- .../model_jakstat_adjoint.h | 25 +- .../model_jakstat_adjoint_J.cpp | 37 - .../model_jakstat_adjoint_JB.cpp | 37 - .../model_jakstat_adjoint_JDiag.cpp | 28 - .../model_jakstat_adjoint_JSparseB.cpp | 66 - .../model_jakstat_adjoint_o2/CMakeLists.txt | 6 +- .../model_jakstat_adjoint_o2.h | 25 +- .../model_jakstat_adjoint_o2_J.cpp | 403 --- .../model_jakstat_adjoint_o2_JB.cpp | 403 --- .../model_jakstat_adjoint_o2_JDiag.cpp | 181 -- .../model_jakstat_adjoint_o2_JSparseB.cpp | 951 ------ .../models/model_nested_events/CMakeLists.txt | 6 +- .../model_nested_events/model_nested_events.h | 25 +- .../model_nested_events_J.cpp | 20 - .../model_nested_events_JB.cpp | 20 - .../model_nested_events_JDiag.cpp | 20 - .../model_nested_events_JSparseB.cpp | 24 - deps/AMICI/models/model_neuron/CMakeLists.txt | 6 +- deps/AMICI/models/model_neuron/model_neuron.h | 25 +- .../models/model_neuron/model_neuron_J.cpp | 23 - .../models/model_neuron/model_neuron_JB.cpp | 23 - .../model_neuron/model_neuron_JDiag.cpp | 21 - .../model_neuron/model_neuron_JSparseB.cpp | 31 - .../models/model_neuron_o2/CMakeLists.txt | 6 +- .../models/model_neuron_o2/model_neuron_o2.h | 25 +- .../model_neuron_o2/model_neuron_o2_J.cpp | 46 - .../model_neuron_o2/model_neuron_o2_JB.cpp | 46 - .../model_neuron_o2/model_neuron_o2_JDiag.cpp | 29 - .../model_neuron_o2_JSparseB.cpp | 85 - .../models/model_robertson/CMakeLists.txt | 6 +- .../models/model_robertson/model_robertson.h | 25 +- .../model_robertson/model_robertson_J.cpp | 28 - .../model_robertson/model_robertson_JB.cpp | 28 - .../model_robertson/model_robertson_JDiag.cpp | 22 - .../model_robertson_JSparseB.cpp | 42 - .../models/model_steadystate/CMakeLists.txt | 6 +- .../model_steadystate/model_steadystate.h | 25 +- .../model_steadystate/model_steadystate_J.cpp | 28 - .../model_steadystate_JB.cpp | 28 - .../model_steadystate_JDiag.cpp | 22 - .../model_steadystate_JSparseB.cpp | 42 - deps/AMICI/python/amici/__init__.py | 136 +- deps/AMICI/python/amici/constants.py | 28 + deps/AMICI/python/amici/custom_commands.py | 104 +- deps/AMICI/python/amici/gradient_check.py | 90 +- deps/AMICI/python/amici/logging.py | 3 +- deps/AMICI/python/amici/numpy.py | 10 +- deps/AMICI/python/amici/ode_export.py | 899 ++++-- deps/AMICI/python/amici/pandas.py | 12 +- deps/AMICI/python/amici/parameter_mapping.py | 6 +- deps/AMICI/python/amici/petab_import.py | 109 +- deps/AMICI/python/amici/petab_import_pysb.py | 326 ++ deps/AMICI/python/amici/petab_objective.py | 3 +- deps/AMICI/python/amici/petab_simulate.py | 107 + deps/AMICI/python/amici/pysb_import.py | 282 +- deps/AMICI/python/amici/sbml_import.py | 1941 ++++++------ deps/AMICI/python/amici/setup.template.py | 31 +- deps/AMICI/python/amici/setuptools.py | 50 +- deps/AMICI/python/amici/swig.py | 24 +- .../ExampleEquilibrationLogic.ipynb | 107 +- .../python/examples/example_petab/petab.ipynb | 15 +- .../model_presimulation.xml | 23 +- .../ExampleSteadystate.ipynb | 166 +- deps/AMICI/python/sdist/MANIFEST.in | 4 + deps/AMICI/python/sdist/amici/constants.py | 1 + .../python/sdist/amici/petab_import_pysb.py | 1 + .../python/sdist/amici/petab_simulate.py | 1 + deps/AMICI/python/sdist/setup.py | 22 +- deps/AMICI/python/sdist/setup_clibs.py | 2 +- deps/AMICI/python/tests/conftest.py | 8 +- .../bngwiki_egfr_simple_deletemolecules.py | 4 +- .../test_compare_conservation_laws_sbml.py | 1 + deps/AMICI/python/tests/test_hdf5.py | 2 + deps/AMICI/python/tests/test_misc.py | 2 + deps/AMICI/python/tests/test_ode_export.py | 28 +- .../AMICI/python/tests/test_petab_simulate.py | 72 + .../python/tests/test_preequilibration.py | 12 +- .../python/tests/test_pregenerated_models.py | 8 +- deps/AMICI/python/tests/test_pysb.py | 36 +- deps/AMICI/python/tests/test_sbml_import.py | 154 +- .../test_sbml_import_special_functions.py | 140 + .../AMICI/python/tests/test_swig_interface.py | 5 +- deps/AMICI/python/tests/valgrind-python.supp | 219 ++ deps/AMICI/scripts/README.md | 35 +- deps/AMICI/scripts/build-mingw.ps1 | 64 - deps/AMICI/scripts/build-msvs.ps1 | 59 - deps/AMICI/scripts/buildAll.sh | 5 +- deps/AMICI/scripts/buildAmici.sh | 3 +- deps/AMICI/scripts/buildDependencies.sh | 14 + deps/AMICI/scripts/buildModel.sh | 17 - deps/AMICI/scripts/buildSdist.sh | 14 + deps/AMICI/scripts/compileBLAS.cmd | 13 + deps/AMICI/scripts/deployPyPi.sh | 17 - deps/AMICI/scripts/downloadAndBuildDoxygen.sh | 3 +- deps/AMICI/scripts/downloadAndBuildMtocpp.sh | 73 + deps/AMICI/scripts/downloadAndBuildSwig.sh | 6 +- deps/AMICI/scripts/hdf5-1.8.7-mingw.patch | 24 - deps/AMICI/scripts/installOpenBLAS.ps1 | 18 +- deps/AMICI/scripts/patch-hdf5.sh | 10 - deps/AMICI/scripts/run-SBMLTestsuite.sh | 4 +- deps/AMICI/scripts/run-doxygen.sh | 67 +- deps/AMICI/scripts/run-sphinx-hasenv.sh | 17 + deps/AMICI/scripts/run-sphinx.sh | 13 +- .../{run-valgrind.sh => run-valgrind-cpp.sh} | 0 deps/AMICI/scripts/run-valgrind-py.sh | 18 + deps/AMICI/sonar-project.properties | 1 + deps/AMICI/src/abstract_model.cpp | 144 +- deps/AMICI/src/amici.cpp | 8 +- deps/AMICI/src/backwardproblem.cpp | 144 +- deps/AMICI/src/edata.cpp | 194 +- deps/AMICI/src/exception.cpp | 8 +- deps/AMICI/src/forwardproblem.cpp | 184 +- deps/AMICI/src/main.template.cpp | 174 +- deps/AMICI/src/model.cpp | 991 +++--- deps/AMICI/src/model_dae.cpp | 155 +- deps/AMICI/src/model_header.ODE_template.h | 111 +- deps/AMICI/src/model_ode.cpp | 271 +- deps/AMICI/src/newton_solver.cpp | 223 +- deps/AMICI/src/rdata.cpp | 106 +- deps/AMICI/src/solver.cpp | 673 ++-- deps/AMICI/src/solver_cvodes.cpp | 295 +- deps/AMICI/src/solver_idas.cpp | 280 +- deps/AMICI/src/steadystateproblem.cpp | 251 +- deps/AMICI/src/sundials_linsol_wrapper.cpp | 134 +- deps/AMICI/src/sundials_matrix_wrapper.cpp | 879 +++-- deps/AMICI/src/vector.cpp | 92 +- deps/AMICI/swig/abstract_model.i | 12 + deps/AMICI/swig/amici.i | 5 +- deps/AMICI/swig/hdf5.i | 10 + deps/AMICI/swig/model.i | 11 +- deps/AMICI/swig/model_dae.i | 2 + deps/AMICI/swig/model_ode.i | 6 + deps/AMICI/swig/solver.i | 1 + deps/AMICI/swig/solver_cvodes.i | 3 + deps/AMICI/swig/solver_idas.i | 3 + deps/AMICI/tests/cpputest/main.cpp | 1 - deps/AMICI/tests/cpputest/testOptions.h5 | Bin 345976 -> 345976 bytes deps/AMICI/tests/cpputest/testfunctions.h | 22 +- .../AMICI/tests/cpputest/unittests/tests1.cpp | 198 +- .../cpputest/unittests/testsSerialization.cpp | 82 +- .../generateTestConfig/example_robertson.py | 3 +- deps/AMICI/tests/performance/reference.yml | 12 +- deps/AMICI/tests/performance/test.py | 50 +- deps/AMICI/tests/petab_test_suite/conftest.py | 18 +- .../petab_test_suite/test_petab_suite.py | 36 +- deps/AMICI/tests/testSBMLSuite.py | 234 +- deps/AMICI/version.txt | 2 +- 271 files changed, 14549 insertions(+), 12712 deletions(-) create mode 100644 deps/AMICI/.github/workflows/deploy_branch.yml rename deps/AMICI/.github/workflows/{deploy_dockerhub.yml => deploy_protected.yml} (60%) create mode 100644 deps/AMICI/.github/workflows/deploy_release.yml delete mode 100644 deps/AMICI/.github/workflows/deploy_sdist.yml delete mode 100644 deps/AMICI/.github/workflows/test-petab-test-suite.yml rename deps/AMICI/.github/workflows/{test-benchmark-collection-models.yml => test_benchmark_collection_models.yml} (66%) delete mode 100644 deps/AMICI/.github/workflows/test_cplusplus.yml delete mode 100644 deps/AMICI/.github/workflows/test_cplusplus_osx.yml create mode 100644 deps/AMICI/.github/workflows/test_doc.yml create mode 100644 deps/AMICI/.github/workflows/test_install.yml rename deps/AMICI/.github/workflows/{test-large-model.yml => test_performance.yml} (76%) create mode 100644 deps/AMICI/.github/workflows/test_petab_test_suite.yml create mode 100644 deps/AMICI/.github/workflows/test_python_cplusplus.yml create mode 100644 deps/AMICI/.github/workflows/test_python_ver_matrix.yml rename deps/AMICI/.github/workflows/{sbml-semantic-test-suite.yml => test_sbml_semantic_test_suite.yml} (63%) rename deps/AMICI/.github/workflows/{test_cplusplus_valgrind.yml => test_valgrind.yml} (58%) create mode 100644 deps/AMICI/CODE_OF_CONDUCT.md delete mode 100644 deps/AMICI/bu_.appveyor.yml create mode 120000 deps/AMICI/documentation/CODE_OF_CONDUCT.md delete mode 100644 deps/AMICI/documentation/CPP.md create mode 100644 deps/AMICI/documentation/CPP.rst create mode 100644 deps/AMICI/documentation/CPP_.md create mode 120000 deps/AMICI/documentation/ExampleEquilibrationLogic.ipynb create mode 120000 deps/AMICI/documentation/ExampleSteadystate.ipynb delete mode 100644 deps/AMICI/documentation/FAQ.md create mode 100644 deps/AMICI/documentation/MATLAB.rst rename deps/AMICI/documentation/{MATLAB.md => MATLAB_.md} (100%) delete mode 100644 deps/AMICI/documentation/PYTHON.md create mode 100644 deps/AMICI/documentation/PYTHON.rst create mode 100644 deps/AMICI/documentation/about.rst create mode 100644 deps/AMICI/documentation/availability.rst create mode 100644 deps/AMICI/documentation/background.rst create mode 100644 deps/AMICI/documentation/contributing.rst create mode 100644 deps/AMICI/documentation/cpp_installation.rst create mode 100644 deps/AMICI/documentation/cpp_interface.rst delete mode 100644 deps/AMICI/documentation/development.md create mode 100644 deps/AMICI/documentation/development.rst create mode 100644 deps/AMICI/documentation/glossary.rst create mode 100644 deps/AMICI/documentation/how_to_cite.rst create mode 100644 deps/AMICI/documentation/implementation_discontinuities.rst create mode 100644 deps/AMICI/documentation/matlab_faq.rst create mode 100644 deps/AMICI/documentation/matlab_installation.rst create mode 100644 deps/AMICI/documentation/matlab_interface.rst create mode 120000 deps/AMICI/documentation/model_presimulation.ipynb create mode 120000 deps/AMICI/documentation/petab.ipynb create mode 100644 deps/AMICI/documentation/python_faq.rst create mode 100644 deps/AMICI/documentation/python_installation.rst create mode 100644 deps/AMICI/documentation/python_interface.rst rename deps/AMICI/documentation/{modules.rst => python_modules.rst} (66%) delete mode 100644 deps/AMICI/models/model_calvetti/model_calvetti_J.cpp delete mode 100644 deps/AMICI/models/model_calvetti/model_calvetti_JB.cpp delete mode 100644 deps/AMICI/models/model_calvetti/model_calvetti_JDiag.cpp delete mode 100644 deps/AMICI/models/model_calvetti/model_calvetti_JSparseB.cpp delete mode 100644 deps/AMICI/models/model_dirac/model_dirac_J.cpp delete mode 100644 deps/AMICI/models/model_dirac/model_dirac_JB.cpp delete mode 100644 deps/AMICI/models/model_dirac/model_dirac_JDiag.cpp delete mode 100644 deps/AMICI/models/model_dirac/model_dirac_JSparseB.cpp delete mode 100644 deps/AMICI/models/model_events/model_events_J.cpp delete mode 100644 deps/AMICI/models/model_events/model_events_JB.cpp delete mode 100644 deps/AMICI/models/model_events/model_events_JDiag.cpp delete mode 100644 deps/AMICI/models/model_events/model_events_JSparseB.cpp delete mode 100644 deps/AMICI/models/model_jakstat_adjoint/model_jakstat_adjoint_J.cpp delete mode 100644 deps/AMICI/models/model_jakstat_adjoint/model_jakstat_adjoint_JB.cpp delete mode 100644 deps/AMICI/models/model_jakstat_adjoint/model_jakstat_adjoint_JDiag.cpp delete mode 100644 deps/AMICI/models/model_jakstat_adjoint/model_jakstat_adjoint_JSparseB.cpp delete mode 100644 deps/AMICI/models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2_J.cpp delete mode 100644 deps/AMICI/models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2_JB.cpp delete mode 100644 deps/AMICI/models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2_JDiag.cpp delete mode 100644 deps/AMICI/models/model_jakstat_adjoint_o2/model_jakstat_adjoint_o2_JSparseB.cpp delete mode 100644 deps/AMICI/models/model_nested_events/model_nested_events_J.cpp delete mode 100644 deps/AMICI/models/model_nested_events/model_nested_events_JB.cpp delete mode 100644 deps/AMICI/models/model_nested_events/model_nested_events_JDiag.cpp delete mode 100644 deps/AMICI/models/model_nested_events/model_nested_events_JSparseB.cpp delete mode 100644 deps/AMICI/models/model_neuron/model_neuron_J.cpp delete mode 100644 deps/AMICI/models/model_neuron/model_neuron_JB.cpp delete mode 100644 deps/AMICI/models/model_neuron/model_neuron_JDiag.cpp delete mode 100644 deps/AMICI/models/model_neuron/model_neuron_JSparseB.cpp delete mode 100644 deps/AMICI/models/model_neuron_o2/model_neuron_o2_J.cpp delete mode 100644 deps/AMICI/models/model_neuron_o2/model_neuron_o2_JB.cpp delete mode 100644 deps/AMICI/models/model_neuron_o2/model_neuron_o2_JDiag.cpp delete mode 100644 deps/AMICI/models/model_neuron_o2/model_neuron_o2_JSparseB.cpp delete mode 100644 deps/AMICI/models/model_robertson/model_robertson_J.cpp delete mode 100644 deps/AMICI/models/model_robertson/model_robertson_JB.cpp delete mode 100644 deps/AMICI/models/model_robertson/model_robertson_JDiag.cpp delete mode 100644 deps/AMICI/models/model_robertson/model_robertson_JSparseB.cpp delete mode 100644 deps/AMICI/models/model_steadystate/model_steadystate_J.cpp delete mode 100644 deps/AMICI/models/model_steadystate/model_steadystate_JB.cpp delete mode 100644 deps/AMICI/models/model_steadystate/model_steadystate_JDiag.cpp delete mode 100644 deps/AMICI/models/model_steadystate/model_steadystate_JSparseB.cpp create mode 100644 deps/AMICI/python/amici/constants.py create mode 100644 deps/AMICI/python/amici/petab_import_pysb.py create mode 100644 deps/AMICI/python/amici/petab_simulate.py create mode 120000 deps/AMICI/python/sdist/amici/constants.py create mode 120000 deps/AMICI/python/sdist/amici/petab_import_pysb.py create mode 120000 deps/AMICI/python/sdist/amici/petab_simulate.py create mode 100644 deps/AMICI/python/tests/test_petab_simulate.py create mode 100644 deps/AMICI/python/tests/test_sbml_import_special_functions.py create mode 100644 deps/AMICI/python/tests/valgrind-python.supp delete mode 100755 deps/AMICI/scripts/build-mingw.ps1 delete mode 100755 deps/AMICI/scripts/build-msvs.ps1 create mode 100755 deps/AMICI/scripts/buildDependencies.sh delete mode 100755 deps/AMICI/scripts/buildModel.sh create mode 100755 deps/AMICI/scripts/buildSdist.sh create mode 100644 deps/AMICI/scripts/compileBLAS.cmd delete mode 100755 deps/AMICI/scripts/deployPyPi.sh create mode 100755 deps/AMICI/scripts/downloadAndBuildMtocpp.sh delete mode 100755 deps/AMICI/scripts/hdf5-1.8.7-mingw.patch delete mode 100755 deps/AMICI/scripts/patch-hdf5.sh create mode 100755 deps/AMICI/scripts/run-sphinx-hasenv.sh rename deps/AMICI/scripts/{run-valgrind.sh => run-valgrind-cpp.sh} (100%) create mode 100755 deps/AMICI/scripts/run-valgrind-py.sh diff --git a/deps/AMICI/.github/workflows/deploy_branch.yml b/deps/AMICI/.github/workflows/deploy_branch.yml new file mode 100644 index 000000000..5264c8157 --- /dev/null +++ b/deps/AMICI/.github/workflows/deploy_branch.yml @@ -0,0 +1,30 @@ +name: Deploy Branch +on: [push, pull_request, workflow_dispatch] + +jobs: + sdist: + name: Deploy Python Source Distribution + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 20 + + - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV + - run: echo "SWIG=${AMICI_DIR}/ThirdParty/swig-4.0.1/install/bin/swig" >> $GITHUB_ENV + + - name: Build swig4 + run: | + sudo scripts/downloadAndBuildSwig.sh + + - name: Create AMICI sdist + run: | + scripts/buildSdist.sh + + - name: "Upload artifact: sdist" + uses: actions/upload-artifact@v1 + with: + name: sdist + path: python/sdist/dist diff --git a/deps/AMICI/.github/workflows/deploy_dockerhub.yml b/deps/AMICI/.github/workflows/deploy_protected.yml similarity index 60% rename from deps/AMICI/.github/workflows/deploy_dockerhub.yml rename to deps/AMICI/.github/workflows/deploy_protected.yml index b4c449578..9f1253795 100644 --- a/deps/AMICI/.github/workflows/deploy_dockerhub.yml +++ b/deps/AMICI/.github/workflows/deploy_protected.yml @@ -1,10 +1,21 @@ -# https://github.com/marketplace/actions/publish-docker -name: Deploy to dockerhub -on: [push] +name: Deploy Protected +on: + push: + branches: + - master + - develop + pull_request: + branches: + - master + workflow_dispatch: + jobs: - build: - name: Deploy to dockerhub - runs-on: ubuntu-latest + dockerhub: + # https://github.com/marketplace/actions/publish-docker + name: Deploy Dockerhub + + runs-on: ubuntu-20.04 + steps: - uses: actions/checkout@master - run: git archive -o docker/amici.tar.gz --format=tar.gz HEAD diff --git a/deps/AMICI/.github/workflows/deploy_release.yml b/deps/AMICI/.github/workflows/deploy_release.yml new file mode 100644 index 000000000..57eacbe91 --- /dev/null +++ b/deps/AMICI/.github/workflows/deploy_release.yml @@ -0,0 +1,35 @@ +name: Deploy +on: + release: + types: + - published + +jobs: + pypi: + name: Deploy PyPI + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 20 + + - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV + - run: echo "SWIG=${AMICI_DIR}/ThirdParty/swig-4.0.1/install/bin/swig" >> $GITHUB_ENV + + - name: Build swig4 + run: | + sudo scripts/downloadAndBuildSwig.sh + + - name: sdist + run: | + scripts/buildSdist.sh + + - name: Publish a Python distribution to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} + packages_dir: python/sdist/dist + diff --git a/deps/AMICI/.github/workflows/deploy_sdist.yml b/deps/AMICI/.github/workflows/deploy_sdist.yml deleted file mode 100644 index dd68fa57c..000000000 --- a/deps/AMICI/.github/workflows/deploy_sdist.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Deploy Python source distribution -on: push - -jobs: - build: - name: Deploy Python source distribution - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - with: - fetch-depth: 20 - - - name: apt - run: | - sudo apt-get update \ - && sudo apt-get install -y swig3.0 \ - && sudo ln -s /usr/bin/swig3.0 /usr/bin/swig - - name: pip - run: | - pip3 install --upgrade --user wheel \ - && pip3 install --upgrade --user setuptools - - - name: Create AMICI sdist - run: | - cd python/sdist && /usr/bin/python3 setup.py sdist - - - name: "Upload artifact: sdist" - uses: actions/upload-artifact@v1 - with: - name: sdist - path: python/sdist/dist diff --git a/deps/AMICI/.github/workflows/test-petab-test-suite.yml b/deps/AMICI/.github/workflows/test-petab-test-suite.yml deleted file mode 100644 index b59d145ea..000000000 --- a/deps/AMICI/.github/workflows/test-petab-test-suite.yml +++ /dev/null @@ -1,70 +0,0 @@ -name: PEtab testsuite -on: - push: - branches: - - develop - - master - - pull_request: - branches: - - master - - develop - -jobs: - build: - name: PEtab testsuite - - runs-on: ubuntu-latest - - env: - ENABLE_GCOV_COVERAGE: TRUE - - steps: - - uses: actions/checkout@master - with: - fetch-depth: 20 - - # install dependencies - - name: apt - run: | - sudo apt-get update \ - && sudo apt-get install -y swig3.0 libatlas-base-dev \ - && sudo ln -s /usr/bin/swig3.0 /usr/bin/swig - - name: pip - run: | - pip3 install --upgrade --user wheel \ - && pip3 install --upgrade --user setuptools - - run: pip3 install pytest shyaml pytest-cov - - run: | - echo ::add-path::${HOME}/.local/bin/ - echo ::add-path::${GITHUB_WORKSPACE}/tests/performance/ - # install AMICI - - name: Create AMICI sdist - run: | - cd python/sdist \ - && check_time.sh create_sdist /usr/bin/python3 setup.py sdist - - name: Install AMICI sdist - run: | - AMICI_PARALLEL_COMPILE=2 check_time.sh \ - install_sdist pip3 install -v --user \ - $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab,pysb] - - - name: Run PEtab-related unit tests - run: | - pytest --cov-report=xml --cov=./ python/tests/test_*petab*.py - - # retrieve test models - - name: Download and run petab test suite - run: | - git clone --depth 1 https://github.com/petab-dev/petab_test_suite \ - && cd petab_test_suite; pip3 install -e .; cd .. \ - && AMICI_PARALLEL_COMPILE=2 pytest -v \ - --cov-report=xml --cov-append --cov=amici tests/petab_test_suite/ - - - name: Codecov - uses: codecov/codecov-action@v1.0.6 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.xml - flags: python - fail_ci_if_error: true diff --git a/deps/AMICI/.github/workflows/test-benchmark-collection-models.yml b/deps/AMICI/.github/workflows/test_benchmark_collection_models.yml similarity index 66% rename from deps/AMICI/.github/workflows/test-benchmark-collection-models.yml rename to deps/AMICI/.github/workflows/test_benchmark_collection_models.yml index 723cddafc..941f4fffc 100644 --- a/deps/AMICI/.github/workflows/test-benchmark-collection-models.yml +++ b/deps/AMICI/.github/workflows/test_benchmark_collection_models.yml @@ -1,4 +1,4 @@ -name: Benchmark collection +name: Benchmark Collection on: push: branches: @@ -9,12 +9,13 @@ on: branches: - master - develop + workflow_dispatch: jobs: build: - name: Benchmark collection + name: Benchmark Collection - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 @@ -25,25 +26,24 @@ jobs: - name: apt run: | sudo apt-get update \ - && sudo apt-get install -y swig3.0 libatlas-base-dev \ - && sudo ln -s /usr/bin/swig3.0 /usr/bin/swig + && sudo apt-get install -y swig libatlas-base-dev + - name: pip run: | pip3 install --upgrade --user wheel \ && pip3 install --upgrade --user setuptools - run: pip3 install pytest shyaml - - run: | - echo ::add-path::${HOME}/.local/bin/ - echo ::add-path::${GITHUB_WORKSPACE}/tests/performance/ + + - run: echo "${HOME}/.local/bin/" >> $GITHUB_PATH + - run: echo "${GITHUB_WORKSPACE}/tests/performance/" >> $GITHUB_PATH + # install AMICI - name: Create AMICI sdist run: | - cd python/sdist \ - && check_time.sh create_sdist /usr/bin/python3 setup.py sdist + cd python/sdist && /usr/bin/python3 setup.py sdist - name: Install AMICI sdist run: | - AMICI_PARALLEL_COMPILE=2 check_time.sh \ - install_sdist pip3 install -v --user \ + AMICI_PARALLEL_COMPILE=2 pip3 install -v --user \ $(ls -t python/sdist/dist/amici-*.tar.gz | head -1)[petab] # retrieve test models diff --git a/deps/AMICI/.github/workflows/test_cplusplus.yml b/deps/AMICI/.github/workflows/test_cplusplus.yml deleted file mode 100644 index 0d62b539f..000000000 --- a/deps/AMICI/.github/workflows/test_cplusplus.yml +++ /dev/null @@ -1,107 +0,0 @@ -name: C++ testsuite / Ubuntu -on: [push] - -jobs: - build: - name: _ - - # TODO: prepare image with more deps preinstalled - runs-on: ubuntu-latest - - env: - ENABLE_GCOV_COVERAGE: TRUE - CI_SONARCLOUD: TRUE - - steps: - - uses: actions/checkout@master - - run: git fetch --prune --unshallow - - - run: echo "::set-env name=AMICI_DIR::$(pwd)" - - run: echo "::set-env name=BNGPATH::${AMICI_DIR}/ThirdParty/BioNetGen-2.3.2" - - # sonar cloud - - run: echo "::set-env name=SONAR_SCANNER_VERSION::4.2.0.1873" - - run: echo "::set-env name=SONAR_SCANNER_HOME::$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux" - - run: echo "::set-env name=SONAR_SCANNER_OPTS::-server" - - run: echo "::add-path::${SONAR_SCANNER_HOME}/bin" - - run: echo "::add-path::$HOME/.sonar/build-wrapper-linux-x86" - - # TODO: add to ci image - - name: Install sonarcloud tools - run: | - sudo apt install nodejs curl unzip \ - && curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip \ - https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip \ - && unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ \ - && curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \ - https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip \ - && unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/ \ - - # install amici dependencies - - name: apt - run: | - sudo apt-get update \ - && sudo apt-get install -y \ - cmake \ - g++ \ - libatlas-base-dev \ - libboost-serialization-dev \ - libhdf5-serial-dev \ - python3-dev \ - swig - - - name: Build suitesparse - run: | - scripts/buildSuiteSparse.sh - - - name: Build sundials - run: | - scripts/buildSundials.sh - - - name: Build cpputest - run: | - scripts/buildCpputest.sh - - - name: Build cpputest - run: | - scripts/buildBNGL.sh - - - name: Build AMICI - run: | - CI_SONARCLOUD=TRUE scripts/buildAmici.sh - - - name: Cache sonar files - id: cache-sonar - uses: actions/cache@v1 - with: - path: sonar_cache - key: ${{ runner.os }}-sonar_cache - - - name: C++ tests - run: | - scripts/run-cpputest.sh - - - name: gcov - run: cd build && gcov CMakeFiles/amici.dir/src/*.o - - - name: Install python package - run: scripts/installAmiciSource.sh - - - name: Python tests - run: | - source build/venv/bin/activate \ - && pip3 install coverage pytest pytest-cov \ - && pytest \ - --ignore-glob=*petab* \ - --cov=amici \ - --cov-report=xml:"${AMICI_DIR}/build/coverage_py.xml" \ - --cov-append \ - ${AMICI_DIR}/python/tests - - - name: Run sonar-scanner - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - sonar-scanner \ - -Dsonar.cfamily.build-wrapper-output=bw-output \ - -Dsonar.projectVersion="$(git describe --abbrev=4 --dirty=-dirty --always --tags | tr -d '\n')" diff --git a/deps/AMICI/.github/workflows/test_cplusplus_osx.yml b/deps/AMICI/.github/workflows/test_cplusplus_osx.yml deleted file mode 100644 index 362398a7c..000000000 --- a/deps/AMICI/.github/workflows/test_cplusplus_osx.yml +++ /dev/null @@ -1,72 +0,0 @@ -name: C++ testsuite / OSX -on: [push] - -jobs: - build: - name: tests_osx - - runs-on: macos-latest - - env: - ENABLE_GCOV_COVERAGE: FALSE - CI_SONARCLOUD: FALSE - - steps: - - uses: actions/checkout@master - - run: git fetch --prune --unshallow - - - run: echo "::set-env name=AMICI_DIR::$(pwd)" - - run: echo "::set-env name=BNGPATH::${AMICI_DIR}/ThirdParty/BioNetGen-2.3.2" - - # install amici dependencies - - name: homebrew - run: | - brew install hdf5 swig gcc cppcheck libomp - - - name: Build suitesparse - run: | - scripts/buildSuiteSparse.sh - - - name: Build sundials - run: | - scripts/buildSundials.sh - - - name: Build cpputest - run: | - scripts/buildCpputest.sh - - - name: Build cpputest - run: | - scripts/buildBNGL.sh - - - name: Build AMICI - run: | - scripts/buildAmici.sh - - - name: Install python archive - run: | - scripts/installAmiciArchive.sh - - - name: Install python package - run: | - scripts/installAmiciSource.sh - - - name: cppcheck - run: | - scripts/run-cppcheck.sh - - - name: notebooks - run: | - scripts/runNotebook.sh python/examples/example_*/ - - - name: Python tests - run: | - scripts/run-python-tests.sh - - - name: C++ tests - run: | - scripts/run-cpputest.sh - - - name: sphinx - run: | - scripts/run-sphinx.sh diff --git a/deps/AMICI/.github/workflows/test_doc.yml b/deps/AMICI/.github/workflows/test_doc.yml new file mode 100644 index 000000000..9bad60975 --- /dev/null +++ b/deps/AMICI/.github/workflows/test_doc.yml @@ -0,0 +1,83 @@ +name: Documentation Tests +on: + push: + branches: + - develop + - master + pull_request: + branches: + - develop + - master + workflow_dispatch: + +jobs: + doxygen: + name: Test Doxygen + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@master + - run: git fetch --prune --unshallow + + - name: apt + run: | + sudo apt-get update \ + && sudo apt-get install -y \ + bison \ + ragel \ + graphviz \ + texlive-latex-extra + + - name: Build doxygen + run: | + sudo scripts/downloadAndBuildDoxygen.sh + + - name: Run doxygen + run: | + scripts/run-doxygen.sh + + sphinx: + name: Test Sphinx + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@master + - run: git fetch --prune --unshallow + + - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV + - run: echo "SWIG=${AMICI_DIR}/ThirdParty/swig-4.0.1/install/bin/swig" >> $GITHUB_ENV + + - name: Build doxygen + run: | + sudo scripts/downloadAndBuildDoxygen.sh + + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + # Semantic version range syntax or exact version of a Python version + python-version: '3.8' + + # install amici dependencies + - name: apt + run: | + sudo apt-get update \ + && sudo apt-get install -y \ + g++ \ + libatlas-base-dev \ + libboost-serialization-dev \ + pandoc \ + python3-venv \ + + - name: Build swig + run: | + sudo scripts/downloadAndBuildSwig.sh + + - name: pip + run: | + pip3 install setuptools + + - name: sphinx + run: | + scripts/run-sphinx.sh diff --git a/deps/AMICI/.github/workflows/test_install.yml b/deps/AMICI/.github/workflows/test_install.yml new file mode 100644 index 000000000..447eeb74a --- /dev/null +++ b/deps/AMICI/.github/workflows/test_install.yml @@ -0,0 +1,82 @@ +name: Installation +on: [push, pull_request, workflow_dispatch] + +jobs: + archive: + name: Archive Install + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@master + - run: git fetch --prune --unshallow + + - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV + + # install amici dependencies + - name: apt + run: | + sudo apt-get update \ + && sudo apt-get install -y \ + cmake \ + g++ \ + libatlas-base-dev \ + libboost-serialization-dev \ + libhdf5-serial-dev \ + swig + + - name: Build suitesparse + run: | + scripts/buildSuiteSparse.sh + + - name: Build sundials + run: | + scripts/buildSundials.sh + + - name: Build cpputest + run: | + scripts/buildCpputest.sh + + - name: pip + run: | + pip3 install numpy + + - name: Build AMICI + run: | + scripts/buildAmici.sh + + - name: Install python archive + run: | + scripts/installAmiciArchive.sh + + sdist: + name: sdist Install + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@master + - run: git fetch --prune --unshallow + + - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV + + # install amici dependencies + - name: apt + run: | + sudo apt-get update \ + && sudo apt-get install -y \ + g++ \ + libatlas-base-dev \ + libboost-serialization-dev \ + libhdf5-serial-dev \ + swig + + - name: Create AMICI sdist + run: | + scripts/buildSdist.sh + + - name: Install python sdist + run: | + pip3 install -v --user $(ls -t python/sdist/dist/amici-*.tar.gz | head -1) + + diff --git a/deps/AMICI/.github/workflows/test-large-model.yml b/deps/AMICI/.github/workflows/test_performance.yml similarity index 76% rename from deps/AMICI/.github/workflows/test-large-model.yml rename to deps/AMICI/.github/workflows/test_performance.yml index 4d7f5e2ff..131ddad04 100644 --- a/deps/AMICI/.github/workflows/test-large-model.yml +++ b/deps/AMICI/.github/workflows/test_performance.yml @@ -1,19 +1,22 @@ -name: Performance test +name: Performance Test on: push: branches: - develop - master + - speedup_reaction_ids pull_request: branches: - master + workflow_dispatch: + jobs: build: - name: Performance test + name: Performance Test - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 @@ -24,16 +27,16 @@ jobs: - name: apt run: | sudo apt-get update \ - && sudo apt-get install -y swig3.0 libatlas-base-dev \ - && sudo ln -s /usr/bin/swig3.0 /usr/bin/swig + && sudo apt-get install -y swig libatlas-base-dev - name: pip run: | pip3 install --upgrade --user wheel \ && pip3 install --upgrade --user setuptools - run: pip3 install petab shyaml - - run: | - echo ::add-path::${HOME}/.local/bin/ - echo ::add-path::${GITHUB_WORKSPACE}/tests/performance/ + + - run: echo "${HOME}/.local/bin/" >> $GITHUB_PATH + - run: echo "${GITHUB_WORKSPACE}/tests/performance/" >> $GITHUB_PATH + # install AMICI - name: Create AMICI sdist run: | @@ -86,3 +89,9 @@ jobs: - name: adjoint_sensitivities_non_optimal_parameters run: | check_time.sh adjoint_sensitivities_non_optimal_parameters tests/performance/test.py adjoint_sensitivities_non_optimal_parameters + - name: forward_steadystate_sensitivities_non_optimal_parameters + run: | + check_time.sh forward_steadystate_sensitivities_non_optimal_parameters tests/performance/test.py forward_steadystate_sensitivities_non_optimal_parameters + - name: adjoint_steadystate_sensitivities_non_optimal_parameters + run: | + check_time.sh adjoint_steadystate_sensitivities_non_optimal_parameters tests/performance/test.py adjoint_steadystate_sensitivities_non_optimal_parameters diff --git a/deps/AMICI/.github/workflows/test_petab_test_suite.yml b/deps/AMICI/.github/workflows/test_petab_test_suite.yml new file mode 100644 index 000000000..66683b092 --- /dev/null +++ b/deps/AMICI/.github/workflows/test_petab_test_suite.yml @@ -0,0 +1,84 @@ +name: PEtab +on: + push: + branches: + - develop + - master + + pull_request: + branches: + - master + - develop + + workflow_dispatch: + +jobs: + build: + name: PEtab Testsuite + + runs-on: ubuntu-20.04 + + env: + ENABLE_GCOV_COVERAGE: TRUE + + steps: + - uses: actions/checkout@master + with: + fetch-depth: 20 + + # install dependencies + - name: apt + run: | + sudo apt-get update \ + && sudo apt-get install -y \ + swig \ + libatlas-base-dev \ + python3-venv + + - name: pip + run: | + pip3 install --upgrade --user wheel \ + && pip3 install --upgrade --user setuptools + - run: pip3 install pytest shyaml pytest-cov pysb petab + + - name: Build BNGL + run: | + scripts/buildBNGL.sh + + - run: | + echo "${HOME}/.local/bin/" >> $GITHUB_PATH + echo "${GITHUB_WORKSPACE}/tests/performance/" >> $GITHUB_PATH + echo "BNGPATH=${GITHUB_WORKSPACE}/ThirdParty/BioNetGen-2.3.2" >> $GITHUB_ENV + + # install AMICI + - name: Install python package + run: | + scripts/installAmiciSource.sh + + # retrieve test models + - name: Download and install PEtab test suite + run: | + git clone --depth 1 --branch pysb https://github.com/FFroehlich/petab_test_suite \ + && source ./build/venv/bin/activate \ + && cd petab_test_suite && pip3 install -e . && cd .. + + - name: Run PEtab-related unit tests + run: | + source ./build/venv/bin/activate \ + && pytest --cov-report=xml --cov=./ python/tests/test_*petab*.py + + # run test models + - name: Run PEtab test suite + # git clone --depth 1 https://github.com/petab-dev/petab_test_suite + run: | + source ./build/venv/bin/activate \ + && AMICI_PARALLEL_COMPILE=2 pytest -v \ + --cov-report=xml --cov-append --cov=amici tests/petab_test_suite/ + + - name: Codecov + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml + flags: petab + fail_ci_if_error: true diff --git a/deps/AMICI/.github/workflows/test_python_cplusplus.yml b/deps/AMICI/.github/workflows/test_python_cplusplus.yml new file mode 100644 index 000000000..63050be16 --- /dev/null +++ b/deps/AMICI/.github/workflows/test_python_cplusplus.yml @@ -0,0 +1,158 @@ +name: C++/Python Tests +on: [push, pull_request, workflow_dispatch] + +jobs: + build: + name: Tests Ubuntu + + # TODO: prepare image with more deps preinstalled + runs-on: ubuntu-20.04 + + env: + ENABLE_GCOV_COVERAGE: "TRUE" + CI_SONARCLOUD: "TRUE" + + steps: + - uses: actions/checkout@master + - run: git fetch --prune --unshallow + + - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV + - run: echo "BNGPATH=${GITHUB_WORKSPACE}/ThirdParty/BioNetGen-2.3.2" >> $GITHUB_ENV + + # sonar cloud + - run: echo "SONAR_SCANNER_VERSION=4.2.0.1873" >> $GITHUB_ENV + - run: echo "SONAR_SCANNER_HOME=${HOME}/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux" >> $GITHUB_ENV + - run: echo "SONAR_SCANNER_OPTS=-server" >> $GITHUB_ENV + - run: echo "${SONAR_SCANNER_HOME}/bin" >> $GITHUB_PATH + - run: echo "${HOME}/.sonar/build-wrapper-linux-x86" >> $GITHUB_PATH + + # TODO: add to ci image + - name: Install sonarcloud tools + run: | + sudo apt install nodejs curl unzip \ + && curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip \ + https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip \ + && unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/ \ + && curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip \ + https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip \ + && unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/ \ + + # install amici dependencies + - name: apt + run: | + sudo apt-get update \ + && sudo apt-get install -y \ + cmake \ + g++ \ + libatlas-base-dev \ + libboost-serialization-dev \ + libhdf5-serial-dev \ + python3-venv \ + swig \ + lcov \ + libboost-math-dev + + - name: Build AMICI dependencies + run: | + scripts/buildDependencies.sh + + - name: Build AMICI + run: | + CI_SONARCLOUD=TRUE scripts/buildAmici.sh + + - name: Cache sonar files + id: cache-sonar + uses: actions/cache@v1 + with: + path: sonar_cache + key: ${{ runner.os }}-sonar_cache + + - name: C++ tests + run: | + scripts/run-cpputest.sh + + - name: Install python package + run: | + scripts/installAmiciSource.sh + + - name: Python tests + run: | + source build/venv/bin/activate \ + && pip3 install coverage pytest pytest-cov \ + && pytest \ + --ignore-glob=*petab* \ + --cov=amici \ + --cov-report=xml:"${AMICI_DIR}/build/coverage_py.xml" \ + --cov-append \ + ${AMICI_DIR}/python/tests + + - name: Codecov Python + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./build/coverage_py.xml + flags: python + fail_ci_if_error: true + + - name: lcov + run: | + lcov --compat-libtool --no-external \ + -d ${AMICI_DIR}/build/CMakeFiles/amici.dir/src \ + -b ${AMICI_DIR} -c -o coverage_cpp.info \ + && lcov --compat-libtool --no-external \ + -d ${AMICI_DIR}/python/sdist/build/temp.linux-x86_64-$(python3 --version | sed -E 's/.*([0-9]+\.[0-9]+)\..*/\1/')/amici/src \ + -b ${AMICI_DIR}/python/sdist -c -o coverage_py.info \ + && lcov -a coverage_cpp.info -a coverage_py.info -o coverage.info + + - name: Codecov CPP + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.info + flags: cpp + fail_ci_if_error: true + + - name: Run sonar-scanner + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + sonar-scanner \ + -Dsonar.cfamily.build-wrapper-output=bw-output \ + -Dsonar.projectVersion="$(git describe --abbrev=4 --dirty=-dirty --always --tags | tr -d '\n')" + + osx: + name: Tests OSX + + runs-on: macos-latest + + steps: + - uses: actions/checkout@master + - run: git fetch --prune --unshallow + + - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV + - run: echo "BNGPATH=${AMICI_DIR}/ThirdParty/BioNetGen-2.3.2" >> $GITHUB_ENV + + # install amici dependencies + - name: homebrew + run: | + brew install hdf5 swig gcc cppcheck libomp boost + + - name: Build AMICI + run: | + scripts/buildAll.sh + + - name: Install python package + run: | + scripts/installAmiciSource.sh + + - name: cppcheck + run: | + scripts/run-cppcheck.sh + + - name: Python tests + run: | + scripts/run-python-tests.sh + + - name: C++ tests + run: | + scripts/run-cpputest.sh diff --git a/deps/AMICI/.github/workflows/test_python_ver_matrix.yml b/deps/AMICI/.github/workflows/test_python_ver_matrix.yml new file mode 100644 index 000000000..d594dc299 --- /dev/null +++ b/deps/AMICI/.github/workflows/test_python_ver_matrix.yml @@ -0,0 +1,71 @@ +name: Python Tests +on: + push: + branches: + - develop + - master + + pull_request: + branches: + - master + workflow_dispatch: + +jobs: + build: + name: Python Version Matrix + + runs-on: ubuntu-20.04 + + env: + AMICI_SKIP_CMAKE_TESTS: "TRUE" + + strategy: + matrix: + python-version: [3.6, 3.7, 3.8, 3.9] + + steps: + - run: echo "AMICI_DIR=$(pwd)" >> $GITHUB_ENV + - run: echo "BNGPATH=${AMICI_DIR}/ThirdParty/BioNetGen-2.3.2" >> $GITHUB_ENV + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - uses: actions/checkout@v1 + with: + fetch-depth: 20 + + # install dependencies + - name: apt + run: | + sudo apt-get update \ + && sudo apt-get install -y \ + swig \ + libatlas-base-dev \ + libhdf5-serial-dev \ + libboost-math-dev + - name: pip + run: | + pip3 install --upgrade --user wheel \ + && pip3 install --upgrade --user setuptools + + + # install AMICI + - name: Build BNGL + run: | + scripts/buildBNGL.sh + - name: Install python package + run: | + scripts/installAmiciSource.sh + + - name: Python tests + run: | + source build/venv/bin/activate \ + && pip3 install pytest \ + && pip3 install git+https://github.com/pysb/pysb \ + && python3 -m pytest --ignore-glob=*petab* ${AMICI_DIR}/python/tests + + - name: notebooks + run: | + scripts/runNotebook.sh python/examples/example_*/ diff --git a/deps/AMICI/.github/workflows/sbml-semantic-test-suite.yml b/deps/AMICI/.github/workflows/test_sbml_semantic_test_suite.yml similarity index 63% rename from deps/AMICI/.github/workflows/sbml-semantic-test-suite.yml rename to deps/AMICI/.github/workflows/test_sbml_semantic_test_suite.yml index c9dd31400..4b5c0897c 100644 --- a/deps/AMICI/.github/workflows/sbml-semantic-test-suite.yml +++ b/deps/AMICI/.github/workflows/test_sbml_semantic_test_suite.yml @@ -1,4 +1,4 @@ -name: SBML semantic test suite +name: SBML on: push: branches: @@ -6,19 +6,20 @@ on: - master pull_request: paths: - - .github/workflows/sbml-semantic-test-suite.yml + - .github/workflows/test_sbml_semantic_test_suite.yml - python/amici/ode_export.py - python/amici/sbml_import.py - scripts/run-SBMLTestsuite.sh - tests/testSBMLSuite.py check_suite: types: [requested] + workflow_dispatch: jobs: build: - name: SBML semantic test suite + name: SBML Semantic Test Suite - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 @@ -27,8 +28,7 @@ jobs: - name: apt run: | sudo apt-get update \ - && sudo apt-get install -y swig3.0 libatlas-base-dev \ - && sudo ln -s /usr/bin/swig3.0 /usr/bin/swig + && sudo apt-get install -y swig3.0 libatlas-base-dev - run: AMICI_PARALLEL_COMPILE=2 ./scripts/installAmiciSource.sh - run: AMICI_PARALLEL_COMPILE=2 ./scripts/run-SBMLTestsuite.sh @@ -37,3 +37,11 @@ jobs: with: name: amici-semantic-results path: tests/amici-semantic-results + + - name: Codecov SBMLSuite + uses: codecov/codecov-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage_SBMLSuite.xml + flags: sbmlsuite + fail_ci_if_error: true diff --git a/deps/AMICI/.github/workflows/test_cplusplus_valgrind.yml b/deps/AMICI/.github/workflows/test_valgrind.yml similarity index 58% rename from deps/AMICI/.github/workflows/test_cplusplus_valgrind.yml rename to deps/AMICI/.github/workflows/test_valgrind.yml index 5152e3212..cd47d3075 100644 --- a/deps/AMICI/.github/workflows/test_cplusplus_valgrind.yml +++ b/deps/AMICI/.github/workflows/test_valgrind.yml @@ -1,16 +1,20 @@ -name: C++ testsuite / Valgrind / Ubuntu +name: C++ Tests on: push: branches: - - develop - master + - feature_cpp_hierarchical_derivatives + pull_request: + branches: + - master + workflow_dispatch: jobs: build: - name: _ + name: Tests Valgrind # TODO: prepare image with more deps preinstalled - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 steps: - uses: actions/checkout@master @@ -29,24 +33,18 @@ jobs: swig \ valgrind - - name: Build suitesparse - run: | - scripts/buildSuiteSparse.sh - - - name: Build sundials + - name: Build AMICI run: | - scripts/buildSundials.sh + scripts/buildAll.sh - - name: Build cpputest + - name: C++ tests / Valgrind run: | - scripts/buildCpputest.sh + scripts/run-valgrind-cpp.sh - - name: Build AMICI - # TODO: should get rid of having to install numpy before + - name: Install python package run: | - pip3 install numpy \ - && scripts/buildAmici.sh + scripts/installAmiciSource.sh - - name: C++ tests / Valgrind + - name: Python tests / Valgrind run: | - scripts/run-valgrind.sh + scripts/run-valgrind-py.sh diff --git a/deps/AMICI/.gitignore b/deps/AMICI/.gitignore index f4474b419..b3fdd8332 100644 --- a/deps/AMICI/.gitignore +++ b/deps/AMICI/.gitignore @@ -8,12 +8,16 @@ tests/cpputest/build/* tests/cpputest/build_xcode/* tests/cpputest/Testing/* +doc-venv/* doc/* fonts/* images/* stylesheets/* documentation/_build/* - +documentation/_exhale_cpp_api/* +documentation/_exhale_matlab_api/* +documentation/_doxyoutput_amici_cpp/* +documentation/_doxyoutput_amici_matlab/* sed-ml/* models/* @@ -91,6 +95,8 @@ python/.idea/* matlab/mtoc/config/latexextras.sty-e matlab/mtoc/config/latexextras.sty matlab/mtoc/config/Doxyfile-e +matlab/mtoc/Doxyfile +matlab/mtoc/config/mtocpp_filter.sh cppcheck.txt coverage_py.xml @@ -172,10 +178,14 @@ ThirdParty/SuiteSparse/share/* ThirdParty/SuperLU_MT_3.1/ ThirdParty/superlu_mt_3.1.tar.gz ThirdParty/swig-* - +ThirdParty/ragel-*.tar.gz _untracked/ documentation/generated/* # vim *.swp +tests/performance/CS_Signalling_ERBB_RAS_AKT/ +tests/performance/CS_Signalling_ERBB_RAS_AKT_petab/* +coverage_SBMLSuite.xml +Benchmark-Models-PEtab/ diff --git a/deps/AMICI/.gitrepo b/deps/AMICI/.gitrepo index 92351b227..26ba81069 100644 --- a/deps/AMICI/.gitrepo +++ b/deps/AMICI/.gitrepo @@ -5,8 +5,8 @@ ; [subrepo] remote = git@github.com:ICB-DCM/AMICI.git - branch = develop - commit = d220128f262747ad9f15db83377e4f8a5d2006d3 - parent = da7afe19a3b70b511bcbbc9eb45457fc616cfac4 + branch = v0.11.8 + commit = 6aa87c34ab80c5a5e6be40b4bcccf3386e316047 + parent = 07505464e98be8a5750f27b94cfe36359498277c cmdver = 0.4.1 method = merge diff --git a/deps/AMICI/.readthedocs.yml b/deps/AMICI/.readthedocs.yml index 32246a9b2..ef19ad6d8 100644 --- a/deps/AMICI/.readthedocs.yml +++ b/deps/AMICI/.readthedocs.yml @@ -18,10 +18,10 @@ sphinx: # Optionally build your docs in additional formats such as PDF and ePub formats: - pdf - + # Optionally set the version of Python and requirements required to build your docs python: - version: 3.7 + version: 3.8 install: - requirements: documentation/rtd_requirements.txt diff --git a/deps/AMICI/.travis.yml b/deps/AMICI/.travis.yml index 7c461d8de..8ec0411ea 100644 --- a/deps/AMICI/.travis.yml +++ b/deps/AMICI/.travis.yml @@ -10,97 +10,6 @@ branches: matrix: fast_finish: true include: - - os: linux - dist: bionic - language: python - python: 3.8 - compiler: gcc - addons: - apt: - packages: - - libhdf5-serial-dev - - zlib1g-dev - - libatlas-base-dev - - lcov - - libboost-serialization-dev - - g++-5 - - libc6-dbg - env: - - ENABLE_GCOV_COVERAGE=TRUE - - CI_BUILD=TRUE - - CI_CPPUTEST=TRUE - - CI_PYTHON=TRUE - - CI_ARCHIVE=TRUE - - CI_NOTEBOOK=TRUE - after_script: - # cpputest coverage cpp - - lcov --compat-libtool --no-external --directory ${BASE_DIR}/build/CMakeFiles/amici.dir/src --base-directory ${BASE_DIR} --capture --output-file coverage_cpp.info - # py coverage cpp - - lcov --compat-libtool --no-external --directory ${BASE_DIR}/python/sdist/build/temp.linux-x86_64-${TRAVIS_PYTHON_VERSION}/amici/src --base-directory ${BASE_DIR} --capture --output-file coverage_py.info - - lcov -a coverage_cpp.info -a coverage_py.info -o coverage.info - - bash <(curl -s https://codecov.io/bash) -f coverage.info -X fix -F cpp - # py coverage py - - bash <(curl -s https://codecov.io/bash) -f coverage_py.xml -F python - before_deploy: - - cd $BASE_DIR - deploy: - skip_cleanup: true - provider: script - script: scripts/deployPyPi.sh - on: - branch: master - tags: true - - - os: linux - dist: bionic - language: python - python: 3.7 - compiler: gcc - addons: - apt: - packages: - - libhdf5-serial-dev - - zlib1g-dev - - libatlas-base-dev - - g++-5 - - libc6-dbg - env: - - CI_BUILD=TRUE - - CI_PYTHON=TRUE - - CI_NOTEBOOK=TRUE - - - os: osx - osx_image: xcode11 - language: minimal - compiler: clang - env: - - CI_DOC=TRUE - addons: - homebrew: - casks: - - mactex - packages: - # - doxygen # disabled because current 1.8.16 does not work with recent ghostscript - - bison # doxygen build - - ragel - - graphviz - update: true - before_install: - - export PATH=/Users/travis/Library/Python/3.7/bin:/Library/TeX/texbin:$PATH - - export -f travis_fold travis_nanoseconds travis_time_start travis_time_finish - - brew link --overwrite python # https://github.com/ICB-DCM/AMICI/issues/894 - after_success: - - cd $BASE_DIR # cd to base dir for correct relative path in deploy - deploy: - provider: pages - local-dir: doc - skip-cleanup: true - github-token: $GITHUB_TOKEN # Set in the settings page of your repository, as a secure variable - keep-history: false - verbose: true - on: - branch: master - - os: windows # language python currently not supported on Windows language: cpp @@ -118,56 +27,23 @@ matrix: # stick to python 3.7 until there is a 3.8 wheel for windows # as installation from sdist fails because of reasons... - choco install python --version 3.7.5 - - choco install swig + - choco install -y swig --version=4.0.1 - python -m pip install --upgrade pip - - git clone -c core.symlinks=true https://github.com/ICB-DCM/AMICI.git && cd AMICI + - git clone -c core.symlinks=true https://github.com/AMICI-dev/AMICI.git && cd AMICI - if [[ "$TRAVIS_PULL_REQUEST" == "false" ]]; then git checkout -qf $TRAVIS_COMMIT; elif [[ "$TRAVIS_PULL_REQUEST" != "false" ]]; then git fetch --update-head-ok origin pull/$TRAVIS_PULL_REQUEST/head:$TRAVIS_BRANCH && git checkout $TRAVIS_BRANCH; fi # run BLAS installation script - - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then powershell -File 'C:\Users\travis\build\AMICI\scripts\installOpenBLAS.ps1';export BLAS_LIBS BLAS_CFLAGS; fi - # define Windows environment variables in BLAS because PowerShell definition didn't do the trick - - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then export BLAS_LIBS='/LIBPATH:C:\\BLAS\\OpenBLAS-0.3.6-x64\\lib libopenblas.lib' BLAS_CFLAGS='/IC:\\BLAS\\OpenBLAS-0.3.6-x64\\include'; fi + - powershell -File 'C:\Users\travis\build\AMICI\scripts\installOpenBLAS.ps1' + - export BLAS_LIBS='/LIBPATH:C:\\BLAS\\lib openblas.lib' BLAS_CFLAGS='-IC:\\BLAS\\OpenBLAS-v0.3.10\\OpenBLAS-0.3.10' + - export PATH=${PATH}:C:\\BLAS\\bin install: - export BASE_DIR=`pwd` - # Build swig4.0 (not yet available with apt) to include pydoc in source distribution for pypi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then scripts/downloadAndBuildSwig.sh && export PATH=${BASE_DIR}/ThirdParty/swig-4.0.1/install/bin:${PATH}; fi - - if [[ "$CI_DOC" == "TRUE" ]]; then pip3 install --user --upgrade pip==9.0.3 doxypypy; fi # pinning pip because of https://github.com/pypa/pip/issues/5240 - - if [[ "$CI_DOC" == "TRUE" ]]; then export PATH="/usr/local/opt/bison/bin:$PATH"; LDFLAGS="-L/usr/local/opt/bison/lib" scripts/downloadAndBuildDoxygen.sh; fi - - if [[ "$CI_BUILD" == "TRUE" ]] && [[ "$TRAVIS_OS_NAME" == "linux" ]]; then pip3 install --upgrade pip==9.0.3 setuptools wheel pkgconfig scipy; fi - - if [[ "$CI_BUILD" == "TRUE" ]] && [[ "$TRAVIS_OS_NAME" != "linux" ]]; then pip3 install --user --upgrade pip==9.0.3 setuptools wheel pkgconfig scipy; fi - - if [[ "$CI_BUILD" == "TRUE" ]]; then ./scripts/buildSuiteSparse.sh; fi - - if [[ "$CI_BUILD" == "TRUE" ]]; then ./scripts/buildSundials.sh; fi - - if [[ "$CI_BUILD" == "TRUE" ]]; then ./scripts/buildCpputest.sh; fi - - if [[ "$CI_PYTHON" == "TRUE" ]]; then ./scripts/buildBNGL.sh; fi - - if [[ "$CI_BUILD" == "TRUE" ]]; then ./scripts/buildAmici.sh; fi - - if [[ "$CI_ARCHIVE" == "TRUE" ]]; then ./scripts/installAmiciArchive.sh; fi - - if [[ "$CI_PYTHON" == "TRUE" ]]; then ./scripts/installAmiciSource.sh; fi - - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then cd python/sdist && python setup.py sdist; fi - - if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then pip install -v $(ls -t dist/amici-*.tar.gz | head -1); fi + - cd python/sdist && python setup.py sdist + - pip install -v $(ls -t dist/amici-*.tar.gz | head -1) script: - - export -f travis_fold travis_nanoseconds travis_time_start travis_time_finish - export FOLD=$BASE_DIR/scripts/travis_wrap.sh - cd $BASE_DIR - - if [[ "$CI_CPPCHECK" == "TRUE" ]]; then $FOLD cppcheck ./scripts/run-cppcheck.sh; fi - - if [[ "$CI_NOTEBOOK" == "TRUE" ]]; then $FOLD notebooks "cd $BASE_DIR && scripts/runNotebook.sh python/examples/example_*/"; fi - - if [[ "$CI_PYTHON" == "TRUE" ]] && [[ "$ENABLE_GCOV_COVERAGE" == "TRUE" ]]; then $FOLD codecov ./scripts/run-codecov.sh; fi - - if [[ "$CI_PYTHON" == "TRUE" ]] && [[ "$ENABLE_GCOV_COVERAGE" != "TRUE" ]]; then $FOLD python-tests ./scripts/run-python-tests.sh; fi - # needs to be run after python tests - - if [[ "$CI_CPPUTEST" == "TRUE" ]]; then $FOLD cpputest ./scripts/run-cpputest.sh; fi - - if [[ "$CI_DOC" == "TRUE" ]]; then $FOLD doxygen ./scripts/run-doxygen.sh; fi - - if [[ "$CI_PYTHON" == "TRUE" ]]; then $FOLD sphinx ./scripts/run-sphinx.sh; fi - -after_failure: - - $FOLD ls -alR - -# cache dependencies -cache: - directories: - - $HOME/Library/Caches/Homebrew - - $HOME/Library/Caches/pip - - $HOME/.cache/pip - timeout: 1200 - -before_cache: - - brew cleanup + - export AMICI_SKIP_CMAKE_TESTS=TRUE + - pip install pytest petab + - python -m pytest --ignore-glob=*petab* --ignore-glob=*special* ./python/tests diff --git a/deps/AMICI/CMakeLists.txt b/deps/AMICI/CMakeLists.txt index 2bd7bbd71..760d1442b 100644 --- a/deps/AMICI/CMakeLists.txt +++ b/deps/AMICI/CMakeLists.txt @@ -41,8 +41,13 @@ endforeach(FLAG) # find dependencies include(GNUInstallDirs) -find_package(HDF5 COMPONENTS C HL CXX REQUIRED) -set(HDF5_LIBRARIES ${HDF5_HL_LIBRARIES} ${HDF5_C_LIBRARIES} ${HDF5_CXX_LIBRARIES}) + +option(ENABLE_HDF5 "Build with HDF5 support?" ON) +if(ENABLE_HDF5) + find_package(HDF5 COMPONENTS C HL CXX REQUIRED) + set(HDF5_LIBRARIES ${HDF5_HL_LIBRARIES} ${HDF5_C_LIBRARIES} ${HDF5_CXX_LIBRARIES}) +endif() + set(SUITESPARSE_DIR "${CMAKE_SOURCE_DIR}/ThirdParty/SuiteSparse/") set(SUITESPARSE_INCLUDE_DIRS "${SUITESPARSE_DIR}/include" "${CMAKE_SOURCE_DIR}/ThirdParty/sundials/src") set(SUITESPARSE_LIBRARIES @@ -122,7 +127,7 @@ set(AMICI_SRC_LIST ${CMAKE_SOURCE_DIR}/src/rdata.cpp ${CMAKE_SOURCE_DIR}/src/edata.cpp ${CMAKE_SOURCE_DIR}/src/exception.cpp - ${CMAKE_SOURCE_DIR}/src/hdf5.cpp + ${CMAKE_SOURCE_DIR}/src/spline.cpp ${CMAKE_SOURCE_DIR}/src/solver.cpp ${CMAKE_SOURCE_DIR}/src/solver_cvodes.cpp @@ -139,6 +144,9 @@ set(AMICI_SRC_LIST ${CMAKE_SOURCE_DIR}/src/abstract_model.cpp ${CMAKE_SOURCE_DIR}/src/vector.cpp ) +if(ENABLE_HDF5) + list(APPEND AMICI_SRC_LIST ${CMAKE_SOURCE_DIR}/src/hdf5.cpp) +endif() add_library(${PROJECT_NAME} ${AMICI_SRC_LIST}) add_dependencies(${PROJECT_NAME} version) @@ -209,7 +217,7 @@ endif() include(clang-tools) set(AUTHORS "Fabian Froehlich, Jan Hasenauer, Daniel Weindl and Paul Stapor") -set(AUTHOR_EMAIL "fabian.froehlich@helmholtz-muenchen.de") +set(AUTHOR_EMAIL "Fabian_Froehlich@hms.harvard.edu") # install(TARGETS ${PROJECT_NAME} EXPORT AmiciTargets @@ -255,7 +263,12 @@ endif() option(BUILD_TESTS "Build integration tests?" ON) if(BUILD_TESTS) - enable_testing() + if(ENABLE_HDF5) + enable_testing() + + add_subdirectory(tests/cpputest) + else() + message(WARNING "Cannot build tests with ENABLE_HDF5=OFF.") + endif() - add_subdirectory(tests/cpputest) endif() diff --git a/deps/AMICI/CODE_OF_CONDUCT.md b/deps/AMICI/CODE_OF_CONDUCT.md new file mode 100644 index 000000000..eaaa3b703 --- /dev/null +++ b/deps/AMICI/CODE_OF_CONDUCT.md @@ -0,0 +1,76 @@ +# Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, sex characteristics, gender identity and expression, +level of experience, education, socio-economic status, nationality, personal +appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +* Using welcoming and inclusive language +* Being respectful of differing viewpoints and experiences +* Gracefully accepting constructive criticism +* Focusing on what is best for the community +* Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +* The use of sexualized language or imagery and unwelcome sexual attention or + advances +* Trolling, insulting/derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or electronic + address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or +reject comments, commits, code, wiki edits, issues, and other contributions +that are not aligned to this Code of Conduct, or to ban temporarily or +permanently any contributor for other behaviors that they deem inappropriate, +threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at froehlichfab@gmail.com. All +complaints will be reviewed and investigated and will result in a response that +is deemed necessary and appropriate to the circumstances. The project team is +obligated to maintain confidentiality with regard to the reporter of an incident. +Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, +available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see +https://www.contributor-covenant.org/faq diff --git a/deps/AMICI/CONTRIBUTING.md b/deps/AMICI/CONTRIBUTING.md index f11322ff2..8a096f919 100644 --- a/deps/AMICI/CONTRIBUTING.md +++ b/deps/AMICI/CONTRIBUTING.md @@ -1,12 +1,12 @@ -# How to contribute +# Contributing to AMICI We are happy about contributions to AMICI in any form, be it new functionality, documentation, bug reports, or anything else. If you would to contribute to AMICI, a good start is looking for issues tagged -[`good first issue`](https://github.com/ICB-DCM/AMICI/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) -or [`help wanted`](https://github.com/ICB-DCM/AMICI/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22). +[`good first issue`](https://github.com/AMICI-dev/AMICI/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) +or [`help wanted`](https://github.com/AMICI-dev/AMICI/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22). For other ideas or questions, just post an issue. For code contributions, please read our -[developer's guide](documentation/development.md) first. +[developer's guide](https://amici.readthedocs.io/en/develop/development.html) first. diff --git a/deps/AMICI/INSTALL.md b/deps/AMICI/INSTALL.md index e89d50749..19baa82e4 100755 --- a/deps/AMICI/INSTALL.md +++ b/deps/AMICI/INSTALL.md @@ -7,14 +7,13 @@ 4. [C++ only](#cpp) 5. [Dependencies](#dependencies) - ## Availability The sources for AMICI are available as -- Source [tarball](https://github.com/ICB-DCM/AMICI/tarball/master) -- Source [zip](https://github.com/ICB-DCM/AMICI/zipball/master) -- GIT repository on [github](https://github.com/ICB-DCM/AMICI) +- Source [tarball](https://github.com/AMICI-dev/AMICI/tarball/master) +- Source [zip](https://github.com/AMICI-dev/AMICI/zipball/master) +- GIT repository on [github](https://github.com/AMICI-dev/AMICI) A Python package is available on pypi, see below. @@ -29,11 +28,10 @@ release is available. For more information about GIT checkout their [website](http://git-scm.com/) The GIT repository can currently be found at -[https://github.com/ICB-DCM/AMICI](https://github.com/ICB-DCM/AMICI) +[https://github.com/AMICI-dev/AMICI](https://github.com/AMICI-dev/AMICI) and a direct clone is possible via - git clone https://github.com/ICB-DCM/AMICI.git AMICI - + git clone https://github.com/AMICI-dev/AMICI.git AMICI ## Python @@ -50,15 +48,14 @@ You can now import it as python module: For cases where this installation fails, check below for special setups and custom installations. For Python-AMICI usage see -[https://github.com/ICB-DCM/AMICI/blob/master/documentation/PYTHON.md](https://github.com/ICB-DCM/AMICI/blob/master/documentation/PYTHON.md). - +[https://github.com/AMICI-dev/AMICI/blob/master/documentation/PYTHON.md](https://github.com/AMICI-dev/AMICI/blob/master/documentation/PYTHON.md). ### Installation of development versions To install development versions which have not been released to pypi yet, you can install AMICI with pip directly from GitHub using: - pip3 install -e git+https://github.com/icb-dcm/amici.git@develop#egg=amici\&subdirectory=python/sdist + pip3 install -e git+https://github.com/AMICI-dev/amici.git@develop#egg=amici\&subdirectory=python/sdist Replace `develop` by the branch or commit you want to install. @@ -79,7 +76,7 @@ Python extension with this installation. NOTE: If you run into an error with above installation command, install all AMICI dependencies listed in -[`setup.py`](https://github.com/ICB-DCM/AMICI/blob/master/python/sdist/setup.py) +[`setup.py`](https://github.com/AMICI-dev/AMICI/blob/master/python/sdist/setup.py) manually, and try again. (This is because `pip` `--install-option`s are applied to *all* installed packages, including dependencies.) @@ -135,10 +132,9 @@ on. This can be done by inserting the following code before calling os.environ['CXX'] = 'clang' os.environ['CFLAGS'] = '-stdlib=libc++' -(For further discussion see https://github.com/ICB-DCM/AMICI/issues/357) - +(For further discussion see https://github.com/AMICI-dev/AMICI/issues/357) -### Windows +### Windows using GCC (mingw) To install AMICI on Windows using python, you can proceed as follows: @@ -149,17 +145,18 @@ Some general remarks: * Replace the following paths according to your installation. * Slashes can be preferable to backslashes for some environment variables. -* See also [#425](https://github.com/icb-dcm/amici/issues/425) for +* See also [#425](https://github.com/AMICI-dev/amici/issues/425) for further discussion. Then, follow these steps: * A python environment for Windows is required. We recommend - [Anaconda](https://www.anaconda.com/distribution/) with python >=3.6. -* Install [mingw64](https://sourceforge.net/projects/mingw-w64/files/latest/download) + [Anaconda](https://www.anaconda.com/distribution/) with python >=3.7. +* Install [MinGW-W64](https://sourceforge.net/projects/mingw-w64/files/) (32bit will succeed to compile, but fail during linking). - During installation, select Version=8.1.0, Architecture=x64_64. - Add the following directory to `PATH`: + MinGW-W64 GCC-8.1.0 for `x86_64-posix-sjlj` + ([direct link](https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/8.1.0/threads-posix/sjlj/x86_64-8.1.0-release-posix-sjlj-rt_v6-rev0.7z/download) has been shown to work on Windows 7 and 10 test systems. +* Add the following directory to `PATH`: + `C:\mingw-w64\x86_64-8.1.0-posix-sjlj-rt_v6-rev0\mingw64\bin` * Make sure that this is the compiler that is found by the system (e.g. `where gcc` in a `cmd` should point to this installation). @@ -174,7 +171,9 @@ Then, follow these steps: + `C:\swigwin-3.0.12` * Install AMICI using: - `pip install --global-option="build_clib" --global-option="--compiler=mingw32" --global-option="build_ext" --global-option="--compiler=mingw32" amici --no-cache-dir --verbose` + `pip install --global-option="build_clib" --global-option="--compiler=mingw32" + --global-option="build_ext" --global-option="--compiler=mingw32" + amici --no-cache-dir --verbose` Possible sources of errors: @@ -196,6 +195,88 @@ Possible sources of errors: AMICI module itself). [DependencyWalker](http://www.dependencywalker.com/) will show you which ones. + + Support for msvc is experimental. + [installOpenBLAS.ps1](https://github.com/AMICI-dev/AMICI/blob/master/scripts/installOpenBLAS.ps1) + and [compileBLAS.cmd](https://github.com/AMICI-dev/AMICI/blob/master/scripts/compileBLAS.cmd) + may serve as guidance on how to install openBLAS using msvc. + +### Windows using MSVC (Visual Studio) + +#### Visual Studio + +We assume that Visual Studio (not to be confused with Visual Studio Code) is already installed. Using Visual Studio Installer, the following components need to be included: + +* Microsoft Visual C++ (MSVC). This is part of multiple packages, including Desktop Development with C++. +* Windows Universal C Runtime. This is an individual component and installs some DLLs that we need. + +#### openBLAS + +To install open BLAS, download the following scripts from AMICI: + +https://github.com/AMICI-dev/AMICI/blob/master/scripts/installOpenBLAS.ps1 +https://github.com/AMICI-dev/AMICI/blob/master/scripts/compileBLAS.cmd + +The first script needs to be called in Powershell, and it needs to call `compileBLAS.cmd`, so you will need to modify line 11: + + C:\Users\travis\build\AMICI\scripts\compileBLAS.cmd + +so that it matches your directory structure. +This will download openBLAS and compile it, creating + + C:\BLAS\lib\openblas.lib + C:\BLAS\bin\openblas.dll + +You will also need to define two environment variables: + + BLAS_LIBS="/LIBPATH:C:\BLAS\lib openblas.lib" + BLAS_CFLAGS="/IC:\BLAS\OpenBLAS-v0.3.10\OpenBLAS-0.3.10" + +One way to do that is to run a PowerShell script with the following commands: + + [System.Environment]::SetEnvironmentVariable("BLAS_LIBS", "/LIBPATH:C:\BLAS\lib openblas.lib", [System.EnvironmentVariableTarget]::User) + [System.Environment]::SetEnvironmentVariable("BLAS_LIBS", "/LIBPATH:C:\BLAS\lib openblas.lib", [System.EnvironmentVariableTarget]::Process) + [System.Environment]::SetEnvironmentVariable("BLAS_CFLAGS", "-IC:\BLAS\OpenBLAS-v0.3.10\OpenBLAS-0.3.10", [System.EnvironmentVariableTarget]::User) + [System.Environment]::SetEnvironmentVariable("BLAS_CFLAGS", "-IC:\BLAS\OpenBLAS-v0.3.10\OpenBLAS-0.3.10", [System.EnvironmentVariableTarget]::Process) + +The call ending in `Process` sets the environment variable in the current process, and it is no longer in effect in the next process. The call ending in `User` is permanent, and takes effect the next time the user logs on. + +#### PATH +Now we need to make sure that all required DLLs are within the scope of the PATH variable. In particular, the following directories need to be included in PATH: + + C:\BLAS\bin + C:\Program Files (x86)\Windows Kits\10\Redist\ucrt\DLLs\x64 + +The first one is needed for `openblas.dll` and the second is needed for the Windows Universal C Runtime. +If any DLLs are missing in the PATH variable, Python will return the following error: + + ImportError: DLL load failed: The specified module could not be found. + +This can be tested using the "where" command. For example + + where openblas.dll + +should return + + C:\BLAS\bin\openblas.dll + +Almost all of the DLLs are standard Windows DLLs and should be included in either Windows or Visual Studio. But, in case it is necessary to test this, here is a list of some DLLs required by AMICI (when compiled with MSVC): + +* `openblas.dll` +* `python37.dll` +* `MSVCP140.dll` +* `KERNEL32.dll` +* `VCRUNTIME140_1.dll` +* `VCRUNTIME140.dll` +* `api-ms-win-crt-convert-l1-1-0.dll` +* `api-ms-win-crt-heap-l1-1-0.dll` +* `api-ms-win-crt-stdio-l1-1-0.dll` +* `api-ms-win-crt-string-l1-1-0.dll` +* `api-ms-win-crt-runtime-l1-1-0.dll` +* `api-ms-win-crt-time-l1-1-0.dll` +* `api-ms-win-crt-math-l1-1-0.dll` + +`MSVCP140.dll`, `VCRUNTIME140.dll`, and `VCRUNTIME140_1.dll` are needed by MSVC (see Visual Studio above). `KERNEL32.dll` is part of Windows and in `C:\Windows\System32`. The `api-ms-win-crt-XXX-l1-1-0.dll` are needed by `openblas.dll` and are part of the Windows Universal C Runtime (see Visual Studio above). ### Custom installation @@ -212,7 +293,6 @@ environment variables: |`ENABLE_AMICI_DEBUGGING`| Set to build AMICI with debugging symbols | `ENABLE_AMICI_DEBUGGING=TRUE`| |`AMICI_PARALLEL_COMPILE`| Set to the number of parallel processes to be used for C(++) file compilation (defaults to 1)| `AMICI_PARALLEL_COMPILE=4`| - ## MATLAB @@ -238,7 +318,6 @@ documentation: [mathworks.com](http://mathworks.com/support/compilers/R2018b/index.html) Note that Microsoft Visual Studio compilers are currently not supported. - ## C++ only @@ -273,7 +352,6 @@ To build AMICI with SuperLU_MT support, run cmake -DSUNDIALS_SUPERLUMT_ENABLE=ON .. make - ## Dependencies @@ -326,6 +404,10 @@ On Ubuntu, this requirement can be satisfied with apt install libatlas-base-dev +On Fedora (32): + + sudo dnf install blas-devel + #### C++ compiler All AMICI installations require a C++11-compatible C++ compiler. @@ -366,7 +448,6 @@ AMICI repository (not included in the PyPI package). The binary directory has to be added to the `PATH` environment variable, or `SWIG` has to be set as described in the following section. - ##### Using a non-default SWIG executable We note here that some linux package managers may provide swig @@ -384,13 +465,12 @@ AMICI package installation as well as during model compilation. The MATLAB interface requires the Mathworks Symbolic Toolbox for model generation via `amiwrap(...)`, but not for execution of precompiled models. Currently MATLAB R2018a or newer is not supported (see -[https://github.com/ICB-DCM/AMICI/issues/307](https://github.com/ICB-DCM/AMICI/issues/307)). +[https://github.com/AMICI-dev/AMICI/issues/307](https://github.com/AMICI-dev/AMICI/issues/307)). The Symbolic Toolbox requirement can be circumvented by performing model import using the Python interface. The result code can then be used from Matlab. - ### Python The python interface requires python 3.6 or newer and a cblas-compatible @@ -407,10 +487,28 @@ They are automatically installed when installing the python package. The C++ interface requires `cmake` and a cblas-compatible BLAS to be installed. - ### Optional -__SuperLU_MT__, "a general purpose library for the direct solution of large, +#### SuperLU_MT + +"A general purpose library for the direct solution of large, sparse, nonsymmetric systems of linear equations" (https://crd-legacy.lbl.gov/~xiaoye/SuperLU/#superlu_mt). SuperLU_MT is optional and is so far only available from the C++ interface. + + +#### Boost + +[Boost](https://www.boost.org/) is an optional C++ dependency only required for +special functions (including e.g. gamma derivatives) in the python interface. +It can be installed via package managers via + + apt-get install libboost-math-dev + +or + + brew install boost + +As only headers are required, also a +[source code](https://www.boost.org/doc/libs/1_66_0/more/getting_started/unix-variants.html) +download suffices. The compiler must be able to find the module in the search path. diff --git a/deps/AMICI/LICENSE.md b/deps/AMICI/LICENSE.md index a10792e80..d504f8447 100644 --- a/deps/AMICI/LICENSE.md +++ b/deps/AMICI/LICENSE.md @@ -1,6 +1,11 @@ -# License Conditions +# License conditions -Copyright (c) 2015-2018, Fabian Fröhlich, Jan Hasenauer, Daniel Weindl and Paul Stapor +## AMICI + +AMICI is released under the 3-Clause BSD License (BSD-3-Clause) with the +following terms: + +Copyright (c) 2015-2020, Fabian Fröhlich, Jan Hasenauer, Daniel Weindl and Paul Stapor All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -12,3 +17,24 @@ Redistribution and use in source and binary forms, with or without modification, 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +## AMICI Logo + +The AMICI logo is released under the Creative Commons CC0 1.0 Universal +(CC0 1.0) license with the terms given in `documentation/gfx/LICENSE.md`. + +## Dependencies + +* Parts of the *SUNDIALS* solver suite are redistributed under the BSD 3-Clause + License (BSD-3-Clause) with terms given in + `ThirdParty/SuiteSparse/LICENSE.txt` +* Parts of *SuiteSparse* are redistributed under the various licenses with the + terms given in `ThirdParty/SuiteSparse/LICENSE.txt` +* *gsl-lite* is redistributed under the MIT License (MIT) with the terms given + in `ThirdParty/gsl/gsl/gsl-lite.hpp` +* *xml2struct* and *struct2xml* are redistributed under the BSD 2-Clause + License (BSD-2-Clause) with terms given in + `matlab/auxiliary/xml2struct/license.txt` and + `matlab/auxiliary/struct2xml/license.txt` +* *CalcMD5* is redistributed under the BSD 2-Clause License (BSD-2-Clause) + with terms given in `matlab/auxiliary/CalcMD5/license.txt` diff --git a/deps/AMICI/README.md b/deps/AMICI/README.md index 07d275eaa..ef48216aa 100644 --- a/deps/AMICI/README.md +++ b/deps/AMICI/README.md @@ -1,4 +1,4 @@ - +AMICI logo ## Advanced Multilanguage Interface for CVODES and IDAS @@ -12,8 +12,8 @@ AMICI provides a multi-language (Python, C++, Matlab) interface for the (for algebraic differential equations). AMICI allows the user to read differential equation models specified as [SBML](http://sbml.org/) or [PySB](http://pysb.org/) -and automatically compiles such models into `.mex` simulation files -(Matlab), C++ executables or Python modules. +and automatically compiles such models into Python modules, C++ libraries or +Matlab `.mex` simulation files. In contrast to the (no longer maintained) [sundialsTB](https://computing.llnl.gov/projects/sundials/sundials-software) @@ -31,24 +31,24 @@ constrained optimization problems. ## Current build status - - - - - - - - - - - - + + PyPI version + + Build Status + + Code coverage + + SonarCloud technical debt + + Zenodo DOI + + ReadTheDocs status - + coreinfrastructure bestpractices badge ## Features -* SBML import (see details below) +* SBML import * PySB import * Generation of C++ code for model simulation and sensitivity computation @@ -67,46 +67,62 @@ constrained optimization problems. ## Interfaces & workflow The AMICI workflow starts with importing a model from either -[SBML](http://sbml.org/) (Matlab, Python) or a Matlab definition of the -model (Matlab-only). From this input, all equations for model simulation +[SBML](http://sbml.org/) (Matlab, Python), [PySB](http://pysb.org/) (Python), +or a Matlab definition of the model (Matlab-only). From this input, +all equations for model simulation are derived symbolically and C++ code is generated. This code is then compiled into a C++ library, a Python module, or a Matlab `.mex` file and is then used for model simulation. -![AMICI workflow](https://raw.githubusercontent.com/ICB-DCM/AMICI/master/documentation/gfx/amici_workflow.png) +![AMICI workflow](https://raw.githubusercontent.com/AMICI-dev/AMICI/master/documentation/gfx/amici_workflow.png) ## Getting started -The AMICI source code is available at https://github.com/ICB-DCM/AMICI/. -To install AMICI, first read the -[installation instructions](http://icb-dcm.github.io/AMICI/md__i_n_s_t_a_l_l.html). +The AMICI source code is available at https://github.com/AMICI-dev/AMICI/. +To install AMICI, first read the installation instructions for +[Python](https://amici.readthedocs.io/en/latest/python_installation.html), +[C++](https://amici.readthedocs.io/en/develop/cpp_installation.html) or +[Matlab](https://amici.readthedocs.io/en/develop/matlab_installation.html). To get you started with Python-AMICI, the best way might be checking out this -[Jupyter notebook](https://github.com/ICB-DCM/AMICI/blob/master/python/examples/example_steadystate/ExampleSteadystate.ipynb). +[Jupyter notebook](https://github.com/AMICI-dev/AMICI/blob/master/python/examples/example_steadystate/ExampleSteadystate.ipynb). To get started with Matlab-AMICI, various examples are available -in [matlab/examples/](https://github.com/ICB-DCM/AMICI/tree/master/matlab/examples). +in [matlab/examples/](https://github.com/AMICI-dev/AMICI/tree/master/matlab/examples). -Comprehensive documentation on installation and usage of AMICI is available -online for the [python](https://amici.readthedocs.io/en/latest/) and -[MATLAB/C++](http://icb-dcm.github.io/AMICI/) interfaces. +Comprehensive documentation is available at +[https://amici.readthedocs.io/en/latest/](https://amici.readthedocs.io/en/latest/). -Any [contributions](http://icb-dcm.github.io/AMICI/md__c_o_n_t_r_i_b_u_t_i_n_g.html) +Any [contributions](https://amici.readthedocs.io/en/develop/CONTRIBUTING.html) to AMICI are welcome (code, bug reports, suggestions for improvements, ...). -### Getting help +## Getting help In case of questions or problems with using AMICI, feel free to post an -[issue](https://github.com/ICB-DCM/AMICI/issues) on Github. We are trying to +[issue](https://github.com/AMICI-dev/AMICI/issues) on GitHub. We are trying to get back to you quickly. +## Projects using AMICI + +There are several tools for parameter estimation offering good integration +with AMICI: + +* [pyPESTO](https://github.com/ICB-DCM/pyPESTO): Python library for + optimization, sampling and uncertainty analysis +* [pyABC](https://github.com/ICB-DCM/pyABC): Python library for + parallel and scalable ABC-SMC (Approximate Bayesian Computation - Sequential + Monte Carlo) +* [parPE](https://github.com/ICB-DCM/parPE): C++ library for parameter + estimation of ODE models offering distributed memory parallelism with focus + on problems with many simulation conditions. + ## Publications **Citeable DOI for the latest AMICI release:** [![DOI](https://zenodo.org/badge/43677177.svg)](https://zenodo.org/badge/latestdoi/43677177) -There is a list of [publications using AMICI](documentation/references.md). +There is a list of [publications using AMICI](https://amici.readthedocs.io/en/latest/references.html). If you used AMICI in your work, we are happy to include your project, please let us know via a Github issue. @@ -122,34 +138,11 @@ and/or doi:[10.1093/bioinformatics/btw764](https://doi.org/10.1093/bioinformatics/btw764) When presenting work that employs AMICI, feel free to use one of the icons in -[documentation/gfx/](https://github.com/ICB-DCM/AMICI/tree/master/documentation/gfx), which are available under a [CC0](https://github.com/ICB-DCM/AMICI/tree/master/documentation/gfx/LICENSE.md) license: +[documentation/gfx/](https://github.com/AMICI-dev/AMICI/tree/master/documentation/gfx), +which are available under a +[CC0](https://github.com/AMICI-dev/AMICI/tree/master/documentation/gfx/LICENSE.md) +license:

- + AMICI Logo

- -## Status of SBML support in Python-AMICI - -Python-AMICI currently passes 696 out of the 1780 (~39%) test cases from -the semantic -[SBML Test Suite](https://github.com/sbmlteam/sbml-test-suite/) -([current status](https://github.com/ICB-DCM/AMICI/actions)). - -In addition, we currently plan to add support for the following features -(see corresponding issues for details and progress): - -- Events (currently Matlab-only) -- Algebraic rules -- Models without species - -contributions are welcome. - -However, the following features are unlikely to be supported: - -- SBML extensions -- `factorial()`, `ceil()`, `floor()`, due to incompatibility with - symbolic sensitivity computations -- initial assignments for parameters -- `delay()` due to missing SUNDIALS solver support - -In addition to SBML, we also plan to implement support for the [Simulation Experiment Description Markup Language (SED-ML)](https://sed-ml.org/). diff --git a/deps/AMICI/bu_.appveyor.yml b/deps/AMICI/bu_.appveyor.yml deleted file mode 100644 index e9eac5615..000000000 --- a/deps/AMICI/bu_.appveyor.yml +++ /dev/null @@ -1,41 +0,0 @@ -version: '{build}' - -os: Visual Studio 2015 - -cache: - - x86_64-4.9.2-release-win32-seh-rt_v4-rev4.7z - - hdf5-1.8.17-win64-vs2015-shared.zip - -platform: - - x64 - -branches: - only: - - master - - staging - -environment: - matrix: - - compiler: mingw - MINGW_DIR: mingw64 - MINGW_URL: https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/4.9.2/threads-win32/seh/x86_64-4.9.2-release-win32-seh-rt_v4-rev4.7z/download - MINGW_ARCHIVE: x86_64-4.9.2-release-win32-seh-rt_v4-rev4.7z - HDF5_URL: https://support.hdfgroup.org/ftp/HDF5/current/bin/windows/extra/hdf5-1.8.17-win64-vs2015-shared.zip - HDF5_ARCHIVE: hdf5-1.8.17-win64-vs2015-shared.zip - -install: - - if not exist "%MINGW_ARCHIVE%" appveyor DownloadFile "%MINGW_URL%" -FileName "%MINGW_ARCHIVE%" - - if not exist "%HDF5_ARCHIVE%" appveyor DownloadFile "%HDF5_URL%" -FileName "%HDF5_ARCHIVE%" - - 7z x -y "%MINGW_ARCHIVE%" > nul - - 7z x -y "%HDF5_ARCHIVE%" > nul - - cd hdf5 - - msiexec /i HDF5-1.8.17-win64.msi /quiet - - cd "C:\Program Files\HDF_Group\HDF5\1.8.17\lib" - - C:\MinGW\msys\1.0\bin\sh C:\projects\amici\scripts\patch-hdf5.sh - - cd "C:\projects\amici" - -before_build: - - set "Path=%CD%\%MINGW_DIR%\bin;C:\Program Files\HDF_Group\HDF5\1.8.17;%Path%" - -build_script: - - ps: .\scripts\build-mingw.ps1 \ No newline at end of file diff --git a/deps/AMICI/codecov.yml b/deps/AMICI/codecov.yml index 2f1478f3e..457744a4c 100644 --- a/deps/AMICI/codecov.yml +++ b/deps/AMICI/codecov.yml @@ -1,2 +1,42 @@ fixes: - - "build/venv/lib/python3.6/site-packages/::python/" \ No newline at end of file + - "build/venv/lib/python3.6/site-packages/::python/" + - "build/venv/lib/python3.7/site-packages/::python/" + - "build/venv/lib/python3.8/site-packages/::python/" + +codecov: + require_ci_to_pass: yes + +coverage: + precision: 2 + round: down + range: "70...100" + +parsers: + gcov: + branch_detection: + conditional: yes + loop: yes + method: no + macro: no + +comment: + layout: "reach,diff,flags,tree" + behavior: default + require_changes: no + +ignore: + - "tests/*" + - "tests/**/*" + +flags: + python: + carryforward: false + cpp: + carryforward: false + petab: + carryforward: false + sbmlsuite: + paths: + - "python/amici/sbml_import.py" + - "python/amici/ode_export.py" + carryforward: true diff --git a/deps/AMICI/docker/Dockerfile b/deps/AMICI/docker/Dockerfile index 2203b522e..fdc2c3b2a 100644 --- a/deps/AMICI/docker/Dockerfile +++ b/deps/AMICI/docker/Dockerfile @@ -7,14 +7,10 @@ RUN apt update \ python3 \ python3-dev \ python3-pip \ - swig \ - && ln -sf /usr/bin/swig3.0 /usr/bin/swig + swig COPY amici.tar.gz /tmp -ENV AMICI_CXXFLAGS -fopenmp -ENV AMICI_LDFLAGS -fopenmp - RUN pip3 install -U --upgrade pip wheel \ && mkdir -p /tmp/amici/ \ && cd /tmp/amici \ diff --git a/deps/AMICI/documentation/CODE_OF_CONDUCT.md b/deps/AMICI/documentation/CODE_OF_CONDUCT.md new file mode 120000 index 000000000..0400d5746 --- /dev/null +++ b/deps/AMICI/documentation/CODE_OF_CONDUCT.md @@ -0,0 +1 @@ +../CODE_OF_CONDUCT.md \ No newline at end of file diff --git a/deps/AMICI/documentation/CPP.md b/deps/AMICI/documentation/CPP.md deleted file mode 100644 index 360d03085..000000000 --- a/deps/AMICI/documentation/CPP.md +++ /dev/null @@ -1,113 +0,0 @@ -# C++ Interface - -The @ref python_interface and @ref matlab_interface can translate the model -definition into C++ code, which is then compiled into a `.mex` file or a Python -module. Advanced users can also use this code within stand-alone C/C++ -application for use in other environments (e.g. on high performance computing -systems). This section will give a short overview over the generated files and -provide a brief introduction of how this code can be included in other -applications. For more details see the function level documentation, e.g. in -http://icb-dcm.github.io/AMICI/amici_8cpp.html. - - -## Generation of C++ model files - -`amiwrap.m` (Matlab) and `amici.SbmlImporter.sbml2amici` (Python) import a -model and create C++ code for various model functions. The model -source files are written to `${AMICI_ROOT_DIR}/models/${MODEL_NAME}` by -default. - -The content of a model source directory might look something like this (given -`MODEL_NAME=model_steadystate`): - -``` -CMakeLists.txt -hashes.mat -main.cpp -model_steadystate_deltaqB.cpp -model_steadystate_deltaqB.h -[... many more files model_steadystate_*.(cpp|h|md5|o) ] -wrapfunctions.cpp -wrapfunctions.h -model_steadystate.h -``` - -These files provide the implementation of a model-specific subclass of -`amici::Model`. The `CMakeLists.txt` file can be used to build the library. -`main.cpp` contains a simple scaffold for running a model simulation from C++. -See next section for more details on these files. - - -## Compiling and linking - -In your application, you need to compile and link every model -`${AMICI_ROOT_DIR}/models/${MODEL_NAME}/*.cpp`, -`${AMICI_ROOT_DIR}/src/*.cpp`, the SUNDIALS and the SuiteSparse library. -The simplest and recommended way is using the CMake package configuration -from the build directory (`AmiciConfig.cmake` for use with -[`find_package`](https://cmake.org/cmake/help/latest/command/find_package.html) -which tells CMake about all AMICI dependencies. - -During model import a [CMake](https://cmake.org/) file (`CMakeLists.txt`) -will be generated automatically. The CMake file shows the above-mentioned -library dependencies. `CMakeLists.txt`, together with `main.cpp`, provides a -scaffold for a standalone simulation program. -The required numerical libraries are shipped with AMICI. -To compile them, run `${AMICI_ROOT_DIR}/scripts/buildAll.sh` once. HDF5 -libraries and header files need to be installed separately (see AMICI -installation instructions). - -More information on how to run the compiled sample program is provided in -`main.cpp`. - -The file `wrapfunctions.h` exports some functions with generic names e.g. to -create a model instance. These functions are meant to be used by applications -which may be linked to single, potentially changing model to avoid hard-coding -the model name. Including multiple `wrapfunctions.h` files from different -models at once is not possible. - - -## Running a simulation - -The complete AMICI API is available through `amici/amici.h`; this is the only -header file that needs to be included for basic usage. -Additionally, `amici/hdf5.h` may be helpful. This file provides some -functions for reading and writing [HDF5](https://support.hdfgroup.org/) files). -All functions are declared within the `amici` namespace. - -The entry function for running an AMICI simulation is -`amici::runAmiciSimulation(...)`, declared in `amici/amici.h`. - -This function requires - -* a `amici::Model` instance. For the example `model_steadystate` the respective - class is provided as `Model_model_steadystate` in `model_steadystate.h`. - For convenience, the header `wrapfunctions.h` defines a function - `getModel()`, that returns an instance of that class. - -* a `amici::Solver` instance. This solver instance needs to match the - requirements of the model and can be generated using `model->getSolver()`. - -* optionally an `amici::ExpData` instance, which contains any experimental data - (e.g. measurements, noise model parameters or model inputs) to - compute residuals or an objective function. - -A scaffold for a standalone simulation program is generated in `main.cpp` in -the model source directory. This program shows how to use the -above-mentioned classes and how to obtain the simulation results. - -For running simulations for multiple experimental conditions -(multiple `amici::ExpData` instances), `amici::runAmiciSimulations(...)` -provides an alternative entry point. If AMICI (and your application) -have been compiled with OpenMP support (see installation guide), this allows -for running those simulations in parallel. - - -## Parameter estimation for AMICI models in high-performance computing environments - -To perform parameter estimation for large or otherwise computationally -demanding AMICI models from C++ in a high-performance computing environment, -you may find the [parPE](https://github.com/ICB-DCM/parPE/) library helpful. -parPE allows for the private or shared memory parallel evaluation of a cost -function requiring multiple simulations of the same model with different -inputs. It provides interfaces to different optimizers, such as Ipopt. diff --git a/deps/AMICI/documentation/CPP.rst b/deps/AMICI/documentation/CPP.rst new file mode 100644 index 000000000..9daac880d --- /dev/null +++ b/deps/AMICI/documentation/CPP.rst @@ -0,0 +1,9 @@ +C++ interface +============= + +.. toctree:: + :maxdepth: 2 + + Installation + Usage + API reference <_exhale_cpp_api/library_root> diff --git a/deps/AMICI/documentation/CPP_.md b/deps/AMICI/documentation/CPP_.md new file mode 100644 index 000000000..3f09951d8 --- /dev/null +++ b/deps/AMICI/documentation/CPP_.md @@ -0,0 +1,3 @@ +# C++ Interface + +See [https://amici.readthedocs.io/en/latest/CPP.html](https://amici.readthedocs.io/en/develop/CPP.html). diff --git a/deps/AMICI/documentation/ExampleEquilibrationLogic.ipynb b/deps/AMICI/documentation/ExampleEquilibrationLogic.ipynb new file mode 120000 index 000000000..4c9dc1436 --- /dev/null +++ b/deps/AMICI/documentation/ExampleEquilibrationLogic.ipynb @@ -0,0 +1 @@ +../python/examples/example_constant_species/ExampleEquilibrationLogic.ipynb \ No newline at end of file diff --git a/deps/AMICI/documentation/ExampleSteadystate.ipynb b/deps/AMICI/documentation/ExampleSteadystate.ipynb new file mode 120000 index 000000000..47d5e9f30 --- /dev/null +++ b/deps/AMICI/documentation/ExampleSteadystate.ipynb @@ -0,0 +1 @@ +../python/examples/example_steadystate/ExampleSteadystate.ipynb \ No newline at end of file diff --git a/deps/AMICI/documentation/FAQ.md b/deps/AMICI/documentation/FAQ.md deleted file mode 100644 index 14142f9de..000000000 --- a/deps/AMICI/documentation/FAQ.md +++ /dev/null @@ -1,69 +0,0 @@ -# FAQ - -__Q__: My model fails to build. - -__A__: Remove the corresponding model directory located in AMICI/models/*yourmodelname* and compile again. - ---- - -__Q__: It still does not compile. - -__A__: Remove the directory AMICI/models/`mexext` and compile again. - ---- - -__Q__: It still does not compile. - -__A__: Make an [issue](https://github.com/ICB-DCM/AMICI/issues) and we will have a look. - ---- - -__Q__: My Python-generated model does not compile from MATLAB. - -__A__: Try building any of the available examples before. If this succeeds, -retry building the original model. Some dependencies might not be built -correctly when using only the `compileMexFile.m` script. - ---- - -__Q__: I get an out of memory error while compiling my model on a Windows machine. - -__A__: This may be due to an old compiler version. See [issue #161](https://github.com/ICB-DCM/AMICI/issues/161) for instructions on how to install a new compiler. - ---- - -__Q__: How are events interpreted in a DAE context? - -__A__: Currently we only support impulse free events. Also sensitivities have never been tested. Proceed with care and create an [issue](https://github.com/ICB-DCM/AMICI/issues) if any problems arise! - ---- - -__Q__: The simulation/sensitivities I get are incorrect. - -__A__: There are some known issues, especially with adjoint sensitivities, events and DAEs. If your particular problem is not featured in the [issues](https://github.com/ICB-DCM/AMICI/issues) list, please add it! - ---- - -__Q__: I am trying to install the AMICI Python package, but installation fails -with something like - - amici/src/cblas.cpp:16:13: fatal error: cblas.h: No such file or directory - #include - ^~~~~~~~~ - compilation terminated. - error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 - -__A__: You will have to install a CBLAS-compatible BLAS library and/or set -`BLAS_CFLAGS` as described in the [installation guide](INSTALL.md). - ---- - -__Q__: Importing my model fails with something like `ImportError: _someModelName.cpython-37m-x86_64-linux-gnu.so: undefined symbol: omp_get_thread_num`. - -__A__: You probably installed the AMICI package with OpenMP support, but did not -have the relevant compiler/linker flags set when importing/building the model. -See [Python-AMICI guide](PYTHON.md#model-compilation). - - - - diff --git a/deps/AMICI/documentation/MATLAB.rst b/deps/AMICI/documentation/MATLAB.rst new file mode 100644 index 000000000..3b22878b7 --- /dev/null +++ b/deps/AMICI/documentation/MATLAB.rst @@ -0,0 +1,10 @@ +Matlab interface +================ + +.. toctree:: + :maxdepth: 2 + + Installation + Usage + FAQ + API reference <_exhale_matlab_api/library_root> diff --git a/deps/AMICI/documentation/MATLAB.md b/deps/AMICI/documentation/MATLAB_.md similarity index 100% rename from deps/AMICI/documentation/MATLAB.md rename to deps/AMICI/documentation/MATLAB_.md diff --git a/deps/AMICI/documentation/PYTHON.md b/deps/AMICI/documentation/PYTHON.md deleted file mode 100644 index 4935aada4..000000000 --- a/deps/AMICI/documentation/PYTHON.md +++ /dev/null @@ -1,87 +0,0 @@ -# Python Interface {#python_interface} - -In the following we will give a detailed overview how to specify models in Python and how to call the generated simulation files. - -## Model Definition - -This guide will guide the user on how to specify models in Python using SBML. For example implementations see the examples in the python/examples directory. - -### SBML input - -First, import an sbml file using the `amici.sbml_import.SbmlImporter` class: - - import amici - sbmlImporter = amici.SbmlImporter('model_steadystate_scaled.sbml') - -the sbml document as imported by [libSBML](http://sbml.org/Software/libSBML) is available as - - sbml = sbmlImporter.sbml - -### Constants - -parameters that should be considered constants can be specified in a list of strings specifying the respective SbmlId of a parameter. - - constantParameters=['k4'] - -### Observables - -Assignment rules that should be considered as observables can extracted using the `amici.assignmentRules2observables` function. - - observables = amici.assignmentRules2observables(sbml, filter_function=lambda variable: - variable.getId().startswith('observable_') and not variable.getId().endswith('_sigma')) - -### Standard Deviations - -standard deviations can be specified as dictionaries ... - - sigmas = {'observable_x1withsigma': 'observable_x1withsigma_sigma'} - - -## Model Compilation - -to compile the sbml as python module, the user has to call the method `amici.sbml_import.SbmlImporter.sbml2amici`, passing all the previously defined model specifications - - sbmlImporter.sbml2amici('test', 'test', - observables=observables, - constantParameters=constantParameters, - sigmas=sigmas) - -Note: To build AMICI with OpenMP support, which allows to parallelize model simulations of multiple -experimental conditions, set the environment variables `AMICI_CXXFLAGS` and `AMICI_LDFLAGS` to the -correct OpenMP flags of your compiler and linker, respectively. This has to be done for both AMICI -package installation *and* model compilation. When using `gcc` on Linux, use: - - # on your shell: - AMICI_CXXFLAGS=-fopenmp AMICI_LDFLAGS=-fopenmp pip3 install amici - - # in python, before model compilation: - import os - os.environ['AMICI_CXXFLAGS'] = '-fopenmp' - os.environ['AMICI_LDFLAGS'] = '-fopenmp' - -## Model Simulation - -currently the model folder has to be manually added to the python path - - import sys - sys.path.insert(0, 'test') - -the compiled model can now be imported as python module - - import test as modelModule - -to obtain a model instance call the `getModel()` method. This model instance will be instantiated using the defautl parameter values specified in the sbml. - - model = modelModule.getModel() - -then pass the simulation timepoints to `amici.Model.setTimepoints` - - model.setTimepoints(np.linspace(0, 60, 60)) - -for simulation we need to generate a solver instance - - solver = model.getSolver() - -the model simulation can now be carried out using `amici.runAmiciSimulation` - - rdata = amici.runAmiciSimulation(model, solver) diff --git a/deps/AMICI/documentation/PYTHON.rst b/deps/AMICI/documentation/PYTHON.rst new file mode 100644 index 000000000..5c53ea1e4 --- /dev/null +++ b/deps/AMICI/documentation/PYTHON.rst @@ -0,0 +1,10 @@ +Python interface +================ + +.. toctree:: + :maxdepth: 2 + + Installation + Usage + FAQ + API reference diff --git a/deps/AMICI/documentation/README.md b/deps/AMICI/documentation/README.md index bc491d0d4..aa1de6382 100644 --- a/deps/AMICI/documentation/README.md +++ b/deps/AMICI/documentation/README.md @@ -2,48 +2,70 @@ This file describes how the AMICI documentation is organized and compiled. -The AMICI documentation is created using [doxygen](http://www.doxygen.nl/). -It combines Markdown files from the root directory, from `documentation/` -and in-source documentation from the C++, Python and Matlab source files. +## Building documentation + +### Multi-interface documentation + +AMICI documentation hosted at [Read the Docs (RTD)](https://amici.readthedocs.io/) is +generated using [Sphinx](https://www.sphinx-doc.org/) and related packages. +The legacy GitHub Pages URL https://amici-dev.github.io/AMICI/ is set up as a +redirect to RTD. + +The main configuration file is `documentation/conf.py` and the documentation +is generated using `scripts/run-sphinx.sh`. The documentation is written to +`documentation/_build/`. + +The documentation comprises: + +* reStructuredText / Markdown files from `documentation/` +* Python API documentation of native Python modules +* Python API documentation of Python generated via SWIG (doxygen-style comments + translated to docstrings by SWIG) +* C++ API documentation (doxygen -> exhale -> breathe -> sphinx) +* Matlab API documentation (mtocpp -> doxygen -> exhale -> breathe -> sphinx) + +### Doxygen-only (legacy) + +(Parts of the) AMICI documentation can also be directly created using +[doxygen](http://www.doxygen.nl/) directly. It combines Markdown files from +the root directory, from `documentation/` and in-source documentation from the +C++ and Matlab source files. The documentation is generated by running scripts/run-doxygen.sh -The resulting HTML and PDF documentation will be created in `doc/`. Upon -merges to the `master` branch, the documentation will be deployed to -github-pages at http://icb-dcm.github.io/AMICI/. - +The resulting HTML and PDF documentation will be created in `doc/`. `scripts/run-doxygen.sh` also checks for any missing in-source documentation. - -## Doxygen configuration +#### Doxygen configuration The main doxygen configuration file is located in `matlab/mtoc/config/Doxyfile.template`. Edit this file for inclusion or exclusion of additional files. - -## Matlab documentation +#### Matlab documentation Matlab documentation is processed by [mtoc++](https://www.morepas.org/software/mtocpp/docs/tools.html). This is configured in `matlab/mtoc/config`. - -## Python documentation +#### Python documentation Python documentation is processed by doxygen and doxypypy using the script and filters in `scripts/`. -## Out-of-source documentation +## Writing documentation -Out-of-source documentation files should be written in Markdown and -created within `documentation/`. +### Out-of-source documentation + +Out-of-source documentation files should be written in reStructuredText if +intended for Read the Docs or in Markdown if intended for rendering on GitHub. +Files to be included in the Sphinx/RTD documentation live in `documentation/`. Graphics for documentation are kept in `documentation/gfx/`. -Some guidelines: +### When using Markdown * Note that there are some incompatibilities of Github Markdown and Doxygen Markdown. Ideally documentation should be written in a format compatible with @@ -64,7 +86,6 @@ Some guidelines: * Avoid trailing whitespace - ## Maintaining the list of publications We want to maintain a list of publications / projects using AMICI. This is @@ -75,3 +96,5 @@ the bibtex file `documentation/amici_refs.bib`. After any changes to `documentation/amici_refs.bib`, please run documentation/recreate_reference_list.py + +(requires [biblib](https://github.com/aclements/biblib)) diff --git a/deps/AMICI/documentation/about.rst b/deps/AMICI/documentation/about.rst new file mode 100644 index 000000000..7c3895012 --- /dev/null +++ b/deps/AMICI/documentation/about.rst @@ -0,0 +1,59 @@ +=========== +About AMICI +=========== + +AMICI provides a multi-language (Python, C++, Matlab) interface to the +:term:`SUNDIALS` solvers :term:`CVODES` (for :term:`ODE`\ s) and :term:`IDAS` +(for :term:`DAE`\ s). AMICI allows the user to read +differential equation models specified as :term:`SBML` or :term:`PySB` +and automatically compiles such models into Python modules, C++ libraries or +`.mex` simulation files (Matlab). + +In contrast to the (no longer maintained) +`sundialsTB `_ +Matlab interface, all necessary functions are transformed into native +C++ code, which allows for a significantly faster simulation. + +Beyond forward integration, the compiled simulation file also allows for +forward sensitivity analysis, steady state sensitivity analysis and +adjoint sensitivity analysis for likelihood-based output functions. + +The interface was designed to provide routines for efficient gradient +computation in parameter estimation of biochemical reaction models but +it is also applicable to a wider range of differential equation +constrained optimization problems. + +Features +======== + +* :term:`SBML` import +* :term:`PySB` import +* Generation of C++ code for model simulation and sensitivity + computation +* Access to and high customizability of :term:`CVODES` and :term:`IDAS` solver +* Python, C++, Matlab interface +* Sensitivity analysis + + * forward + * steady state + * adjoint + * first- and second-order (second-order Matlab-only) + +* Pre-equilibration and pre-simulation conditions +* Support for + `discrete events and logical operations `_ + (Matlab-only) + +Interfaces & workflow +====================== + +The AMICI workflow starts with importing a model from either :term:`SBML` +(Matlab, Python), :term:`PySB` (Python), or a Matlab definition of the model +(Matlab-only). From this input, all equations for model simulation are derived +symbolically and C++ code is generated. This code is then compiled into a C++ +library, a Python module, or a Matlab `.mex` file and is then used for model +simulation. + +.. image:: gfx/amici_workflow.png + :alt: AMICI workflow + diff --git a/deps/AMICI/documentation/amici_refs.bib b/deps/AMICI/documentation/amici_refs.bib index 30ed49d76..34bde4506 100644 --- a/deps/AMICI/documentation/amici_refs.bib +++ b/deps/AMICI/documentation/amici_refs.bib @@ -1,44 +1,5 @@ % Encoding: UTF-8 - - - -@article{VillaverdeRai2019, - Author = {Villaverde, Alejandro F. and Raim\'undez, Elba and Hasenauer, Jan and Banga, Julio R.}, - Date-Added = {2019-07-26 10:02:28 +0200}, - Date-Modified = {2019-07-26 10:04:48 +0200}, - Journal = {accepted for publication in Proc. of the Foundations of Syst. Biol. in Engin. (FOSBE)}, - Keywords = {ODE, large-scale, Parameter identification, prediction uncertainty, FIM, profile likelihood}, - Title = {A Comparison of Methods for Quantifying Prediction Uncertainty in Systems Biology}, - Year = {2019}} - -@article{WangSta2019, - Author = {Wang, Dantong and Stapor, Paul and Hasenauer, Jan}, - Date-Added = {2019-07-26 09:11:43 +0200}, - Date-Modified = {2019-07-26 09:13:12 +0200}, - Journal = {accepted for publication in Proc. of the Foundations of Syst. Biol. in Engin. (FOSBE)}, - Keywords = {mixed-effect models, dirac mixture model, dmd, sigma points}, - Title = {Dirac mixture distributions for the approximation of mixed effects models}, - Year = {2019}} - -@article{LinesPas2019, - Author = {Lines, Glenn Terje and Paszkowski, Lukasz and Schmiester, Leonard and Weindl, Daniel and Stapor, Paul and Hasenauer, Jan}, - Date-Added = {2019-07-26 09:08:46 +0200}, - Date-Modified = {2019-07-26 09:13:34 +0200}, - Journal = {accepted for publication in Proc. of the Foundations of Syst. Biol. in Engin. (FOSBE)}, - Keywords = {ODE, large-scale, Simulation, steady state, Newton solver}, - Title = {Efficient computation of steady states in large-scale ODE models of biochemical reaction networks}, - Year = {2019}} - -@article{KapferSta2019, - Author = {Kapfer, Eva-Maria and Stapor, Paul and Hasenauer, Jan}, - Date-Added = {2019-07-26 08:59:38 +0200}, - Date-Modified = {2019-07-26 09:13:24 +0200}, - Journal = {accepted for publication in Proc. of the Foundations of Syst. Biol. in Engin. (FOSBE)}, - Keywords = {Optimization, large-scale, parameter estimation, Parameter identification, standards, PEtab, SBML, SED-ML, ODE, Simulation, steady state}, - Title = {Challenges in the calibration of large-scale ordinary differential equation models}, - Year = {2019}} - @article{BallnusHug2017, Author = {Ballnus, B. and Hug, S. and Hatz, K. and G{\"o}rlitz, L. and Hasenauer, J. and Theis, F. J.}, Date-Added = {2019-03-19 23:04:09 +0100}, @@ -75,14 +36,16 @@ @article{BallnusSch2018 Year = {2018}, Bdsk-Url-1 = {https://doi.org/10.1093/bioinformatics/bty229}} -@article{BastCal2018, - Author = {Bast, Lisa and Calzolari, Filippo and Strasser, Michael and Hasenauer, Jan and Theis, Fabian J. and Ninkovic, Jovica and Marr, Carsten}, - Date-Added = {2019-03-19 23:04:09 +0100}, - Date-Modified = {2019-03-19 23:04:09 +0100}, - Journal = {Cell Reports}, - Keywords = {stem cells, differentiation, stochastic modeling, parameter estimation, tree structure}, - Title = {Subtle Changes in Clonal Dynamics Underlie the Age-Related Decline in Neurogenesis}, - Year = {2018}} +@Article{BastCal2018, + author = {Bast, Lisa and Calzolari, Filippo and Strasser, Michael and Hasenauer, Jan and Theis, Fabian J. and Ninkovic, Jovica and Marr, Carsten}, + journal = {Cell Reports}, + title = {Subtle Changes in Clonal Dynamics Underlie the Age-Related Decline in Neurogenesis}, + year = {2018}, + date-added = {2019-03-19 23:04:09 +0100}, + date-modified = {2019-03-19 23:04:09 +0100}, + doi = {10.1016/j.celrep.2018.11.088}, + keywords = {stem cells, differentiation, stochastic modeling, parameter estimation, tree structure}, +} @article{BoigerHas2016, Author = {Boiger, R. and Hasenauer, J. and Hross, S. and Kaltenbacher, B.}, @@ -272,20 +235,22 @@ @article{LoosKra2018 Year = {2018}, Bdsk-Url-1 = {https://doi.org/10.1093/bioinformatics/bty514}} -@inbook{LoosMar2015, - Author = {Loos, C. and Marr, C. and Theis, F. J. and Hasenauer, J.}, - Chapter = {Approximate {B}ayesian {C}omputation for stochastic single-cell time-lapse data using multivariate test statistics}, - Date-Added = {2019-03-19 23:04:09 +0100}, - Date-Modified = {2019-03-19 23:04:09 +0100}, - Editor = {Roux, O. and Bourdon, J.}, - Keywords = {ABC, single-cell time lapse, parameter estimation}, - Month = {Sept.}, - Pages = {52--63}, - Publisher = {Springer International Publishing}, - Series = {Lecture Notes in Computer Science}, - Title = {Computational Methods in Systems Biology}, - Volume = {9308}, - Year = {2015}} +@InBook{LoosMar2015, + author = {Loos, C. and Marr, C. and Theis, F. J. and Hasenauer, J.}, + editor = {Roux, O. and Bourdon, J.}, + chapter = {Approximate {B}ayesian {C}omputation for stochastic single-cell time-lapse data using multivariate test statistics}, + pages = {52--63}, + publisher = {Springer International Publishing}, + title = {Computational Methods in Systems Biology}, + year = {2015}, + month = {Sept.}, + series = {Lecture Notes in Computer Science}, + volume = {9308}, + date-added = {2019-03-19 23:04:09 +0100}, + date-modified = {2019-03-19 23:04:09 +0100}, + doi = {10.1007/978-3-319-23401-4_6}, + keywords = {ABC, single-cell time lapse, parameter estimation}, +} @article{LoosMoe2018, Author = {Loos, Carolin and Moeller, Katharina and Fr{\"o}hlich, Fabian and Hucho, Tim and Hasenauer, Jan}, @@ -317,41 +282,34 @@ @article{MaierLoo2017 Year = {2017}, Bdsk-Url-1 = {https://doi.org/10.1093/bioinformatics/btw703}} -@article{SchaelteSta2018, - Author = {Sch{\"a}lte, Y. and Stapor, P. and Hasenauer, J.}, - Date-Added = {2019-03-19 23:04:09 +0100}, - Date-Modified = {2019-07-26 09:04:30 +0200}, - Journal = {FAC-PapersOnLine}, - Keywords = {Optimization, Parameter estimation, derivative-free, derivatives, gradients}, - Number = {19}, - Pages = {98--101}, - Title = {Evaluation of Derivative-Free Optimizers for Parameter Estimation in Systems Biology}, - Volume = {51}, - Year = {2018}} - -@article{StaporFro2018, - Author = {Stapor, Paul and Fr{\"o}hlich, Fabian and Hasenauer, Jan}, - Date-Added = {2019-03-19 23:04:09 +0100}, - Date-Modified = {2019-07-26 09:06:44 +0200}, - Journal = {Bioinformatics}, - Keywords = {adjoint sensitivity, second order methods, hessian, optimization, profile likelihood, hybrid methods, profile integration}, - Number = {13}, - Pages = {i151--i159}, - Publisher = {Oxford University Press}, - Title = {Optimization and profile calculation of {ODE} models using second order adjoint sensitivity analysis}, - Volume = {34}, - Year = {2018}} +@Article{SchaelteSta2018, + author = {Sch{\"a}lte, Y. and Stapor, P. and Hasenauer, J.}, + journal = {FAC-PapersOnLine}, + title = {Evaluation of Derivative-Free Optimizers for Parameter Estimation in Systems Biology}, + year = {2018}, + number = {19}, + pages = {98--101}, + volume = {51}, + date-added = {2019-03-19 23:04:09 +0100}, + date-modified = {2019-07-26 09:04:30 +0200}, + doi = {10.1016/j.ifacol.2018.09.025}, + keywords = {Optimization, Parameter estimation, derivative-free, derivatives, gradients}, +} -@article{VillaverdeFro2018, - Abstract = {Motivation: Mechanistic kinetic models usually contain unknown parameters, which need to be estimated by optimizing the fit of the model to experimental data. This task can be computationally challenging due to the presence of local optima and ill-conditioning. While a variety of optimization methods have been suggested to surmount these issues, it is not obvious how to choose the best one for a given problem a priori, since many factors can influence their performance. A systematic comparison of methods that are suited to parameter estimation problems of sizes ranging from tens to hundreds of optimization variables is currently missing, and smaller studies indeed provided contradictory findings. Results: Here, we use a collection of benchmark problems to evaluate the performance of two families of optimization methods: (i) a multi-start of deterministic local searches; and (ii) a hybrid metaheuristic combining stochastic global search with deterministic local searches. A fair comparison is ensured through a collaborative evaluation, involving researchers applying each method on a daily basis, and a consideration of multiple performance metrics capturing the trade-off between computational efficiency and robustness. Our results show that, thanks to recent advances in the calculation of parametric sensitivities, a multi-start of gradient-based local methods is often a successful strategy, but a better performance can be obtained with a hybrid metaheuristic. The best performer is a combination of a global scatter search metaheuristic with an interior point local method, provided with gradients estimated with adjoint-based sensitivities. We provide an implementation of this novel method in an open-source software toolbox to render it available to the scientific community. Availability and Implementation: The code to reproduce the results is available at Zenodo https://doi.org/10.5281/zenodo.1160343}, - Author = {Villaverde, Alejandro F. and Froehlich, Fabian and Weindl, Daniel and Hasenauer, Jan and Banga, Julio R}, - Date-Added = {2019-03-19 23:04:09 +0100}, - Date-Modified = {2019-07-26 09:07:31 +0200}, - Journal = {Bioinformatics}, - Keywords = {large-scale, benchmarking, optimization, MEIGO, scatter-search, multi-start}, - Pages = {bty736}, - Title = {Benchmarking optimization methods for parameter estimation in large kinetic models}, - Year = {2018}} +@Article{StaporFro2018, + author = {Stapor, Paul and Fr{\"o}hlich, Fabian and Hasenauer, Jan}, + journal = {Bioinformatics}, + title = {Optimization and profile calculation of {ODE} models using second order adjoint sensitivity analysis}, + year = {2018}, + number = {13}, + pages = {i151--i159}, + volume = {34}, + date-added = {2019-03-19 23:04:09 +0100}, + date-modified = {2019-07-26 09:06:44 +0200}, + doi = {10.1093/bioinformatics/bty230}, + keywords = {adjoint sensitivity, second order methods, hessian, optimization, profile likelihood, hybrid methods, profile integration}, + publisher = {Oxford University Press}, +} @article{DharmarajanKal2019, Author = {Dharmarajan, Lekshmi and Kaltenbach, Hans-Michael and Rudolf, Fabian and Stelling, Joerg}, @@ -369,84 +327,88 @@ @article{DharmarajanKal2019 Year = {2019}, Bdsk-Url-1 = {https://doi.org/10.1016/j.cels.2018.12.007}} -@article{GreggSar2019, - __Markedentry = {[dweindl:]}, - Abstract = {Cyclic GMP-AMP synthase (cGAS) has recently been identified as the primary protein that detects cytosolic double stranded DNA to invoke a type I interferon response. The cGAS pathway is vital in the recognition of DNA encoded viruses as well as self-DNA leaked from the nucleus of damaged cells. Currently, the dynamics regulating the cGAS pathway are poorly understood; limiting our knowledge of how DNA-induced immune responses are regulated. Using systems biology approaches, we formulated a mathematical model to describe the dynamics of this pathway and examine the resulting system-level emergent properties. Unknown model parameters were fit to data compiled from literature using a Parallel Tempering Markov Chain Monte Carlo (PT-MCMC) approach, resulting in an ensemble of parameterized models. A local sensitivity analysis demonstrated that parameter sensitivity trends across model ensembles were independent of the select parameterization. An in-silico knock-down of TREX1 found that the interferon response is highly robust, showing that complete inhibition is necessary to induce chemical conditions consistent with chronic inflammation. Lastly, we demonstrate that the model recapitulates interferon expression data resulting from small molecule inhibition of cGAS. Overall, the importance of this model is exhibited in its capacity to identify sensitive components of the cGAS pathway, generate testable hypotheses, and confirm experimental observations.}, - Author = {Gregg, Robert W and Sarkar, Saumendra N and Shoemaker, Jason E}, - Country = {England}, - Doi = {10.1016/j.jtbi.2018.11.001}, - Issn = {1095-8541}, - Issn-Linking = {0022-5193}, - Journal = {Journal of theoretical biology}, - Keywords = {Interferon signaling; ODE modeling; Systems biology}, - Month = feb, - Nlm-Id = {0376342}, - Owner = {NLM}, - Pages = {148--157}, - Pii = {S0022-5193(18)30548-4}, - Pmid = {30395807}, - Pubmodel = {Print-Electronic}, - Pubstatus = {ppublish}, - Revised = {2018-12-23}, - Title = {Mathematical modeling of the cGAS pathway reveals robustness of DNA sensing to TREX1 feedback.}, - Volume = {462}, - Year = {2019}, - Bdsk-Url-1 = {https://doi.org/10.1016/j.jtbi.2018.11.001}} - -@article{PittBan2019, - __Markedentry = {[dweindl:6]}, - Abstract = {Dynamic modelling is a core element in the systems biology approach to understanding complex biosystems. Here, we consider the problem of parameter estimation in models of biological oscillators described by deterministic nonlinear differential equations. These problems can be extremely challenging due to several common pitfalls: (i) a lack of prior knowledge about parameters (i.e. massive search spaces), (ii) convergence to local optima (due to multimodality of the cost function), (iii) overfitting (fitting the noise instead of the signal) and (iv) a lack of identifiability. As a consequence, the use of standard estimation methods (such as gradient-based local ones) will often result in wrong solutions. Overfitting can be particularly problematic, since it produces very good calibrations, giving the impression of an excellent result. However, overfitted models exhibit poor predictive power. Here, we present a novel automated approach to overcome these pitfalls. Its workflow makes use of two sequential optimisation steps incorporating three key algorithms: (1) sampling strategies to systematically tighten the parameter bounds reducing the search space, (2) efficient global optimisation to avoid convergence to local solutions, (3) an advanced regularisation technique to fight overfitting. In addition, this workflow incorporates tests for structural and practical identifiability. We successfully evaluate this novel approach considering four difficult case studies regarding the calibration of well-known biological oscillators (Goodwin, FitzHugh-Nagumo, Repressilator and a metabolic oscillator). In contrast, we show how local gradient-based approaches, even if used in multi-start fashion, are unable to avoid the above-mentioned pitfalls. Our approach results in more efficient estimations (thanks to the bounding strategy) which are able to escape convergence to local optima (thanks to the global optimisation approach). Further, the use of regularisation allows us to avoid overfitting, resulting in more generalisable calibrated models (i.e. models with greater predictive power).}, - Author = {Pitt, Jake Alan and Banga, Julio R}, - Citation-Subset = {IM}, - Completed = {2019-03-13}, - Country = {England}, - Doi = {10.1186/s12859-019-2630-y}, - Issn = {1471-2105}, - Issn-Linking = {1471-2105}, - Issue = {1}, - Journal = {BMC bioinformatics}, - Keywords = {Algorithms; Biological Clocks; Calibration; Humans; Metabolic Networks and Pathways; Models, Biological; Signal Transduction; Systems Biology, methods; Dynamic modelling; Global optimisation; Parameter bounding; Parameter estimation; Regularisation}, - Month = feb, - Nlm-Id = {100965194}, - Owner = {NLM}, - Pages = {82}, - Pii = {10.1186/s12859-019-2630-y}, - Pmc = {PMC6377730}, - Pmid = {30770736}, - Pubmodel = {Electronic}, - Pubstatus = {epublish}, - Revised = {2019-03-13}, - Title = {Parameter estimation in models of biological oscillators: an automated regularised estimation approach.}, - Volume = {20}, - Year = {2019}, - Bdsk-Url-1 = {https://doi.org/10.1186/s12859-019-2630-y}} - -@article{KaltenbacherPed2018, - Abstract = {In this paper we consider the problem of identifying parameters in stochastic differential equations. For this purpose, we transform the originally stochastic and nonlinear state equation to a deterministic linear partial differential equation for the transition probability density. We provide an appropriate likelihood cost function for parameter fitting, and derive an adjoint based approach for the computation of its gradient.}, - Author = {Barbara Kaltenbacher and Barbara Pedretscher}, - Doi = {https://doi.org/10.1016/j.jmaa.2018.05.048}, - Issn = {0022-247X}, - Journal = {Journal of Mathematical Analysis and Applications}, - Keywords = {Parameter identification, Stochastic differential equation, State space model, Likelihood function, Adjoint method}, - Number = {2}, - Pages = {872 - 884}, - Title = {Parameter estimation in SDEs via the Fokker--Planck equation: Likelihood function and adjoint based gradient computation}, - Url = {http://www.sciencedirect.com/science/article/pii/S0022247X18304414}, - Volume = {465}, - Year = {2018}, - Bdsk-Url-1 = {http://www.sciencedirect.com/science/article/pii/S0022247X18304414}, - Bdsk-Url-2 = {https://doi.org/10.1016/j.jmaa.2018.05.048}} +@Article{GreggSar2019, + author = {Gregg, Robert W and Sarkar, Saumendra N and Shoemaker, Jason E}, + journal = {Journal of theoretical biology}, + title = {Mathematical modeling of the cGAS pathway reveals robustness of DNA sensing to TREX1 feedback.}, + year = {2019}, + issn = {1095-8541}, + month = feb, + pages = {148--157}, + volume = {462}, + abstract = {Cyclic GMP-AMP synthase (cGAS) has recently been identified as the primary protein that detects cytosolic double stranded DNA to invoke a type I interferon response. The cGAS pathway is vital in the recognition of DNA encoded viruses as well as self-DNA leaked from the nucleus of damaged cells. Currently, the dynamics regulating the cGAS pathway are poorly understood; limiting our knowledge of how DNA-induced immune responses are regulated. Using systems biology approaches, we formulated a mathematical model to describe the dynamics of this pathway and examine the resulting system-level emergent properties. Unknown model parameters were fit to data compiled from literature using a Parallel Tempering Markov Chain Monte Carlo (PT-MCMC) approach, resulting in an ensemble of parameterized models. A local sensitivity analysis demonstrated that parameter sensitivity trends across model ensembles were independent of the select parameterization. An in-silico knock-down of TREX1 found that the interferon response is highly robust, showing that complete inhibition is necessary to induce chemical conditions consistent with chronic inflammation. Lastly, we demonstrate that the model recapitulates interferon expression data resulting from small molecule inhibition of cGAS. Overall, the importance of this model is exhibited in its capacity to identify sensitive components of the cGAS pathway, generate testable hypotheses, and confirm experimental observations.}, + bdsk-url-1 = {https://doi.org/10.1016/j.jtbi.2018.11.001}, + country = {England}, + doi = {10.1016/j.jtbi.2018.11.001}, + groups = {[dweindl:]}, + issn-linking = {0022-5193}, + keywords = {Interferon signaling; ODE modeling; Systems biology}, + nlm-id = {0376342}, + owner = {NLM}, + pii = {S0022-5193(18)30548-4}, + pmid = {30395807}, + pubmodel = {Print-Electronic}, + pubstatus = {ppublish}, + revised = {2018-12-23}, +} + +@Article{PittBan2019, + author = {Pitt, Jake Alan and Banga, Julio R}, + journal = {BMC bioinformatics}, + title = {Parameter estimation in models of biological oscillators: an automated regularised estimation approach.}, + year = {2019}, + issn = {1471-2105}, + month = feb, + pages = {82}, + volume = {20}, + abstract = {Dynamic modelling is a core element in the systems biology approach to understanding complex biosystems. Here, we consider the problem of parameter estimation in models of biological oscillators described by deterministic nonlinear differential equations. These problems can be extremely challenging due to several common pitfalls: (i) a lack of prior knowledge about parameters (i.e. massive search spaces), (ii) convergence to local optima (due to multimodality of the cost function), (iii) overfitting (fitting the noise instead of the signal) and (iv) a lack of identifiability. As a consequence, the use of standard estimation methods (such as gradient-based local ones) will often result in wrong solutions. Overfitting can be particularly problematic, since it produces very good calibrations, giving the impression of an excellent result. However, overfitted models exhibit poor predictive power. Here, we present a novel automated approach to overcome these pitfalls. Its workflow makes use of two sequential optimisation steps incorporating three key algorithms: (1) sampling strategies to systematically tighten the parameter bounds reducing the search space, (2) efficient global optimisation to avoid convergence to local solutions, (3) an advanced regularisation technique to fight overfitting. In addition, this workflow incorporates tests for structural and practical identifiability. We successfully evaluate this novel approach considering four difficult case studies regarding the calibration of well-known biological oscillators (Goodwin, FitzHugh-Nagumo, Repressilator and a metabolic oscillator). In contrast, we show how local gradient-based approaches, even if used in multi-start fashion, are unable to avoid the above-mentioned pitfalls. Our approach results in more efficient estimations (thanks to the bounding strategy) which are able to escape convergence to local optima (thanks to the global optimisation approach). Further, the use of regularisation allows us to avoid overfitting, resulting in more generalisable calibrated models (i.e. models with greater predictive power).}, + bdsk-url-1 = {https://doi.org/10.1186/s12859-019-2630-y}, + citation-subset = {IM}, + completed = {2019-03-13}, + country = {England}, + doi = {10.1186/s12859-019-2630-y}, + groups = {dweindl:6}, + issn-linking = {1471-2105}, + issue = {1}, + keywords = {Algorithms; Biological Clocks; Calibration; Humans; Metabolic Networks and Pathways; Models, Biological; Signal Transduction; Systems Biology, methods; Dynamic modelling; Global optimisation; Parameter bounding; Parameter estimation; Regularisation}, + nlm-id = {100965194}, + owner = {NLM}, + pii = {10.1186/s12859-019-2630-y}, + pmc = {PMC6377730}, + pmid = {30770736}, + pubmodel = {Electronic}, + pubstatus = {epublish}, + revised = {2019-03-13}, +} + +@Article{KaltenbacherPed2018, + author = {Barbara Kaltenbacher and Barbara Pedretscher}, + journal = {Journal of Mathematical Analysis and Applications}, + title = {Parameter estimation in SDEs via the Fokker--Planck equation: Likelihood function and adjoint based gradient computation}, + year = {2018}, + issn = {0022-247X}, + number = {2}, + pages = {872 - 884}, + volume = {465}, + abstract = {In this paper we consider the problem of identifying parameters in stochastic differential equations. For this purpose, we transform the originally stochastic and nonlinear state equation to a deterministic linear partial differential equation for the transition probability density. We provide an appropriate likelihood cost function for parameter fitting, and derive an adjoint based approach for the computation of its gradient.}, + bdsk-url-1 = {http://www.sciencedirect.com/science/article/pii/S0022247X18304414}, + bdsk-url-2 = {https://doi.org/10.1016/j.jmaa.2018.05.048}, + doi = {10.1016/j.jmaa.2018.05.048}, + keywords = {Parameter identification, Stochastic differential equation, State space model, Likelihood function, Adjoint method}, + url = {http://www.sciencedirect.com/science/article/pii/S0022247X18304414}, +} @InProceedings{NousiainenInt2019, author = {Nousiainen, Kari and Intosalmi, Jukka and L{\"a}hdesm{\"a}ki, Harri}, - title = {A Mathematical Model for Enhancer Activation Kinetics During Cell Differentiation}, booktitle = {Algorithms for Computational Biology}, + title = {A Mathematical Model for Enhancer Activation Kinetics During Cell Differentiation}, year = {2019}, + address = {Cham}, editor = {Holmes, Ian and Mart{\'\i}n-Vide, Carlos and Vega-Rodr{\'\i}guez, Miguel A.}, pages = {191--202}, - address = {Cham}, publisher = {Springer International Publishing}, abstract = {Cell differentiation and development are for a great part steered by cell type specific enhancers. Transcription factor (TF) binding to an enhancer together with DNA looping result in transcription initiation. In addition to binding motifs for TFs, enhancer regions typically contain specific histone modifications. This information has been used to detect enhancer regions and classify them into different subgroups. However, it is poorly understood how TF binding and histone modifications are causally connected and what kind of molecular dynamics steer the activation process.}, + doi = {10.1007/978-3-030-18174-1_14}, isbn = {978-3-030-18174-1}, } @@ -463,29 +425,16 @@ @Article{SchmiesterSch2019 url = {https://doi.org/10.1093/bioinformatics/btz581}, } -@Article{SchmiesterWei2019, - author = {Schmiester, Leonard and Weindl, Daniel and Hasenauer, Jan}, - title = {Statistical inference of mechanistic models from qualitative data using an efficient optimal scaling approach}, - journal = {bioRxiv}, - year = {2019}, - abstract = {Quantitative dynamical models facilitate the understanding of biological processes and the prediction of their dynamics. These models usually comprise unknown parameters, which have to be inferred from experimental data. For quantitative experimental data, there are several methods and software tools available. However, for qualitative data the available approaches are limited and computationally demanding.Here, we consider the optimal scaling method which has been developed in statistics for categorical data and has been applied to dynamical systems. This approach turns qualitative variables into quantitative ones, accounting for constraints on their relation. We derive a reduced formulation for the optimization problem defining the optimal scaling. The reduced formulation possesses the same optimal points as the established formulation but requires less degrees of freedom. Parameter estimation for dynamical models of cellular pathways revealed that the reduced formulation improves the robustness and convergence of optimizers. This resulted in substantially reduced computation times.We implemented the proposed approach in the open-source Python Parameter EStimation TOolbox (pyPESTO) to facilitate reuse and extension. The proposed approach enables efficient parameterization of quantitative dynamical models using qualitative data.}, - doi = {10.1101/848648}, - elocation-id = {848648}, - eprint = {https://www.biorxiv.org/content/early/2019/11/20/848648.full.pdf}, - publisher = {Cold Spring Harbor Laboratory}, - url = {https://www.biorxiv.org/content/early/2019/11/20/848648}, -} - @Article{PedretscherKal2019, author = {B. Pedretscher and B. Kaltenbacher and O. Pfeiler}, - title = {Parameter identification and uncertainty quantification in stochastic state space models and its application to texture analysis}, journal = {Applied Numerical Mathematics}, + title = {Parameter identification and uncertainty quantification in stochastic state space models and its application to texture analysis}, year = {2019}, - volume = {146}, - pages = {38 - 54}, issn = {0168-9274}, + pages = {38 - 54}, + volume = {146}, abstract = {In this paper, a computational framework, which enables efficient and robust parameter identification, as well as uncertainty quantification in state space models based on Itô stochastic processes, is presented. For optimization, a Maximum Likelihood approach based on the system's corresponding Fokker-Planck equation is followed. Gradient information is included by means of an adjoint approach, which is based on the Lagrangian of the optimization problem. To quantify the uncertainty of the Maximum-A-Posteriori estimates of the model parameters, a Bayesian inference approach based on Markov Chain Monte Carlo simulations, as well as profile likelihoods are implemented and compared in terms of runtime and accuracy. The framework is applied to experimental electron backscatter diffraction data of a fatigued metal film, where the aim is to develop a model, which consistently and physically meaningfully captures the metal's microstructural changes that are caused by external loading.}, - doi = {https://doi.org/10.1016/j.apnum.2019.06.020}, + doi = {10.1016/j.apnum.2019.06.020}, keywords = {Stochastic state space model, Parameter identification, Uncertainty quantification, Profile likelihood, Adjoint approach, Fokker-Planck equation, Thermo-mechanical fatigue, Texture analysis}, url = {http://www.sciencedirect.com/science/article/pii/S0168927419301722}, } @@ -520,4 +469,150 @@ @Article{StaporSch2019 url = {https://www.biorxiv.org/content/early/2019/11/30/859884}, } +@Article{AlabertLoo2020, + author = {Alabert, Constance and Loos, Carolin and Voelker-Albert, Moritz and Graziano, Simona and Forné, Ignasi and Reveron-Gomez, Nazaret and Schuh, Lea and Hasenauer, Jan and Marr, Carsten and Imhof, Axel and Groth, Anja}, + journal = {Cell reports}, + title = {Domain Model Explains Propagation Dynamics and Stability of Histone H3K27 and H3K36 Methylation Landscapes.}, + year = {2020}, + issn = {2211-1247}, + month = jan, + pages = {1223--1234.e8}, + volume = {30}, + abstract = {Chromatin states must be maintained during cell proliferation to uphold cellular identity and genome integrity. Inheritance of histone modifications is central in this process. However, the histone modification landscape is challenged by incorporation of new unmodified histones during each cell cycle, and the principles governing heritability remain unclear. We take a quantitative computational modeling approach to describe propagation of histone H3K27 and H3K36 methylation states. We measure combinatorial H3K27 and H3K36 methylation patterns by quantitative mass spectrometry on subsequent generations of histones. Using model comparison, we reject active global demethylation and invoke the existence of domains defined by distinct methylation endpoints. We find that H3K27me3 on pre-existing histones stimulates the rate of de novo H3K27me3 establishment, supporting a read-write mechanism in timely chromatin restoration. Finally, we provide a detailed quantitative picture of the mutual antagonism between H3K27 and H3K36 methylation and propose that it stabilizes epigenetic states across cell division.}, + citation-subset = {IM}, + country = {United States}, + doi = {10.1016/j.celrep.2019.12.060}, + issue = {4}, + nlm-id = {101573691}, + owner = {NLM}, + pii = {S2211-1247(19)31717-6}, + pmid = {31995760}, + pubmodel = {Print}, + pubstate = {ppublish}, + revised = {2020-07-30}, +} + +@Article{SchmiesterWei2020, + author = {Schmiester, Leonard and Weindl, Daniel and Hasenauer, Jan}, + journal = {Journal of mathematical biology}, + title = {Parameterization of mechanistic models from qualitative data using an efficient optimal scaling approach.}, + year = {2020}, + issn = {1432-1416}, + month = jul, + abstract = {Quantitative dynamical models facilitate the understanding of biological processes and the prediction of their dynamics. These models usually comprise unknown parameters, which have to be inferred from experimental data. For quantitative experimental data, there are several methods and software tools available. However, for qualitative data the available approaches are limited and computationally demanding. Here, we consider the optimal scaling method which has been developed in statistics for categorical data and has been applied to dynamical systems. This approach turns qualitative variables into quantitative ones, accounting for constraints on their relation. We derive a reduced formulation for the optimization problem defining the optimal scaling. The reduced formulation possesses the same optimal points as the established formulation but requires less degrees of freedom. Parameter estimation for dynamical models of cellular pathways revealed that the reduced formulation improves the robustness and convergence of optimizers. This resulted in substantially reduced computation times. We implemented the proposed approach in the open-source Python Parameter EStimation TOolbox (pyPESTO) to facilitate reuse and extension. The proposed approach enables efficient parameterization of quantitative dynamical models using qualitative data.}, + citation-subset = {IM}, + country = {Germany}, + doi = {10.1007/s00285-020-01522-w}, + issn-linking = {0303-6812}, + keywords = {Dynamical modeling; Optimization; Parameter estimation; Qualitative data; Systems Biology}, + nlm-id = {7502105}, + owner = {NLM}, + pii = {10.1007/s00285-020-01522-w}, + pmid = {32696085}, + pubmodel = {Print-Electronic}, + pubstate = {aheadofprint}, + revised = {2020-07-22}, +} + +@Article{KapferSta2019, + author = {Eva-Maria Kapfer and Paul Stapor and Jan Hasenauer}, + journal = {IFAC-PapersOnLine}, + title = {Challenges in the calibration of large-scale ordinary differential equation models}, + year = {2019}, + issn = {2405-8963}, + note = {8th Conference on Foundations of Systems Biology in Engineering FOSBE 2019}, + number = {26}, + pages = {58 - 64}, + volume = {52}, + abstract = {Mathematical models based on ordinary differential equations have been employed with great success to study complex biological systems. With soaring data availability, more and more models of increasing size are being developed. When working with these large-scale models, several challenges arise, such as high computation times or poor identifiability of model parameters. In this work, we review and illustrate the most common challenges using a published model of cellular metabolism. We summarize currently available methods to deal with some of these challenges while focusing on reproducibility and reusability of models, efficient and robust model simulation and parameter estimation.}, + doi = {10.1016/j.ifacol.2019.12.236}, + keywords = {Differential equations, Dynamic modelling, Steady states, Large-scale systems, Parameter estimation, Reproducibility}, + url = {http://www.sciencedirect.com/science/article/pii/S2405896319321196}, +} + +@Article{LinesPas2019, + author = {Glenn {Terje Lines} and Łukasz Paszkowski and Leonard Schmiester and Daniel Weindl and Paul Stapor and Jan Hasenauer}, + journal = {IFAC-PapersOnLine}, + title = {Efficient computation of steady states in large-scale ODE models of biochemical reaction networks}, + year = {2019}, + issn = {2405-8963}, + note = {8th Conference on Foundations of Systems Biology in Engineering FOSBE 2019}, + number = {26}, + pages = {32 - 37}, + volume = {52}, + abstract = {In systems and computational biology, ordinary differential equations are used for the mechanistic modelling of biochemical networks. These models can easily have hundreds of states and parameters. Typically most parameters are unknown and estimated by fitting model output to observation. During parameter estimation the model needs to be solved repeatedly, sometimes millions of times. This can then be a computational bottleneck, and limits the employment of such models. In many situations the experimental data provides information about the steady state of the biochemical reaction network. In such cases one only needs to obtain the equilibrium state for a given set of model parameters. In this paper we exploit this fact and solve the steady state problem directly rather than integrating the ODE forward in time until steady state is reached. We use Newton’s method - like some previous studies - and develop several improvements to achieve robust convergence. To address the reliance of Newtons method on good initial guesses, we propose a continuation method. We show that the method works robustly in this setting and achieves a speed up of up to 100 compared to using ODE solves.}, + doi = {10.1016/j.ifacol.2019.12.232}, + keywords = {Differential equations, Dynamic modelling, Large-scale systems, Steady states, Steady-state stability, Steady-state errors, Parameter estimation}, + url = {http://www.sciencedirect.com/science/article/pii/S2405896319321135}, +} + +@Article{VillaverdeRai2019, + author = {Alejandro F. Villaverde and Elba Raimúndez and Jan Hasenauer and Julio R. Banga}, + journal = {IFAC-PapersOnLine}, + title = {A Comparison of Methods for Quantifying Prediction Uncertainty in Systems Biology⁎⁎This research has received funding from the European Unions Horizon 2020 research and innovation program under grant agreement No 686282 (CanPathPro) and the German Ministry of Education and Research (BMBF) under the grant agreement No 01ZX1310B (SYS-Stomach) and No 01ZX1705A (INCOME).}, + year = {2019}, + issn = {2405-8963}, + note = {8th Conference on Foundations of Systems Biology in Engineering FOSBE 2019}, + number = {26}, + pages = {45 - 51}, + volume = {52}, + abstract = {The parameters of dynamical models of biological processes always possess some degree of uncertainty. This parameter uncertainty translates into an uncertainty of model predictions. The trajectories of unmeasured state variables are examples of such predictions. Quantifying the uncertainty associated with a given prediction is an important problem for model developers and users. However, the nonlinearity and complexity of most dynamical models renders it nontrivial. Here, we evaluate three state-of-the-art approaches for prediction uncertainty quantification using two models of different sizes and computational complexities. We discuss the trade-offs between applicability and statistical interpretability of the different methods, and provide guidelines for their application.}, + doi = {10.1016/j.ifacol.2019.12.234}, + keywords = {Computational methods, Dynamic models, Nonlinear systems, Observability, Prediction error methods, State estimation, Uncertainty}, + url = {http://www.sciencedirect.com/science/article/pii/S2405896319321159}, +} + +@Article{VillaverdeFroe2018, + author = {Villaverde, Alejandro F and Fröhlich, Fabian and Weindl, Daniel and Hasenauer, Jan and Banga, Julio R}, + journal = {Bioinformatics}, + title = {{Benchmarking optimization methods for parameter estimation in large kinetic models}}, + year = {2018}, + issn = {1367-4803}, + month = {08}, + number = {5}, + pages = {830-838}, + volume = {35}, + abstract = {{Kinetic models contain unknown parameters that are estimated by optimizing the fit to experimental data. This task can be computationally challenging due to the presence of local optima and ill-conditioning. While a variety of optimization methods have been suggested to surmount these issues, it is difficult to choose the best one for a given problem a priori. A systematic comparison of parameter estimation methods for problems with tens to hundreds of optimization variables is currently missing, and smaller studies provided contradictory findings.We use a collection of benchmarks to evaluate the performance of two families of optimization methods: (i) multi-starts of deterministic local searches and (ii) stochastic global optimization metaheuristics; the latter may be combined with deterministic local searches, leading to hybrid methods. A fair comparison is ensured through a collaborative evaluation and a consideration of multiple performance metrics. We discuss possible evaluation criteria to assess the trade-off between computational efficiency and robustness. Our results show that, thanks to recent advances in the calculation of parametric sensitivities, a multi-start of gradient-based local methods is often a successful strategy, but a better performance can be obtained with a hybrid metaheuristic. The best performer combines a global scatter search metaheuristic with an interior point local method, provided with gradients estimated with adjoint-based sensitivities. We provide an implementation of this method to render it available to the scientific community.The code to reproduce the results is provided as Supplementary Material and is available at Zenodo https://doi.org/10.5281/zenodo.1304034.Supplementary data are available at Bioinformatics online.}}, + doi = {10.1093/bioinformatics/bty736}, + eprint = {https://academic.oup.com/bioinformatics/article-pdf/35/5/830/27994799/bty736.pdf}, + url = {https://doi.org/10.1093/bioinformatics/bty736}, +} + +@Article{WangSta2019, + author = {Dantong Wang and Paul Stapor and Jan Hasenauer}, + journal = {IFAC-PapersOnLine}, + title = {Dirac mixture distributions for the approximation of mixed effects models}, + year = {2019}, + issn = {2405-8963}, + note = {8th Conference on Foundations of Systems Biology in Engineering FOSBE 2019}, + number = {26}, + pages = {200 - 206}, + volume = {52}, + abstract = {Mixed effect modeling is widely used to study cell-to-cell and patient-to-patient variability. The population statistics of mixed effect models is usually approximated using Dirac mixture distributions obtained using Monte-Carlo, quasi Monte-Carlo, and sigma point methods. Here, we propose the use of a method based on the Cramér-von Mises Distance, which has been introduced in the context of filtering. We assess the accuracy of the different methods using several problems and provide the first scalability study for the Cramér-von Mises Distance method. Our results indicate that for a given number of points, the method based on the modified Cramér-von Mises Distance method tends to achieve a better approximation accuracy than Monte-Carlo and quasi Monte-Carlo methods. In contrast to sigma-point methods, the method based on the modified Cramér-von Mises Distance allows for a flexible number of points and a more accurate approximation for nonlinear problems.}, + doi = {10.1016/j.ifacol.2019.12.258}, + keywords = {Mixed effect model, Dirac mixture distribution, Monte Carlo method, Sigma point method, Differential equations}, + url = {http://www.sciencedirect.com/science/article/pii/S2405896319321433}, +} + +@Article{Staedter2020.09.03.268276, + author = {St{\"a}dter, Philipp and Sch{\"a}lte, Yannik and Schmiester, Leonard and Hasenauer, Jan and Stapor, Paul L.}, + journal = {bioRxiv}, + title = {Benchmarking of numerical integration methods for ODE models of biological systems}, + year = {2020}, + abstract = {Ordinary differential equation (ODE) models are a key tool to understand complex mechanisms in systems biology. These models are studied using various approaches, including stability and bifurcation analysis, but most frequently by numerical simulations. The number of required simulations is often large, e.g., when unknown parameters need to be inferred. This renders efficient and reliable numerical integration methods essential. However, these methods depend on various hyperparameters, which strongly impact the ODE solution. Despite this, and although hundreds of published ODE models are freely available in public databases, a thorough study that quantifies the impact of hyperparameters on the ODE solver in terms of accuracy and computation time is still missing. In this manuscript, we investigate which choices of algorithms and hyperparameters are generally favorable when dealing with ODE models arising from biological processes. To ensure a representative evaluation, we considered 167 published models. Our study provides evidence that most ODEs in computational biology are stiff, and we give guidelines for the choice of algorithms and hyperparameters. We anticipate that our results will help researchers in systems biology to choose appropriate numerical methods when dealing with ODE models.Competing Interest StatementThe authors have declared no competing interest.}, + doi = {10.1101/2020.09.03.268276}, + elocation-id = {2020.09.03.268276}, + eprint = {https://www.biorxiv.org/content/early/2020/09/04/2020.09.03.268276.full.pdf}, + publisher = {Cold Spring Harbor Laboratory}, + timestamp = {2020-09-30}, + url = {https://www.biorxiv.org/content/early/2020/09/04/2020.09.03.268276}, +} + @Comment{jabref-meta: databaseType:bibtex;} + +@Comment{jabref-meta: grouping: +0 AllEntriesGroup:; +1 StaticGroup:Markings\;2\;1\;\;\;\;; +2 StaticGroup:[dweindl:]\;2\;1\;\;\;\;; +2 StaticGroup:dweindl:6\;2\;1\;\;\;\;; +} diff --git a/deps/AMICI/documentation/availability.rst b/deps/AMICI/documentation/availability.rst new file mode 100644 index 000000000..627da7b27 --- /dev/null +++ b/deps/AMICI/documentation/availability.rst @@ -0,0 +1,44 @@ +Availability +============ + +Source code ++++++++++++ + +The AMICI source code is available as + +- `tar archive `_ +- `zip archive `_ +- Git repository on `GitHub `_ + +If AMICI was downloaded as an archive, it needs to be unpacked. If AMICI was +obtained via cloning the Git repository, no further unpacking is necessary. + +Obtaining AMICI via the Git version control system +-------------------------------------------------- + +In order to always stay up-to-date with the latest AMICI versions, +simply pull it from our Git repository and recompile it when a new +version is available. For more information about Git, check out their +`website `_. + +The Git repository can currently be found at +`https://github.com/AMICI-dev/AMICI `_ +and clone is done via: + +.. code-block:: bash + + git clone https://github.com/AMICI-dev/AMICI.git AMICI + +Python package +++++++++++++++ + +A Python package is available on `PyPI `_. + +Installation instructions ++++++++++++++++++++++++++ + +Installation instructions are available for + +* :ref:`Python ` +* :ref:`C++ ` +* :ref:`Matlab ` diff --git a/deps/AMICI/documentation/background.rst b/deps/AMICI/documentation/background.rst new file mode 100644 index 000000000..f9123f694 --- /dev/null +++ b/deps/AMICI/documentation/background.rst @@ -0,0 +1,79 @@ +Background +========== + +*This section is to be extended.* + +Publications on various features of AMICI +----------------------------------------- + +Some mathematical background for AMICI is provided in the following +publications: + +* Fröhlich, F., Kaltenbacher, B., Theis, F. J., & Hasenauer, J. (2017). + Scalable Parameter Estimation for Genome-Scale Biochemical Reaction Networks. + PLOS Computational Biology, 13(1), e1005331. + doi:`10.1371/journal.pcbi.1005331 `_. + +* Fröhlich, F., Theis, F. J., Rädler, J. O., & Hasenauer, J. (2017). + Parameter estimation for dynamical systems with discrete events and logical + operations. Bioinformatics, 33(7), 1049-1056. + doi:`10.1093/bioinformatics/btw764 `_. + +* Terje Lines, Glenn, Łukasz Paszkowski, Leonard Schmiester, Daniel Weindl, + Paul Stapor, and Jan Hasenauer. 2019. "Efficient Computation of Steady States + in Large-Scale Ode Models of Biochemical Reaction Networks. + *IFAC-PapersOnLine* 52 (26): 32–37. + DOI: `10.1016/j.ifacol.2019.12.232 `_. + +* Stapor, Paul, Fabian Fröhlich, and Jan Hasenauer. 2018. + "Optimization and Profile Calculation of ODE Models Using Second Order + Adjoint Sensitivity Analysis." *Bioinformatics* 34 (13): i151–i159. + DOI: `10.1093/bioinformatics/bty230 `_. + + +.. note:: + + Implementation details of the latest AMICI versions may differ from the ones + given in the references manuscripts. + + +Third-Party numerical algorithms used by AMICI +---------------------------------------------- + +AMICI uses the following packages from SUNDIALS: + +* CVODES: + + The sensitivity-enabled ODE solver in SUNDIALS. Radu Serban + and Alan C. Hindmarsh. *ASME 2005 International Design Engineering + Technical Conferences and Computers and Information in Engineering + Conference*. American Society of Mechanical Engineers, 2005. + `PDF `__ + +* IDAS + +AMICI uses the following packages from SuiteSparse: + +* Algorithm 907: **KLU** A Direct Sparse Solver for Circuit Simulation + Problems. Timothy A. Davis, Ekanathan Palamadai Natarajan, + *ACM Transactions on Mathematical Software*, Vol 37, Issue 6, 2010, + pp 36:1-36:17. `PDF `__ + +* Algorithm 837: **AMD**, an approximate minimum degree ordering + algorithm, Patrick R. Amestoy, Timothy A. Davis, Iain S. Duff, + *ACM Transactions on Mathematical Software*, Vol 30, Issue 3, 2004, + pp 381-388. `PDF `__ + +* Algorithm 836: **COLAMD**, a column approximate minimum degree ordering + algorithm, Timothy A. Davis, John R. Gilbert, Stefan I. Larimore, + Esmond G. Ng *ACM Transactions on Mathematical Software*, Vol 30, + Issue 3, 2004, pp 377-380. `PDF `__ + +Others: + +* SuperLU_MT + + "A general purpose library for the direct solution of large, + sparse, nonsymmetric systems of linear equations" + (https://crd-legacy.lbl.gov/~xiaoye/SuperLU/#superlu_mt). + SuperLU_MT is optional and is so far only available from the C++ interface. diff --git a/deps/AMICI/documentation/code_review_guide.md b/deps/AMICI/documentation/code_review_guide.md index a842502c5..456b78709 100644 --- a/deps/AMICI/documentation/code_review_guide.md +++ b/deps/AMICI/documentation/code_review_guide.md @@ -1,4 +1,4 @@ -# Code review +# Code review guide A guide for reviewing code and having your code reviewed by others. diff --git a/deps/AMICI/documentation/conf.py b/deps/AMICI/documentation/conf.py index a3b8b005b..f6350b819 100644 --- a/deps/AMICI/documentation/conf.py +++ b/deps/AMICI/documentation/conf.py @@ -1,48 +1,117 @@ +# -*- coding: utf-8 -*- +# +# Configuration file for the Sphinx documentation builder. +# +# This file does only contain a selection of the most common options. For a +# full list see the documentation: +# http://www.sphinx-doc.org/en/stable/config + import os import sys import re -import subprocess import mock +import subprocess from sphinx.transforms.post_transforms import ReferencesResolver +import exhale_multiproject_monkeypatch +from exhale import configs as exhale_configs +import exhale.deploy -import amici +# BEGIN Monkeypatch exhale +exhale_multiproject_monkeypatch # to avoid removal of unused import +from exhale.deploy import _generate_doxygen as exhale_generate_doxygen -# The short X.Y version -version = amici.__version__ -# The full version, including alpha/beta/rc tags -release = version -del amici +def my_exhale_generate_doxygen(doxygen_input): + """Monkey-patch exhale for post-processing doxygen output""" + # run mtocpp_post + doxy_xml_dir = exhale_configs._doxygen_xml_output_directory + if 'matlab' in doxy_xml_dir: + print('Running mtocpp_post on ', doxy_xml_dir) + mtocpp_post = os.path.join(amici_dir, 'ThirdParty', 'mtocpp-master', + 'build', 'mtocpp_post') + subprocess.run([mtocpp_post, doxy_xml_dir]) -# -*- coding: utf-8 -*- -# -# Configuration file for the Sphinx documentation builder. -# -# This file does only contain a selection of the most common options. For a -# full list see the documentation: -# http://www.sphinx-doc.org/en/stable/config + # let exhale do it's job + exhale_generate_doxygen(doxygen_input) -# -- RTD custom build -------------------------------------------------------- -# only execute those commands when running from RTD -if 'READTHEDOCS' in os.environ and os.environ['READTHEDOCS']: - amici_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) +exhale.deploy._generate_doxygen = my_exhale_generate_doxygen +# END Monkeypatch exhale + + +# BEGIN Monkeypatch breathe +from breathe.renderer.sphinxrenderer import \ + DomainDirectiveFactory as breathe_DomainDirectiveFactory + +old_breathe_DomainDirectiveFactory_create = breathe_DomainDirectiveFactory.create + + +def my_breathe_DomainDirectiveFactory_create(domain: str, args): + if domain != 'mat': + return old_breathe_DomainDirectiveFactory_create(domain, args) + + from sphinxcontrib.matlab import MATLABDomain, MatClassmember + + matlab_classes = {k: (v, k) for k, v in MATLABDomain.directives.items()} + matlab_classes['variable'] = (MatClassmember, 'attribute') + cls, name = matlab_classes[args[0]] + return cls(domain + ':' + name, *args[1:]) + + +breathe_DomainDirectiveFactory.create = my_breathe_DomainDirectiveFactory_create + + +# END Monkeypatch breathe + + +def install_mtocpp(): + """Install mtocpp (Matlab doxygen filter)""" + cmd = os.path.join(amici_dir, 'scripts', 'downloadAndBuildMtocpp.sh') + ret = subprocess.run(cmd, shell=True, + stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + if ret.returncode != 0: + print(ret.stdout.decode('utf-8')) + raise RuntimeError('downloadAndBuildMtocpp.sh failed') + + +def install_amici_deps_rtd(): + """Install AMICI dependencies and set up environment for use on RTD""" + + # cblas -- manually install ubuntu deb package + cblas_root = os.path.join(amici_dir, 'ThirdParty', 'libatlas-base-dev', + 'usr') + + if os.path.isdir(cblas_root): + # If this exists, it means this has been run before. On RTD, sphinx is + # being run several times and we don't want to reinstall dependencies + # every time. + return + + cblas_inc_dir = os.path.join(cblas_root, "include", "x86_64-linux-gnu") + cblas_lib_dir = os.path.join(cblas_root, "lib", "x86_64-linux-gnu") + cmd = (f"cd '{os.path.join(amici_dir, 'ThirdParty')}' " + "&& apt download libatlas-base-dev && mkdir libatlas-base-dev " + "&& cd libatlas-base-dev " + "&& ar x ../libatlas-base-dev_3.10.3-5_amd64.deb " + "&& tar -xJf data.tar.xz " + f"&& ln -s {cblas_inc_dir}/cblas-atlas.h {cblas_inc_dir}/cblas.h " + ) + subprocess.run(cmd, shell=True, check=True) + os.environ['BLAS_CFLAGS'] = f'-I{cblas_inc_dir}' + os.environ['BLAS_LIBS'] = (f'-L{cblas_lib_dir}/atlas -L{cblas_lib_dir} ' + '-lcblas -latlas -lblas -lm') + # build swig4.0 subprocess.run(os.path.join(amici_dir, 'scripts', - 'downloadAndBuildSwig.sh')) + 'downloadAndBuildSwig.sh'), check=True) # add swig to path swig_dir = os.path.join(amici_dir, 'ThirdParty', 'swig-4.0.1', 'install', 'bin') os.environ['SWIG'] = os.path.join(swig_dir, 'swig') - # in source install, this fails to compile the c extensions but we don't - # care since we replace it by a mock import later on - subprocess.run([ - 'python', '-m', 'pip', 'install', '--verbose', '-e', - os.path.join(amici_dir, 'python', 'sdist') - ]) + # -- Path setup -------------------------------------------------------------- @@ -51,23 +120,53 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. # -sys.path.insert(0, os.path.abspath('../python/sdist')) -sys.path.insert(0, os.path.abspath('../')) +amici_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -# -- Mock out some problematic modules------------------------------------- +# -- RTD custom build -------------------------------------------------------- -# Note that for sub-modules, all parent modules must be listed explicitly. -autodoc_mock_imports = ['_amici', 'amici._amici'] -for mod_name in autodoc_mock_imports: - sys.modules[mod_name] = mock.MagicMock() +# only execute those commands when running from RTD +if 'READTHEDOCS' in os.environ and os.environ['READTHEDOCS']: + install_amici_deps_rtd() + +# Required for matlab doxygen processing +install_mtocpp() + +# Install AMICI if not already present +try: + import amici +except ModuleNotFoundError: + subprocess.run([ + 'python', '-m', 'pip', 'install', '--verbose', '-e', + os.path.join(amici_dir, 'python', 'sdist') + ], check=True) + + from importlib import invalidate_caches + + invalidate_caches() + + sys.path.insert(0, amici_dir) + sys.path.insert(0, os.path.join(amici_dir, 'python', 'sdist')) + + import amici # -- Project information ----------------------------------------------------- +# The short X.Y version +version = amici.__version__ +# The full version, including alpha/beta/rc tags +release = version project = 'AMICI' copyright = '2020, The AMICI developers' author = 'The AMICI developers' title = 'AMICI Documentation' +# -- Mock out some problematic modules------------------------------------- + +# Note that for sub-modules, all parent modules must be listed explicitly. +autodoc_mock_imports = ['_amici', 'amici._amici'] +for mod_name in autodoc_mock_imports: + sys.modules[mod_name] = mock.MagicMock() + # -- General configuration --------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. @@ -78,14 +177,25 @@ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ + 'readthedocs_ext.readthedocs', + # Required, e.g. for PEtab-derived classes where the base class has non-rst + # docstrings + 'sphinx.ext.napoleon', 'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.coverage', 'sphinx.ext.intersphinx', 'sphinx.ext.autosummary', + 'sphinx.ext.viewcode', + 'sphinx.ext.mathjax', + 'sphinxcontrib.matlab', 'nbsphinx', + 'IPython.sphinxext.ipython_console_highlighting', 'recommonmark', 'sphinx_autodoc_typehints', + 'hoverxref.extension', + 'breathe', + 'exhale', ] intersphinx_mapping = { @@ -119,8 +229,17 @@ # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path . -exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', - '**.ipynb_checkpoints', 'numpy.py', 'MATLAB.md', 'gfx'] +exclude_patterns = [ + '_build', + 'Thumbs.db', + '.DS_Store', + '**.ipynb_checkpoints', + 'numpy.py', + 'INSTALL.md', + 'MATLAB_.md', + 'CPP_.md', + 'gfx' +] # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' @@ -128,7 +247,85 @@ # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False +# sphinx-autodoc-typehints +typehints_fully_qualified = True +typehints_document_rtype = True +set_type_checking_flag = True + +# hoverxref +hoverxref_auto_ref = True +hoverxref_roles = ['term'] +hoverxref_domains = ['py'] +hoverxref_role_types = { + 'hoverxref': 'tooltip', + 'ref': 'tooltip', + 'term': 'tooltip', + 'obj': 'tooltip', + 'func': 'tooltip', + 'mod': 'tooltip', + 'meth': 'tooltip', + 'class': 'tooltip', +} + +# breathe settings +breathe_projects = { + "AMICI_Matlab": "./_doxyoutput_amici_matlab/xml", + "AMICI_CPP": "./_doxyoutput_amici_cpp/xml", +} + +breathe_default_project = "AMICI_CPP" +breathe_domain_by_extension = { + "m": "mat", + "h": "cpp", + "cpp": "cpp", +} + +# exhale settings +exhale_args = { + "rootFileName": "library_root.rst", + "doxygenStripFromPath": "..", + "createTreeView": True, + # TIP: if using the sphinx-bootstrap-theme, you need + # "treeViewIsBootstrap": True, + "exhaleExecutesDoxygen": True, + "verboseBuild": True, +} +mtocpp_filter = os.path.join(amici_dir, 'matlab', 'mtoc', + 'config', 'mtocpp_filter.sh') +exhale_projects_args = { + "AMICI_CPP": { + "exhaleDoxygenStdin": "\n".join([ + "INPUT = ../include", + "BUILTIN_STL_SUPPORT = YES", + "PREDEFINED += EXHALE_DOXYGEN_SHOULD_SKIP_THIS" + ]), + "containmentFolder": "_exhale_cpp_api", + "rootFileTitle": "AMICI C++ API", + "afterTitleDescription": + "AMICI C++ library functions", + }, + # Third Party Project Includes + "AMICI_Matlab": { + "exhaleDoxygenStdin": "\n".join([ + "INPUT = ../matlab", + "EXTENSION_MAPPING = .m=C++", + "FILTER_PATTERNS = " + f"*.m={mtocpp_filter}", + "EXCLUDE += ../matlab/examples", + "EXCLUDE += ../matlab/mtoc", + "EXCLUDE += ../matlab/SBMLimporter", + "EXCLUDE += ../matlab/auxiliary", + "EXCLUDE += ../matlab/tests", + "PREDEFINED += EXHALE_DOXYGEN_SHOULD_SKIP_THIS", + ]), + "containmentFolder": "_exhale_matlab_api", + "rootFileTitle": "AMICI Matlab API", + "afterTitleDescription": + "AMICI Matlab library functions", + "lexerMapping": {r'.*\.m$': 'matlab'} + }, +} # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for @@ -164,7 +361,6 @@ # Output file base name for HTML help builder. htmlhelp_basename = 'AMICIdoc' - # -- Options for LaTeX output ------------------------------------------------ latex_elements = { @@ -193,7 +389,6 @@ author, 'manual'), ] - # -- Options for manual page output ------------------------------------------ # One entry per manual page. List of tuples @@ -203,7 +398,6 @@ [author], 1) ] - # -- Options for Texinfo output ---------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples @@ -258,7 +452,6 @@ def process_docstring(app, what, name, obj, options, lines): - # only apply in the amici.amici module if len(name.split('.')) < 2 or name.split('.')[1] != 'amici': return @@ -288,7 +481,7 @@ def process_docstring(app, what, name, obj, options, lines): if name == 'amici.amici.ParameterScalingVector': lines.append( - 'Swig-Generated class, which ,in contrast to other Vector ' + 'Swig-Generated class, which, in contrast to other Vector ' 'classes, does not allow for simple interoperability with common ' 'python types, but must be created using ' ':func:`amici.amici.parameterScalingFromIntVector`' @@ -300,11 +493,11 @@ def process_docstring(app, what, name, obj, options, lines): cname = name.split('.')[2] lines.append( f'Swig-Generated class that implements smart pointers to ' - f'{cname.replace("Ptr","")} as objects.' + f'{cname.replace("Ptr", "")} as objects.' ) return - # add linebreaks before argument/return defintions + # add linebreaks before argument/return definitions lines_clean = [] while len(lines): @@ -335,6 +528,9 @@ def process_docstring(app, what, name, obj, options, lines): def fix_typehints(sig: str) -> str: # cleanup types + if not isinstance(sig, str): + return sig + for old, new in typemaps.items(): sig = sig.replace(old, new) sig = sig.replace('void', 'None') @@ -366,7 +562,6 @@ def fix_typehints(sig: str) -> str: def process_signature(app, what: str, name: str, obj, options, signature, return_annotation): - if signature is None: return @@ -430,26 +625,26 @@ def skip_member(app, what, name, obj, skip, options): if name.startswith('_') and name != '__init__': return True - # igore various functions for std::vector<> types + # ignore various functions for std::vector<> types if re.match(r'^` and + :ref:`Matlab interface `. It cannot be used for model + import itself. + +Prerequisites: + +* CBLAS compatible BLAS library +* HDF5 libraries (currently mandatory, see https://github.com/AMICI-dev/AMICI/issues/1252) +* a C++14 compatible compiler +* a C compiler +* Optional: boost for serialization + +To use AMICI from C++, run the + +.. code-block:: bash + + ./scripts/buildSundials.sh + ./scripts/buildSuitesparse.sh + ./scripts/buildAmici.sh + +script to build the AMICI library. + +.. note:: + + On some systems, the CMake executable may be named something + other than ``cmake``. In this case, set the ``CMAKE`` environment variable + to the correct name (e.g. ``export CMAKE=cmake3``, in case you have CMake + available as ``cmake3``). + +The static library can then be linked from + +.. code-block:: bash + + ./build/libamici.a + +In CMake-based packages, amici can be linked via + +.. code-block:: cmake + + find_package(Amici) + +For further usage, consult the AMICI +:ref:`C++ interface documentation `. + + +Supported CBLAS libraries +------------------------- + +The C++ interfaces require a system installation of a CBLAS-compatible +*Basic Linear Algebra Subprograms* (BLAS) library. +AMICI has been tested with various implementations such as Accelerate, +Intel MKL, cblas, openblas and atlas. + +Optional SuperLU_MT support +--------------------------- + +To build AMICI with SuperLU_MT support, run + +.. code-block:: bash + + ./scripts/buildSuperLUMT.sh + ./scripts/buildSundials.sh + cd build/ + cmake -DSUNDIALS_SUPERLUMT_ENABLE=ON .. + make diff --git a/deps/AMICI/documentation/cpp_interface.rst b/deps/AMICI/documentation/cpp_interface.rst new file mode 100644 index 000000000..bc589986d --- /dev/null +++ b/deps/AMICI/documentation/cpp_interface.rst @@ -0,0 +1,145 @@ +.. _cpp_interface: + +=========================== +Using AMICI's C++ interface +=========================== + +The various import functions in of the +:ref:`Python interface ` and +:ref:`Matlab interface ` translate models defined in +different formats into C++ code. These generated model libraries, together with +the AMICI base library can be used in any C++ application for model simulation +and sensitivity analysis. This section will give a short overview over the +generated files and provide a brief introduction of how this code can be +included in other applications. Further details are available in the +:doc:`C++ API reference <_exhale_cpp_api/library_root>`. + +AMICI-generated C++ model files +=============================== + +After importing a model using either the +:ref:`Python interface ` or the +:ref:`Matlab interface `, the specified output directory +contains (among others) C++ code for the various model functions. + +The content of a model source directory looks something like this (given +`MODEL_NAME=model_steadystate`): + +.. code-block:: text + + CMakeLists.txt + main.cpp + model_steadystate_deltaqB.cpp + model_steadystate_deltaqB.h + [... many more files model_steadystate_*.(cpp|h|md5|o) ] + wrapfunctions.cpp + wrapfunctions.h + model_steadystate.h + +These files provide the implementation of a model-specific subclass of +:cpp:class:`amici::Model`. The ``CMakeLists.txt`` file can be used to build the +model library using `CMake `_. +``main.cpp`` contains a simple scaffold for running a model simulation from C++. +See next section for more details on these files. + + +Running a model simulation +========================== + +AMICI's public API is mostly available through +:ref:`amici/amici.h `. This is the only header file +that needs to be included for basic usage. All functions there are declared within the :ref:`amici namespace `. +Additionally, +:ref:`amici/hdf5.h ` and :ref:`amici/serialization.h ` may be handy for specific use cases. +The former provides some functions for reading and writing +`HDF5 `_ files, latter for serialization +(requires `Boost `_). +All model-specific functions are defined in the namespace ``model_$modelname``. + +The main function for running an AMICI simulation is +:cpp:func:`amici::runAmiciSimulation`. This function requires + +* an instance of a :cpp:class:`amici::Model` subclass as generated during model + import. For the example `model_steadystate` the respective class is provided + as ``Model_model_steadystate`` in ``model_steadystate.h`` in output directory + for the given model. + +* a :cpp:class:`amici::Solver` instance. This solver instance needs to match + the requirements of the model and can be obtained from + :cpp:func:`amici::AbstractModel::getSolver`. + +* optionally an :cpp:class:`amici::ExpData` instance, which contains any + experimental data (e.g. measurements, noise model parameters or model inputs) + to evaluate residuals or an objective function. + +This function returns a :cpp:class:`amici::ReturnData` object, which contains +all simulation results. + +For running simulations for multiple experimental conditions +(multiple :cpp:class:`amici::ExpData` instances), +:cpp:func:`amici::runAmiciSimulations` +provides an alternative entry point. If AMICI (and your application) +have been compiled with OpenMP support (see installation guide), this allows +for running those simulations in parallel. + +A scaffold for a standalone simulation program is automatically generated +during model import in ``main.cpp`` in the model output directory. This program +shows how to use the above-mentioned classes, how to obtain the simulation +results, and may provide a starting point for your own simulation code. + +Working with multiple or anonymous models ++++++++++++++++++++++++++++++++++++++++++ + +AMICI model import generates a :cpp:class:`amici::Model` subclass for the +specific model, based on the name used during import. One the one hand, this +allows you to use multiple models with different names within a single +application. On the other hand, this requires you to know the name of the +model, which can be inconvenient in some cases. + +When working with a single model, the ``wrapfunctions.h`` file generated during +model import can be used to avoid specifying model names explicitly. It defines +a function ``amici::generic_model::getModel()``, that returns an instance of +the model class by a generic name. + +.. note:: + + Including multiple ``wrapfunctions.h`` files from different + models in a single application is not possible. When using multiple models, + explicit names have to be used or the different model libraries need to be + loaded dynamically at runtime. + +Compiling and linking +===================== + +To run AMICI simulations from within your C++ application, you need to compile +and link the following libraries: + +* model library +* AMICI base library +* SUNDIALS libraries +* SuiteSparse libraries +* CBLAS-compatible BLAS +* optionally HDF5 (C, HL, and CXX components) + set CMake option ``ENABLE_HDF5`` to ``OFF`` to build without HDF5-support +* optionally OpenMP (for parallel simulation of multiple conditions, see + :cpp:func:`amici::runAmiciSimulations`) +* optionally boost (only when using serialization of AMICI object) + +The simplest and recommended way is using the provide CMake files which take +care of all these dependencies. + +Considering the simple case, that you want to simulate one specific model +in your CMake-based C++ application, you can copy or move the generated model +directory containing the ``CMakeLists.txt`` file to your application directory, +add `add_subdirectory(yourModelDirectory)` to your project's ``CMakeLists.txt`` +file and build your project using CMake as usual. + +Parameter estimation for AMICI models in high-performance computing environments +================================================================================ + +To perform parameter estimation for large or otherwise computationally +demanding AMICI models from C++ in a high-performance computing environment, +you may find the `parPE library `_ helpful. +parPE allows for the private or shared memory parallel evaluation of a cost +function requiring multiple simulations of the same model with different +inputs. It provides interfaces to different optimizers, such as Ipopt. diff --git a/deps/AMICI/documentation/development.md b/deps/AMICI/documentation/development.md deleted file mode 100644 index 59802e28d..000000000 --- a/deps/AMICI/documentation/development.md +++ /dev/null @@ -1,141 +0,0 @@ -# AMICI developer's guide - -This document contains information for AMICI developers, not too relevant to -regular users. - - -## Branches / releases - -AMICI roughly follows the -[GitFlow](https://nvie.com/posts/a-successful-git-branching-model/). All new -contributions are merged into `develop`. These changes are regularly merged -into `master` as new releases. For release versioning we are trying to follow -[semantic versioning](https://semver.org/). New releases are created on Github -and are automatically deployed to -[Zenodo](https://zenodo.org/record/3362453#.XVwJ9vyxVMA) for archiving and to -obtain a digital object identifier (DOI) to make them citable. -Furthermore, our [CI pipeline](documentation/CI.md) will automatically create -and deploy a new release on [PyPI](https://pypi.org/project/amici/). - -We try to keep a clean git history. Therefore, feature pull requests are -squash-merged to `develop`. Merging of release branches to master is done via -merge commits. - - -## When starting to work on some issue - -When starting to work on some Github issue, please assign yourself to let other -developers know that you are working on it to avoid duplicate work. If the -respective issue is not completely clear, it is generally a good idea to ask -for clarification before starting to work on it. - -If you want to work on something new, please create a Github issue first. - - -## Code contributions - -When making code contributions, please follow our style guide and the process -described below: - -* Check if you agree to release your contribution under the conditions provided - in `LICENSE`. By opening a pull requests you confirm us that you do agree. - -* Start a new branch from `develop` (on your fork, or at the main - repository if you have access) - -* Implement your changes - -* Submit a pull request to the `develop` branch - -* Make sure your code is documented appropriately - - * Run `scripts/run-doxygen.sh` to check completeness of your documentation - -* Make sure your code is compatible with C++11, `gcc` and `clang` - (our CI pipeline will do this for you) - -* When adding new functionality, please also provide test cases - (see `tests/cpputest/` and [documentation/CI.md](documentation/CI.md)) - -* Write meaningful commit messages - -* Run all tests to ensure nothing was broken - ([more details](documentation/CI.md)) - - * Run `scripts/buildAll.sh && scripts/run-cpputest.sh`. - - * If you made changes to the Matlab or C++ code and have a Matlab license, - please also run `tests/cpputest/wrapTestModels.m` and `tests/testModels.m` - - * If you made changes to the Python or C++ code, - run `make python-tests` in `build` - -* When all tests are passing and you think your code is ready to merge, - request a code review - (see also our [code review guideline](documentation/code_review_guide.md)) - -* Wait for feedback. If you do not receive feedback to your pull request within - a week, please give us a friendly reminder. - - -### Style guide - - -#### General - -* All files and functions should come with file-level and function-level - documentation. - -* All new functionality should be covered by unit or integration tests. Runtime - of those tests should be kept as short as possible. - - -#### Python - -* We want to be compatible with Python 3.6 - -* For the Python code we want to follow - [PEP8](https://www.python.org/dev/peps/pep-0008/). Although this is not the - case for all existing code, any new contributions should do so. - -* We use Python [type hints](https://docs.python.org/3/library/typing.html) - for all functions (but not for class attributes, since they are not supported - by the current Python doxygen filter). In Python code type hints should be - used instead of doxygen `@type`. (All legacy `@type` attributes are to be - removed.) - - For function docstrings, follow this format: - - ``` - """One-line description. - - Possible a more detailed description - - Arguments: - Argument1: This needs to start on the same line, otherwise the current - doxygen filter will fail. - - Returns: - Return value - - Raises: - SomeError in case of some error. - """ - ``` - - -#### C++ - -* We follow C++11 - -* We want to maintain compatibility with g++, clang and the Intel C++ compiler - -* For code formatting, we use the settings from `.clang-format` in the root - directory - -* *Details to be defined* - - -#### Matlab - -*To be defined* diff --git a/deps/AMICI/documentation/development.rst b/deps/AMICI/documentation/development.rst new file mode 100644 index 000000000..0e4899bd2 --- /dev/null +++ b/deps/AMICI/documentation/development.rst @@ -0,0 +1,160 @@ +AMICI developer’s guide +======================= + +This document contains information for AMICI developers, not too +relevant to regular users. + +Branches / releases +------------------- + +AMICI roughly follows the +`GitFlow `__. +All new contributions are merged into ``develop``. These changes are +regularly merged into ``master`` as new releases. For release versioning +we are trying to follow `semantic versioning `__. +New releases are created on Github and are automatically deployed to +`Zenodo `__ for +archiving and to obtain a digital object identifier (DOI) to make them +citable. Furthermore, our `CI pipeline `__ will +automatically create and deploy a new release on +`PyPI `__. + +We try to keep a clean git history. Therefore, feature pull requests are +squash-merged to ``develop``. Merging of release branches to master is +done via merge commits. + +When starting to work on some issue +----------------------------------- + +When starting to work on some Github issue, please assign yourself to +let other developers know that you are working on it to avoid duplicate +work. If the respective issue is not completely clear, it is generally a +good idea to ask for clarification before starting to work on it. + +If you want to work on something new, please create a Github issue +first. + +Code contributions +------------------ + +When making code contributions, please follow our style guide and the +process described below: + +- Check if you agree to release your contribution under the conditions + provided in ``LICENSE``. By opening a pull requests you confirm us + that you do agree. + +- Start a new branch from ``develop`` (on your fork, or at the main + repository if you have access) + +- Implement your changes + +- Submit a pull request to the ``develop`` branch + +- Make sure your code is documented appropriately + + - Run ``scripts/run-doxygen.sh`` to check completeness of your + documentation + +- Make sure your code is compatible with C++11, ``gcc`` and ``clang`` + (our CI pipeline will do this for you) + +- When adding new functionality, please also provide test cases (see + ``tests/cpputest/`` and + `documentation/CI.md `__) + +- Write meaningful commit messages + +- Run all tests to ensure nothing was broken (`more + details `__) + + - Run ``scripts/buildAll.sh && scripts/run-cpputest.sh``. + + - If you made changes to the Matlab or C++ code and have a Matlab + license, please also run ``tests/cpputest/wrapTestModels.m`` and + ``tests/testModels.m`` + + - If you made changes to the Python or C++ code, run + ``make python-tests`` in ``build`` + +- When all tests are passing and you think your code is ready to merge, + request a code review (see also our `code review + guideline `__) + +- Wait for feedback. If you do not receive feedback to your pull + request within a week, please give us a friendly reminder. + +Style guide +~~~~~~~~~~~ + +General +^^^^^^^ + +- All files and functions should come with file-level and + function-level documentation. + +- All new functionality should be covered by unit or integration tests. + Runtime of those tests should be kept as short as possible. + +Python +^^^^^^ + +- We want to be compatible with Python 3.7 + +- For the Python code we want to follow + `PEP8 `__. Although this + is not the case for all existing code, any new contributions should + do so. + +- We use Python `type + hints `__ for all + functions (but not for class attributes, since they are not supported + by the current Python doxygen filter). In Python code type hints + should be used instead of doxygen ``@type``. + + For function docstrings, follow this format: + + :: + + """One-line description. + + Possible a more detailed description + + Arguments: + Argument1: This needs to start on the same line, otherwise the current + doxygen filter will fail. + + Returns: + Return value + + Raises: + SomeError in case of some error. + """ + +C++ +^^^ + +- We use C++14 + +- We want to maintain compatibility with g++, clang and the Intel C++ + compiler + +- For code formatting, we use the settings from ``.clang-format`` in + the root directory + +- *Details to be defined* + +Matlab +^^^^^^ + +*To be defined* + +Further topics +-------------- + +.. toctree:: + :maxdepth: 2 + + Organization of the documentation + code_review_guide + CI diff --git a/deps/AMICI/documentation/glossary.rst b/deps/AMICI/documentation/glossary.rst new file mode 100644 index 000000000..4f92d18e1 --- /dev/null +++ b/deps/AMICI/documentation/glossary.rst @@ -0,0 +1,60 @@ +******** +Glossary +******** + +.. glossary:: + :sorted: + + CVODES + `CVODES `_ is a + solver for stiff and non-stiff :term:`ODE` systems with sensitivity + analysis capabilities and is used by AMICI. It is part of the + :term:`SUNDIALS` solver suite. + + DAE + Differential-Algebraic Equation + + fixed parameters + In AMICI, *fixed parameters* are parameters with respect to which no + sensitivities are computed. They usually correspond to experimental + conditions. For fixed parameters, different values can be set for + :term:`preequilibration`, :term:`presimulation` and simulation. + + IDAS + `IDAS `_ is a + solver :term:`DAE` systems with sensitivity analysis capabilities + and is used by AMICI. It is part of the :term:`SUNDIALS` solver suite. + + ODE + Ordinary Differential Equation + + preequilibration + Simulating or solving the dynamical system for the steadystate. + + presimulation + Simulation for a fixed time before the regular simulation. Can be used + to specify pretreatments. + + PEtab + `PEtab `_ is a format for + specifying parameter estimation problems. It is based on an + :term:`SBML` model and tab-separated value files specifying the + observation model and experimental conditions. + + PySB + `PySB `_ is a tool for specifying rule-based systems + biology models as Python code. + + SBML + `SBML `_ is a commonly used format for specifying + systems biology models. + + SUNDIALS + `SUNDIALS `_: + SUite of Nonlinear and DIfferential/ALgebraic equation Solvers. + Provides the :term:`CVODES` and :term:`IDAS` solvers used by AMICI. + + SWIG + `SWIG `_ is a tool that creates interfaces for + C(++) code to a variety of languages. Much of the AMICI Python + interface is generated by SWIG. diff --git a/deps/AMICI/documentation/how_to_cite.rst b/deps/AMICI/documentation/how_to_cite.rst new file mode 100644 index 000000000..916b9bbdd --- /dev/null +++ b/deps/AMICI/documentation/how_to_cite.rst @@ -0,0 +1,37 @@ +How to cite AMICI +================= + +**Citable DOI for the latest AMICI release:** + +.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3992844.svg + :target: https://doi.org/10.5281/zenodo.3992844 + :alt: AMICI release DOI + +There is a list of `publications using AMICI `_. +If you used AMICI in your work, we are happy to include +your project, please let us know via a Github issue. + +When using AMICI in your project, please cite + +* Fröhlich, F., Kaltenbacher, B., Theis, F. J., & Hasenauer, J. (2017). + Scalable Parameter Estimation for Genome-Scale Biochemical Reaction Networks. + PLOS Computational Biology, 13(1), e1005331. + doi:`10.1371/journal.pcbi.1005331 `_. + +and/or + +* Fröhlich, F., Theis, F. J., Rädler, J. O., & Hasenauer, J. (2017). + Parameter estimation for dynamical systems with discrete events and logical + operations. Bioinformatics, 33(7), 1049-1056. + doi:`10.1093/bioinformatics/btw764 `_. + +When presenting work that employs AMICI, feel free to use one of the icons in +`documentation/gfx/ `_, +which are available under a +`CC0 `_ +license: + +.. image:: https://raw.githubusercontent.com/AMICI-dev/AMICI/master/documentation/gfx/logo_text.png + :target: https://raw.githubusercontent.com/AMICI-dev/AMICI/master/documentation/gfx/logo_text.png + :height: 75 + :alt: AMICI LOGO diff --git a/deps/AMICI/documentation/implementation_discontinuities.rst b/deps/AMICI/documentation/implementation_discontinuities.rst new file mode 100644 index 000000000..f0343312a --- /dev/null +++ b/deps/AMICI/documentation/implementation_discontinuities.rst @@ -0,0 +1,86 @@ +Handling of Discontinuities +=========================== + +This document provides guidance and rationale on the implementation of events +in AMICI. Events include any discontinuities in the right hand side of the +differential equation. There are three types of discontinuities: + +- **Solution Jump Discontinuities** can be created by SBML events or delta + functions in the right hand side. + +- **Right-Hand-Side Jump Discontinuities** result in removable + discontinuities in the solution and can be created by Piecewise, + Heaviside functions and other logical operators in the right hand side. + +- **Right-Hand-Side Removable Discontinuities** do not lead to + discontinuities in the solution, but may lead to discontinuous higher + order temporal derivatives and can be created by functions such as max or + min in the right hand side. + +Mathematical Considerations +--------------------------- + +A detailed mathematical description of the required sensitivity formulas is +provided in + +* Fröhlich, F., Theis, F. J., Rädler, J. O., & Hasenauer, J. (2017). + Parameter estimation for dynamical systems with discrete events and logical + operations. Bioinformatics, 33(7), 1049-1056. + doi:`10.1093/bioinformatics/btw764 `_. + +Algorithmic Considerations +-------------------------- + +Solution Jump Discontinuities +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +SUNDIALS by itself does not support solution jump discontinuities. We +implement support by accessing private SUNDIALS API in +:cpp:func:`amici::Solver::resetState`, +:cpp:func:`amici::Solver::reInitPostProcess` and +:cpp:func:`amici::Solver::reInitPostProcessB`. These functions reset interval +variables to initial values to simulate a fresh integration start, but +keep/update the solution history, which is important for adjoint solutions. + + +Right-Hand-Side Jump Discontinuities +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +In principle these discontinuities do not need any special treatment, but +empirically, the solver may overstep or completely ignore the discontinuity, +leading to poor solution quality. This is particularly problematic when +step size is large and changes in step size, which can be caused by +parameter changes, inclusion of forward sensitivities or during backward +solves, may alter solutions in unexpected ways. Accordingly, finite +difference approximations, forward sensitivities as well as adjoint +sensitivities will yield poor derivative approximations. + +To address these issues, we use the built-in rootfinding functionality in +SUNDIALS, which pauses the solver at the locations of discontinuities and +avoids overstepping or ignoring of discontinuities. + +Another difficulty comes with the evaluation of Heaviside functions. After +or during processing of discontinuities, Heaviside functions need to be +evaluated at the left and right hand limit of discontinuities. +This is challenging as the solver may slightly over- or understep the +discontinuity timepoint by a small epsilon and limits have to be correctly +computed in both forward and backward passes. + +To address this issue, AMICI uses a vector of Heaviside helper variables `h` +that keeps track of the values of the Heaviside functions that have the +respective root function as argument. These will be automatically updated +during events and take either 0 or 1 values as appropriate pre/post event +limits. + +In order to fully support SBML events, AMICI uses the SUNDIALS functionality to +only track zero crossings from negative to positive. Accordingly, two root +functions are necessary to keep track of Heaviside functions and two +Heaviside function helper variables will be created, where one corresponds +to the value of `Heaviside(...)` and one to the value of `1-Heaviside(...)`. + + +Right-Hand-Side Removable Discontinuities +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Removable discontinuities do not require any special treatment. Numerically, +this may be advantageous, but is currently not implemented. diff --git a/deps/AMICI/documentation/index.rst b/deps/AMICI/documentation/index.rst index eeedad2e7..d230451a3 100644 --- a/deps/AMICI/documentation/index.rst +++ b/deps/AMICI/documentation/index.rst @@ -1,68 +1,51 @@ -.. AMICI documentation master file, created by - sphinx-quickstart on Fri Feb 14 13:16:43 2020. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - Welcome to AMICI's documentation! ================================= -.. image:: https://travis-ci.com/ICB-DCM/AMICI.svg?branch=master - :target: https://travis-ci.com/ICB-DCM/AMICI +.. image:: https://travis-ci.com/AMICI-dev/AMICI.svg?branch=master + :target: https://travis-ci.com/AMICI-dev/AMICI :alt: Build status -.. image:: https://codecov.io/gh/ICB-DCM/AMICI/branch/master/graph/badge.svg - :target: https://codecov.io/gh/ICB-DCM/AMICI +.. image:: https://codecov.io/gh/AMICI-dev/AMICI/branch/master/graph/badge.svg + :target: https://codecov.io/gh/AMICI-dev/AMICI :alt: Code coverage -.. image:: https://api.codacy.com/project/badge/Grade/945235766e344a7fa36278feab915ff6 - :target: https://www.codacy.com/app/FFroehlich/AMICI - :alt: Codacy .. image:: https://readthedocs.org/projects/amici/badge/?version=latest :target: https://amici.readthedocs.io/en/latest/?badge=latest :alt: Documentation status -.. image:: https://zenodo.org/badge/43677177.svg - :target: https://zenodo.org/badge/latestdoi/43677177 +.. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3976250.svg + :target: https://doi.org/10.5281/zenodo.3976250 :alt: DOI | Version: |version| -| Source code: https://github.com/icb-dcm/amici +| Source code: https://github.com/AMICI-dev/amici .. toctree:: :maxdepth: 2 - :caption: User's guide - - INSTALL - PYTHON + :caption: About + about + availability + LICENSE + how_to_cite + references + background + glossary + contributing .. toctree:: :maxdepth: 2 - :caption: Developer's guide + :caption: User's guide - README - CONTRIBUTING + PYTHON CPP - development - code_review_guide - CI - + MATLAB .. toctree:: :maxdepth: 2 - :caption: API reference - - modules - - -.. toctree:: - :maxdepth: 2 - :caption: About - - FAQ - LICENSE - references - + :caption: Developer's guide + development + implementation_discontinuities Indices and tables ================== diff --git a/deps/AMICI/documentation/matlab_faq.rst b/deps/AMICI/documentation/matlab_faq.rst new file mode 100644 index 000000000..309d44ae1 --- /dev/null +++ b/deps/AMICI/documentation/matlab_faq.rst @@ -0,0 +1,55 @@ +FAQ +=== + +**Q**: My model fails to build. + +**A**: Remove the corresponding model directory located in +AMICI/models/\ *yourmodelname* and compile again. + +-------------- + +**Q**: It still does not compile. + +**A**: Remove the directory AMICI/models/\ ``mexext`` and compile again. + +-------------- + +**Q**: It still does not compile. + +**A**: Make an `issue `__ and +we will have a look. + +-------------- + +**Q**: My Python-generated model does not compile from MATLAB. + +**A**: Try building any of the available examples before. If this +succeeds, retry building the original model. Some dependencies might not +be built correctly when using only the ``compileMexFile.m`` script. + +-------------- + +**Q**: I get an out of memory error while compiling my model on a +Windows machine. + +**A**: This may be due to an old compiler version. See `issue +#161 `__ for instructions +on how to install a new compiler. + +-------------- + +**Q**: How are events interpreted in a DAE context? + +**A**: Currently we only support impulse free events. Also sensitivities +have never been tested. Proceed with care and create an +`issue `__ if any problems +arise! + +-------------- + +**Q**: The simulation/sensitivities I get are incorrect. + +**A**: There are some known issues, especially with adjoint +sensitivities, events and DAEs. If your particular problem is not +featured in the `issues `__ +list, please add it! diff --git a/deps/AMICI/documentation/matlab_installation.rst b/deps/AMICI/documentation/matlab_installation.rst new file mode 100644 index 000000000..19dabf1c2 --- /dev/null +++ b/deps/AMICI/documentation/matlab_installation.rst @@ -0,0 +1,30 @@ +.. _amici_matlab_installation: + +Installing the AMICI MATLAB toolbox +=================================== + +To use AMICI from MATLAB, start MATLAB and add the ``AMICI/matlab`` +directory to the MATLAB path. To add all toolbox directories to the +MATLAB path, execute the matlab script: + +.. code-block:: matlab + + installAMICI.m + +To store the installation for further MATLAB session, the path can be +saved via: + +.. code-block:: matlab + + savepath + +For the compilation of ``.mex`` files, MATLAB needs to be configured with a +working C++ compiler. The C++ compiler needs to be installed and +configured via: + +.. code-block:: matlab + + mex -setup c++ + +For a list of supported compilers we refer to the respective MathWorks +`documentation `_. diff --git a/deps/AMICI/documentation/matlab_interface.rst b/deps/AMICI/documentation/matlab_interface.rst new file mode 100644 index 000000000..8c47229eb --- /dev/null +++ b/deps/AMICI/documentation/matlab_interface.rst @@ -0,0 +1,510 @@ +.. _matlab_interface: + +Using AMICI's MATLAB interface +============================== + +In the following we will give a detailed overview how to specify models in +MATLAB and how to call the generated simulation files. + +.. note:: + + The MATLAB interface requires the MathWorks + `Symbolic Math Toolbox `_ + for model import (but not for model simulation). + + The Symbolic Math Toolbox requirement can be circumvented by performing model + import using the Python interface. The resulting code can then be used from + Matlab (see :ref:`matlab_compile_python_imported_model`). + +.. warning:: + + Due to changes in the Symbolic Math Toolbox, the last MATLAB release + with working AMICI model import is R2017b + (see `https://github.com/AMICI-dev/AMICI/issues/307 `__). + + +Specifying models in Matlab ++++++++++++++++++++++++++++ + +This guide will guide the user on how to specify models in MATLAB. +For example implementations see the examples in the ``matlab/examples`` +directory. + +Header +------ + +The model definition needs to be defined as a function which returns a +``struct`` with all symbolic definitions and options. + +.. code-block:: matlab + + function [model] = example_model_syms() + +Options +------- + +Set the options by specifying the respective field of the model struct + +.. code-block:: matlab + + model.(fieldname) = value + +The options specify default options for simulation, parametrisation and +compilation. All of these options are optional. + ++--------------+-----------------------------------------------+---------+ +| field | description | default | ++==============+===============================================+=========+ +| .param | default parametrisation 'log'/'log10'/'lin' | 'lin' | ++--------------+-----------------------------------------------+---------+ +| .debug | flag to compile with debug symbols | false | ++--------------+-----------------------------------------------+---------+ +| .forward | flag to activate forward sensitivities | true | ++--------------+-----------------------------------------------+---------+ +| .adjoint | flag to activate adjoint sensitivities | true | ++--------------+-----------------------------------------------+---------+ + +When set to ``false``, the fields ``forward`` and ``adjoint`` will speed up the +time required to compile the model but also disable the respective sensitivity +computation. + +States +------ + +Create the respective symbolic variables. The name of the symbolic variable +can be chosen arbitrarily. + +.. code-block:: matlab + + syms state1 state2 state3 + +Create the state vector containing all states: + +.. code-block:: matlab + + model.sym.x = [ state1 state2 state3 ]; + +Parameters +---------- + +Create the respective symbolic variables. The name of the symbolic variable can +be chosen arbitrarily. Sensitivities will be derived for all *parameters*. + +.. code-block:: matlab + + syms param1 param2 param3 param4 param5 param6 + +Create the parameters vector + +.. code-block:: matlab + + model.sym.p = [ param1 param2 param3 param4 param5 param6 ]; + +Constants +--------- + +Create the respective symbolic variables. The name of the symbolic variable +can be chosen arbitrarily. Sensitivities with respect to *constants* will not +be derived. + +.. code-block:: matlab + + syms const1 const2 + +Create the constants vector + +.. code-block:: matlab + + model.sym.k = [ const1 const2 ]; + +Differential equations +---------------------- + +For time-dependent differential equations you can specify a symbolic variable +for time. This **needs** to be denoted by ``t``. + +.. code-block:: matlab + + syms t + +Specify the right hand side of the differential equation ``f`` or ``xdot`` + +.. code-block:: matlab + + model.sym.xdot(1) = [ const1 - param1*state1 ]; + model.sym.xdot(2) = [ +param2*state1 + dirac(t-param3) - const2*state2 ]; + model.sym.xdot(3) = [ param4*state2 ]; + +or + +.. code-block:: matlab + + model.sym.f(1) = [ const1 - param1*state1 ]; + model.sym.f(2) = [ +param2*state1 + dirac(t-param3) - const2*state2 ]; + model.sym.f(3) = [ param4*state2 ]; + +The specification of ``f`` or ``xdot`` may depend on states, parameters and +constants. + +For DAEs also specify the mass matrix. + +.. code-block:: matlab + + model.sym.M = [1, 0, 0;... + 0, 1, 0;... + 0, 0, 0]; + +The specification of ``M`` may depend on parameters and constants. + +For ODEs the integrator will solve the equation :math:`\dot{x} = f` and for +DAEs the equations :math:`M \cdot \dot{x} = f`. +AMICI will decide whether to use CVODES (for ODEs) or IDAS (for DAEs) based on +whether the mass matrix is defined or not. + +In the definition of the differential equation you can use certain symbolic +functions. For a full list of available functions see +``src/symbolic_functions.cpp``. + +Dirac functions can be used to cause a jump in the respective states at the +specified time-point. This is typically used to model injections, or other +external stimuli. Spline functions can be used to model time/state dependent +response with unknown time/state dependence. + +Initial Conditions +------------------ + +Specify the initial conditions. These may depend on parameters on constants +and must have the same size as ``x``. + +.. code-block:: matlab + + model.sym.x0 = [ param4, 0, 0 ]; + +Observables +----------- + +Specify the observables. These may depend on parameters and constants. + +.. code-block:: matlab + + model.sym.y(1) = state1 + state2; + model.sym.y(2) = state3 - state2; + +In the definition of the observable you can use certain symbolic functions. +For a full list of available functions see ``src/symbolic_functions.cpp``. +Dirac functions in observables will have no effect. + +Events +------ + +Specifying events is optional. Events are specified in terms of a trigger +function, a bolus function and an output function. The roots of the trigger +function defines the occurrences of the event. The bolus function defines the +change in the state on event occurrences. The output function defines the +expression which is evaluated and reported by the simulation routine on every +event occurrence. The user can create events by constructing a vector of +objects of the class :mat:class:`amievent`. + +.. code-block:: matlab + + model.sym.event(1) = amievent(state1 - state2,0,[]); + +Events may depend on states, parameters and constants but *not* on observables. + +For more details about event support see: + + Fröhlich, F., Theis, F. J., Rädler, J. O., & Hasenauer, J. (2017). + Parameter estimation for dynamical systems with discrete events and logical + operations. Bioinformatics, 33(7), 1049-1056. + doi:`10.1093/bioinformatics/btw764 `_. + + +Standard deviation +------------------ + +Specifying standard deviations is optional. It only has an effect when +computing adjoint sensitivities. It allows the user to specify standard +deviations of experimental data for observables and events. + +Standard deviation for observable data is denoted by ``sigma_y`` + +.. code-block:: matlab + + model.sym.sigma_y(1) = param5; + +Standard deviation for event data is denoted by ``sigma_t`` + +.. code-block:: matlab + + model.sym.sigma_t(1) = param6; + +Both ``sigma_y`` and ``sigma_t`` can either be a scalar or of the same dimension +as the observables / events function. +They can depend on time and parameters but must not depend on the states or +observables. The values provided in ``sigma_y`` and ``sigma_t`` will only be used +if the value in ``D.Sigma_Y`` or ``D.Sigma_T`` in the user-provided data struct is +``NaN``. See simulation for details. + +Objective Function +------------------ + +By default, AMICI assumes a normal noise model and uses the corresponding +negative log-likelihood + +.. math:: + + J = 1/2*sum(((y_i(t)-my_ti)/sigma_y_i)^2 + log(2*pi*sigma_y^2) + +as objective function. A user provided objective function can be specified in + +.. code-block:: matlab + + model.sym.Jy + +As reference see the default specification of ``this.sym.Jy`` in ``amimodel.makeSyms``. + +SBML +++++ + +AMICI can also import SBML models using the command ``SBML2AMICI``. +This will generate a model specification as described above, which may be +edited by the user to apply further changes. + +Model Compilation ++++++++++++++++++ + +The model can then be compiled by calling ``amiwrap.m``: + +.. code-block:: matlab + + amiwrap(modelname,'example_model_syms',dir,o2flag) + +Here ``modelname`` should be a string defining the name of the model, ``dir`` +should be a string containing the path to the directory in which simulation +files should be placed and ``o2flag`` is a flag indicating whether second order +sensitivities should also be compiled. +The user should make sure that the previously defined function +``example_model_syms`` is in the user path. Alternatively, the user can also +call the function ``example_model_syms`` + +.. code-block:: matlab + + [model] = example_model_syms() + +and subsequently provide the generated struct to ``amiwrap(...)``, instead of +providing the symbolic function: + +.. code-block:: matlab + + amiwrap(modelname,model,dir,o2flag) + +In a similar fashion, the user could also generate multiple models and pass +them directly to ``amiwrap(...)`` without generating respective model +definition scripts. + + +.. _matlab_compile_python_imported_model: + +Compiling a Python-generated model +---------------------------------- + +For better performance or to avoid the Symbolic Math Toolbox requirement, +it might be desirable to import a model in Python and compile the +resulting code into a mex file. For Python model import, consult the +respective section of the Python documentation. Once the imported +succeeded, there will be a ``compileMexFile.m`` script inside the newly +created model directory which can be invoked to compile the mex file. +This mex file and ``simulate_*.m`` can be used as if fully created by +matlab. + + +Using Python-AMICI model import from Matlab +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +With recent matlab versions it is possible to use the AMICI python package +from within Matlab. This not quite comfortable yet, but it is possible. + +Here for proof of concept: + +* Install the python package as described in the documentation +* Ensure ``pyversion`` shows the correct python version (3.6 or 3.7) +* Then, from within the AMICI ``matlab/`` directory: + +.. code-block:: matlab + + sbml_importer = py.amici.SbmlImporter('../python/examples/example_steadystate/model_steadystate_scaled.xml') + sbml_importer.sbml2amici('steadystate', 'steadystate_example_from_python') + model = py.steadystate.getModel() + solver = model.getSolver() + model.setTimepoints(linspace(0, 50, 51)) + rdata = py.amici.runAmiciSimulation(model, solver) + result = struct(py.dict(rdata.items())) + t = double(py.array.array('d', result.ts)) + x = double(py.array.array('d', result.x.flatten())) + x = reshape(x, flip(double(py.array.array('d', result.x.shape)))) + plot(t, x) + +Model simulation +++++++++++++++++ + +After the call to ``amiwrap(...)`` two files will be placed in the specified +directory. One is a ``_modelname_.mex`` and the other is ``simulate_*modelname*.m``. +The mex file should never be called directly. Instead the MATLAB script, which +acts as a wrapper around the .mex simulation file should be used. + +The ``simulate_ _modelname_.m`` itself carries extensive documentation on how to +call the function, what it returns and what additional options can be +specified. In the following we will give a short overview of possible function +calls. + +Integration +----------- +Define a time vector: + +.. code-block:: matlab + + t = linspace(0,10,100) + +Generate a parameter vector: + +.. code-block:: matlab + + theta = ones(6,1); + +Generate a constants vector: + +.. code-block:: matlab + + kappa = ones(2,1); + +Integrate: + +.. code-block:: matlab + + sol = simulate_modelname(t,theta,kappa,[],options) + + +The integration status will be indicated by the ``sol.status`` flag. Negative +values indicated failed integration. The states will then be available as ``sol.x``. +The observables will then be available as ``sol.y``. The event outputs will then +be available as ``sol.z``. If no event occurred there will be an event at the end +of the considered interval with the final value of the root function is stored +in ``sol.rz``. + +Alternatively the integration can also be called via + +.. code-block:: matlab + + [status,t,x,y] = simulate_modelname(t,theta,kappa,[],options) + +The integration status will be indicated by the flag ``status`` . Negative +values indicated failed integration. The states will then be available as ``x``. +The observables will then be available as ``y``. No event output will be given. + +Forward Sensitivities +--------------------- + +Set the sensitivity computation to forward sensitivities and integrate: + +.. code-block:: matlab + + options.sensi = 1; + options.sensi_meth = 'forward'; + sol = simulate_modelname(t,theta,kappa,[],options) + +The integration status will be indicated by the ``sol.status`` flag. Negative +values indicate failed integration. The states will be available as ``sol.x``, +with the derivative with respect to the parameters in ``sol.sx``. +The observables will be available as ``sol.y``, with the derivative with respect +to the parameters in ``sol.sy``. The event outputs will be available as ``sol.z``, +with the derivative with respect to the parameters in ``sol.sz``. If no event +occured there will be an event at the end of the considered interval with the +final value of the root function stored in ``sol.rz``, with the derivative with +respect to the parameters in ``sol.srz``. + +Alternatively the integration can also be called via + +.. code-block:: matlab + + [status,t,x,y,sx,sy] = simulate_modelname(t,theta,kappa,[],options) + +The integration status will be indicated by the status flag. Negative values +indicate failed integration. The states will then be available as ``x``, with +derivative with respect to the parameters in ``sx``. The observables will then +be available as ``y``, with derivative with respect to the parameters in ``sy``. +No event output will be given. + +Adjoint sensitivities +--------------------- + +Set the sensitivity computation to adjoint sensitivities: + +.. code-block:: matlab + + options.sensi = 1; + options.sensi_meth = 'adjoint'; + +Define Experimental Data: + +.. code-block:: matlab + + D.Y = [NaN(1,2)],ones(length(t)-1,2)]; + D.Sigma_Y = [0.1*ones(length(t)-1,2),NaN(1,2)]; + D.T = ones(1,1); + D.Sigma_T = NaN; + +The ``NaN`` values in ``Sigma_Y`` and ``Sigma_T`` will be replaced by the +specification in ``model.sym.sigma_y`` and ``model.sym.sigma_t``. Data points +with ``NaN`` value will be completely ignored. + +Integrate: + +.. code-block:: matlab + + sol = simulate_modelname(t,theta,kappa,D,options) + +The integration status will be indicated by the sol.status flag. Negative +values indicate failed integration. The log-likelihood will then be available +as ``sol.llh`` and the derivative with respect to the parameters in +``sol.sllh``. Note that for adjoint sensitivities no state, observable and +event sensitivities will be available. Yet this approach can be expected to be +significantly faster for systems with a large number of parameters. + +Steady-state sensitivities +-------------------------- + +This will compute state sensitivities according to the formula + +.. math:: + + s_k^x = -\left(\frac{\partial f}{\partial x} \right)^{-1}\frac{\partial f}{\partial \theta_k} + +In the current implementation this formulation does not allow for conservation +laws as this would result in a singular Jacobian. + +Set the final timepoint as infinity, this will indicate the solver to compute +the steadystate: + +.. code-block:: matlab + + t = Inf; + +Set the sensitivity computation to steady state sensitivities: + +.. code-block:: matlab + + options.sensi = 1; + +Integrate: + +.. code-block:: matlab + + sol = simulate_modelname(t,theta,kappa,D,options) + +The states will be available as ``sol.x``, with the derivative with respect +to the parameters in ``sol.sx``. The observables will be available as ``sol.y``, +with the derivative with respect to the parameters in ``sol.sy``. Notice that +for steady state sensitivities no event sensitivities will be available. For +the accuracy of the computed derivatives it is essential that the system is +sufficiently close to a steady state. This can be checked by examining the +right hand side of the system at the final time-point via ``sol.diagnosis.xdot``. diff --git a/deps/AMICI/documentation/model_presimulation.ipynb b/deps/AMICI/documentation/model_presimulation.ipynb new file mode 120000 index 000000000..7b73d05c7 --- /dev/null +++ b/deps/AMICI/documentation/model_presimulation.ipynb @@ -0,0 +1 @@ +../python/examples/example_presimulation/model_presimulation.ipynb \ No newline at end of file diff --git a/deps/AMICI/documentation/petab.ipynb b/deps/AMICI/documentation/petab.ipynb new file mode 120000 index 000000000..2fd69ec0a --- /dev/null +++ b/deps/AMICI/documentation/petab.ipynb @@ -0,0 +1 @@ +../python/examples/example_petab/petab.ipynb \ No newline at end of file diff --git a/deps/AMICI/documentation/python_faq.rst b/deps/AMICI/documentation/python_faq.rst new file mode 100644 index 000000000..68ec6f532 --- /dev/null +++ b/deps/AMICI/documentation/python_faq.rst @@ -0,0 +1,28 @@ +.. _amici_python_faq: + +FAQ +=== + +**Q**: I am trying to install the AMICI Python package, but installation +fails with something like + +:: + + amici/src/cblas.cpp:16:13: fatal error: cblas.h: No such file or directory + #include + ^~~~~~~~~ + compilation terminated. + error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 + +**A**: You will have to install a CBLAS-compatible BLAS library and/or +set ``BLAS_CFLAGS`` as described in the +:ref:`installation guide `. + +-------------- + +**Q**: Importing my model fails with something like +``ImportError: _someModelName.cpython-37m-x86_64-linux-gnu.so: undefined symbol: omp_get_thread_num``. + +**A**: You probably installed the AMICI package with OpenMP support, but +did not have the relevant compiler/linker flags set when +importing/building the model. See :ref:`here `. diff --git a/deps/AMICI/documentation/python_installation.rst b/deps/AMICI/documentation/python_installation.rst new file mode 100644 index 000000000..127309fd6 --- /dev/null +++ b/deps/AMICI/documentation/python_installation.rst @@ -0,0 +1,435 @@ +.. _amici_python_installation: + +Installing the AMICI Python package +=================================== + +Short guide ++++++++++++ + +Installation of the AMICI Python package has the following prerequisites: + +* Python>=3.7 +* :term:`SWIG`>=3.0 +* CBLAS compatible BLAS library + (e.g., OpenBLAS, CBLAS, Atlas, Accelerate, Intel MKL) +* a C++14 compatible C++ compiler and a C compiler + (e.g., g++, clang, Intel C++ compiler, mingw) + +If these requirements are fulfilled and all relevant paths are setup properly, +AMICI can be installed using: + +.. code-block:: bash + + pip3 install amici + +If this worked, you can now import the Python module via:: + + import amici + +If this does not work for you, please follow the full instructions below. + +Installation on Linux ++++++++++++++++++++++ + +Ubuntu 20.04 +------------ + +Install the AMICI dependencies via ``apt`` +(this requires superuser privileges): + +.. code-block:: bash + + sudo apt install libatlas-base-dev swig + + # optionally for HDF5 support: + sudo apt install libhdf5-serial-dev + +Install AMICI: + +.. code-block:: bash + + pip3 install amici + +Fedora 32 +--------- + +Install the AMICI dependencies via ``apt`` +(this requires superuser privileges): + +.. code-block:: bash + + sudo dnf install blas-devel swig + +Install AMICI: + +.. code-block:: bash + + pip3 install amici + +Installation on OSX ++++++++++++++++++++ + +Install the AMICI dependencies using homebrew: + +.. code-block:: bash + + brew install swig + + # optionally for HDF5 support: + brew install hdf5 + + # optionally for parallel simulations: + brew install libomp + +Install AMICI: + +.. code-block:: bash + + pip3 install amici + + +Installation on Windows ++++++++++++++++++++++++ + +Some general remarks: + +* Install all libraries in a path not containing white spaces, + e.g. directly under C:. +* Replace the following paths according to your installation. +* Slashes can be preferable to backslashes for some environment + variables. +* See also [#425](https://github.com/AMICI-dev/amici/issues/425) for + further discussion. + +Using the MinGW compilers +------------------------- + +* Install `MinGW-W64 `_ + (the 32bit version will succeed to compile, but fail during linking). + + MinGW-W64 GCC-8.1.0 for ``x86_64-posix-sjlj`` + (`direct link `_) has been shown to work on Windows 7 and 10 test systems. + +* Add the following directory to your ``PATH``: + ``C:\mingw-w64\x86_64-8.1.0-posix-sjlj-rt_v6-rev0\mingw64\bin`` + +* Make sure that this is the compiler that is found by the system + (e.g. ``where gcc`` in a ``cmd`` should point to this installation). + +* Download CBLAS headers and libraries, e.g. + `OpenBLAS `_, + binary distribution 0.2.19. + + Set the following environment variables: + + + ``BLAS_CFLAGS=-IC:/OpenBLAS-v0.2.19-Win64-int32/include`` + + ``BLAS_LIBS=-Wl,-Bstatic -LC:/OpenBLAS-v0.2.19-Win64-int32/lib -lopenblas -Wl,-Bdynamic`` + +* Install `SWIG `_ + and add the SWIG directory to ``PATH`` + (e.g. ``C:\swigwin-3.0.12`` for version 3.0.12) + +* Install AMICI using: + + .. code-block:: bash + + pip install --global-option="build_clib" \ + --global-option="--compiler=mingw32" \ + --global-option="build_ext" \ + --global-option="--compiler=mingw32" \ + amici --no-cache-dir --verbose` + +.. note:: + + **Possible sources of errors:** + + * On recent Windows versions, + ``anaconda3\Lib\distutils\cygwinccompiler.py`` fails linking + ``msvcr140.dll`` with + ``[...] x86_64-w64-mingw32/bin/ld.exe: cannot find -lmsvcr140``. + This is not required for amici, so in ``cygwinccompiler.py`` + ``return ['msvcr140']`` can be changed to ``return []``. + + * If you use a python version where + `python/cpython#880 `_ + has not been fixed yet, you need to disable + ``define hypot _hypot`` in ``anaconda3\include/pyconfig.h`` yourself. + + * ``import amici`` in Python resulting in the very informative + + ImportError: DLL load failed: The specified module could not be found. + + means that some amici module dependencies were not found (not the + AMICI module itself). + `DependencyWalker `_ can show you + which ones. + +Using the Microsoft Visual Studio +--------------------------------- + +.. note:: Support for MSVC is experimental. + +We assume that Visual Studio (not to be confused with Visual Studio Code) +is already installed. Using Visual Studio Installer, the following components +need to be included: + +* Microsoft Visual C++ (MSVC). + This is part of multiple packages, including Desktop Development with C++. +* Windows Universal C Runtime. + This is an individual component and installs some DLLs that we need. + +OpenBLAS +^^^^^^^^ + +There are prebuilt OpenBLAS binaries available, but they did not seem to work +well here. Therefore, we recommend building OpenBLAS from scratch. + +To build OpenBLAS, download the following scripts from the AMICI repository: + +* https://github.com/AMICI-dev/AMICI/blob/master/scripts/installOpenBLAS.ps1 +* https://github.com/AMICI-dev/AMICI/blob/master/scripts/compileBLAS.cmd + +The first script needs to be called in Powershell, and it needs to call +``compileBLAS.cmd``, so you will need to modify line 11: + + C: \\Users\\travis\\build\\AMICI\\scripts\\compileBLAS.cmd + +so that it matches your directory structure. +This will download OpenBLAS and compile it, creating + + C:\\BLAS\lib\\openblas.lib + C:\\BLAS\\bin\\openblas.dll + +You will also need to define two environment variables: + +.. code-block:: text + + BLAS_LIBS="/LIBPATH:C:\BLAS\lib openblas.lib" + BLAS_CFLAGS="/IC:\BLAS\OpenBLAS-v0.3.10\OpenBLAS-0.3.10" + +One way to do that is to run a PowerShell script with the following commands: + +.. code-block:: text + + [System.Environment]::SetEnvironmentVariable("BLAS_LIBS", "/LIBPATH:C:\BLAS\lib openblas.lib", [System.EnvironmentVariableTarget]::User) + [System.Environment]::SetEnvironmentVariable("BLAS_LIBS", "/LIBPATH:C:\BLAS\lib openblas.lib", [System.EnvironmentVariableTarget]::Process) + [System.Environment]::SetEnvironmentVariable("BLAS_CFLAGS", "-IC:\BLAS\OpenBLAS-v0.3.10\OpenBLAS-0.3.10", [System.EnvironmentVariableTarget]::User) + [System.Environment]::SetEnvironmentVariable("BLAS_CFLAGS", "-IC:\BLAS\OpenBLAS-v0.3.10\OpenBLAS-0.3.10", [System.EnvironmentVariableTarget]::Process) + +The call ending in ``Process`` sets the environment variable in the current +process, and it is no longer in effect in the next process. The call ending in +``User`` is permanent, and takes effect the next time the user logs on. + +Now you need to make sure that all required DLLs are within the scope of the +``PATH`` variable. In particular, the following directories need to be included +in ``PATH``: + + C:\\BLAS\\bin + C:\\Program Files (x86)\\Windows Kits\\10\\Redist\\ucrt\\DLLs\\x64 + +The first one is needed for ``openblas.dll`` and the second is needed for the +Windows Universal C Runtime. + +If any DLLs are missing in the ``PATH`` variable, Python will return the +following error upon ``import amici``: + + ImportError: DLL load failed: The specified module could not be found. + +This can be tested using the "where" command. For example + + where openblas.dll + +should return + + C:\\BLAS\\bin\\openblas.dll + +Almost all of the DLLs are standard Windows DLLs and should be included in +either Windows or Visual Studio. But, in case it is necessary to test this, +here is a list of some DLLs required by AMICI (when compiled with MSVC): + +* ``openblas.dll`` +* ``python37.dll`` +* ``MSVCP140.dll`` +* ``KERNEL32.dll`` +* ``VCRUNTIME140_1.dll`` +* ``VCRUNTIME140.dll`` +* ``api-ms-win-crt-convert-l1-1-0.dll`` +* ``api-ms-win-crt-heap-l1-1-0.dll`` +* ``api-ms-win-crt-stdio-l1-1-0.dll`` +* ``api-ms-win-crt-string-l1-1-0.dll`` +* ``api-ms-win-crt-runtime-l1-1-0.dll`` +* ``api-ms-win-crt-time-l1-1-0.dll`` +* ``api-ms-win-crt-math-l1-1-0.dll`` + +``MSVCP140.dll``, ``VCRUNTIME140.dll``, and ``VCRUNTIME140_1.dll`` are needed +by MSVC (see Visual Studio above). ``KERNEL32.dll`` is part of Windows and in +``C:\Windows\System32``. The ``api-ms-win-crt-XXX-l1-1-0.dll`` are needed by +``openblas.dll`` and are part of the Windows Universal C Runtime. + + +Further topics +++++++++++++++ + +Installation of development versions +------------------------------------ + +To install development versions which have not been released to PyPI yet, +you can install AMICI with ``pip`` directly from GitHub using: + +.. code-block:: bash + + pip3 install -e git+https://github.com/AMICI-dev/amici.git@develop#egg=amici\&subdirectory=python/sdist + +Replace ``develop`` by the branch or commit you want to install. + +Note that this will only work on Windows if you have enabled developer mode, +because symlinks are not supported by default +(`more information `_). + +Light installation +------------------ + +In case you only want to use the AMICI Python package for generating model code +for use with Matlab or C++ and don't want to bothered with any unnecessary +dependencies, you can run + +.. code-block:: bash + + pip3 install --install-option --no-clibs amici + +.. note:: + + Following this installation, you will not be able to simulate the imported + models in Python. + +.. note:: + + If you run into an error with above installation command, install all AMICI + dependencies listed in `setup.py `_ + manually, and try again. (This is because ``pip`` ``--install-option`` is + applied to *all* installed packages, including dependencies.) + + +Custom installation +------------------- + +Installation of the AMICI Python package can be customized using a number of +environment variables: + ++----------------------------+----------------------------------+---------------------------------+ +| Variable | Purpose | Example | ++============================+==================================+=================================+ +| ``SWIG`` | Path to the :term:`SWIG` | ``SWIG=$HOME/bin/swig4.0`` | +| | executable | | ++----------------------------+----------------------------------+---------------------------------+ +| ``CC`` | Setting the C(++) compiler | ``CC=/usr/bin/g++`` | ++----------------------------+----------------------------------+---------------------------------+ +| ``CFLAGS`` | Extra compiler flags used in | | +| | every compiler invocation | | ++----------------------------+----------------------------------+---------------------------------+ +| ``BLAS_CFLAGS`` | Compiler flags for, e.g. BLAS | | +| | include directories | | ++----------------------------+----------------------------------+---------------------------------+ +| ``BLAS_LIBS`` | Flags for linking BLAS | | ++----------------------------+----------------------------------+---------------------------------+ +| ``ENABLE_GCOV_COVERAGE`` | Set to build AMICI to generate | ``ENABLE_GCOV_COVERAGE=TRUE`` | +| | code coverage information | | ++----------------------------+----------------------------------+---------------------------------+ +| ``ENABLE_AMICI_DEBUGGING`` | Set to build AMICI with | ``ENABLE_AMICI_DEBUGGING=TRUE`` | +| | debugging symbols | | ++----------------------------+----------------------------------+---------------------------------+ +| ``AMICI_PARALLEL_COMPILE`` | Set to the number of parallel | ``AMICI_PARALLEL_COMPILE=4`` | +| | processes to be used for C(++) | | +| | compilation (defaults to 1) | | ++----------------------------+----------------------------------+---------------------------------+ + +Installation under Anaconda +--------------------------- + +To use an Anaconda installation of Python +`https://www.anaconda.com/distribution/ `_, +Python>=3.7), proceed as follows: + +Since Anaconda provides own versions of some packages which might not +work with AMICI (in particular the ``gcc`` compiler), create a minimal +virtual environment via: + +.. code-block:: bash + + conda create --name ENV_NAME pip python + +Here, replace ``ENV_NAME`` by some name for the environment. + +To activate the environment, run: + +.. code-block:: bash + + source activate ENV_NAME + +(and ``conda deactivate`` later to deactivate it again). + +:term:`SWIG` must be installed and available in your ``PATH``, and a +CBLAS-compatible BLAS must be available. You can also use conda to +install the latter locally, using: + +.. code-block:: bash + + conda install -c conda-forge openblas + +To install AMICI, now run: + +.. code-block:: bash + + pip install amici + +The ``pip`` option ``--no-cache`` may be helpful here to make sure the +installation is done completely anew. + +Now, you are ready to use AMICI in the virtual environment. + +.. note:: + + **Anaconda on Mac** + + If the above installation does not work for you, try installing AMICI via: + + .. code-block:: bash + + CFLAGS="-stdlib=libc++" CC=clang CXX=clang pip3 install --verbose amici + + This will use the ``clang`` compiler. + + You will have to pass the same options when compiling any model later + on. This can be done by inserting the following code before model import: + + .. code-block:: python + + import os + os.environ['CC'] = 'clang' + os.environ['CXX'] = 'clang' + os.environ['CFLAGS'] = '-stdlib=libc++' + + (For further discussion see https://github.com/AMICI-dev/AMICI/issues/357) + + +Optional Boost support +---------------------- + +`Boost `_ is an optional C++ dependency only required +for special functions (including e.g. gamma derivatives) in the Python +interface. Boost can be installed via package managers via + +.. code-block:: bash + + apt-get install libboost-math-dev + +or + +.. code-block:: bash + + brew install boost + +As only headers are required, also a +`source code `_ +download suffices. The compiler must be able to find the module in the search +path. diff --git a/deps/AMICI/documentation/python_interface.rst b/deps/AMICI/documentation/python_interface.rst new file mode 100644 index 000000000..2ec510f01 --- /dev/null +++ b/deps/AMICI/documentation/python_interface.rst @@ -0,0 +1,231 @@ +.. _python_interface: + +****************************** +Using AMICI's Python interface +****************************** + +In the following we will give a detailed overview how to specify models in +Python and how to call the generated simulation files. + +Model definition +================ + +This guide will guide the user on how to specify models to import and simulate +them using the Python interface. Further examples are available in the AMICI +repository in the +`python/examples `_ +directory. + +SBML import +----------- + +AMICI can import :term:`SBML` models via the +:py:func:`amici.sbml_import.SbmlImporter` class. + +Status of SBML support in Python-AMICI +++++++++++++++++++++++++++++++++++++++ + +Python-AMICI currently **passes 750 out of the 1780 (~42%) test cases** from +the semantic +`SBML Test Suite `_ +(`current status `_). + +In addition, we currently plan to add support for the following features +(see corresponding issues for details and progress): + +- Events (currently Matlab-only) +- Algebraic rules +- Models without species + +contributions are welcome. + +However, the following features are unlikely to be supported: + +- SBML extensions +- `factorial()`, `ceil()`, `floor()`, due to incompatibility with + symbolic sensitivity computations +- `delay()` due to missing SUNDIALS solver support + + +How to import an SBML model into AMICI +++++++++++++++++++++++++++++++++++++++ + +To import an :term:`SBML` model into AMICI, first, load an SBML file +using the :py:func:`amici.sbml_import.SbmlImporter` class:: + + import amici + sbml_importer = amici.SbmlImporter('model_steadystate_scaled.sbml') + +the SBML model as imported by `libSBML `_ +is available as:: + + sbml_model = sbml_importer.sbml + +Constants +^^^^^^^^^ + +Model parameters that should be considered :term:`constants ` +can be specified in a list +of strings specifying the SBML ID of the respective parameter, e.g.:: + + constant_parameters=['k4'] + +Observables +^^^^^^^^^^^ + +Observables are specified as a dictionary with observable ID as key and +observable formula as value. + +A convenient way for specifying observables for an SBML model is storing them +as ``AssignmentRule``\ s. Assignment rules that should be considered as observables +can then be extracted using the :py:func:`amici.sbml_import.assignmentRules2observables` +function, e.g.:: + + observables = amici.assignmentRules2observables(sbml, filter_function=lambda variable: + variable.getId().startswith('observable_') and not variable.getId().endswith('_sigma')) + +Standard deviations +^^^^^^^^^^^^^^^^^^^ + +Standard deviations can be specified as dictionaries, such as:: + + sigmas = {'observable_x1withsigma': 'observable_x1withsigma_sigma'} + +Noise distributions +^^^^^^^^^^^^^^^^^^^ + +Various noise distributions including normal and Laplace and discrete +distributions, and scale transformations including linear, log and log10 +are supported:: + + noise_distributions = {'observable_x1withsigma': 'log-normal'} + +Find details in :py:func:`amici.sbml_import.noise_distribution_to_cost_function`. + +Model compilation +^^^^^^^^^^^^^^^^^ + +To generate a Python module from the SBML model, call the method +:py:func:`amici.sbml_import.SbmlImporter.sbml2amici`, passing all the +previously defined model specifications:: + + sbml_importer.sbml2amici('test', 'test', + observables=observables, + constant_parameters=constant_parameters, + sigmas=sigmas) + +Full example +^^^^^^^^^^^^ + +See `here `_ for a full example. + +PySB import +----------- + +AMICI can import :term:`PySB` models via +:py:func:`amici.pysb_import.pysb2amici`. + +`BioNetGen `_ and +`Kappa `_ models can be imported into AMICI using +PySB. + +PEtab import +------------ + +AMICI can import :term:`PEtab`-based model definitions and run simulations for +the specified simulations conditions. For usage, see +`python/examples/example_petab/petab.ipynb `_. + +Importing plain ODEs +-------------------- + +The AMICI Python interface does not currently support direct import of ODEs. +However, it is straightforward to encode them as RateRules in an SBML model. +The `yaml2sbml `_ package may come in +handy, as it facilitates generating SBML models from a YAML-based specification +of an ODE model. Besides the SBML model it can also create +`PEtab `_ files. + +SED-ML import +------------- + +We also plan to implement support for the `Simulation Experiment Description Markup Language (SED-ML) `_. + +Model simulation +================ + +AMICI model import creates a Python module for simulation of the respective +model. To use the model module, the model directory has to be manually added to +the python path:: + + import sys + sys.path.insert(0, 'test') + +the compiled model can then be imported as:: + + import test as model_module + +It is usually more convenient to use :py:func:`amici.import_model_module` for +that purpose. + +To obtain a model instance call the `getModel()` method. This model instance +will be instantiated using the default parameter values specified in the +imported model:: + + model = model_module.getModel() + +Specify the simulation timepoints via :py:func:`amici.Model.setTimepoints`:: + + model.setTimepoints(np.linspace(0, 60, 60)) + +For simulation, we need to generate a solver instance:: + + solver = model.getSolver() + +The model simulation can now be carried out using +:py:func:`amici.runAmiciSimulation`:: + + rdata = amici.runAmiciSimulation(model, solver) + + +Examples +======== + +.. toctree:: + :maxdepth: 1 + + ExampleSteadystate.ipynb + petab.ipynb + model_presimulation.ipynb + ExampleEquilibrationLogic.ipynb + + +Miscellaneous +============= + +.. _amici_python_openmp: + +OpenMP support for parallelized simulation for multiple experimental conditions +------------------------------------------------------------------------------- + +AMICI can be built with OpenMP support, which allows to parallelize model +simulations for multiple experimental conditions. + +On Linux and OSX this is enabled by default. This can be verified using:: + + import amici + amici.compiledWithOpenMP() + +If not already enabled by default, you can enable OpenMP support by setting +the environment variables ``AMICI_CXXFLAGS`` and ``AMICI_LDFLAGS`` to the +correct OpenMP flags of your compiler and linker, respectively. This has to be +done for both AMICI package installation *and* model compilation. When using +``gcc`` on Linux, this would be:: + + # on your shell: + AMICI_CXXFLAGS=-fopenmp AMICI_LDFLAGS=-fopenmp pip3 install amici + + # in python, before model compilation: + import os + os.environ['AMICI_CXXFLAGS'] = '-fopenmp' + os.environ['AMICI_LDFLAGS'] = '-fopenmp' diff --git a/deps/AMICI/documentation/modules.rst b/deps/AMICI/documentation/python_modules.rst similarity index 66% rename from deps/AMICI/documentation/modules.rst rename to deps/AMICI/documentation/python_modules.rst index cbcd75fbc..e5da79a6e 100644 --- a/deps/AMICI/documentation/modules.rst +++ b/deps/AMICI/documentation/python_modules.rst @@ -1,18 +1,21 @@ -AMICI -============= +AMICI Python API +================ .. rubric:: Modules .. autosummary:: :toctree: generated + amici amici.amici amici.sbml_import amici.pysb_import amici.petab_import - amici.ode_export + amici.petab_import_pysb amici.petab_objective + amici.ode_export amici.plotting amici.pandas amici.logging - amici.gradient_check \ No newline at end of file + amici.gradient_check + amici.parameter_mapping diff --git a/deps/AMICI/documentation/recreate_reference_list.py b/deps/AMICI/documentation/recreate_reference_list.py index e6c4ab538..02d7873ef 100755 --- a/deps/AMICI/documentation/recreate_reference_list.py +++ b/deps/AMICI/documentation/recreate_reference_list.py @@ -40,14 +40,14 @@ def get_sub_bibliography(year, by_year, bibfile): """Get HTML bibliography for the given year""" entries = ','.join(['@' + x for x in by_year[year]]) - input = '---\n' \ - f'bibliography: {bibfile}\n' \ - f'nocite: "{entries}"\n...\n' \ - f'# {year}' + stdin_input = '---\n' \ + f'bibliography: {bibfile}\n' \ + f'nocite: "{entries}"\n...\n' \ + f'# {year}' out = subprocess.run(['pandoc', '--filter=pandoc-citeproc', '-f', 'markdown'], - input=input, capture_output=True, + input=stdin_input, capture_output=True, encoding='utf-8') if out.returncode != 0: raise AssertionError(out.stderr) diff --git a/deps/AMICI/documentation/references.md b/deps/AMICI/documentation/references.md index d4739c704..a4b60cc14 100644 --- a/deps/AMICI/documentation/references.md +++ b/deps/AMICI/documentation/references.md @@ -1,126 +1,135 @@ # References -List of publications using AMICI. Total number is 35. +List of publications using AMICI. Total number is 37. If you applied AMICI in your work and your publication is missing, please let us know via a new Github issue. +

2020

+
+
+

Alabert, Constance, Carolin Loos, Moritz Voelker-Albert, Simona Graziano, Ignasi Forné, Nazaret Reveron-Gomez, Lea Schuh, et al. 2020. “Domain Model Explains Propagation Dynamics and Stability of Histone H3k27 and H3k36 Methylation Landscapes.” Cell Reports 30 (4): 1223–1234.e8. https://doi.org/10.1016/j.celrep.2019.12.060.

+
+
+

Schmiester, Leonard, Daniel Weindl, and Jan Hasenauer. 2020. “Parameterization of Mechanistic Models from Qualitative Data Using an Efficient Optimal Scaling Approach.” Journal of Mathematical Biology, July. https://doi.org/10.1007/s00285-020-01522-w.

+
+
+

Städter, Philipp, Yannik Schälte, Leonard Schmiester, Jan Hasenauer, and Paul L. Stapor. 2020. “Benchmarking of Numerical Integration Methods for Ode Models of Biological Systems.” bioRxiv. https://doi.org/10.1101/2020.09.03.268276.

+
+

2019

-

Dharmarajan, Lekshmi, Hans-Michael Kaltenbach, Fabian Rudolf, and Joerg Stelling. 2019. “A Simple and Flexible Computational Framework for Inferring Sources of Heterogeneity from Single-Cell Dynamics.” Cell Systems 8 (1). Elsevier: 15–26.e11. https://doi.org/10.1016/j.cels.2018.12.007.

+

Dharmarajan, Lekshmi, Hans-Michael Kaltenbach, Fabian Rudolf, and Joerg Stelling. 2019. “A Simple and Flexible Computational Framework for Inferring Sources of Heterogeneity from Single-Cell Dynamics.” Cell Systems 8 (1): 15–26.e11. https://doi.org/10.1016/j.cels.2018.12.007.

-

Fischer, David S., Anna K. Fiedler, Eric Kernfeld, Ryan M. J. Genga, Aimée Bastidas-Ponce, Mostafa Bakhti, Heiko Lickert, Jan Hasenauer, Rene Maehr, and Fabian J. Theis. 2019. “Inferring Population Dynamics from Single-Cell Rna-Sequencing Time Series Data.” Nature Biotechnology 37: 461–68. https://doi.org/10.1038/s41587-019-0088-0.

+

Fischer, David S., Anna K. Fiedler, Eric Kernfeld, Ryan M. J. Genga, Aimée Bastidas-Ponce, Mostafa Bakhti, Heiko Lickert, Jan Hasenauer, Rene Maehr, and Fabian J. Theis. 2019. “Inferring Population Dynamics from Single-Cell Rna-Sequencing Time Series Data.” Nature Biotechnology 37: 461–68. https://doi.org/10.1038/s41587-019-0088-0.

-

Gregg, Robert W, Saumendra N Sarkar, and Jason E Shoemaker. 2019. “Mathematical Modeling of the cGAS Pathway Reveals Robustness of Dna Sensing to Trex1 Feedback.” Journal of Theoretical Biology 462 (February): 148–57. https://doi.org/10.1016/j.jtbi.2018.11.001.

+

Gregg, Robert W, Saumendra N Sarkar, and Jason E Shoemaker. 2019. “Mathematical Modeling of the cGAS Pathway Reveals Robustness of Dna Sensing to Trex1 Feedback.” Journal of Theoretical Biology 462 (February): 148–57. https://doi.org/10.1016/j.jtbi.2018.11.001.

-

Kapfer, Eva-Maria, Paul Stapor, and Jan Hasenauer. 2019. “Challenges in the Calibration of Large-Scale Ordinary Differential Equation Models.” Accepted for Publication in Proc. Of the Foundations of Syst. Biol. In Engin. (FOSBE).

-
-
-

Lines, Glenn Terje, Lukasz Paszkowski, Leonard Schmiester, Daniel Weindl, Paul Stapor, and Jan Hasenauer. 2019. “Efficient Computation of Steady States in Large-Scale Ode Models of Biochemical Reaction Networks.” Accepted for Publication in Proc. Of the Foundations of Syst. Biol. In Engin. (FOSBE).

+

Kapfer, Eva-Maria, Paul Stapor, and Jan Hasenauer. 2019. “Challenges in the Calibration of Large-Scale Ordinary Differential Equation Models.” IFAC-PapersOnLine 52 (26): 58–64. https://doi.org/10.1016/j.ifacol.2019.12.236.

-

Nousiainen, Kari, Jukka Intosalmi, and Harri Lähdesmäki. 2019. “A Mathematical Model for Enhancer Activation Kinetics During Cell Differentiation.” In Algorithms for Computational Biology, edited by Ian Holmes, Carlos Martín-Vide, and Miguel A. Vega-Rodríguez, 191–202. Cham: Springer International Publishing.

+

Nousiainen, Kari, Jukka Intosalmi, and Harri Lähdesmäki. 2019. “A Mathematical Model for Enhancer Activation Kinetics During Cell Differentiation.” In Algorithms for Computational Biology, edited by Ian Holmes, Carlos Martı́n-Vide, and Miguel A. Vega-Rodrı́guez, 191–202. Cham: Springer International Publishing. https://doi.org/10.1007/978-3-030-18174-1_14.

-

Pedretscher, B., B. Kaltenbacher, and O. Pfeiler. 2019. “Parameter Identification and Uncertainty Quantification in Stochastic State Space Models and Its Application to Texture Analysis.” Applied Numerical Mathematics 146: 38–54. https://doi.org/https://doi.org/10.1016/j.apnum.2019.06.020.

+

Pedretscher, B., B. Kaltenbacher, and O. Pfeiler. 2019. “Parameter Identification and Uncertainty Quantification in Stochastic State Space Models and Its Application to Texture Analysis.” Applied Numerical Mathematics 146: 38–54. https://doi.org/10.1016/j.apnum.2019.06.020.

-

Pitt, Jake Alan, and Julio R Banga. 2019. “Parameter Estimation in Models of Biological Oscillators: An Automated Regularised Estimation Approach.” BMC Bioinformatics 20 (1): 82. https://doi.org/10.1186/s12859-019-2630-y.

+

Pitt, Jake Alan, and Julio R Banga. 2019. “Parameter Estimation in Models of Biological Oscillators: An Automated Regularised Estimation Approach.” BMC Bioinformatics 20 (1): 82. https://doi.org/10.1186/s12859-019-2630-y.

-

Schmiester, Leonard, Yannik Schälte, Fabian Fröhlich, Jan Hasenauer, and Daniel Weindl. 2019. “Efficient parameterization of large-scale dynamic models based on relative measurements.” Bioinformatics, July. https://doi.org/10.1093/bioinformatics/btz581.

-
-
-

Schmiester, Leonard, Daniel Weindl, and Jan Hasenauer. 2019. “Statistical Inference of Mechanistic Models from Qualitative Data Using an Efficient Optimal Scaling Approach.” bioRxiv. Cold Spring Harbor Laboratory. https://doi.org/10.1101/848648.

+

Schmiester, Leonard, Yannik Schälte, Fabian Fröhlich, Jan Hasenauer, and Daniel Weindl. 2019. “Efficient parameterization of large-scale dynamic models based on relative measurements.” Bioinformatics, July. https://doi.org/10.1093/bioinformatics/btz581.

-

Stapor, Paul, Leonard Schmiester, Christoph Wierling, Bodo Lange, Daniel Weindl, and Jan Hasenauer. 2019. “Mini-Batch Optimization Enables Training of Ode Models on Large-Scale Datasets.” bioRxiv. Cold Spring Harbor Laboratory. https://doi.org/10.1101/859884.

+

Stapor, Paul, Leonard Schmiester, Christoph Wierling, Bodo Lange, Daniel Weindl, and Jan Hasenauer. 2019. “Mini-Batch Optimization Enables Training of Ode Models on Large-Scale Datasets.” bioRxiv. https://doi.org/10.1101/859884.

+
+
+

Terje Lines, Glenn, Łukasz Paszkowski, Leonard Schmiester, Daniel Weindl, Paul Stapor, and Jan Hasenauer. 2019. “Efficient Computation of Steady States in Large-Scale Ode Models of Biochemical Reaction Networks.” IFAC-PapersOnLine 52 (26): 32–37. https://doi.org/10.1016/j.ifacol.2019.12.232.

-

Villaverde, Alejandro F., Elba Raimúndez, Jan Hasenauer, and Julio R. Banga. 2019. “A Comparison of Methods for Quantifying Prediction Uncertainty in Systems Biology.” Accepted for Publication in Proc. Of the Foundations of Syst. Biol. In Engin. (FOSBE).

+

Villaverde, Alejandro F., Elba Raimúndez, Jan Hasenauer, and Julio R. Banga. 2019. “A Comparison of Methods for Quantifying Prediction Uncertainty in Systems Biology⁎⁎This Research Has Received Funding from the European Unions Horizon 2020 Research and Innovation Program Under Grant Agreement No 686282 (Canpathpro) and the German Ministry of Education and Research (Bmbf) Under the Grant Agreement No 01ZX1310B (Sys-Stomach) and No 01ZX1705A (Income).” IFAC-PapersOnLine 52 (26): 45–51. https://doi.org/10.1016/j.ifacol.2019.12.234.

-

Wang, Dantong, Paul Stapor, and Jan Hasenauer. 2019. “Dirac Mixture Distributions for the Approximation of Mixed Effects Models.” Accepted for Publication in Proc. Of the Foundations of Syst. Biol. In Engin. (FOSBE).

+

Wang, Dantong, Paul Stapor, and Jan Hasenauer. 2019. “Dirac Mixture Distributions for the Approximation of Mixed Effects Models.” IFAC-PapersOnLine 52 (26): 200–206. https://doi.org/10.1016/j.ifacol.2019.12.258.

2018

-

Ballnus, Benjamin, Steffen Schaper, Fabian J Theis, and Jan Hasenauer. 2018. “Bayesian Parameter Estimation for Biochemical Reaction Networks Using Region-Based Adaptive Parallel Tempering.” Bioinformatics 34 (13): i494–i501. https://doi.org/10.1093/bioinformatics/bty229.

+

Ballnus, Benjamin, Steffen Schaper, Fabian J Theis, and Jan Hasenauer. 2018. “Bayesian Parameter Estimation for Biochemical Reaction Networks Using Region-Based Adaptive Parallel Tempering.” Bioinformatics 34 (13): i494–i501. https://doi.org/10.1093/bioinformatics/bty229.

-

Bast, Lisa, Filippo Calzolari, Michael Strasser, Jan Hasenauer, Fabian J. Theis, Jovica Ninkovic, and Carsten Marr. 2018. “Subtle Changes in Clonal Dynamics Underlie the Age-Related Decline in Neurogenesis.” Cell Reports.

+

Bast, Lisa, Filippo Calzolari, Michael Strasser, Jan Hasenauer, Fabian J. Theis, Jovica Ninkovic, and Carsten Marr. 2018. “Subtle Changes in Clonal Dynamics Underlie the Age-Related Decline in Neurogenesis.” Cell Reports. https://doi.org/10.1016/j.celrep.2018.11.088.

-

Fröhlich, Fabian, Thomas Kessler, Daniel Weindl, Alexey Shadrin, Leonard Schmiester, Hendrik Hache, Artur Muradyan, et al. 2018. “Efficient Parameter Estimation Enables the Prediction of Drug Response Using a Mechanistic Pan-Cancer Pathway Model.” Cell Systems 7 (6). Elsevier: 567–579.e6. https://doi.org/10.1016/j.cels.2018.10.013.

+

Fröhlich, Fabian, Thomas Kessler, Daniel Weindl, Alexey Shadrin, Leonard Schmiester, Hendrik Hache, Artur Muradyan, et al. 2018. “Efficient Parameter Estimation Enables the Prediction of Drug Response Using a Mechanistic Pan-Cancer Pathway Model.” Cell Systems 7 (6): 567–579.e6. https://doi.org/10.1016/j.cels.2018.10.013.

-

Fröhlich, Fabian, Anita Reiser, Laura Fink, Daniel Woschée, Thomas Ligon, Fabian Joachim Theis, Joachim Oskar Rädler, and Jan Hasenauer. 2018. “Multi-Experiment Nonlinear Mixed Effect Modeling of Single-Cell Translation Kinetics After Transfection.” Npj Systems Biology and Applications 5 (1): 1. https://doi.org/10.1038/s41540-018-0079-7.

+

Fröhlich, Fabian, Anita Reiser, Laura Fink, Daniel Woschée, Thomas Ligon, Fabian Joachim Theis, Joachim Oskar Rädler, and Jan Hasenauer. 2018. “Multi-Experiment Nonlinear Mixed Effect Modeling of Single-Cell Translation Kinetics After Transfection.” Npj Systems Biology and Applications 5 (1): 1. https://doi.org/10.1038/s41540-018-0079-7.

-

Kaltenbacher, Barbara, and Barbara Pedretscher. 2018. “Parameter Estimation in Sdes via the Fokker–Planck Equation: Likelihood Function and Adjoint Based Gradient Computation.” Journal of Mathematical Analysis and Applications 465 (2): 872–84. https://doi.org/https://doi.org/10.1016/j.jmaa.2018.05.048.

+

Kaltenbacher, Barbara, and Barbara Pedretscher. 2018. “Parameter Estimation in Sdes via the Fokker–Planck Equation: Likelihood Function and Adjoint Based Gradient Computation.” Journal of Mathematical Analysis and Applications 465 (2): 872–84. https://doi.org/10.1016/j.jmaa.2018.05.048.

-

Loos, Carolin, Sabrina Krause, and Jan Hasenauer. 2018. “Hierarchical Optimization for the Efficient Parametrization of ODE Models.” Bioinformatics 34 (24): 4266–73. https://doi.org/10.1093/bioinformatics/bty514.

+

Loos, Carolin, Sabrina Krause, and Jan Hasenauer. 2018. “Hierarchical Optimization for the Efficient Parametrization of ODE Models.” Bioinformatics 34 (24): 4266–73. https://doi.org/10.1093/bioinformatics/bty514.

-

Loos, Carolin, Katharina Moeller, Fabian Fröhlich, Tim Hucho, and Jan Hasenauer. 2018. “A Hierarchical, Data-Driven Approach to Modeling Single-Cell Populations Predicts Latent Causes of Cell-to-Cell Variability.” Cell Systems 6 (5). Elsevier: 593–603. https://doi.org/10.1016/j.cels.2018.04.008.

+

Loos, Carolin, Katharina Moeller, Fabian Fröhlich, Tim Hucho, and Jan Hasenauer. 2018. “A Hierarchical, Data-Driven Approach to Modeling Single-Cell Populations Predicts Latent Causes of Cell-to-Cell Variability.” Cell Systems 6 (5): 593–603. https://doi.org/10.1016/j.cels.2018.04.008.

-

Schälte, Y., P. Stapor, and J. Hasenauer. 2018. “Evaluation of Derivative-Free Optimizers for Parameter Estimation in Systems Biology.” FAC-PapersOnLine 51 (19): 98–101.

+

Schälte, Y., P. Stapor, and J. Hasenauer. 2018. “Evaluation of Derivative-Free Optimizers for Parameter Estimation in Systems Biology.” FAC-PapersOnLine 51 (19): 98–101. https://doi.org/10.1016/j.ifacol.2018.09.025.

-

Stapor, Paul, Fabian Fröhlich, and Jan Hasenauer. 2018. “Optimization and Profile Calculation of ODE Models Using Second Order Adjoint Sensitivity Analysis.” Bioinformatics 34 (13). Oxford University Press: i151–i159.

+

Stapor, Paul, Fabian Fröhlich, and Jan Hasenauer. 2018. “Optimization and Profile Calculation of ODE Models Using Second Order Adjoint Sensitivity Analysis.” Bioinformatics 34 (13): i151–i159. https://doi.org/10.1093/bioinformatics/bty230.

-
-

Villaverde, Alejandro F., Fabian Froehlich, Daniel Weindl, Jan Hasenauer, and Julio R Banga. 2018. “Benchmarking Optimization Methods for Parameter Estimation in Large Kinetic Models.” Bioinformatics, bty736.

+
+

Villaverde, Alejandro F, Fabian Fröhlich, Daniel Weindl, Jan Hasenauer, and Julio R Banga. 2018. “Benchmarking optimization methods for parameter estimation in large kinetic models.” Bioinformatics 35 (5): 830–38. https://doi.org/10.1093/bioinformatics/bty736.

2017

-

Ballnus, B., S. Hug, K. Hatz, L. Görlitz, J. Hasenauer, and F. J. Theis. 2017. “Comprehensive Benchmarking of Markov Chain Monte Carlo Methods for Dynamical Systems.” BMC Syst. Biol. 11 (63). https://doi.org/10.1186/s12918-017-0433-1.

+

Ballnus, B., S. Hug, K. Hatz, L. Görlitz, J. Hasenauer, and F. J. Theis. 2017. “Comprehensive Benchmarking of Markov Chain Monte Carlo Methods for Dynamical Systems.” BMC Syst. Biol. 11 (63). https://doi.org/10.1186/s12918-017-0433-1.

-

Fröhlich, F., B. Kaltenbacher, F. J. Theis, and J. Hasenauer. 2017. “Scalable Parameter Estimation for Genome-Scale Biochemical Reaction Networks.” PLoS Comput. Biol. 13 (1): e1005331. https://doi.org/10.1371/journal.pcbi.1005331.

+

Fröhlich, F., B. Kaltenbacher, F. J. Theis, and J. Hasenauer. 2017. “Scalable Parameter Estimation for Genome-Scale Biochemical Reaction Networks.” PLoS Comput. Biol. 13 (1): e1005331. https://doi.org/10.1371/journal.pcbi.1005331.

-

Fröhlich, F., F. J. Theis, J. O. Rädler, and J. Hasenauer. 2017. “Parameter Estimation for Dynamical Systems with Discrete Events and Logical Operations.” Bioinformatics 33 (7): 1049–56. https://doi.org/10.1093/bioinformatics/btw764.

+

Fröhlich, F., F. J. Theis, J. O. Rädler, and J. Hasenauer. 2017. “Parameter Estimation for Dynamical Systems with Discrete Events and Logical Operations.” Bioinformatics 33 (7): 1049–56. https://doi.org/10.1093/bioinformatics/btw764.

-

Kazeroonian, A., F. J. Theis, and J. Hasenauer. 2017. “A Scalable Moment-Closure Approximation for Large-Scale Biochemical Reaction Networks.” Bioinformatics 33 (14): i293–i300. https://doi.org/10.1093/bioinformatics/btx249.

+

Kazeroonian, A., F. J. Theis, and J. Hasenauer. 2017. “A Scalable Moment-Closure Approximation for Large-Scale Biochemical Reaction Networks.” Bioinformatics 33 (14): i293–i300. https://doi.org/10.1093/bioinformatics/btx249.

-

Maier, C., C. Loos, and J. Hasenauer. 2017. “Robust Parameter Estimation for Dynamical Systems from Outlier-Corrupted Data.” Bioinformatics 33 (5): 718–25. https://doi.org/10.1093/bioinformatics/btw703.

+

Maier, C., C. Loos, and J. Hasenauer. 2017. “Robust Parameter Estimation for Dynamical Systems from Outlier-Corrupted Data.” Bioinformatics 33 (5): 718–25. https://doi.org/10.1093/bioinformatics/btw703.

2016

-

Boiger, R., J. Hasenauer, S. Hross, and B. Kaltenbacher. 2016. “Integration Based Profile Likelihood Calculation for PDE Constrained Parameter Estimation Problems.” Inverse Prob. 32 (12): 125009. https://doi.org/10.1088/0266-5611/32/12/125009.

+

Boiger, R., J. Hasenauer, S. Hross, and B. Kaltenbacher. 2016. “Integration Based Profile Likelihood Calculation for PDE Constrained Parameter Estimation Problems.” Inverse Prob. 32 (12): 125009. https://doi.org/10.1088/0266-5611/32/12/125009.

-

Fiedler, A., S. Raeth, F. J. Theis, A. Hausser, and J. Hasenauer. 2016. “Tailored Parameter Optimization Methods for Ordinary Differential Equation Models with Steady-State Constraints.” BMC Syst. Biol. 10 (80). https://doi.org/10.1186/s12918-016-0319-7.

+

Fiedler, A., S. Raeth, F. J. Theis, A. Hausser, and J. Hasenauer. 2016. “Tailored Parameter Optimization Methods for Ordinary Differential Equation Models with Steady-State Constraints.” BMC Syst. Biol. 10 (80). https://doi.org/10.1186/s12918-016-0319-7.

-

Fröhlich, F., P. Thomas, A. Kazeroonian, F. J. Theis, R. Grima, and J. Hasenauer. 2016. “Inference for Stochastic Chemical Kinetics Using Moment Equations and System Size Expansion.” PLoS Comput. Biol. 12 (7): e1005030. https://doi.org/10.1371/journal.pcbi.1005030.

+

Fröhlich, F., P. Thomas, A. Kazeroonian, F. J. Theis, R. Grima, and J. Hasenauer. 2016. “Inference for Stochastic Chemical Kinetics Using Moment Equations and System Size Expansion.” PLoS Comput. Biol. 12 (7): e1005030. https://doi.org/10.1371/journal.pcbi.1005030.

-

Hross, S., A. Fiedler, F. J. Theis, and J. Hasenauer. 2016. “Quantitative Comparison of Competing PDE Models for Pom1p Dynamics in Fission Yeast.” In Proc. 6th IFAC Conf. Found. Syst. Biol. Eng., edited by R. Findeisen, E. Bullinger, E. Balsa-Canto, and K. Bernaerts, 49:264–69. 26. IFAC-PapersOnLine. https://doi.org/10.1016/j.ifacol.2016.12.136.

+

Hross, S., A. Fiedler, F. J. Theis, and J. Hasenauer. 2016. “Quantitative Comparison of Competing PDE Models for Pom1p Dynamics in Fission Yeast.” In Proc. 6th IFAC Conf. Found. Syst. Biol. Eng., edited by R. Findeisen, E. Bullinger, E. Balsa-Canto, and K. Bernaerts, 49:264–69. 26. IFAC-PapersOnLine. https://doi.org/10.1016/j.ifacol.2016.12.136.

-

Kazeroonian, A., F. Fröhlich, A. Raue, F. J. Theis, and J. Hasenauer. 2016. “CERENA: Chemical REaction Network Analyzer – A Toolbox for the Simulation and Analysis of Stochastic Chemical Kinetics.” PLoS ONE 11 (1): e0146732. https://doi.org/10.1371/journal.pone.0146732.

+

Kazeroonian, A., F. Fröhlich, A. Raue, F. J. Theis, and J. Hasenauer. 2016. “CERENA: Chemical REaction Network Analyzer – A Toolbox for the Simulation and Analysis of Stochastic Chemical Kinetics.” PLoS ONE 11 (1): e0146732. https://doi.org/10.1371/journal.pone.0146732.

-

Loos, C., A. Fiedler, and J. Hasenauer. 2016. “Parameter Estimation for Reaction Rate Equation Constrained Mixture Models.” In Proc. 13th Int. Conf. Comp. Meth. Syst. Biol., edited by E. Bartocci, P. Lio, and N. Paoletti, 186–200. Lecture Notes in Bioinformatics. Springer International Publishing. https://doi.org/10.1007/978-3-319-45177-0.

+

Loos, C., A. Fiedler, and J. Hasenauer. 2016. “Parameter Estimation for Reaction Rate Equation Constrained Mixture Models.” In Proc. 13th Int. Conf. Comp. Meth. Syst. Biol., edited by E. Bartocci, P. Lio, and N. Paoletti, 186–200. Lecture Notes in Bioinformatics. Springer International Publishing. https://doi.org/10.1007/978-3-319-45177-0.

2015

-

Loos, C., C. Marr, F. J. Theis, and J. Hasenauer. 2015. “Computational Methods in Systems Biology.” In, edited by O. Roux and J. Bourdon, 9308:52–63. Lecture Notes in Computer Science. Springer International Publishing.

+

Loos, C., C. Marr, F. J. Theis, and J. Hasenauer. 2015. “Computational Methods in Systems Biology.” In, edited by O. Roux and J. Bourdon, 9308:52–63. Lecture Notes in Computer Science. Springer International Publishing. https://doi.org/10.1007/978-3-319-23401-4_6.

diff --git a/deps/AMICI/documentation/rtd_requirements.txt b/deps/AMICI/documentation/rtd_requirements.txt index f95b52832..500b1bf8b 100644 --- a/deps/AMICI/documentation/rtd_requirements.txt +++ b/deps/AMICI/documentation/rtd_requirements.txt @@ -1,4 +1,4 @@ -sphinx>=2.4.3 +sphinx>=3.2.1 mock>=4.0.1 setuptools>=45.2.0 pysb>=1.11.0 @@ -8,4 +8,17 @@ nbsphinx>=0.5.1 recommonmark>=0.6.0 sphinx_rtd_theme>=0.4.3 petab>=0.1.5 -sphinx-autodoc-typehints>=1.10.3 \ No newline at end of file +sphinx-autodoc-typehints>=1.10.3 +git+https://github.com/readthedocs/sphinx-hoverxref@master +prompt-toolkit<=3.0.0 +ipython>=7.17.0 +breathe>=4.20.0 +#exhale>=0.2.3 +git+https://github.com/dweindl/exhale@ea77a313777c1382a7830ce9ee6c405ce47f5f3b#egg=exhale +# Newer versions cause trouble with including notebooks: +# sphinx.errors.SphinxParallelError: ImportError: cannot import name 'Application' from partially initialized module 'prompt_toolkit.application.application' (most likely due to a circular import) +# https://github.com/svenevs/exhale/issues/27 https://github.com/mithro/sphinx-contrib-mithro/tree/master/sphinx-contrib-exhale-multiproject +-e git+https://github.com/mithro/sphinx-contrib-mithro#egg=sphinx-contrib-exhale-multiproject&subdirectory=sphinx-contrib-exhale-multiproject +sphinxcontrib-matlabdomain +sphinxcontrib-napoleon +pygments==2.4.1 \ No newline at end of file diff --git a/deps/AMICI/include/amici/abstract_model.h b/deps/AMICI/include/amici/abstract_model.h index ef787aef7..e624fec40 100644 --- a/deps/AMICI/include/amici/abstract_model.h +++ b/deps/AMICI/include/amici/abstract_model.h @@ -219,7 +219,7 @@ class AbstractModel { /** * @brief Function indicating whether reinitialization of states depending * on fixed parameters is permissible - * @return flag inidication whether reinitialization of states depending on + * @return flag indicating whether reinitialization of states depending on * fixed parameters is permissible */ virtual bool isFixedParameterStateReinitializationAllowed() const; @@ -275,7 +275,7 @@ class AbstractModel { * @param x current state * @param p parameter vector * @param k constant vector - * @param h heavyside vector + * @param h Heaviside vector * @param sx current state sensitivity * @param ip sensitivity index * @param ie event index @@ -291,7 +291,7 @@ class AbstractModel { * @param x current state * @param p parameter vector * @param k constant vector - * @param h heavyside vector + * @param h Heaviside vector * @param w repeating elements vector */ virtual void fy(realtype *y, const realtype t, const realtype *x, @@ -305,7 +305,7 @@ class AbstractModel { * @param x current state * @param p parameter vector * @param k constant vector - * @param h heavyside vector + * @param h Heaviside vector * @param ip parameter index w.r.t. which the derivative is requested * @param w repeating elements vector * @param dwdp Recurring terms in xdot, parameter derivative @@ -321,7 +321,7 @@ class AbstractModel { * @param x current state * @param p parameter vector * @param k constant vector - * @param h heavyside vector + * @param h Heaviside vector * @param w repeating elements vector * @param dwdx Recurring terms in xdot, state derivative */ @@ -337,7 +337,7 @@ class AbstractModel { * @param x current state * @param p parameter vector * @param k constant vector - * @param h heavyside vector + * @param h Heaviside vector */ virtual void fz(realtype *z, int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); @@ -350,7 +350,7 @@ class AbstractModel { * @param x current state * @param p parameter vector * @param k constant vector - * @param h heavyside vector + * @param h Heaviside vector * @param sx current state sensitivity * @param ip sensitivity index */ @@ -367,7 +367,7 @@ class AbstractModel { * @param x current state * @param p parameter vector * @param k constant vector - * @param h heavyside vector + * @param h Heaviside vector */ virtual void frz(realtype *rz, int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); @@ -381,7 +381,7 @@ class AbstractModel { * @param p parameter vector * @param k constant vector * @param sx current state sensitivity - * @param h heavyside vector + * @param h Heaviside vector * @param ip sensitivity index */ virtual void fsrz(realtype *srz, int ie, const realtype t, @@ -397,7 +397,7 @@ class AbstractModel { * @param x current state * @param p parameter vector * @param k constant vector - * @param h heavyside vector + * @param h Heaviside vector * @param ip parameter index w.r.t. which the derivative is requested */ virtual void fdzdp(realtype *dzdp, int ie, const realtype t, @@ -413,7 +413,7 @@ class AbstractModel { * @param x current state * @param p parameter vector * @param k constant vector - * @param h heavyside vector + * @param h Heaviside vector */ virtual void fdzdx(realtype *dzdx, int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, @@ -428,7 +428,7 @@ class AbstractModel { * @param x current state * @param p parameter vector * @param k constant vector - * @param h heavyside vector + * @param h Heaviside vector * @param ip parameter index w.r.t. which the derivative is requested */ virtual void fdrzdp(realtype *drzdp, int ie, const realtype t, @@ -443,7 +443,7 @@ class AbstractModel { * @param x current state * @param p parameter vector * @param k constant vector - * @param h heavyside vector + * @param h Heaviside vector */ virtual void fdrzdx(realtype *drzdx, int ie, const realtype t, const realtype *x, const realtype *p, const realtype *k, @@ -456,7 +456,7 @@ class AbstractModel { * @param x current state * @param p parameter vector * @param k constant vector - * @param h heavyside vector + * @param h Heaviside vector * @param ie event index * @param xdot new model right hand side * @param xdot_old previous model right hand side @@ -473,7 +473,7 @@ class AbstractModel { * @param x current state * @param p parameter vector * @param k constant vector - * @param h heavyside vector + * @param h Heaviside vector * @param w repeating elements vector * @param ip sensitivity index * @param ie event index @@ -496,7 +496,7 @@ class AbstractModel { * @param x current state * @param p parameter vector * @param k constant vector - * @param h heavyside vector + * @param h Heaviside vector * @param ie event index * @param xdot new model right hand side * @param xdot_old previous model right hand side @@ -515,7 +515,7 @@ class AbstractModel { * @param x current state * @param p parameter vector * @param k constant vector - * @param h heavyside vector + * @param h Heaviside vector * @param ip sensitivity index * @param ie event index * @param xdot new model right hand side @@ -626,6 +626,20 @@ 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 + * @param index ytrue index + */ + virtual void fdJydy_colptrs(SUNMatrixWrapper &dJydy, int index); + + /** + * @brief Model-specific implementation of fdJydy rowvals + * @param dJydy sparse matrix to which rowvals will be written + * @param index `ytrue` index + */ + virtual void fdJydy_rowvals(SUNMatrixWrapper &dJydy, int index); /** * @brief Model specific implementation of fdJydsigma @@ -706,8 +720,8 @@ class AbstractModel { * @param x vector with the states * @param p parameter vector * @param k constants vector - * @param h heavyside vector - * @param tcl total abundances for conservations laws + * @param h Heaviside vector + * @param tcl total abundances for conservation laws */ virtual void fw(realtype *w, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, @@ -720,10 +734,10 @@ class AbstractModel { * @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 conservations laws - * @param stcl sensitivities of total abundances for conservations laws + * @param tcl total abundances for conservation laws + * @param stcl sensitivities of total abundances for conservation laws */ virtual void fdwdp(realtype *dwdp, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, @@ -732,15 +746,15 @@ class AbstractModel { /** * @brief Model specific implementation for dwdp, column pointers - * @param indexptrs column pointers + * @param dwdp sparse matrix to which colptrs will be written */ - virtual void fdwdp_colptrs(sunindextype *indexptrs); + virtual void fdwdp_colptrs(SUNMatrixWrapper &dwdp); /** * @brief Model specific implementation for dwdp, row values - * @param indexvals row values + * @param dwdp sparse matrix to which rowvals will be written */ - virtual void fdwdp_rowvals(sunindextype *indexvals); + virtual void fdwdp_rowvals(SUNMatrixWrapper &dwdp); /** * @brief Model specific sensitivity implementation of dwdp @@ -749,10 +763,10 @@ class AbstractModel { * @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 conservations laws - * @param stcl sensitivities of total abundances for conservations laws + * @param tcl total abundances for conservation laws + * @param stcl sensitivities of total abundances for conservation laws * @param ip sensitivity parameter index */ virtual void fdwdp(realtype *dwdp, const realtype t, const realtype *x, @@ -767,9 +781,9 @@ class AbstractModel { * @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 conservations laws + * @param tcl total abundances for conservation laws */ virtual void fdwdx(realtype *dwdx, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, @@ -777,15 +791,42 @@ class AbstractModel { /** * @brief Model specific implementation for dwdx, column pointers - * @param indexptrs column pointers + * @param dwdx sparse matrix to which colptrs will be written */ - virtual void fdwdx_colptrs(sunindextype *indexptrs); + virtual void fdwdx_colptrs(SUNMatrixWrapper &dwdx); /** * @brief Model specific implementation for dwdx, row values - * @param indexvals row values + * @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 w vector with helper variables + * @param tcl Total abundances for conservation laws + */ + virtual void fdwdw(realtype *dwdw, realtype t, const realtype *x, + const realtype *p, const realtype *k, const realtype *h, + const realtype *w, const realtype *tcl); + + /** + * @brief Model specific implementation of fdwdw, colptrs part + * @param dwdw sparse matrix to which colptrs will be written + */ + virtual void fdwdw_colptrs(SUNMatrixWrapper &dwdw); + + /** + * @brief Model specific implementation of fdwdw, rowvals part + * @param dwdw sparse matrix to which rowvals will be written */ - virtual void fdwdx_rowvals(sunindextype *indexvals); + virtual void fdwdw_rowvals(SUNMatrixWrapper &dwdw); }; } // namespace amici diff --git a/deps/AMICI/include/amici/amici.h b/deps/AMICI/include/amici/amici.h index be98a65ff..b3fe221de 100644 --- a/deps/AMICI/include/amici/amici.h +++ b/deps/AMICI/include/amici/amici.h @@ -125,7 +125,7 @@ std::unique_ptr runAmiciSimulation(Solver &solver, /** * @brief Same as runAmiciSimulation, but for multiple ExpData instances. When - * compiled with openMP support, this function runs multi-threaded. + * compiled with OpenMP support, this function runs multi-threaded. * * @param solver Solver instance * @param edatas experimental data objects diff --git a/deps/AMICI/include/amici/backwardproblem.h b/deps/AMICI/include/amici/backwardproblem.h index 17f48e324..e59c93ec6 100644 --- a/deps/AMICI/include/amici/backwardproblem.h +++ b/deps/AMICI/include/amici/backwardproblem.h @@ -44,7 +44,7 @@ class BackwardProblem { * @return t */ realtype gett() const { - return t; + return t_; } /** @@ -68,26 +68,26 @@ class BackwardProblem { * @return dJydx */ std::vector const& getdJydx() const { - return dJydx; + return dJydx_; } - + /** * @brief Accessor for xB * @return xB */ AmiVector const& getAdjointState() const { - return xB; + return xB_; } - + /** * @brief Accessor for xQB * @return xQB */ AmiVector const& getAdjointQuadrature() const { - return xQB; + return xQB_; } - private: +private: /** * @brief Execute everything necessary for the handling of events * for the backward problem @@ -98,7 +98,7 @@ class BackwardProblem { * @brief Execute everything necessary for the handling of data * points for the backward problems * - * @param it index of data point @type int + * @param it index of data point */ void handleDataPointB(int it); @@ -109,46 +109,44 @@ class BackwardProblem { * This is the maximum of tdata and troot but also takes into account if * it<0 or iroot<0 where these expressions do not necessarily make sense. * - * @param it index of next data point @type int - * @return tnext next timepoint @type realtype + * @param it index of next data point + * @return tnext next timepoint */ realtype getTnext(int it); - Model *model; - Solver *solver; - const ExpData *edata; + Model *model_; + Solver *solver_; + const ExpData *edata_; /** current time */ - realtype t; - /** parameter derivative of likelihood array */ - std::vector llhS0; + realtype t_; /** adjoint state vector */ - AmiVector xB; + AmiVector xB_; /** differential adjoint state vector */ - AmiVector dxB; + AmiVector dxB_; /** quadrature state vector */ - AmiVector xQB; + AmiVector xQB_; /** array of state vectors at discontinuities*/ - std::vector x_disc; + std::vector x_disc_; /** array of differential state vectors at discontinuities*/ - std::vector xdot_disc; + std::vector xdot_disc_; /** array of old differential state vectors at discontinuities*/ - std::vector xdot_old_disc; + std::vector xdot_old_disc_; /** sensitivity state vector array */ - AmiVectorArray sx0; + AmiVectorArray sx0_; /** array of number of found roots for a certain event type */ - std::vector nroots; + std::vector nroots_; /** array containing the time-points of discontinuities*/ - std::vector discs; + std::vector discs_; /** index of the backward problem */ int which = 0; /** array of index which root has been found */ - std::vector> rootidx; + std::vector> root_idx_; /** state derivative of data likelihood */ - std::vector dJydx; + std::vector dJydx_; /** state derivative of event likelihood */ - const std::vector dJzdx; + const std::vector dJzdx_; }; } // namespace amici diff --git a/deps/AMICI/include/amici/defines.h b/deps/AMICI/include/amici/defines.h index a88baad64..f095f3366 100644 --- a/deps/AMICI/include/amici/defines.h +++ b/deps/AMICI/include/amici/defines.h @@ -1,20 +1,61 @@ #ifndef AMICI_DEFINES_H #define AMICI_DEFINES_H -#include +#if !defined(_USE_MATH_DEFINES) +#define _USE_MATH_DEFINES +#endif + #include #include +#include + +/* Math constants in case _USE_MATH_DEFINES is not supported */ +#if defined(_USE_MATH_DEFINES) +#if !defined(M_E) +#define M_E 2.71828182845904523536 +#endif +#if !defined(M_LOG2E) +#define M_LOG2E 1.44269504088896340736 +#endif +#if !defined(M_LOG10E) +#define M_LOG10E 0.434294481903251827651 +#endif +#if !defined(M_LN2) +#define M_LN2 0.693147180559945309417 +#endif +#if !defined(M_LN10) +#define M_LN10 2.30258509299404568402 +#endif +#if !defined(M_PI) +#define M_PI 3.14159265358979323846 +#endif +#if !defined(M_PI_2) +#define M_PI_2 1.57079632679489661923 +#endif +#if !defined(M_PI_4) +#define M_PI_4 0.785398163397448309616 +#endif +#if !defined(M_1_PI) +#define M_1_PI 0.318309886183790671538 +#endif +#if !defined(M_2_PI) +#define M_2_PI 0.636619772367581343076 +#endif +#if !defined(M_2_SQRTPI) +#define M_2_SQRTPI 1.12837916709551257390 +#endif +#if !defined(M_SQRT2) +#define M_SQRT2 1.41421356237309504880 +#endif +#if !defined(M_SQRT1_2) +#define M_SQRT1_2 0.707106781186547524401 +#endif +#endif namespace amici { -#define _USE_MATH_DEFINES -#ifdef M_PI -/** pi definition from MATH_DEFINES */ constexpr double pi = M_PI; -#else -/** MS definition of PI and other constants */ -constexpr double pi = 3.14159265358979323846; -#endif + // clang-format off @@ -42,10 +83,6 @@ constexpr int AMICI_ONE_STEP= 2; constexpr int AMICI_PREEQUILIBRATE= -1; -#ifndef booleantype -#define booleantype int -#endif - /** defines variable type for simulation variables * (determines numerical accuracy) */ using realtype = double; diff --git a/deps/AMICI/include/amici/edata.h b/deps/AMICI/include/amici/edata.h index ba2d1dc9b..bd7266e56 100644 --- a/deps/AMICI/include/amici/edata.h +++ b/deps/AMICI/include/amici/edata.h @@ -306,11 +306,11 @@ class ExpData { /** * @brief get function that returns a pointer to observed data at ieth - * occurence + * occurrence * - * @param ie event occurence + * @param ie event occurrence * - * @return pointer to observed event data at ieth occurence + * @return pointer to observed event data at ieth occurrence */ const realtype *getObservedEventsPtr(int ie) const; @@ -372,12 +372,12 @@ class ExpData { /** * @brief get function that returns a pointer to standard deviation of - * observed event data at ieth occurence + * observed event data at ieth occurrence * - * @param ie event occurence + * @param ie event occurrence * * @return pointer to standard deviation of observed event data at ieth - * occurence + * occurrence */ const realtype *getObservedEventsStdDevPtr(int ie) const; @@ -407,7 +407,7 @@ class ExpData { std::vector x0; /** * @brief condition-specific initial condition sensitivities of size - * Model::nx() * Model::nplist(), Model::nx() * ExpDataplist.size(), if + * Model::nx() * Model::nplist(), Model::nx() * ExpData::plist.size(), if * ExpData::plist is not empty, or empty */ std::vector sx0; @@ -422,7 +422,7 @@ class ExpData { /** * @brief duration of pre-simulation - * if this is > 0, presimualation will be performed from + * if this is > 0, presimulation will be performed from * (model->t0 - t_presim) to model->t0 using the fixedParameters in * fixedParametersPresimulation */ @@ -463,7 +463,7 @@ class ExpData { * @brief checker for dimensions of input observedEvents or * observedEventsStdDev * - * @param input vector input to be checkedjupyter_contrib_nbextensions + * @param input vector input to be checked * @param fieldname name of the input */ void checkEventsDimension(std::vector const &input, @@ -475,29 +475,29 @@ class ExpData { /** @brief number of event observables */ int nztrue_{0}; - /** @brief maximal number of event occurences */ + /** @brief maximal number of event occurrences */ int nmaxevent_{0}; /** @brief observation timepoints (dimension: nt) */ - std::vector ts; + std::vector ts_; /** @brief observed data (dimension: nt x nytrue, row-major) */ - std::vector observedData; + std::vector observed_data_; /** * @brief standard deviation of observed data (dimension: nt x nytrue, * row-major) */ - std::vector observedDataStdDev; + std::vector observed_data_std_dev_; /** * @brief observed events (dimension: nmaxevents x nztrue, row-major) */ - std::vector observedEvents; + std::vector observed_events_; /** * @brief standard deviation of observed events/roots * (dimension: nmaxevents x nztrue, row-major) */ - std::vector observedEventsStdDev; + std::vector observed_events_std_dev_; }; /** @@ -529,7 +529,7 @@ class ConditionContext : public ContextManager { * * @param model * @param edata - * @param fpc flag indicating which fixedParmeter from edata to apply + * @param fpc flag indicating which fixedParameter from edata to apply */ explicit ConditionContext( Model *model, const ExpData *edata = nullptr, @@ -545,7 +545,7 @@ class ConditionContext : public ContextManager { * backed-up in the constructor call. * * @param edata - * @param fpc flag indicating which fixedParmeter from edata to apply + * @param fpc flag indicating which fixedParameter from edata to apply */ void applyCondition(const ExpData *edata, FixedParameterContext fpc); @@ -558,15 +558,15 @@ class ConditionContext : public ContextManager { void restore(); private: - Model *model = nullptr; - std::vector originalx0; - std::vector originalsx0; - std::vector originalParameters; - std::vector originalFixedParameters; - std::vector originalTimepoints; - std::vector originalParameterList; - std::vector originalScaling; - bool originalReinitializeFixedParameterInitialStates; + Model *model_ = nullptr; + std::vector original_x0_; + std::vector original_sx0_; + std::vector original_parameters_; + std::vector original_fixed_parameters_; + std::vector original_timepoints_; + std::vector original_parameter_list_; + std::vector original_scaling_; + bool original_reinitialize_fixed_parameter_initial_states_; }; } // namespace amici diff --git a/deps/AMICI/include/amici/exception.h b/deps/AMICI/include/amici/exception.h index 3e1c9bb80..5b9b2c226 100644 --- a/deps/AMICI/include/amici/exception.h +++ b/deps/AMICI/include/amici/exception.h @@ -18,16 +18,10 @@ class AmiException : public std::exception { /** * @brief Constructor with printf style interface * @param fmt error message with printf format - * @param ... printf formating variables + * @param ... printf formatting variables */ explicit AmiException(char const* fmt, ...); - /** - * @brief Move constructor - * @param old object to move from - */ - AmiException(AmiException&& old) noexcept; - /** * @brief Override of default error message function * @return msg error message @@ -47,8 +41,8 @@ class AmiException : public std::exception { void storeBacktrace(int nMaxFrames); private: - std::array msg; - std::array trace; + std::array msg_; + std::array trace_; }; @@ -83,7 +77,7 @@ class IDAException : public AmiException { /** * @brief Integration failure exception for the forward problem * - * This exception should be thrown when an integration failure occured + * This exception should be thrown when an integration failure occurred * for this exception we can assume that we can recover from the exception * and return a solution struct to the user */ @@ -107,7 +101,7 @@ class IntegrationFailure : public AmiException { /** * @brief Integration failure exception for the backward problem * - * This exception should be thrown when an integration failure occured + * This exception should be thrown when an integration failure occurred * for this exception we can assume that we can recover from the exception * and return a solution struct to the user */ @@ -156,7 +150,7 @@ class NewtonFailure : public AmiException { public: /** * @brief Constructor, simply calls AmiException constructor - * @param function name of the function in which the error occured + * @param function name of the function in which the error occurred * @param code error code */ NewtonFailure(int code, const char *function); diff --git a/deps/AMICI/include/amici/forwardproblem.h b/deps/AMICI/include/amici/forwardproblem.h index f08c721b1..712377d95 100644 --- a/deps/AMICI/include/amici/forwardproblem.h +++ b/deps/AMICI/include/amici/forwardproblem.h @@ -56,12 +56,12 @@ class ForwardProblem { ~ForwardProblem() = default; /** allow FinalStateStorer to access private members and functions */ - friend FinalStateStorer; + friend ::amici::FinalStateStorer; /** * @brief Solve the forward problem. * - * If forward sensitivities are enabled this will also compute sensitivies. + * If forward sensitivities are enabled this will also compute sensitivities. */ void workForwardProblem(); @@ -77,7 +77,7 @@ class ForwardProblem { * @return t */ realtype getTime() const { - return t; + return t_; } /** @@ -85,7 +85,7 @@ class ForwardProblem { * @return x */ AmiVector const& getState() const { - return x; + return x_; } /** @@ -93,7 +93,7 @@ class ForwardProblem { * @return dx */ AmiVector const& getStateDerivative() const { - return dx; + return dx_; } /** @@ -101,7 +101,7 @@ class ForwardProblem { * @return sx */ AmiVectorArray const& getStateSensitivity() const { - return sx; + return sx_; } /** @@ -109,7 +109,7 @@ class ForwardProblem { * @return x_disc */ std::vector const& getStatesAtDiscontinuities() const { - return x_disc; + return x_disc_; } /** @@ -117,7 +117,7 @@ class ForwardProblem { * @return xdot_disc */ std::vector const& getRHSAtDiscontinuities() const { - return xdot_disc; + return xdot_disc_; } /** @@ -125,7 +125,7 @@ class ForwardProblem { * @return xdot_old_disc */ std::vector const& getRHSBeforeDiscontinuities() const { - return xdot_old_disc; + return xdot_old_disc_; } /** @@ -133,7 +133,7 @@ class ForwardProblem { * @return nroots */ std::vector const& getNumberOfRoots() const { - return nroots; + return nroots_; } /** @@ -141,7 +141,7 @@ class ForwardProblem { * @return discs */ std::vector const& getDiscontinuities() const { - return discs; + return discs_; } /** @@ -149,7 +149,7 @@ class ForwardProblem { * @return rootidx */ std::vector> const& getRootIndexes() const { - return rootidx; + return root_idx_; } /** @@ -157,7 +157,7 @@ class ForwardProblem { * @return dJydx */ std::vector const& getDJydx() const { - return dJydx; + return dJydx_; } /** @@ -165,7 +165,7 @@ class ForwardProblem { * @return dJzdx */ std::vector const& getDJzdx() const { - return dJzdx; + return dJzdx_; } /** @@ -173,7 +173,7 @@ class ForwardProblem { * @return &x */ AmiVector *getStatePointer() { - return &x; + return &x_; } /** @@ -181,7 +181,7 @@ class ForwardProblem { * @return &dx */ AmiVector *getStateDerivativePointer() { - return &dx; + return &dx_; } /** @@ -189,7 +189,7 @@ class ForwardProblem { * @return &sx */ AmiVectorArray *getStateSensitivityPointer() { - return &sx; + return &sx_; } /** @@ -197,7 +197,7 @@ class ForwardProblem { * @return &sdx */ AmiVectorArray *getStateDerivativeSensitivityPointer() { - return &sdx; + return &sdx_; } /** @@ -205,7 +205,7 @@ class ForwardProblem { * @return it */ int getCurrentTimeIteration() const { - return it; + return it_; } /** @@ -213,7 +213,7 @@ class ForwardProblem { * @return time point */ realtype getFinalTime() const { - return final_state.t; + return final_state_.t; } /** @@ -221,7 +221,7 @@ class ForwardProblem { * @return index */ int getEventCounter() const { - return static_cast(event_states.size() - 1); + return static_cast(event_states_.size() - 1); } /** @@ -229,19 +229,19 @@ class ForwardProblem { * @return index */ int getRootCounter() const { - return static_cast(discs.size() - 1); + return static_cast(discs_.size() - 1); } /** * @brief Retrieves the carbon copy of the simulation state variables at * the specified timepoint index - * @param it timpoint index + * @param it timepoint index * @return state */ const SimulationState &getSimulationStateTimepoint(int it) const { - if (model->getTimepoint(it) == initial_state.t) + if (model->getTimepoint(it) == initial_state_.t) return getInitialSimulationState(); - return timepoint_states.find(model->getTimepoint(it))->second; + return timepoint_states_.find(model->getTimepoint(it))->second; }; /** @@ -251,7 +251,7 @@ class ForwardProblem { * @return SimulationState */ const SimulationState &getSimulationStateEvent(int iroot) const { - return event_states.at(iroot); + return event_states_.at(iroot); }; /** @@ -260,7 +260,7 @@ class ForwardProblem { * @return SimulationState */ const SimulationState &getInitialSimulationState() const { - return initial_state; + return initial_state_; }; /** @@ -269,7 +269,7 @@ class ForwardProblem { * @return SimulationState */ const SimulationState &getFinalSimulationState() const { - return final_state; + return final_state_; }; /** pointer to model instance */ @@ -280,6 +280,7 @@ class ForwardProblem { /** pointer to experimental data instance */ const ExpData *edata; + private: void handlePresimulation(); @@ -288,6 +289,7 @@ class ForwardProblem { * @brief Execute everything necessary for the handling of events * * @param tlastroot pointer to the timepoint of the last event + * @param seflag Secondary event flag */ void handleEvent(realtype *tlastroot,bool seflag); @@ -322,7 +324,7 @@ class ForwardProblem { * @param nmaxevent maximal number of events */ bool checkEventsToFill(int nmaxevent) const { - return std::any_of(nroots.cbegin(), nroots.cend(), + return std::any_of(nroots_.cbegin(), nroots_.cend(), [nmaxevent](int curNRoots) { return curNRoots < nmaxevent; }); @@ -335,7 +337,7 @@ class ForwardProblem { */ void fillEvents(int nmaxevent) { if (checkEventsToFill(nmaxevent)) { - discs.push_back(t); + discs_.push_back(t_); storeEvent(); } } @@ -349,106 +351,106 @@ class ForwardProblem { /** array of index vectors (dimension ne) indicating whether the respective * root has been detected for all so far encountered discontinuities, * extended as needed (dimension: dynamic) */ - std::vector> rootidx; + std::vector> root_idx_; /** array of number of found roots for a certain event type * (dimension: ne) */ - std::vector nroots; + std::vector nroots_; /** array of values of the root function (dimension: ne) */ - std::vector rootvals; + std::vector rootvals_; /** temporary rootval storage to check crossing in secondary event * (dimension: ne) */ - std::vector rvaltmp; + std::vector rval_tmp_; /** array containing the time-points of discontinuities * (dimension: nmaxevent x ne, ordering = ?) */ - std::vector discs; + std::vector discs_; /** array containing the index of discontinuities * (dimension: nmaxevent x ne, ordering = ?) */ - std::vector irdiscs; + std::vector irdiscs_; /** array of state vectors (dimension nx) for all so far encountered * discontinuities, extended as needed (dimension dynamic) */ - std::vector x_disc; + std::vector x_disc_; /** array of differential state vectors (dimension nx) for all so far * encountered discontinuities, extended as needed (dimension dynamic) */ - std::vector xdot_disc; + std::vector xdot_disc_; /** array of old differential state vectors (dimension nx) for all so far * encountered discontinuities, extended as needed (dimension dynamic) */ - std::vector xdot_old_disc; + std::vector xdot_old_disc_; /** state derivative of data likelihood * (dimension nJ x nx x nt, ordering =?) */ - std::vector dJydx; + std::vector dJydx_; /** state derivative of event likelihood * (dimension nJ x nx x nMaxEvent, ordering =?) */ - std::vector dJzdx; + std::vector dJzdx_; /** current time */ - realtype t; + realtype t_; /** - * @brief Array of flags indicating which root has beend found. + * @brief Array of flags indicating which root has been found. * * Array of length nr (ne) with the indices of the user functions gi found * to have a root. For i = 0, . . . ,nr 1 if gi has a root, and = 0 if not. */ - std::vector rootsfound; + std::vector roots_found_; /** simulation states history at timepoints */ - std::map timepoint_states; + std::map timepoint_states_; /** simulation state history at events*/ - std::vector event_states; + std::vector event_states_; /** simulation state after initialization*/ - SimulationState initial_state; + SimulationState initial_state_; /** simulation state after simulation*/ - SimulationState final_state; + SimulationState final_state_; /** state vector (dimension: nx_solver) */ - AmiVector x; + AmiVector x_; /** old state vector (dimension: nx_solver) */ - AmiVector x_old; + AmiVector x_old_; /** differential state vector (dimension: nx_solver) */ - AmiVector dx; + AmiVector dx_; /** old differential state vector (dimension: nx_solver) */ - AmiVector dx_old; + AmiVector dx_old_; /** time derivative state vector (dimension: nx_solver) */ - AmiVector xdot; + AmiVector xdot_; /** old time derivative state vector (dimension: nx_solver) */ - AmiVector xdot_old; + AmiVector xdot_old_; /** sensitivity state vector array (dimension: nx_cl x nplist, row-major) */ - AmiVectorArray sx; + AmiVectorArray sx_; /** differential sensitivity state vector array * (dimension: nx_cl x nplist, row-major) */ - AmiVectorArray sdx; + AmiVectorArray sdx_; /** sensitivity of the event timepoint (dimension: nplist) */ - std::vector stau; + std::vector stau_; /** storage for last found root */ - realtype tlastroot = 0.0; + realtype tlastroot_ {0.0}; - /** flag to indicate wheter solver was preeinitialized via preequilibration */ - bool preequilibrated = false; + /** flag to indicate whether solver was preeinitialized via preequilibration */ + bool preequilibrated_ {false}; /** current iteration number for time index */ - int it; + int it_; }; @@ -461,7 +463,7 @@ class FinalStateStorer : public ContextManager { * @brief constructor, attaches problem pointer * @param fwd problem from which the simulation state is to be stored */ - explicit FinalStateStorer(ForwardProblem *fwd) : fwd(fwd) { + explicit FinalStateStorer(ForwardProblem *fwd) : fwd_(fwd) { } FinalStateStorer &operator=(const FinalStateStorer &other) = delete; @@ -470,11 +472,11 @@ class FinalStateStorer : public ContextManager { * @brief destructor, stores simulation state */ ~FinalStateStorer() { - if(fwd) - fwd->final_state = fwd->getSimulationState(); + if(fwd_) + fwd_->final_state_ = fwd_->getSimulationState(); } private: - ForwardProblem *fwd; + ForwardProblem *fwd_; }; } // namespace amici diff --git a/deps/AMICI/include/amici/hdf5.h b/deps/AMICI/include/amici/hdf5.h index d326a2bcd..ab7eb05f3 100644 --- a/deps/AMICI/include/amici/hdf5.h +++ b/deps/AMICI/include/amici/hdf5.h @@ -33,25 +33,27 @@ namespace hdf5 { /* Functions for reading and writing AMICI data to/from HDF5 files. */ /** - * @brief Open the given file for writing. Append if exists, create if not. - * @param hdf5filename - * @return + * @brief Open the given file for writing. + * + * Append if exists, create if not. + * @param hdf5filename File to open + * @return File object */ H5::H5File createOrOpenForWriting(std::string const &hdf5filename); /** - * @brief Read solver options from HDF5 file - * @param file hdf5 file handle to read from - * @param solver solver to set options on + * @brief Read solver options from HDF5 file. + * @param file HDF5 file to read from + * @param solver Solver to set options on * @param datasetPath Path inside the HDF5 file */ void readSolverSettingsFromHDF5(const H5::H5File &file, Solver &solver, std::string const &datasetPath); /** - * @brief Write solver options from HDF5 file - * @param hdf5Filenamehdf5 Name of HDF5 file - * @param solver solver to write options from + * @brief Write solver options to HDF5 file. + * @param hdf5Filename Name of HDF5 file to write to + * @param solver Solver to write options from * @param hdf5Location Path inside the HDF5 file */ void writeSolverSettingsToHDF5(Solver const& solver, @@ -59,9 +61,9 @@ void writeSolverSettingsToHDF5(Solver const& solver, std::string const& hdf5Location); /** - * @brief Write solver options from HDF5 file - * @param file file handle to read from - * @param solver solver to write options from + * @brief Write solver options to HDF5 file. + * @param file File to read from + * @param solver Solver to write options from * @param hdf5Location Path inside the HDF5 file */ void writeSolverSettingsToHDF5(Solver const& solver, @@ -69,65 +71,76 @@ void writeSolverSettingsToHDF5(Solver const& solver, std::string const& hdf5Location); /** - * @brief Read solver options from HDF5 file + * @brief Read solver options from HDF5 file. * @param hdffile Name of HDF5 file - * @param solver solver to set options on + * @param solver Solver to set options on * @param datasetPath Path inside the HDF5 file */ void readSolverSettingsFromHDF5(std::string const &hdffile, Solver &solver, std::string const &datasetPath); /** - * @brief Read model data from HDF5 file + * @brief Read model data from HDF5 file. * @param hdffile Name of HDF5 file - * @param model model to set data on + * @param model Model to set data on * @param datasetPath Path inside the HDF5 file */ void readModelDataFromHDF5(std::string const &hdffile, Model &model, std::string const &datasetPath); /** - * @brief Read model data from HDF5 file - * @param fileId hdf5 file handle to read from - * @param model model to set data on + * @brief Read model data from HDF5 file. + * @param file HDF5 file handle to read from + * @param model Model to set data on * @param datasetPath Path inside the HDF5 file */ void readModelDataFromHDF5(H5::H5File const &file, Model &model, std::string const &datasetPath); /** - * @brief Write ReturnData struct to HDF5 dataset + * @brief Write ReturnData to HDF5 file. * @param rdata Data to write - * @param hdffile Filename of HDF5 file - * @param datasetPath Full dataset path inside the HDF5 file (will be created) + * @param file HDF5 file to write to + * @param hdf5Location Full dataset path inside the HDF5 file (will be created) */ void writeReturnData(const ReturnData &rdata, H5::H5File const &file, const std::string &hdf5Location); +/** + * @brief Write ReturnData to HDF5 file. + * @param rdata Data to write + * @param hdf5Filename Filename of HDF5 file + * @param hdf5Location Full dataset path inside the HDF5 file (will be created) + */ + void writeReturnData(const ReturnData &rdata, std::string const &hdf5Filename, const std::string &hdf5Location); +/** + * @brief Write ReturnData diagnosis data to HDF5 file. + * @param rdata Data to write + * @param file HDF5 file to write to + * @param hdf5Location Full dataset path inside the HDF5 file (will be created) + */ void writeReturnDataDiagnosis(const ReturnData &rdata, H5::H5File const &file, const std::string &hdf5Location); /** - * @brief Create the given group and possibly parents - * @param file - * @param groupPath - * @param recursively + * @brief Create the given group and possibly parents. + * @param file HDF5 file to write to + * @param groupPath Path to the group to be created + * @param recursively Create intermediary groups */ void createGroup(const H5::H5File &file, std::string const &groupPath, bool recursively = true); /** - * @brief readSimulationExpData reads AMICI experimental data from attributes in - * HDF5 file. + * @brief Read AMICI ExpData data from HDF5 file. * @param hdf5Filename Name of HDF5 file - * @param hdf5Root Path inside the HDF5 file to object having ExpData as - * attributes + * @param hdf5Root Path inside the HDF5 file to object having ExpData * @param model The model for which data is to be read - * @return + * @return ExpData created from data in the given location */ std::unique_ptr readSimulationExpData(const std::string &hdf5Filename, @@ -135,85 +148,184 @@ std::unique_ptr readSimulationExpData(const std::string &hdf5Filename, const Model &model); /** - * @brief writeSimulationExpData writes AMICI experimental data to attributes in - * HDF5 file. + * @brief Write AMICI experimental data to HDF5 file. * @param edata The experimental data which is to be written - * @param hdf5Filename Name of HDF5 file - * @param hdf5Root Path inside the HDF5 file to object having ExpData as - * attributes + * @param file Name of HDF5 file + * @param hdf5Location Path inside the HDF5 file to object having ExpData */ void writeSimulationExpData(const ExpData &edata, H5::H5File const &file, const std::string &hdf5Location); /** - * @brief attributeExists Check whether an attribute with the given name exists - * on the given dataset - * @param fileId The HDF5 file object - * @param datasetPath Dataset of which attributes should be checked + * @brief Check whether an attribute with the given name exists + * on the given dataset. + * @param file The HDF5 file object + * @param optionsObject Dataset of which attributes should be checked * @param attributeName Name of the attribute of interest - * @return + * @return `true` if attribute exists, `false` otherwise */ bool attributeExists(H5::H5File const &file, const std::string &optionsObject, const std::string &attributeName); +/** + * @brief Check whether an attribute with the given name exists + * on the given object. + * @param object An HDF5 object + * @param attributeName Name of the attribute of interest + * @return `true` if attribute exists, `false` otherwise + */ bool attributeExists(H5::H5Object const &object, const std::string &attributeName); +/** + * @brief Create and write to 1-dimensional native integer dataset. + * @param file HDF5 file object + * @param datasetName Name of dataset to create + * @param buffer Data to write to dataset + */ void createAndWriteInt1DDataset(H5::H5File const &file, std::string const &datasetName, gsl::span buffer); +/** + * @brief Create and write to 2-dimensional native integer dataset. + * @param file HDF5 file object + * @param datasetName Name of dataset to create + * @param buffer Flattened data to write to dataset (assuming row-major) + * @param m Number of rows in buffer + * @param n Number of columns buffer + */ void createAndWriteInt2DDataset(H5::H5File const &file, std::string const &datasetName, gsl::span buffer, hsize_t m, hsize_t n); +/** + * @brief Create and write to 1-dimensional native double dataset. + * @param file HDF5 file object + * @param datasetName Name of dataset to create + * @param buffer Data to write to dataset + */ void createAndWriteDouble1DDataset(H5::H5File const &file, std::string const &datasetName, gsl::span buffer); +/** + * @brief Create and write to 2-dimensional native double dataset. + * @param file HDF5 file object + * @param datasetName Name of dataset to create + * @param buffer Flattened data to write to dataset (assuming row-major) + * @param m Number of rows in buffer + * @param n Number of columns buffer + */ + void createAndWriteDouble2DDataset(H5::H5File const &file, std::string const &datasetName, gsl::span buffer, hsize_t m, hsize_t n); +/** + * @brief Create and write to 3-dimensional native double dataset. + * @param file HDF5 file object + * @param datasetName Name of dataset to create + * @param buffer Flattened data to write to dataset (assuming row-major) + * @param m Length of first dimension in buffer + * @param n Length of first dimension in buffer + * @param o Length of first dimension in buffer + */ + void createAndWriteDouble3DDataset(H5::H5File const &file, std::string const &datasetName, gsl::span buffer, hsize_t m, hsize_t n, hsize_t o); +/** + * @brief Read scalar native double attribute from HDF5 object. + * @param file HDF5 file + * @param optionsObject Object to read attribute frin + * @param attributeName Name of attribute to read + * @return Attribute value + */ double getDoubleScalarAttribute(const H5::H5File &file, const std::string &optionsObject, const std::string &attributeName); +/** + * @brief Read scalar native integer attribute from HDF5 object. + * @param file HDF5 file + * @param optionsObject Object to read attribute from + * @param attributeName Name of attribute to read + * @return Attribute value + */ + int getIntScalarAttribute(const H5::H5File &file, const std::string &optionsObject, const std::string &attributeName); +/** + * @brief Read 1-dimensional native integer dataset from HDF5 file. + * @param file HDF5 file object + * @param name Name of dataset to read + * @return Data read + */ std::vector getIntDataset1D(const H5::H5File &file, std::string const &name); +/** + * @brief Read 1-dimensional native double dataset from HDF5 file. + * @param file HDF5 file object + * @param name Name of dataset to read + * @return Data read + */ + std::vector getDoubleDataset1D(const H5::H5File &file, std::string const &name); +/** + * @brief Read 2-dimensional native double dataset from HDF5 file. + * @param file HDF5 file object + * @param name Name of dataset to read + * @param m Number of rows in the dataset + * @param n Number of columns in the dataset + * @return Flattened data (row-major) + */ + std::vector getDoubleDataset2D(const H5::H5File &file, std::string const &name, hsize_t &m, hsize_t &n); +/** + * @brief Read 3-dimensional native double dataset from HDF5 file. + * @param file HDF5 file object + * @param name Name of dataset to read + * @param m Length of first dimension in dataset + * @param n Length of first dimension in dataset + * @param o Length of first dimension in dataset + * @return Flattened data (row-major) + */ + std::vector getDoubleDataset3D(const H5::H5File &file, std::string const &name, hsize_t &m, hsize_t &n, hsize_t &o); /** * @brief Check if the given location (group, link or dataset) exists in the - * given file - * @param filename - * @param location - * @return + * given file. + * @param filename HDF5 filename + * @param location Location to test for + * @return `true` if exists, `false` otherwise */ bool locationExists(std::string const &filename, std::string const &location); +/** + * @brief Check if the given location (group, link or dataset) exists in the + * given file. + * @param file HDF5 file object + * @param location Location to test for + * @return `true` if exists, `false` otherwise + */ + bool locationExists(H5::H5File const &file, std::string const &location); } // namespace hdf5 diff --git a/deps/AMICI/include/amici/interface_matlab.h b/deps/AMICI/include/amici/interface_matlab.h index cea3d3a1f..1f1846188 100644 --- a/deps/AMICI/include/amici/interface_matlab.h +++ b/deps/AMICI/include/amici/interface_matlab.h @@ -19,7 +19,7 @@ class ReturnDataMatlab; /** * @brief setModelData sets data from the matlab call to the model object - * @param prhs: pointer to the array of input arguments @type mxArray + * @param prhs: pointer to the array of input arguments * @param nrhs: number of elements in prhs * @param model: model to update */ @@ -28,7 +28,7 @@ void setModelData(const mxArray *prhs[], int nrhs, Model& model); /** * @brief setSolverOptions solver options from the matlab call to a solver * object - * @param prhs: pointer to the array of input arguments @type mxArray + * @param prhs: pointer to the array of input arguments * @param nrhs: number of elements in prhs * @param solver: solver to update */ @@ -36,9 +36,9 @@ void setSolverOptions(const mxArray *prhs[], int nrhs, Solver& solver); /** * @brief setupReturnData initialises the return data struct - * @param plhs user input @type mxArray - * @param nlhs number of elements in plhs @type mxArray - * @return rdata: return data struct @type *ReturnData + * @param plhs user input + * @param nlhs number of elements in plhs + * @return rdata: return data struct */ ReturnDataMatlab *setupReturnData(mxArray *plhs[], int nlhs); @@ -49,8 +49,8 @@ ReturnDataMatlab *setupReturnData(mxArray *plhs[], int nlhs); * * @param prhs pointer to the array of input arguments * @param model pointer to the model object, this is necessary to perform - * dimension checks @type *mxArray - * @return edata pointer to experimental data object @type *ExpData + * dimension checks + * @return edata pointer to experimental data object */ std::unique_ptr expDataFromMatlabCall(const mxArray *prhs[], const Model &model); diff --git a/deps/AMICI/include/amici/misc.h b/deps/AMICI/include/amici/misc.h index 06862e9c8..dd59b03fc 100644 --- a/deps/AMICI/include/amici/misc.h +++ b/deps/AMICI/include/amici/misc.h @@ -84,8 +84,8 @@ void writeSlice(const gsl::span slice, gsl::span buffer) { /** * @brief local helper function to write computed slice to provided buffer (vector) - * @param slice computed value - * @param buffer buffer to which values are to be written + * @param s computed value + * @param b buffer to which values are to be written */ template void writeSlice(const std::vector &s, std::vector &b) { @@ -95,8 +95,8 @@ void writeSlice(const std::vector &s, std::vector &b) { /** * @brief local helper function to write computed slice to provided buffer (vector/span) - * @param slice computed value - * @param buffer buffer to which values are to be written + * @param s computed value + * @param b buffer to which values are to be written */ template void writeSlice(const std::vector &s, gsl::span b) { @@ -105,8 +105,8 @@ void writeSlice(const std::vector &s, gsl::span b) { /** * @brief local helper function to write computed slice to provided buffer (AmiVector/span) - * @param slice computed value - * @param buffer buffer to which values are to be written + * @param s computed value + * @param b buffer to which values are to be written */ void writeSlice(const AmiVector &s, gsl::span b); @@ -177,8 +177,8 @@ std::string regexErrorToString(std::regex_constants::error_type err_type); std::string printfToString(const char *fmt, va_list ap); /** - * @brief Generic implementation for a context manager, explicitely deletes copy and move operators for - * derived classes + * @brief Generic implementation for a context manager, explicitly deletes copy + * and move operators for derived classes */ class ContextManager{ public: diff --git a/deps/AMICI/include/amici/model.h b/deps/AMICI/include/amici/model.h index 05e8b430d..f2e4b68f6 100644 --- a/deps/AMICI/include/amici/model.h +++ b/deps/AMICI/include/amici/model.h @@ -25,38 +25,43 @@ extern AmiciApplication defaultContext; namespace boost { namespace serialization { template -void serialize(Archive &ar, amici::Model &u, unsigned int version); +void serialize(Archive &ar, amici::Model &m, unsigned int version); } } // namespace boost namespace amici { /** - * @brief implements an exchange format to store and transfer the state of the model at a - * specific timepoint. This is designed to only encompass the minimal number of attributes that need to be - * transferred. + * @brief Exchange format to store and transfer the state of the + * model at a specific timepoint. + * + * This is designed to only encompass the minimal + * number of attributes that need to be transferred. */ struct ModelState { - /** flag indicating whether a certain heaviside function should be active or - not (dimension: ne) */ + /** + * Flag indicating whether a certain Heaviside function should be active or + * not (dimension: `ne`) + */ std::vector h; - /** total abundances for conservation laws - (dimension: nx_rdata-nx_solver) */ + /** Total abundances for conservation laws + (dimension: `nx_rdata - nx_solver`) */ std::vector total_cl; - /** sensitivities of total abundances for conservation laws - (dimension: (nx_rdata-nx_solver) x np, row-major) */ + /** Sensitivities of total abundances for conservation laws + (dimension: `(nx_rdata-nx_solver) x np`, row-major) */ std::vector stotal_cl; - /** unscaled parameters (dimension: np) */ + /** Unscaled parameters (dimension: `np`) */ std::vector unscaledParameters; - /** constants (dimension: nk) */ + /** Constants (dimension: `nk`) */ std::vector fixedParameters; - /** indexes of parameters wrt to which sensitivities are computed - * (dimension: nplist) + /** + * Indexes of parameters wrt to which sensitivities are computed + * (dimension: nplist) */ std::vector plist; }; @@ -64,91 +69,98 @@ struct ModelState { /** - * @brief The Model class represents an AMICI ODE/DAE model. The model can compute - * various model related quantities based on symbolically generated code. + * @brief The Model class represents an AMICI ODE/DAE model. + * + * The model can compute various model related quantities based on symbolically + * generated code. */ class Model : public AbstractModel { public: - /** default constructor */ + /** Default constructor */ Model() = default; /** - * @brief Constructor with model dimensions - * @param nx_rdata number of state variables - * @param nxtrue_rdata number of state variables of the non-augmented model - * @param nx_solver number of state variables with conservation laws applied - * @param nxtrue_solver number of state variables of the non-augmented model + * @brief Constructor with model dimensions. + * @param nx_rdata Number of state variables + * @param nxtrue_rdata Number of state variables of the non-augmented model + * @param nx_solver Number of state variables with conservation laws applied + * @param nxtrue_solver Number of state variables of the non-augmented model * with conservation laws applied - * @param nx_solver_reinit number of state variables with conservation laws + * @param nx_solver_reinit Number of state variables with conservation laws * subject to reinitialization - * @param ny number of observables - * @param nytrue number of observables of the non-augmented model - * @param nz number of event observables - * @param nztrue number of event observables of the non-augmented model - * @param ne number of events - * @param nJ number of objective functions - * @param nw number of repeating elements - * @param ndwdx number of nonzero elements in the x derivative of the + * @param ny Number of observables + * @param nytrue Number of observables of the non-augmented model + * @param nz Number of event observables + * @param nztrue Number of event observables of the non-augmented model + * @param ne Number of events + * @param nJ Number of objective functions + * @param nw Number of repeating elements + * @param ndwdx Number of nonzero elements in the `x` derivative of the + * repeating elements + * @param ndwdp Number of nonzero elements in the `p` derivative of the * repeating elements - * @param ndwdp number of nonzero elements in the p derivative of the + * @param ndwdw Number of nonzero elements in the `w` derivative of the * repeating elements - * @param ndxdotdw number of nonzero elements in the w derivative of xdot - * @param ndJydy number of nonzero elements in the y derivative of dJy - * (dimension nytrue) - * @param nnz number of nonzero elements in Jacobian - * @param ubw upper matrix bandwidth in the Jacobian - * @param lbw lower matrix bandwidth in the Jacobian - * @param o2mode second order sensitivity mode - * @param p parameters - * @param k constants - * @param plist indexes wrt to which sensitivities are to be computed - * @param idlist indexes indicating algebraic components (DAE only) - * @param z2event mapping of event outputs to events - * @param pythonGenerated flag indicating matlab or python wrapping - * @param ndxdotdp_explicit number of nonzero elements dxdotdp_explicit - * @param ndxdotdp_implicit number of nonzero elements dxdotdp_implicit + * @param ndxdotdw Number of nonzero elements in the \f$w\f$ derivative of + * \f$xdot\f$ + * @param ndJydy Number of nonzero elements in the \f$y\f$ derivative of + * \f$dJy\f$ (dimension `nytrue`) + * @param nnz Number of nonzero elements in Jacobian + * @param ubw Upper matrix bandwidth in the Jacobian + * @param lbw Lower matrix bandwidth in the Jacobian + * @param o2mode Second order sensitivity mode + * @param p Parameters + * @param k Constants + * @param plist Indexes wrt to which sensitivities are to be computed + * @param idlist Indexes indicating algebraic components (DAE only) + * @param z2event Mapping of event outputs to events + * @param pythonGenerated Flag indicating matlab or python wrapping + * @param ndxdotdp_explicit Number of nonzero elements in `dxdotdp_explicit` + * @param ndxdotdx_explicit Number of nonzero elements in `dxdotdx_explicit` + * @param w_recursion_depth Recursion depth of fw */ Model(int nx_rdata, int nxtrue_rdata, int nx_solver, int nxtrue_solver, int nx_solver_reinit, int ny, int nytrue, int nz, int nztrue, int ne, - int nJ, int nw, int ndwdx, int ndwdp, int ndxdotdw, + int nJ, int nw, int ndwdx, int ndwdp, int ndwdw, int ndxdotdw, std::vector ndJydy, int nnz, int ubw, int lbw, amici::SecondOrderMode o2mode, const std::vector &p, std::vector k, const std::vector &plist, std::vector idlist, std::vector z2event, bool pythonGenerated = false, - int ndxdotdp_explicit = 0, int ndxdotdp_implicit = 0); + int ndxdotdp_explicit = 0, int ndxdotdx_explicit = 0, + int w_recursion_depth = 0); - /** destructor */ + /** Destructor. */ ~Model() override = default; /** - * @brief Copy assignment is disabled until const members are removed - * @param other object to copy from + * @brief Copy assignment is disabled until const members are removed. + * @param other Object to copy from * @return */ Model &operator=(Model const &other) = delete; /** - * @brief Clone this instance + * @brief Clone this instance. * @return The clone */ virtual Model *clone() const = 0; /** - * @brief Serialize Model (see boost::serialization::serialize) + * @brief Serialize Model (see `boost::serialization::serialize`). * @param ar Archive to serialize to - * @param u Data to serialize + * @param m Data to serialize * @param version Version number */ template - friend void boost::serialization::serialize(Archive &ar, Model &u, + friend void boost::serialization::serialize(Archive &ar, Model &m, unsigned int version); /** - * @brief Check equality of data members - * @param a first model instance - * @param b second model instance - * @return equality + * @brief Check equality of data members. + * @param a First model instance + * @param b Second model instance + * @return Equality */ friend bool operator==(const Model &a, const Model &b); @@ -161,6 +173,8 @@ class Model : public AbstractModel { using AbstractModel::fdJrzdz; using AbstractModel::fdJydsigma; using AbstractModel::fdJydy; + using AbstractModel::fdJydy_colptrs; + using AbstractModel::fdJydy_rowvals; using AbstractModel::fdJzdsigma; using AbstractModel::fdJzdz; using AbstractModel::fdrzdp; @@ -173,6 +187,9 @@ class Model : public AbstractModel { using AbstractModel::fdwdx; using AbstractModel::fdwdx_colptrs; using AbstractModel::fdwdx_rowvals; + using AbstractModel::fdwdw; + using AbstractModel::fdwdw_colptrs; + using AbstractModel::fdwdw_rowvals; using AbstractModel::fdydp; using AbstractModel::fdydx; using AbstractModel::fdzdp; @@ -193,161 +210,168 @@ class Model : public AbstractModel { using AbstractModel::fx0_fixedParameters; using AbstractModel::fy; using AbstractModel::fz; - - /** - * @brief Initialization of model properties - * @param x pointer to state variables - * @param dx pointer to time derivative of states (DAE only) - * @param sx pointer to state variable sensititivies - * @param sdx pointer to time derivative of state sensitivities (DAE only) - * @param computeSensitivities flag indicating whether sensitivities are to + + /** + * @brief Initialize model properties. + * @param x Reference to state variables + * @param dx Reference to time derivative of states (DAE only) + * @param sx Reference to state variable sensitivities + * @param sdx Reference to time derivative of state sensitivities (DAE only) + * @param computeSensitivities Flag indicating whether sensitivities are to * be computed */ void initialize(AmiVector &x, AmiVector &dx, AmiVectorArray &sx, AmiVectorArray &sdx, bool computeSensitivities); /** - * @brief Initialization of model properties - * @param xB adjoint state variables - * @param dxB time derivative of adjoint states (DAE only) - * @param xQB adjoint quadratures - * @param posteq flag indicating whether postequilibration was performed + * @brief Initialize model properties. + * @param xB Adjoint state variables + * @param dxB Time derivative of adjoint states (DAE only) + * @param xQB Adjoint quadratures + * @param posteq Flag indicating whether postequilibration was performed */ void initializeB(AmiVector &xB, AmiVector &dxB, AmiVector &xQB, bool posteq) const; /** - * @brief Initialization of initial states - * @param x pointer to state variables + * @brief Initialize initial states. + * @param x State vector to be initialized */ void initializeStates(AmiVector &x); /** - * @brief Initialization of initial state sensitivities - * @param sx pointer to state variable sensititivies - * @param x pointer to state variables + * @brief Initialize initial state sensitivities. + * @param sx Reference to state variable sensitivities + * @param x Reference to state variables */ void initializeStateSensitivities(AmiVectorArray &sx, const AmiVector &x); /** - * @brief Initialises the heaviside variables h at the intial time t0 - * heaviside variables activate/deactivate on event occurences - * @param x pointer to state variables - * @param dx pointer to time derivative of states (DAE only) + * @brief Initialize the Heaviside variables `h` at the initial time `t0`. + * + * Heaviside variables activate/deactivate on event occurrences. + * + * @param x Reference to state variables + * @param dx Reference to time derivative of states (DAE only) */ void initHeaviside(const AmiVector &x, const AmiVector &dx); /** - * @brief Number of parameters wrt to which sensitivities are computed - * @return length of sensitivity index vector + * @brief Get number of parameters wrt to which sensitivities are computed. + * @return Length of sensitivity index vector */ int nplist() const; /** - * @brief Total number of model parameters - * @return length of parameter vector + * @brief Get total number of model parameters. + * @return Length of parameter vector */ int np() const; /** - * @brief Number of constants - * @return length of constant vector + * @brief Get number of constants + * @return Length of constant vector */ int nk() const; /** - * @brief Number of conservation laws - * @return difference between nx_rdata and nx_solver + * @brief Get number of conservation laws. + * @return Number of conservation laws (i.e., difference between `nx_rdata` + * and `nx_solver`). */ int ncl() const; /** - * @brief Number of solver states subject to reinitialization - * @return model member nx_solver_reinit + * @brief Get number of solver states subject to reinitialization. + * @return Model member `nx_solver_reinit` */ int nx_reinit() const; /** - * @brief Fixed parameters - * @return pointer to constants array + * @brief Get fixed parameters. + * @return Pointer to constants array */ const double *k() const; /** - * @brief Get nmaxevent - * @return maximum number of events that may occur for each type + * @brief Get maximum number of events that may occur for each type. + * @return Maximum number of events that may occur for each type */ int nMaxEvent() const; /** - * @brief Set nmaxevent - * @param nmaxevent maximum number of events that may occur for each type + * @brief Set maximum number of events that may occur for each type. + * @param nmaxevent Maximum number of events that may occur for each type */ void setNMaxEvent(int nmaxevent); /** - * @brief Get number of timepoints - * @return number of timepoints + * @brief Get number of timepoints. + * @return Number of timepoints */ int nt() const; /** - * @brief Get ParameterScale for each parameter - * @return vector of parameter scale + * @brief Get parameter scale for each parameter. + * @return Vector of parameter scales */ std::vector const &getParameterScale() const; /** - * @brief Set ParameterScale for each parameter, resets initial state - * sensitivities - * @param pscale scalar parameter scale for all parameters + * @brief Set parameter scale for each parameter. + * + * NOTE: Resets initial state sensitivities. + * + * @param pscale Scalar parameter scale to be set for all parameters */ void setParameterScale(ParameterScaling pscale); /** - * @brief Set ParameterScale for each parameter, resets initial state - * sensitivities - * @param pscaleVec vector of parameter scales + * @brief Set parameter scale for each parameter. + * + * NOTE: Resets initial state sensitivities. + * + * @param pscaleVec Vector of parameter scales */ void setParameterScale(const std::vector &pscaleVec); /** - * @brief Gets parameters with transformation according to ParameterScale - * applied - * @return unscaled parameters + * @brief Get parameters with transformation according to parameter scale + * applied. + * @return Unscaled parameters */ std::vector const &getUnscaledParameters() const; /** - * @brief Get the parameter vector - * @return The user-set parameters (see also getUnscaledParameters) + * @brief Get parameter vector. + * @return The user-set parameters (see also `Model::getUnscaledParameters`) */ std::vector const &getParameters() const; /** - * @brief Get value of first model parameter with the specified id - * @param par_id parameter id - * @return parameter value + * @brief Get value of first model parameter with the specified ID. + * @param par_id Parameter ID + * @return Parameter value */ realtype getParameterById(std::string const &par_id) const; /** - * @brief Get value of first model parameter with the specified name, - * @param par_name parameter name - * @return parameter value + * @brief Get value of first model parameter with the specified name. + * @param par_name Parameter name + * @return Parameter value */ realtype getParameterByName(std::string const &par_name) const; /** - * @brief Sets the parameter vector - * @param p vector of parameters + * @brief Set the parameter vector. + * @param p Vector of parameters */ void setParameters(std::vector const &p); /** - * @brief Sets model parameters according to the parameter IDs and mapped + * @brief Set model parameters according to the parameter IDs and mapped * values. - * @param p map of parameters IDs and values + * @param p Map of parameters IDs and values * @param ignoreErrors Ignore errors such as parameter IDs in p which are * not model parameters */ @@ -355,32 +379,32 @@ class Model : public AbstractModel { bool ignoreErrors = false); /** - * @brief Set value of first model parameter with the specified id - * @param par_id parameter id - * @param value parameter value + * @brief Set value of first model parameter with the specified ID. + * @param par_id Parameter ID + * @param value Parameter value */ void setParameterById(std::string const &par_id, realtype value); /** - * @brief Set all values of model parameters with ids matching the specified - * regex - * @param par_id_regex parameter id regex - * @param value parameter value - * @return number of parameter ids that matched the regex + * @brief Set all values of model parameters with IDs matching the specified + * regular expression. + * @param par_id_regex Parameter ID regex + * @param value Parameter value + * @return Number of parameter IDs that matched the regex */ int setParametersByIdRegex(std::string const &par_id_regex, realtype value); /** - * @brief Set value of first model parameter with the specified name - * @param par_name parameter name - * @param value parameter value + * @brief Set value of first model parameter with the specified name. + * @param par_name Parameter name + * @param value Parameter value */ void setParameterByName(std::string const &par_name, realtype value); /** - * @brief Sets model parameters according to the parameter name and mapped + * @brief Set model parameters according to the parameter name and mapped * values. - * @param p map of parameters names and values + * @param p Map of parameters names and values * @param ignoreErrors Ignore errors such as parameter names in p which are * not model parameters */ @@ -389,248 +413,253 @@ class Model : public AbstractModel { /** * @brief Set all values of all model parameters with names matching the - * specified regex - * @param par_name_regex parameter name regex - * @param value parameter value - * @return number of fixed parameter names that matched the regex + * specified regex. + * @param par_name_regex Parameter name regex + * @param value Parameter value + * @return Number of fixed parameter names that matched the regex */ int setParametersByNameRegex(std::string const &par_name_regex, realtype value); /** - * @brief Gets the fixedParameter member - * @return vector of fixed parameters + * @brief Get values of fixed parameters. + * @return Vector of fixed parameters with same ordering as in + * Model::getFixedParameterIds */ std::vector const &getFixedParameters() const; /** - * @brief Get value of fixed parameter with the specified Id - * @param par_id parameter id - * @return parameter value + * @brief Get value of fixed parameter with the specified ID. + * @param par_id Parameter ID + * @return Parameter value */ realtype getFixedParameterById(std::string const &par_id) const; /** - * @brief Get value of fixed parameter with the specified name, if multiple - * parameters have the same name, the first parameter with matching name is - * returned - * @param par_name parameter name - * @return parameter value + * @brief Get value of fixed parameter with the specified name. + * + * If multiple parameters have the same name, the first parameter with + * matching name is returned. + * + * @param par_name Parameter name + * @return Parameter value */ realtype getFixedParameterByName(std::string const &par_name) const; /** - * @brief Sets the fixedParameter member - * @param k vector of fixed parameters + * @brief Set values for constants. + * @param k Vector of fixed parameters */ void setFixedParameters(std::vector const &k); /** - * @brief Set value of first fixed parameter with the specified id - * @param par_id fixed parameter id - * @param value fixed parameter value + * @brief Set value of first fixed parameter with the specified ID. + * @param par_id Fixed parameter id + * @param value Fixed parameter value */ void setFixedParameterById(std::string const &par_id, realtype value); /** - * @brief Set values of all fixed parameters with the id matching the - * specified regex - * @param par_id_regex fixed parameter name regex - * @param value fixed parameter value - * @return number of fixed parameter ids that matched the regex + * @brief Set values of all fixed parameters with the ID matching the + * specified regex. + * @param par_id_regex Fixed parameter name regex + * @param value Fixed parameter value + * @return Number of fixed parameter IDs that matched the regex */ int setFixedParametersByIdRegex(std::string const &par_id_regex, realtype value); /** - * @brief Set value of first fixed parameter with the specified name, - * @param par_name fixed parameter id - * @param value fixed parameter value + * @brief Set value of first fixed parameter with the specified name. + * @param par_name Fixed parameter ID + * @param value Fixed parameter value */ void setFixedParameterByName(std::string const &par_name, realtype value); /** * @brief Set value of all fixed parameters with name matching the specified - * regex, - * @param par_name_regex fixed parameter name regex - * @param value fixed parameter value - * @return number of fixed parameter names that matched the regex + * regex. + * @param par_name_regex Fixed parameter name regex + * @param value Fixed parameter value + * @return Number of fixed parameter names that matched the regex */ int setFixedParametersByNameRegex(std::string const &par_name_regex, realtype value); /** - * @brief Returns the model name - * @return model name + * @brief Get the model name. + * @return Model name */ virtual std::string getName() const; /** - * @brief Reports whether the model has parameter names set. Also returns - * true if the number of corresponding variables is just zero. - * @return boolean indicating whether parameter names were set + * @brief Report whether the model has parameter names set. + * + * @return Boolean indicating whether parameter names were set. Also returns + * `true` if the number of corresponding variables is just zero. */ virtual bool hasParameterNames() const; /** - * @brief Get names of the model parameters - * @return the names + * @brief Get names of the model parameters. + * @return The parameter names */ virtual std::vector getParameterNames() const; /** - * @brief Reports whether the model has state names set. Also returns true - * if the number of corresponding variables is just zero. - * @return boolean indicating whether state names were set + * @brief Report whether the model has state names set. + * + * @return Boolean indicating whether state names were set. Also returns + * `true` if the number of corresponding variables is just zero. */ virtual bool hasStateNames() const; /** - * @brief Get names of the model states - * @return the names + * @brief Get names of the model states. + * @return State names */ virtual std::vector getStateNames() const; /** - * @brief Reports whether the model has fixed parameter names set. Also - * returns true if the number of corresponding variables is just zero. - * @return boolean indicating whether fixed parameter names were set + * @brief Report whether the model has fixed parameter names set. + * @return Boolean indicating whether fixed parameter names were set. Also + * returns `true` if the number of corresponding variables is just zero. */ virtual bool hasFixedParameterNames() const; /** - * @brief Get names of the fixed model parameters - * @return the names + * @brief Get names of the fixed model parameters. + * @return Fixed parameter names */ virtual std::vector getFixedParameterNames() const; /** - * @brief Reports whether the model has observable names set. Also returns - * true if the number of corresponding variables is just zero. - * @return boolean indicating whether observabke names were set + * @brief Report whether the model has observable names set. + * @return Boolean indicating whether observable names were set. Also + * returns `true` if the number of corresponding variables is just zero. */ virtual bool hasObservableNames() const; /** - * @brief Get names of the observables - * @return the names + * @brief Get names of the observables. + * @return Observable names */ virtual std::vector getObservableNames() const; /** - * @brief Reports whether the model has parameter ids set. Also returns true - * if the number of corresponding variables is just zero. - * @return boolean indicating whether parameter ids were set + * @brief Report whether the model has parameter IDs set. + * @return Boolean indicating whether parameter IDs were set. Also returns + * `true` if the number of corresponding variables is just zero. */ virtual bool hasParameterIds() const; /** - * @brief Get ids of the model parameters - * @return the ids + * @brief Get IDs of the model parameters. + * @return Parameter IDs */ virtual std::vector getParameterIds() const; /** - * @brief Reports whether the model has state ids set. Also returns true if - * the number of corresponding variables is just zero. - * @return boolean indicating whether state ids were set + * @brief Report whether the model has state IDs set. + * @return Boolean indicating whether state IDs were set. Also returns + * `true` if the number of corresponding variables is just zero. */ virtual bool hasStateIds() const; /** - * @brief Get ids of the model states - * @return the ids + * @brief Get IDs of the model states. + * @return Sate IDs */ virtual std::vector getStateIds() const; /** - * @brief Reports whether the model has fixed parameter ids set. Also - * returns true if the number of corresponding variables is just zero. - * @return boolean indicating whether fixed parameter ids were set + * @brief Report whether the model has fixed parameter IDs set. + * @return Boolean indicating whether fixed parameter IDs were set. Also + * returns `true` if the number of corresponding variables is just zero. */ virtual bool hasFixedParameterIds() const; /** - * @brief Get ids of the fixed model parameters - * @return the ids + * @brief Get IDs of the fixed model parameters. + * @return Fixed parameter IDs */ virtual std::vector getFixedParameterIds() const; /** - * @brief Reports whether the model has observable ids set. Also returns - * true if the number of corresponding variables is just zero. - * @return boolean indicating whether observale ids were set + * @brief Report whether the model has observable IDs set. + * @return Boolean indicating whether observable ids were set. Also returns + * `true` if the number of corresponding variables is just zero. */ virtual bool hasObservableIds() const; /** - * @brief Get ids of the observables - * @return the ids + * @brief Get IDs of the observables. + * @return Observable IDs */ virtual std::vector getObservableIds() const; /** - * @brief Get the timepoint vector - * @return timepoint vector + * @brief Get the timepoint vector. + * @return Timepoint vector */ std::vector const &getTimepoints() const; /** - * @brief get simulation timepoint for time index it - * @param it time index - * @return t timepoint + * @brief Get simulation timepoint for time index `it`. + * @param it Time index + * @return Timepoint */ realtype getTimepoint(int it) const; /** - * @brief Set the timepoint vector - * @param ts timepoint vector + * @brief Set the timepoint vector. + * @param ts New timepoint vector */ void setTimepoints(std::vector const &ts); /** - * @brief get simulation start time - * @return simulation start time + * @brief Get simulation start time. + * @return Simulation start time */ double t0() const; /** - * @brief set simulation start time - * @param t0 simulation start time + * @brief Set simulation start time. + * @param t0 Simulation start time */ void setT0(double t0); /** - * @brief gets flags indicating whether states should be treated as - * non-negative - * @return vector of flags + * @brief Get flags indicating whether states should be treated as + * non-negative. + * @return Vector of flags */ std::vector const &getStateIsNonNegative() const; /** - * @brief sets flags indicating whether states should be treated as - * non-negative - * @param stateIsNonNegative vector of flags + * @brief Set flags indicating whether states should be treated as + * non-negative. + * @param stateIsNonNegative Vector of flags */ void setStateIsNonNegative(std::vector const &stateIsNonNegative); /** - * @brief sets flags indicating that all states should be treated as - * non-negative + * @brief Set flags indicating that all states should be treated as + * non-negative. */ void setAllStatesNonNegative(); /** - * @brief retrieves the current model state - * @return current model state + * @brief Get the current model state. + * @return Current model state */ ModelState const &getModelState() const { - return state; + return state_; }; /** - * @brief sets the current model state - * @param state model state + * @brief Set the current model state. + * @param state Model state */ void setModelState(ModelState const &state) { if (static_cast(state.unscaledParameters.size()) != np()) @@ -638,180 +667,191 @@ class Model : public AbstractModel { if (static_cast(state.fixedParameters.size()) != nk()) throw AmiException("Mismatch in fixed parameter size"); if (static_cast(state.h.size()) != ne) - throw AmiException("Mismatch in heaviside size"); + throw AmiException("Mismatch in Heaviside size"); if (static_cast(state.total_cl.size()) != ncl()) throw AmiException("Mismatch in conservation law size"); if (static_cast(state.stotal_cl.size()) != ncl() * np() ) throw AmiException("Mismatch in conservation law sensitivity size"); - this->state = state; + state_ = state; }; /** - * @brief Get the list of parameters for which sensitivities are computed - * @return list of parameter indices + * @brief Get the list of parameters for which sensitivities are computed. + * @return List of parameter indices */ std::vector const &getParameterList() const; /** - * @brief entry in parameter list - * @param pos index - * @return entry + * @brief Get entry in parameter list by index. + * @param pos Index in sensitivity parameter list + * @return Index in parameter list */ int plist(int pos) const; /** - * @brief Set the list of parameters for which sensitivities are computed, - * resets initial state sensitivities - * @param plist list of parameter indices + * @brief Set the list of parameters for which sensitivities are to be + * computed. + * + * NOTE: Resets initial state sensitivities. + * + * @param plist List of parameter indices */ void setParameterList(std::vector const &plist); /** - * @brief Get the initial states - * @return initial state vector + * @brief Get the initial states. + * @return Initial state vector */ std::vector getInitialStates(); /** - * @brief Set the initial states - * @param x0 initial state vector + * @brief Set the initial states. + * @param x0 Initial state vector */ void setInitialStates(std::vector const &x0); /** - * @brief Returns whether custom initial states have been set - * @return True if has custom initial states, otherwise false + * @brief Return whether custom initial states have been set. + * @return `true` if has custom initial states, otherwise `false` */ bool hasCustomInitialStates() const; /** - * @brief Get the initial states sensitivities + * @brief Get the initial states sensitivities. * @return vector of initial state sensitivities */ std::vector getInitialStateSensitivities(); /** - * @brief Set the initial state sensitivities + * @brief Set the initial state sensitivities. * @param sx0 vector of initial state sensitivities with chainrule applied. * This could be a slice of ReturnData::sx or ReturnData::sx0 */ void setInitialStateSensitivities(std::vector const &sx0); /** - * @brief Returns whether custom initial state sensitivitiess have been set - * @return True if has custom initial state sensitivitiess, otherwise false + * @brief Return whether custom initial state sensitivities have been set. + * @return `true` if has custom initial state sensitivities, otherwise + * `false`. */ bool hasCustomInitialStateSensitivities() const; /** - * @brief Set the initial state sensitivities - * @param sx0 vector of initial state sensitivities without chainrule - * applied. This could be the readin from a model.sx0data saved to hdf5. + * @brief Set the initial state sensitivities. + * @param sx0 Vector of initial state sensitivities without chainrule + * applied. This could be the readin from a `model.sx0data` saved to HDF5. */ void setUnscaledInitialStateSensitivities(std::vector const &sx0); /** - * @brief Sets the mode how sensitivities are computed in the steadystate - * simulation - * @param mode steadyStateSensitivityMode + * @brief Set the mode how sensitivities are computed in the steadystate + * simulation. + * @param mode Steadystate sensitivity mode */ void setSteadyStateSensitivityMode(SteadyStateSensitivityMode mode); /** * @brief Gets the mode how sensitivities are computed in the steadystate - * simulation - * @return flag value + * simulation. + * @return Mode */ SteadyStateSensitivityMode getSteadyStateSensitivityMode() const; /** - * @brief Set whether initial states depending on fixedParmeters are to be - * reinitialized after preequilibration and presimulation - * @param flag true/false + * @brief Set whether initial states depending on fixed parameters are to be + * reinitialized after preequilibration and presimulation. + * @param flag Fixed parameters reinitialized? */ void setReinitializeFixedParameterInitialStates(bool flag); /** - * @brief Get whether initial states depending on fixedParmeters are to be - * reinitialized after preequilibration and presimulation - * @return flag true/false + * @brief Get whether initial states depending on fixedParameters are to be + * reinitialized after preequilibration and presimulation. + * @return flag `true` / `false` */ bool getReinitializeFixedParameterInitialStates() const; /** * @brief Require computation of sensitivities for all parameters p [0..np[ - * in natural order, resets initial state sensitivities + * in natural order. + * + * NOTE: Resets initial state sensitivities. */ void requireSensitivitiesForAllParameters(); /** - * @brief Time-resolved w, - * @param w buffer (dimension: nw) - * @param t current timepoint - * @param x current state + * @brief Get time-resolved `w`. + * @param w Buffer (dimension: `nw`) + * @param t Current timepoint + * @param x Current state */ void getExpression(gsl::span w, const realtype t, const AmiVector &x); /** - * @brief Time-resolved observables, - * @param y buffer (dimension: ny) - * @param t current timepoint - * @param x current state + * @brief Get time-resolved observables. + * @param y Buffer (dimension: `ny`) + * @param t Current timepoint + * @param x Current state */ void getObservable(gsl::span y, const realtype t, const AmiVector &x); /** - * @brief Sensitivity of time-resolved observables, total derivative sy = - * dydx * sx + dydp (only for forward sensitivities) - * @param sy buffer (dimension: ny x nplist, row-major) - * @param t timpoint - * @param x state variables - * @param sx state sensitivities + * @brief Get sensitivity of time-resolved observables. + * + * Total derivative \f$sy = dydx * sx + dydp\f$ + * (only for forward sensitivities). + * @param sy buffer (dimension: `ny` x `nplist`, row-major) + * @param t Timpoint + * @param x State variables + * @param sx State sensitivities */ void getObservableSensitivity(gsl::span sy, const realtype t, const AmiVector &x, const AmiVectorArray &sx); /** - * @brief Time-resolved observable standard deviations - * @param sigmay buffer (dimension: ny) - * @param it timepoint index - * @param edata pointer to experimental data instance (optional, pass - * nullptr to ignore) + * @brief Get time-resolved observable standard deviations + * @param sigmay Buffer (dimension: `ny`) + * @param it Timepoint index + * @param edata Pointer to experimental data instance (optional, pass + * `nullptr` to ignore) */ void getObservableSigma(gsl::span sigmay, const int it, const ExpData *edata); /** - * @brief Sensitivity of time-resolved observable standard deviation, total - * derivative (can be used with both adjoint and forward sensitivity) - * @param ssigmay buffer (dimension: ny x nplist, row-major) - * @param it timepoint index - * @param edata pointer to experimental data instance (optional, pass - * nullptr to ignore) + * @brief Sensitivity of time-resolved observable standard deviation. + * + * Total derivative (can be used with both adjoint and forward sensitivity). + * + * @param ssigmay Buffer (dimension: `ny` x `nplist`, row-major) + * @param it Timepoint index + * @param edata Pointer to experimental data instance (optional, pass + * `nullptr` to ignore) */ void getObservableSigmaSensitivity(gsl::span ssigmay, const int it, const ExpData *edata); /** - * @brief Time-resolved measurement negative log-likelihood Jy - * @param Jy buffer (dimension: 1) - * @param it timepoint index - * @param x state variables - * @param edata experimental data instance + * @brief Add time-resolved measurement negative log-likelihood \f$Jy\f$. + * @param Jy Buffer (dimension: 1) + * @param it Timepoint index + * @param x State variables + * @param edata Experimental data */ void addObservableObjective(realtype &Jy, const int it, const AmiVector &x, const ExpData &edata); /** - * @brief Sensitivity of time-resolved measurement negative log-likelihood - * Jy, total derivative (to be used with forward senstivities) - * @param sllh first order buffer (dimension: nplist) - * @param s2llh second order buffer (dimension: nJ-1 x nplist, row-major) - * @param it timepoint index - * @param x state variables - * @param sx state sensitivities - * @param edata experimental data instance + * @brief Add sensitivity of time-resolved measurement negative log-likelihood + * \f$Jy\f$. + * + * @param sllh First-order buffer (dimension: `nplist`) + * @param s2llh Second-order buffer (dimension: `nJ - 1` x `nplist`, row-major) + * @param it Timepoint index + * @param x State variables + * @param sx State sensitivities + * @param edata Experimental data */ void addObservableObjectiveSensitivity(std::vector &sllh, std::vector &s2llh, @@ -820,13 +860,17 @@ class Model : public AbstractModel { const ExpData &edata); /** - * @brief Sensitivity of time-resolved measurement negative log-likelihood - * Jy, partial derivative (to be used with adjoint senstivities) - * @param sllh first order buffer (dimension: nplist) - * @param s2llh second order buffer (dimension: nJ-1 x nplist, row-major) - * @param it timepoint index - * @param x state variables - * @param edata experimental data instance + * @brief Add sensitivity of time-resolved measurement negative + * log-likelihood \f$Jy\f$. + * + * Partial derivative (to be used with adjoint sensitivities). + * + * @param sllh First order output buffer (dimension: `nplist`) + * @param s2llh Second order output buffer + * (dimension: `nJ - 1` x `nplist`, row-major) + * @param it Timepoint index + * @param x State variables + * @param edata Experimental data */ void addPartialObservableObjectiveSensitivity(std::vector &sllh, std::vector &s2llh, @@ -835,118 +879,129 @@ class Model : public AbstractModel { const ExpData &edata); /** - * @brief State sensitivity of the negative loglikelihood Jy, partial - * derivative (to be used with adjoint senstivities) - * @param dJydx buffer (dimension: nJ x nx_solver, row-major) - * @param it timepoint index - * @param x state variables - * @param edata experimental data instance + * @brief Get state sensitivity of the negative loglikelihood \f$Jy\f$, + * partial derivative (to be used with adjoint sensitivities). + * + * @param dJydx Output buffer (dimension: `nJ` x `nx_solver`, row-major) + * @param it Timepoint index + * @param x State variables + * @param edata Experimental data instance */ void getAdjointStateObservableUpdate(gsl::span dJydx, const int it, const AmiVector &x, const ExpData &edata); /** - * @brief Event-resolved observables - * @param z buffer (dimension: nz) - * @param ie event index - * @param t timepoint - * @param x state variables + * @brief Get event-resolved observables. + * @param z Output buffer (dimension: `nz`) + * @param ie Event index + * @param t Timepoint + * @param x State variables */ void getEvent(gsl::span z, const int ie, const realtype t, const AmiVector &x); /** - * @brief Sensitivities of event-resolved observables, total derivative, - * total derivative (only forward sensitivities) - * @param sz buffer (dimension: nz x nplist, row-major) - * @param ie event index - * @param t timepoint - * @param x state variables - * @param sx state sensitivities + * @brief Get sensitivities of event-resolved observables. + * + * Total derivative (only forward sensitivities). + * + * @param sz Output buffer (dimension: `nz x nplist`, row-major) + * @param ie Event index + * @param t Timepoint + * @param x State variables + * @param sx State sensitivities */ void getEventSensitivity(gsl::span sz, const int ie, const realtype t, const AmiVector &x, const AmiVectorArray &sx); /** - * @brief Sensitivity of z at final timepoint (ignores sensitivity of - * timepoint), total derivative - * @param sz output buffer (dimension: nz x nplist, row-major) - * @param ie event index + * @brief Get sensitivity of `z` at final timepoint. + * + * Ignores sensitivity of timepoint. Total derivative. + * + * @param sz Output buffer (dimension: `nz x nplist`, row-major) + * @param ie Event index */ void getUnobservedEventSensitivity(gsl::span sz, const int ie); /** - * @brief Regularization for event-resolved observables - * @param rz buffer (dimension: nz) - * @param ie event index - * @param t timepoint - * @param x state variables + * @brief Get regularization for event-resolved observables. + * @param rz Output buffer (dimension: `nz`) + * @param ie Event index + * @param t Timepoint + * @param x State variables */ void getEventRegularization(gsl::span rz, const int ie, const realtype t, const AmiVector &x); /** - * @brief Sensitivities of regularization for event-resolved observables, - * total derivative (only forward sensitivities) - * @param srz buffer (dimension: nz x nplist, row-major) - * @param ie event index - * @param t timepoint - * @param x state variables - * @param sx state sensitivities + * @brief Get sensitivities of regularization for event-resolved + * observables. + * + * Total derivative. Only forward sensitivities. + * + * @param srz Output buffer (dimension: `nz x nplist`, row-major) + * @param ie Event index + * @param t Timepoint + * @param x State variables + * @param sx State sensitivities */ void getEventRegularizationSensitivity(gsl::span srz, const int ie, const realtype t, const AmiVector &x, const AmiVectorArray &sx); /** - * @brief Event-resolved observable standard deviations - * @param sigmaz buffer (dimension: nz) - * @param ie event index - * @param nroots event occurence - * @param t timepoint - * @param edata pointer to experimental data instance (optional, pass - * nullptr to ignore) + * @brief Get event-resolved observable standard deviations. + * @param sigmaz Output buffer (dimension: `nz`) + * @param ie Event index + * @param nroots Event occurrence + * @param t Timepoint + * @param edata Pointer to experimental data (optional, pass + * `nullptr` to ignore) */ void getEventSigma(gsl::span sigmaz, const int ie, const int nroots, const realtype t, const ExpData *edata); /** - * @brief Sensitivities of event-resolved observable standard deviations, - * total derivative (only forward sensitivities) - * @param ssigmaz buffer (dimension: nz x nplist, row-major) - * @param ie event index - * @param nroots event occurence - * @param t timepoint - * @param edata pointer to experimental data instance (optional, pass - * nullptr to ignore) + * @brief Get sensitivities of event-resolved observable standard + * deviations. + * + * Total derivative (only forward sensitivities). + * + * @param ssigmaz Output buffer (dimension: `nz x nplist`, row-major) + * @param ie Event index + * @param nroots Event occurrence + * @param t Timepoint + * @param edata Pointer to experimental data (optional, pass + * `nullptr` to ignore) */ void getEventSigmaSensitivity(gsl::span ssigmaz, const int ie, const int nroots, const realtype t, const ExpData *edata); /** - * @brief Event-resolved observable negative log-likelihood, - * @param Jz buffer (dimension: 1) - * @param ie event index - * @param nroots event occurence - * @param t timepoint - * @param x state variables - * @param edata experimental data instance + * @brief Add event-resolved observable negative log-likelihood. + * @param Jz Output buffer (dimension: 1) + * @param ie Event index + * @param nroots Event occurrence + * @param t Timepoint + * @param x State variables + * @param edata Experimental data */ void addEventObjective(realtype &Jz, const int ie, const int nroots, const realtype t, const AmiVector &x, const ExpData &edata); /** - * @brief Event-resolved observable negative log-likelihood, - * @param Jrz buffer (dimension: 1) - * @param ie event index - * @param nroots event occurence - * @param t timepoint - * @param x state variables - * @param edata experimental data instance + * @brief Add event-resolved observable negative log-likelihood. + * @param Jrz Output buffer (dimension: 1) + * @param ie Event index + * @param nroots Event occurrence + * @param t Timepoint + * @param x State variables + * @param edata Experimental data */ void addEventObjectiveRegularization(realtype &Jrz, const int ie, const int nroots, const realtype t, @@ -954,16 +1009,20 @@ class Model : public AbstractModel { const ExpData &edata); /** - * @brief Sensitivity of time-resolved measurement negative log-likelihood - * Jy, total derivative (to be used with forward senstivities) - * @param sllh first order buffer (dimension: nplist) - * @param s2llh second order buffer (dimension: nJ-1 x nplist, row-major) - * @param ie event index - * @param nroots event occurence - * @param t timepoint - * @param x state variables - * @param sx state sensitivities - * @param edata experimental data instance + * @brief Add sensitivity of time-resolved measurement negative + * log-likelihood \f$Jy\f$. + * + * Total derivative (to be used with forward sensitivities). + * + * @param sllh First order buffer (dimension: `nplist`) + * @param s2llh Second order buffer + * (dimension: `(nJ-1) x nplist`, row-major) + * @param ie Event index + * @param nroots Event occurrence + * @param t Timepoint + * @param x State variables + * @param sx State sensitivities + * @param edata Experimental data */ void addEventObjectiveSensitivity(std::vector &sllh, std::vector &s2llh, @@ -973,15 +1032,19 @@ class Model : public AbstractModel { const ExpData &edata); /** - * @brief Sensitivity of time-resolved measurement negative log-likelihood - * Jy, partial derivative (to be used with adjoint senstivities) - * @param sllh first order buffer (dimension: nplist) - * @param s2llh second order buffer (dimension: nJ-1 x nplist, row-major) - * @param ie event index - * @param nroots event occurence - * @param t timepoint - * @param x state variables - * @param edata experimental data instance + * @brief Add sensitivity of time-resolved measurement negative + * log-likelihood \f$Jy\f$. + * + * Partial derivative (to be used with adjoint sensitivities). + * + * @param sllh First order buffer (dimension: `nplist`) + * @param s2llh Second order buffer + * (dimension: `(nJ-1) x nplist`, row-major) + * @param ie Event index + * @param nroots Event occurrence + * @param t Timepoint + * @param x State variables + * @param edata Experimental data */ void addPartialEventObjectiveSensitivity(std::vector &sllh, std::vector &s2llh, @@ -991,53 +1054,57 @@ class Model : public AbstractModel { const ExpData &edata); /** - * @brief State sensitivity of the negative loglikelihood Jz, partial - * derivative (to be used with adjoint senstivities) - * @param dJzdx buffer (dimension: nJ x nx_solver, row-major) - * @param ie event index - * @param nroots event occurence - * @param t timepoint - * @param x state variables - * @param edata experimental data instance + * @brief State sensitivity of the negative loglikelihood \f$Jz\f$. + * + * Partial derivative (to be used with adjoint sensitivities). + * + * @param dJzdx Output buffer (dimension: `nJ x nx_solver`, row-major) + * @param ie Event index + * @param nroots Event occurrence + * @param t Timepoint + * @param x State variables + * @param edata Experimental data */ void getAdjointStateEventUpdate(gsl::span dJzdx, const int ie, const int nroots, const realtype t, const AmiVector &x, const ExpData &edata); /** - * @brief Sensitivity of event timepoint, total derivative (only forward - * sensi) - * @param stau current timepoint (dimension: nplist) - * @param t timepoint - * @param ie event index - * @param x state variables - * @param sx state sensitivities + * @brief Sensitivity of event timepoint, total derivative. + * + * Only forward sensitivities. + * + * @param stau Timepoint sensitivity (dimension: `nplist`) + * @param t Timepoint + * @param ie Event index + * @param x State variables + * @param sx State sensitivities */ void getEventTimeSensitivity(std::vector &stau, const realtype t, const int ie, const AmiVector &x, const AmiVectorArray &sx); /** - * @brief Update state variables after event - * @param x current state (will be overwritten) - * @param ie event index - * @param t current timepoint - * @param xdot current residual function values - * @param xdot_old value of residual function before event + * @brief Update state variables after event. + * @param x Current state (will be overwritten) + * @param ie Event index + * @param t Current timepoint + * @param xdot Current residual function values + * @param xdot_old Value of residual function before event */ void addStateEventUpdate(AmiVector &x, const int ie, const realtype t, const AmiVector &xdot, const AmiVector &xdot_old); /** - * @brief Update state sensitivity after event - * @param sx current state sensitivity (will be overwritten) - * @param ie event index - * @param t current timepoint - * @param x_old current state - * @param xdot current residual function values - * @param xdot_old value of residual function before event - * @param stau timepoint sensitivity, to be computed with - * Model::getEventTimeSensitivity + * @brief Update state sensitivity after event. + * @param sx Current state sensitivity (will be overwritten) + * @param ie Event index + * @param t Current timepoint + * @param x_old Current state + * @param xdot Current residual function values + * @param xdot_old Value of residual function before event + * @param stau Timepoint sensitivity, to be computed with + * `Model::getEventTimeSensitivity` */ void addStateSensitivityEventUpdate(AmiVectorArray &sx, const int ie, const realtype t, @@ -1047,13 +1114,13 @@ class Model : public AbstractModel { const std::vector &stau); /** - * @brief Update adjoint state after event - * @param xB current adjoint state (will be overwritten) - * @param ie event index - * @param t current timepoint - * @param x current state - * @param xdot current residual function values - * @param xdot_old value of residual function before event + * @brief Update adjoint state after event. + * @param xB Current adjoint state (will be overwritten) + * @param ie Event index + * @param t Current timepoint + * @param x Current state + * @param xdot Current residual function values + * @param xdot_old Value of residual function before event */ void addAdjointStateEventUpdate(AmiVector &xB, const int ie, const realtype t, const AmiVector &x, @@ -1061,14 +1128,14 @@ class Model : public AbstractModel { const AmiVector &xdot_old); /** - * @brief Update adjoint quadratures after event - * @param xQB current quadrature state (will be overwritten) - * @param ie event index - * @param t current timepoint - * @param x current state - * @param xB current adjoint state - * @param xdot current residual function values - * @param xdot_old value of residual function before event + * @brief Update adjoint quadratures after event. + * @param xQB Current quadrature state (will be overwritten) + * @param ie Event index + * @param t Current timepoint + * @param x Current state + * @param xB Current adjoint state + * @param xdot Current residual function values + * @param xdot_old Value of residual function before event */ void addAdjointQuadratureEventUpdate(AmiVector xQB, const int ie, const realtype t, const AmiVector &x, @@ -1077,211 +1144,194 @@ class Model : public AbstractModel { const AmiVector &xdot_old); /** - * @brief Update the heaviside variables h on event occurences + * @brief Update the Heaviside variables `h` on event occurrences. * - * @param rootsfound provides the direction of the zero-crossing, so adding - * it will give the right update to the heaviside variables (zero if no root + * @param rootsfound Provides the direction of the zero-crossing, so adding + * it will give the right update to the Heaviside variables (zero if no root * was found) */ void updateHeaviside(const std::vector &rootsfound); /** - * @brief Updates the heaviside variables h on event occurences in the - * backward problem - * @param rootsfound provides the direction of the zero-crossing, so adding - * it will give the right update to the heaviside variables (zero if no root + * @brief Updates the Heaviside variables `h` on event occurrences in the + * backward problem. + * @param rootsfound Provides the direction of the zero-crossing, so adding + * it will give the right update to the Heaviside variables (zero if no root * was found) */ void updateHeavisideB(const int *rootsfound); /** - * @brief Check if the given array has only finite elements. If not try to - * give hints by which other fields this could be caused. + * @brief Check if the given array has only finite elements. * - * @param array arrays of values - * @param fun name of the fucntion that generated the values - * @return AMICI_RECOVERABLE_ERROR if a NaN/Inf value was found, - * AMICI_SUCCESS otherwise + * If not, try to give hints by which other fields this could be caused. + * + * @param array Array to check + * @param fun Name of the function that generated the values (for more + * informative messages). + * @return `amici::AMICI_RECOVERABLE_ERROR` if a NaN/Inf value was found, + * `amici::AMICI_SUCCESS` otherwise */ int checkFinite(gsl::span array, const char *fun) const; /** - * @brief Set if the result of every call to Model::f* should be checked for - * finiteness + * @brief Set whether the result of every call to `Model::f*` should be + * checked for finiteness. * @param alwaysCheck */ void setAlwaysCheckFinite(bool alwaysCheck); /** - * @brief Get setting of whether the result of every call to Model::f* - * should be checked for finiteness + * @brief Get setting of whether the result of every call to `Model::f*` + * should be checked for finiteness. * @return that */ bool getAlwaysCheckFinite() const; /** - * @brief Initial states - * @param x pointer to state variables + * @brief Compute/get initial states. + * @param x Output buffer. */ void fx0(AmiVector &x); /** - * @brief Sets only those initial states that are specified via - * fixedParmeters - * @param x pointer to state variables + * @brief Set only those initial states that are specified via + * fixed parameters. + * @param x Output buffer. */ void fx0_fixedParameters(AmiVector &x); /** - * @brief Initial value for initial state sensitivities - * @param sx pointer to state sensitivity variables - * @param x pointer to state variables + * @brief Compute/get initial value for initial state sensitivities. + * @param sx Output buffer for state sensitivities + * @param x State variables */ void fsx0(AmiVectorArray &sx, const AmiVector &x); /** - * @brief Sets only those initial states sensitivities that are affected - * from fx0 fixedParmeters - * @param sx pointer to state sensitivity variables - * @param x pointer to state variables + * @brief Get only those initial states sensitivities that are affected + * from `amici::Model::fx0_fixedParameters`. + * @param sx Output buffer for state sensitivities + * @param x State variables */ void fsx0_fixedParameters(AmiVectorArray &sx, const AmiVector &x); /** - * @brief Sensitivity of derivative initial states sensitivities sdx0 (only - * necessary for DAEs) + * @brief Compute sensitivity of derivative initial states sensitivities + * `sdx0`. + * + * Only necessary for DAEs. */ virtual void fsdx0(); /** - * @brief Expands conservation law for states - * @param x_rdata pointer to state variables with conservation laws expanded - * (stored in rdata) - * @param x_solver pointer to state variables with conservation laws applied + * @brief Expand conservation law for states. + * @param x_rdata Output buffer for state variables with conservation laws + * expanded (stored in `amici::ReturnData`). + * @param x_solver State variables with conservation laws applied * (solver returns this) */ void fx_rdata(AmiVector &x_rdata, const AmiVector &x_solver); /** - * @brief Expands conservation law for state sensitivities - * @param sx_rdata pointer to state variable sensitivities with conservation - * laws expanded (stored in rdata) - * @param sx_solver pointer to state variable sensitivities with - * conservation laws applied (solver returns this) + * @brief Expand conservation law for state sensitivities. + * @param sx_rdata Output buffer for state variables sensitivities with + * conservation laws expanded (stored in `amici::ReturnData`). + * @param sx_solver State variables sensitivities with conservation laws + * applied (solver returns this) */ void fsx_rdata(AmiVectorArray &sx_rdata, const AmiVectorArray &sx_solver); - /** number of states */ + /** Number of states */ int nx_rdata{0}; - /** number of states in the unaugmented system */ + /** Number of states in the unaugmented system */ int nxtrue_rdata{0}; - /** number of states with conservation laws applied */ + /** Number of states with conservation laws applied */ int nx_solver{0}; /** - * number of states in the unaugmented system with conservation laws + * Number of states in the unaugmented system with conservation laws * applied */ int nxtrue_solver{0}; - /** number of solver states subject to reinitialization */ + /** Number of solver states subject to reinitialization */ int nx_solver_reinit{0}; - /** number of observables */ + /** Number of observables */ int ny{0}; - /** number of observables in the unaugmented system */ + /** Number of observables in the unaugmented system */ int nytrue{0}; - /** number of event outputs */ + /** Number of event outputs */ int nz{0}; - /** number of event outputs in the unaugmented system */ + /** Number of event outputs in the unaugmented system */ int nztrue{0}; - /** number of events */ + /** Number of events */ int ne{0}; - /** number of common expressions */ + /** Number of common expressions */ int nw{0}; - /** number of derivatives of common expressions wrt x */ - int ndwdx{0}; - - /** number of derivatives of common expressions wrt p */ - int ndwdp{0}; - - /** number of nonzero entries in dxdotdw */ - int ndxdotdw{0}; - /** number of nonzero entries in dJydy */ - std::vector ndJydy; - - /** number of nonzero entries in jacobian */ + /** Number of nonzero entries in Jacobian */ int nnz{0}; - /** dimension of the augmented objective function for 2nd order ASA */ + /** Dimension of the augmented objective function for 2nd order ASA */ int nJ{0}; - /** upper bandwith of the jacobian */ + /** Upper bandwidth of the Jacobian */ int ubw{0}; - /** lower bandwith of the jacobian */ + /** Lower bandwidth of the Jacobian */ int lbw{0}; - /** flag indicating Matlab or python based model generation */ + /** Flag indicating Matlab- or Python-based model generation */ bool pythonGenerated; - - /** number of nonzero entries in ndxdotdp_explicit */ - int ndxdotdp_explicit{0}; - - /** number of nonzero entries in ndxdotdp_implicit */ - int ndxdotdp_implicit{0}; - + /** - * flag indicating whether for sensi == AMICI_SENSI_ORDER_SECOND - * directional or full second order derivative will be computed + * @brief getter for dxdotdp (matlab generated) + * @return dxdotdp */ - SecondOrderMode o2mode{SecondOrderMode::none}; - - /** flag array for DAE equations */ - std::vector idlist; - + const AmiVectorArray &get_dxdotdp() const; + /** - * temporary storage of dxdotdp data across functions, Python only - * (dimension: nplist x nx_solver, nnz: ndxdotdp_explicit, type CSC_MAT) + * @brief getter for dxdotdp (python generated) + * @return dxdotdp */ - mutable SUNMatrixWrapper dxdotdp_explicit; + const SUNMatrixWrapper &get_dxdotdp_full() const; /** - * temporary storage of dxdotdp_implicit data across functions, Python only - * (dimension: nplist x * nx_solver, nnz: ndxdotdp_implicit, type CSC_MAT) + * Flag indicating whether for + * `amici::Solver::sensi_` == `amici::SensitivityOrder::second` + * directional or full second order derivative will be computed */ - mutable SUNMatrixWrapper dxdotdp_implicit; + SecondOrderMode o2mode{SecondOrderMode::none}; - /** - * temporary storage of dxdotdp data across functions, Matlab only - * (dimension: nplist x nx_solver, row-major) - */ - AmiVectorArray dxdotdp {0, 0}; - /** AMICI context */ + /** Flag array for DAE equations */ + std::vector idlist; + + /** AMICI application context */ AmiciApplication *app = &defaultContext; protected: /** - * @brief Writes part of a slice to a buffer according to indices specified - * in z2event - * @param slice source data slice - * @param buffer output data slice - * @param ie event index + * @brief Write part of a slice to a buffer according to indices specified + * in z2event. + * @param slice Input data slice + * @param buffer Output data slice + * @param ie Event index */ void writeSliceEvent(gsl::span slice, gsl::span buffer, const int ie); /** - * @brief Writes part of a sensitivity slice to a buffer according to - * indices specified in z2event + * @brief Write part of a sensitivity slice to a buffer according to + * indices specified in z2event. * @param slice source data slice * @param buffer output data slice * @param ie event index @@ -1290,18 +1340,18 @@ class Model : public AbstractModel { gsl::span buffer, const int ie); /** - * @brief Seperates first and second order objective sensitivity information - * and writes them into the respective buffers - * @param dLLhdp data with mangled first and second order information - * @param sllh first order buffer - * @param s2llh second order buffer + * @brief Separate first and second order objective sensitivity information + * and write them into the respective buffers. + * @param dLLhdp Data with mangled first- and second-order information + * @param sllh First order buffer + * @param s2llh Second order buffer */ void writeLLHSensitivitySlice(const std::vector &dLLhdp, std::vector &sllh, std::vector &s2llh); /** - * @brief Verifies that the provided buffers have the expected size. + * @brief Verify that the provided buffers have the expected size. * @param sllh first order buffer * @param s2llh second order buffer */ @@ -1309,81 +1359,70 @@ class Model : public AbstractModel { const std::vector &s2llh) const; /** - * @brief Set the nplist-dependent vectors to their proper sizes + * @brief Set the nplist-dependent vectors to their proper sizes. */ void initializeVectors(); /** - * @brief Observables / measurements - * @param t current timepoint - * @param x current state + * @brief Compute observables / measurements. + * @param t Current timepoint + * @param x Current state */ void fy(realtype t, const AmiVector &x); /** - * @brief Partial derivative of observables y w.r.t. model parameters p - * @param t current timepoint - * @param x current state + * @brief Compute partial derivative of observables \f$y\f$ w.r.t. model + * parameters `p`. + * @param t Current timepoint + * @param x Current state */ void fdydp(realtype t, const AmiVector &x); /** - * @brief Partial derivative of observables y w.r.t. state variables x - * @param t current timepoint - * @param x current state + * @brief Compute partial derivative of observables \f$y\f$ w.r.t. state + * variables `x`. + * @param t Current timepoint + * @param x Current state */ void fdydx(realtype t, const AmiVector &x); /** - * @brief Standard deviation of measurements - * @param it timepoint index - * @param edata pointer to experimental data instance + * @brief Compute standard deviation of measurements. + * @param it Timepoint index + * @param edata Experimental data */ void fsigmay(int it, const ExpData *edata); /** - * @brief Partial derivative of standard deviation of measurements w.r.t. - * model - * @param it timepoint index - * @param edata pointer to ExpData data instance holding sigma values + * @brief Compute partial derivative of standard deviation of measurements + * w.r.t. model parameters. + * @param it Timepoint index + * @param edata pointer to `amici::ExpData` data instance holding sigma values */ void fdsigmaydp(int it, const ExpData *edata); /** - * @brief Negative log-likelihood of measurements y - * @param Jy variable to which llh will be added - * @param it timepoint index - * @param y simulated observable - * @param edata pointer to experimental data instance + * @brief Compute negative log-likelihood of measurements \f$y\f$. + * + * @param Jy Variable to which llh will be added + * @param it Timepoint index + * @param y Simulated observable + * @param edata Pointer to experimental data instance */ void fJy(realtype &Jy, int it, const AmiVector &y, const ExpData &edata); /** - * @brief Model specific implementation of fdJydy colptrs - * @param indexptrs column pointers - * @param index ytrue index - */ - virtual void fdJydy_colptrs(sunindextype *indexptrs, int index); - - /** - * @brief Model specific implementation of fdJydy row vals - * @param indexptrs row val pointers - * @param index ytrue index - */ - virtual void fdJydy_rowvals(sunindextype *indexptrs, int index); - - /** - * @brief Partial derivative of time-resolved measurement negative - * log-likelihood Jy + * @brief Compute partial derivative of time-resolved measurement negative + * log-likelihood \f$Jy\f$. * @param it timepoint index * @param x state variables - * @param edata pointer to experimental data instance + * @param edata Pointer to experimental data */ void fdJydy(int it, const AmiVector &x, const ExpData &edata); /** * @brief Sensitivity of time-resolved measurement negative log-likelihood - * Jy w.r.t. standard deviation sigma + * Jy w.r.t. standard deviation sigma. * @param it timepoint index * @param x state variables * @param edata pointer to experimental data instance @@ -1392,8 +1431,7 @@ class Model : public AbstractModel { /** * @brief Compute sensitivity of time-resolved measurement negative - * log-likelihood Jy w.r.t. parameters for the given timepoint. Add result - * to respective fields in rdata. + * log-likelihood \f$Jy\f$ w.r.t. parameters for the given timepoint. * @param it timepoint index * @param x state variables * @param edata pointer to experimental data instance @@ -1402,24 +1440,24 @@ class Model : public AbstractModel { /** * @brief Sensitivity of time-resolved measurement negative log-likelihood - * Jy w.r.t. state variables - * @param it timepoint index - * @param x state variables - * @param edata pointer to experimental data instance + * \f$Jy\f$ w.r.t. state variables. + * @param it Timepoint index + * @param x State variables + * @param edata Pointer to experimental data instance */ void fdJydx(const int it, const AmiVector &x, const ExpData &edata); /** - * @brief Event-resolved output - * @param ie event index - * @param t current timepoint - * @param x current state + * @brief Compute event-resolved output. + * @param ie Event index + * @param t Current timepoint + * @param x Current state */ void fz(int ie, realtype t, const AmiVector &x); /** - * @brief Partial derivative of event-resolved output z w.r.t. to model - * parameters p + * @brief Compute partial derivative of event-resolved output `z` w.r.t. + * model parameters `p` * @param ie event index * @param t current timepoint * @param x current state @@ -1427,143 +1465,148 @@ class Model : public AbstractModel { void fdzdp(int ie, realtype t, const AmiVector &x); /** - * @brief Partial derivative of event-resolved output z w.r.t. to model - * states x - * @param ie event index - * @param t current timepoint - * @param x current state + * @brief Compute partial derivative of event-resolved output `z` w.r.t. + * model states `x`. + * @param ie Event index + * @param t Current timepoint + * @param x Current state */ void fdzdx(int ie, realtype t, const AmiVector &x); /** - * @brief Event root function of events (equal to froot but does not include - * non-output events) - * @param ie event index - * @param t current timepoint - * @param x current state + * @brief Compute event root function of events. + * + * Equal to `Model::froot` but does not include non-output events. + * + * @param ie Event index + * @param t Current timepoint + * @param x Current state */ void frz(int ie, realtype t, const AmiVector &x); /** - * @brief Sensitivity of event-resolved root output w.r.t. to model - * parameters p - * @param ie event index - * @param t current timepoint - * @param x current state + * @brief Compute sensitivity of event-resolved root output w.r.t. model + * parameters `p`. + * @param ie Event index + * @param t Current timepoint + * @param x Current state */ void fdrzdp(int ie, realtype t, const AmiVector &x); /** - * @brief Sensitivity of event-resolved measurements rz w.r.t. to model - * states x - * @param ie event index - * @param t current timepoint - * @param x current state + * @brief Compute sensitivity of event-resolved measurements \f$rz\f$ w.r.t. + * model states `x`. + * @param ie Event index + * @param t Current timepoint + * @param x Current state */ void fdrzdx(int ie, realtype t, const AmiVector &x); /** - * @brief Standard deviation of events - * @param ie event index - * @param nroots event index - * @param t current timepoint - * @param edata pointer to experimental data instance + * @brief Compute standard deviation of events. + * @param ie Event index + * @param nroots Event index + * @param t Current timepoint + * @param edata Experimental data */ void fsigmaz(const int ie, const int nroots, const realtype t, const ExpData *edata); /** - * @brief Sensitivity of standard deviation of events measurements w.r.t. - * model parameters p - * @param ie event index - * @param nroots event occurence - * @param t current timepoint - * @param edata pointer to experimental data instance + * @brief Compute sensitivity of standard deviation of events measurements + * w.r.t. model parameters `p`. + * @param ie Event index + * @param nroots Event occurrence + * @param t Current timepoint + * @param edata Pointer to experimental data instance */ void fdsigmazdp(int ie, int nroots, realtype t, const ExpData *edata); /** - * @brief Negative log-likelihood of event-resolved measurements z - * @param Jz variable to which llh will be added - * @param nroots event index - * @param z simulated event - * @param edata pointer to experimental data instance + * @brief Compute negative log-likelihood of event-resolved measurements + * `z`. + * @param Jz Variable to which llh will be added + * @param nroots Event index + * @param z Simulated event + * @param edata Experimental data */ void fJz(realtype &Jz, int nroots, const AmiVector &z, const ExpData &edata); /** - * @brief Partial derivative of event measurement negative log-likelihood Jz - * @param ie event index - * @param nroots event index - * @param t current timepoint - * @param x state variables - * @param edata pointer to experimental data instance + * @brief Compute partial derivative of event measurement negative + * log-likelihood \f$Jz\f$. + * @param ie Event index + * @param nroots Event index + * @param t Current timepoint + * @param x State variables + * @param edata Experimental data */ void fdJzdz(const int ie, const int nroots, const realtype t, const AmiVector &x, const ExpData &edata); /** - * @brief Sensitivity of event measurement negative log-likelihood Jz w.r.t. - * standard deviation sigmaz - * @param ie event index - * @param nroots event index - * @param t current timepoint - * @param x state variables - * @param edata pointer to experimental data instance + * @brief Compute sensitivity of event measurement negative log-likelihood + * \f$Jz\f$ w.r.t. standard deviation sigmaz. + * @param ie Event index + * @param nroots Event index + * @param t Current timepoint + * @param x State variables + * @param edata Pointer to experimental data instance */ void fdJzdsigma(const int ie, const int nroots, const realtype t, const AmiVector &x, const ExpData &edata); /** - * @brief Sensitivity of event-resolved measurement negative log-likelihood - * Jz w.r.t. parameters - * @param ie event index - * @param nroots event index - * @param t current timepoint - * @param x state variables - * @param edata pointer to experimental data instance + * @brief Compute sensitivity of event-resolved measurement negative + * log-likelihood Jz w.r.t. parameters. + * @param ie Event index + * @param nroots Event index + * @param t Current timepoint + * @param x State variables + * @param edata Pointer to experimental data instance */ void fdJzdp(const int ie, const int nroots, realtype t, const AmiVector &x, const ExpData &edata); /** - * @brief Sensitivity of event-resolved measurement negative log-likelihood - * Jz w.r.t. state variables - * @param ie event index - * @param nroots event index - * @param t current timepoint - * @param x state variables - * @param edata pointer to experimental data instance + * @brief Compute sensitivity of event-resolved measurement negative + * log-likelihood Jz w.r.t. state variables. + * @param ie Event index + * @param nroots Event index + * @param t Current timepoint + * @param x State variables + * @param edata Experimental data */ void fdJzdx(const int ie, const int nroots, realtype t, const AmiVector &x, const ExpData &edata); /** - * @brief Regularization of negative log-likelihood with roots of - * event-resolved measurements rz - * @param Jrz variable to which regularization will be added - * @param nroots event index - * @param rz regularization variable - * @param edata pointer to experimental data instance + * @brief Compute regularization of negative log-likelihood with roots of + * event-resolved measurements rz. + * @param Jrz Variable to which regularization will be added + * @param nroots Event index + * @param rz Regularization variable + * @param edata Experimental data */ void fJrz(realtype &Jrz, int nroots, const AmiVector &rz, const ExpData &edata); /** - * @brief Partial derivative of event measurement negative log-likelihood Jz - * @param ie event index - * @param nroots event index - * @param t current timepoint - * @param x state variables - * @param edata pointer to experimental data instance + * @brief Compute partial derivative of event measurement negative + * log-likelihood J. + * @param ie Event index + * @param nroots Event index + * @param t Current timepoint + * @param x State variables + * @param edata Experimental data */ void fdJrzdz(const int ie, const int nroots, const realtype t, const AmiVector &x, const ExpData &edata); /** - * @brief Sensitivity of event measurement negative log-likelihood Jz w.r.t. - * standard deviation sigmaz + * @brief Compute sensitivity of event measurement negative log-likelihood + * Jz w.r.t. standard deviation sigmaz * @param ie event index * @param nroots event index * @param t current timepoint @@ -1574,307 +1617,394 @@ class Model : public AbstractModel { const AmiVector &x, const ExpData &edata); /** - * @brief Recurring terms in xdot - * @param t timepoint - * @param x array with the states + * @brief Compute recurring terms in xdot. + * @param t Timepoint + * @param x Array with the states */ void fw(realtype t, const realtype *x); /** - * @brief Recurring terms in xdot, parameter derivative - * @param t timepoint - * @param x array with the states + * @brief Compute parameter derivative for recurring terms in xdot. + * @param t Timepoint + * @param x Array with the states */ void fdwdp(realtype t, const realtype *x); /** - * @brief Recurring terms in xdot, state derivative - * @param t timepoint - * @param x array with the states + * @brief Compute state derivative for recurring terms in xdot. + * @param t Timepoint + * @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 + * @param x Array with the states + */ + void fdwdw(realtype t, const realtype *x); /** - * @brief Model specific implementation of fx_rdata - * @param x_rdata state variables with conservation laws expanded - * @param x_solver state variables with conservation laws applied - * @param tcl total abundances for conservation laws + * @brief Compute fx_rdata. + * + * To be implemented by derived class if applicable. + * + * @param x_rdata State variables with conservation laws expanded + * @param x_solver State variables with conservation laws applied + * @param tcl Total abundances for conservation laws */ virtual void fx_rdata(realtype *x_rdata, const realtype *x_solver, const realtype *tcl); /** - * @brief Model specific implementation of fsx_solver - * @param sx_rdata state sensitivity variables with conservation laws + * @brief Compute fsx_solver. + * + * To be implemented by derived class if applicable. + * + * @param sx_rdata State sensitivity variables with conservation laws * expanded - * @param sx_solver state sensitivity variables with conservation laws + * @param sx_solver State sensitivity variables with conservation laws * applied - * @param stcl sensitivities of total abundances for conservation laws - * @param ip sensitivity index + * @param stcl Sensitivities of total abundances for conservation laws + * @param ip Sensitivity index */ virtual void fsx_rdata(realtype *sx_rdata, const realtype *sx_solver, const realtype *stcl, int ip); /** - * @brief Model specific implementation of fx_solver - * @param x_solver state variables with conservation laws applied - * @param x_rdata state variables with conservation laws expanded + * @brief Compute fx_solver. + * + * To be implemented by derived class if applicable. + * + * @param x_solver State variables with conservation laws applied + * @param x_rdata State variables with conservation laws expanded */ virtual void fx_solver(realtype *x_solver, const realtype *x_rdata); /** - * @brief Model specific implementation of fsx_solver - * @param sx_rdata state sensitivity variables with conservation laws + * @brief Compute fsx_solver. + * + * To be implemented by derived class if applicable. + * + * @param sx_rdata State sensitivity variables with conservation laws * expanded - * @param sx_solver state sensitivity variables with conservation laws + * @param sx_solver State sensitivity variables with conservation laws * applied */ virtual void fsx_solver(realtype *sx_solver, const realtype *sx_rdata); /** - * @brief Model specific implementation of ftotal_cl - * @param total_cl total abundances of conservation laws - * @param x_rdata state variables with conservation laws expanded + * @brief Compute ftotal_cl. + * + * To be implemented by derived class if applicable. + * + * @param total_cl Total abundances of conservation laws + * @param x_rdata State variables with conservation laws expanded */ virtual void ftotal_cl(realtype *total_cl, const realtype *x_rdata); /** - * @brief Model specific implementation of fstotal_cl - * @param stotal_cl sensitivites for the total abundances of conservation + * @brief Compute fstotal_cl + * + * To be implemented by derived class if applicable. + * + * @param stotal_cl Sensitivities for the total abundances of conservation * laws - * @param sx_rdata state sensitivity variables with conservation laws + * @param sx_rdata State sensitivity variables with conservation laws * expanded - * @param ip sensitivity index + * @param ip Sensitivity index */ virtual void fstotal_cl(realtype *stotal_cl, const realtype *sx_rdata, int ip); /** - * @brief Computes nonnegative state vector according to stateIsNonNegative - * if anyStateNonNegative is set to false, i.e., all entries in - * stateIsNonNegative are false, this function directly returns x, otherwise - * all entries of x are copied in to x_pos_tmp and negative values are - * replaced by 0 where applicable + * @brief Compute non-negative state vector. + * + * Compute non-negative state vector according to stateIsNonNegative. + * If anyStateNonNegative is set to `false`, i.e., all entries in + * stateIsNonNegative are `false`, this function directly returns `x`, + * otherwise all entries of x are copied in to `amici::Model::x_pos_tmp_` + * and negative values are replaced by `0` where applicable. * - * @param x state vector possibly containing negative values - * @return state vector with negative values replaced by 0 according to + * @param x State vector possibly containing negative values + * @return State vector with negative values replaced by `0` according to * stateIsNonNegative */ N_Vector computeX_pos(const_N_Vector x); - /** all variables necessary for function evaluation */ - ModelState state; + /** All variables necessary for function evaluation */ + ModelState state_; + + /** Sparse Jacobian (dimension: `amici::Model::nnz`) */ + mutable SUNMatrixWrapper J_; + + /** Sparse Backwards Jacobian (dimension: `amici::Model::nnz`) */ + mutable SUNMatrixWrapper JB_; - /** Sparse Jacobian (dimension: nnz)*/ - mutable SUNMatrixWrapper J; + /** Sparse dxdotdw temporary storage (dimension: `ndxdotdw`) */ + mutable SUNMatrixWrapper dxdotdw_; + + /** 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, + * type `CSC_MAT`) + */ + mutable SUNMatrixWrapper dxdotdp_full; - /** Sparse dxdotdw temporary storage (dimension: ndxdotdw) */ - mutable SUNMatrixWrapper dxdotdw; + /** + * Temporary storage of `dxdotdp_explicit` data across functions (Python only) + * (dimension: `nplist` x `nx_solver`, nnz: `ndxdotdp_explicit`, + * type `CSC_MAT`) + */ + mutable SUNMatrixWrapper dxdotdp_explicit; - /** Sparse dwdp temporary storage (dimension: ndwdp) */ - mutable SUNMatrixWrapper dwdp; + /** + * Temporary storage of `dxdotdp_implicit` data across functions, + * Python-only + * (dimension: `nplist` x `nx_solver`, nnz: dynamic, + * 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', + * type `CSC_MAT`) + */ + mutable SUNMatrixWrapper dxdotdx_explicit; - /** Sparse dwdx temporary storage (dimension: ndwdx) */ - mutable SUNMatrixWrapper dwdx; + /** + * Temporary storage of `dxdotdx_implicit` data across functions, + * Python-only + * (dimension: `nplist` x `nx_solver`, nnz: dynamic, + * type `CSC_MAT`) + */ + mutable SUNMatrixWrapper dxdotdx_implicit; - /** Dense Mass matrix (dimension: nx_solver x nx_solver) */ - mutable SUNMatrixWrapper M; + /** + * Temporary storage of `dxdotdp` data across functions, Matlab only + * (dimension: `nplist` x `nx_solver`, row-major) + */ + AmiVectorArray dxdotdp {0, 0}; - /** current observable (dimension: nytrue) */ - mutable std::vector my; + /** Current observable (dimension: `nytrue`) */ + mutable std::vector my_; - /** current event measurement (dimension: nztrue) */ - mutable std::vector mz; + /** Current event measurement (dimension: `nztrue`) */ + mutable std::vector mz_; /** Sparse observable derivative of data likelihood, only used if - * pythonGenerated==true (dimension nytrue, nJ x ny, row-major) */ - mutable std::vector dJydy; + * `pythonGenerated` == `true` (dimension `nytrue`, `nJ` x `ny`, row-major) + */ + mutable std::vector dJydy_; - /** observable derivative of data likelihood, only used if - * pythonGenerated==false (dimension nJ x ny x nytrue, row-major) + /** Observable derivative of data likelihood, only used if + * `pythonGenerated` == `false` (dimension `nJ` x `ny` x `nytrue`, + * row-major) */ - mutable std::vector dJydy_matlab; + mutable std::vector dJydy_matlab_; - /** observable sigma derivative of data likelihood + /** Observable sigma derivative of data likelihood * (dimension nJ x ny x nytrue, row-major) */ - mutable std::vector dJydsigma; + mutable std::vector dJydsigma_; - /** state derivative of data likelihood + /** State derivative of data likelihood * (dimension nJ x nx_solver, row-major) */ - mutable std::vector dJydx; + mutable std::vector dJydx_; - /** parameter derivative of data likelihood for current timepoint + /** Parameter derivative of data likelihood for current timepoint * (dimension: nJ x nplist, row-major) */ - mutable std::vector dJydp; + mutable std::vector dJydp_; /** event output derivative of event likelihood * (dimension nJ x nz x nztrue, row-major) */ - mutable std::vector dJzdz; + mutable std::vector dJzdz_; /** event sigma derivative of event likelihood * (dimension nJ x nz x nztrue, row-major) */ - mutable std::vector dJzdsigma; + mutable std::vector dJzdsigma_; /** event output derivative of event likelihood at final timepoint * (dimension nJ x nz x nztrue, row-major) */ - mutable std::vector dJrzdz; + mutable std::vector dJrzdz_; /** event sigma derivative of event likelihood at final timepoint * (dimension nJ x nz x nztrue, row-major) */ - mutable std::vector dJrzdsigma; + mutable std::vector dJrzdsigma_; /** state derivative of event likelihood * (dimension nJ x nx_solver, row-major) */ - mutable std::vector dJzdx; + mutable std::vector dJzdx_; /** parameter derivative of event likelihood for current timepoint * (dimension: nJ x nplist x, row-major) */ - mutable std::vector dJzdp; + mutable std::vector dJzdp_; /** state derivative of event output * (dimension: nz x nx_solver, row-major) */ - mutable std::vector dzdx; + mutable std::vector dzdx_; /** parameter derivative of event output * (dimension: nz x nplist, row-major) */ - mutable std::vector dzdp; + mutable std::vector dzdp_; /** state derivative of event regularization variable * (dimension: nz x nx_solver, row-major) */ - mutable std::vector drzdx; + mutable std::vector drzdx_; /** parameter derivative of event regularization variable * (dimension: nz x nplist, row-major) */ - mutable std::vector drzdp; + mutable std::vector drzdp_; /** parameter derivative of observable * (dimension: ny x nplist, row-major) */ - mutable std::vector dydp; + mutable std::vector dydp_; /** state derivative of time-resolved observable * (dimension: nx_solver x ny, row-major) */ - mutable std::vector dydx; + mutable std::vector dydx_; - /** tempory storage of w data across functions (dimension: nw) */ - mutable std::vector w; + /** temporary storage of w data across functions (dimension: nw) */ + mutable std::vector w_; - /** tempory storage for flattened sx, + /** temporary storage for flattened sx, * (dimension: nx_solver x nplist, row-major) */ - mutable std::vector sx; + mutable std::vector sx_; - /** tempory storage for x_rdata (dimension: nx_rdata) */ - mutable std::vector x_rdata; + /** temporary storage for x_rdata (dimension: nx_rdata) */ + mutable std::vector x_rdata_; - /** tempory storage for sx_rdata slice (dimension: nx_rdata) */ - mutable std::vector sx_rdata; + /** temporary storage for sx_rdata slice (dimension: nx_rdata) */ + mutable std::vector sx_rdata_; /** temporary storage for time-resolved observable (dimension: ny) */ - mutable std::vector y; + mutable std::vector y_; /** data standard deviation for current timepoint (dimension: ny) */ - mutable std::vector sigmay; + mutable std::vector sigmay_; /** temporary storage for parameter derivative of data standard deviation, * (dimension: ny x nplist, row-major) */ - mutable std::vector dsigmaydp; + mutable std::vector dsigmaydp_; /** temporary storage for event-resolved observable (dimension: nz) */ - mutable std::vector z; + mutable std::vector z_; /** temporary storage for event regularization (dimension: nz) */ - mutable std::vector rz; + mutable std::vector rz_; /** temporary storage for event standard deviation (dimension: nz) */ - mutable std::vector sigmaz; + mutable std::vector sigmaz_; /** temporary storage for parameter derivative of event standard deviation, * (dimension: nz x nplist, row-major) */ - mutable std::vector dsigmazdp; + mutable std::vector dsigmazdp_; /** temporary storage for change in x after event (dimension: nx_solver) */ - mutable std::vector deltax; + mutable std::vector deltax_; /** temporary storage for change in sx after event * (dimension: nx_solver x nplist, row-major) */ - mutable std::vector deltasx; + mutable std::vector deltasx_; /** temporary storage for change in xB after event (dimension: nx_solver) */ - mutable std::vector deltaxB; + mutable std::vector deltaxB_; /** temporary storage for change in qB after event * (dimension: nJ x nplist, row-major) */ - mutable std::vector deltaqB; + mutable std::vector deltaqB_; /** temporary storage of positified state variables according to * stateIsNonNegative (dimension: nx_solver) */ - mutable AmiVector x_pos_tmp {0}; + mutable AmiVector x_pos_tmp_ {0}; - /** orignal user-provided, possibly scaled parameter array (dimension: np) + /** original user-provided, possibly scaled parameter array (dimension: np) */ - std::vector originalParameters; + std::vector original_parameters_; /** index indicating to which event an event output belongs */ - std::vector z2event; + std::vector z2event_; - /** state initialisation (size nx_solver) */ - std::vector x0data; + /** state initialization (size nx_solver) */ + std::vector x0data_; - /** sensitivity initialisation (size nx_rdata x nplist, row-major) */ - std::vector sx0data; + /** sensitivity initialization (size nx_rdata x nplist, row-major) */ + std::vector sx0data_; /** timepoints (size nt) */ - std::vector ts; + std::vector ts_; /** vector of bools indicating whether state variables are to be assumed to * be positive */ - std::vector stateIsNonNegative; + std::vector state_is_non_negative_; /** boolean indicating whether any entry in stateIsNonNegative is `true` */ - bool anyStateNonNegative = false; + bool any_state_non_negative_ {false}; /** maximal number of events to track */ - int nmaxevent = 10; + int nmaxevent_ {10}; /** parameter transformation of `originalParameters` (dimension np) */ - std::vector pscale; + std::vector pscale_; /** starting time */ - double tstart = 0.0; + realtype tstart_ {0.0}; - /** flag indicating whether steadystate sensivities are to be computed + /** flag indicating whether steadystate sensitivities are to be computed * via FSA when steadyStateSimulation is used */ - SteadyStateSensitivityMode steadyStateSensitivityMode = - SteadyStateSensitivityMode::newtonOnly; + SteadyStateSensitivityMode steadystate_sensitivity_mode_ {SteadyStateSensitivityMode::newtonOnly}; /** flag indicating whether reinitialization of states depending on * fixed parameters is activated */ - bool reinitializeFixedParameterInitialStates = false; + bool reinitialize_fixed_parameter_initial_states_ {false}; - /** Indicates whether the result of every call to Model::f* should be + /** Indicates whether the result of every call to `Model::f*` should be * checked for finiteness */ - bool alwaysCheckFinite = false; + bool always_check_finite_ {false}; + + private: + /** Sparse dwdp implicit temporary storage (dimension: `ndwdp`) */ + mutable std::vector dwdp_hierarchical_; + + /** Sparse dwdw temporary storage (dimension: `ndwdw`) */ + mutable SUNMatrixWrapper dwdw_; + + /** Sparse dwdx implicit temporary storage (dimension: `ndwdx`) */ + mutable std::vector dwdx_hierarchical_; + + /** Recursion */ + int w_recursion_depth_ {0}; }; bool operator==(const Model &a, const Model &b); diff --git a/deps/AMICI/include/amici/model_dae.h b/deps/AMICI/include/amici/model_dae.h index 7446765c4..a353aa05e 100644 --- a/deps/AMICI/include/amici/model_dae.h +++ b/deps/AMICI/include/amici/model_dae.h @@ -22,7 +22,7 @@ class IDASolver; * * The model does not contain any data, but represents the state * of the model at a specific time t. The states must not always be - * in sync, but may be updated asynchroneously. + * in sync, but may be updated asynchronously. */ class Model_DAE : public Model { public: @@ -49,6 +49,8 @@ class Model_DAE : public Model { * repeating elements * @param ndwdp number of nonzero elements in the p derivative of the * repeating elements + * @param ndwdw number of nonzero elements in the w derivative of the + * repeating elements * @param ndxdotdw number of nonzero elements dxdotdw * @param ndJydy number of nonzero elements dJydy * @param nnz number of nonzero elements in Jacobian @@ -62,23 +64,24 @@ class Model_DAE : public Model { * @param z2event mapping of event outputs to events * @param pythonGenerated flag indicating matlab or python wrapping * @param ndxdotdp_explicit number of nonzero elements dxdotdp_explicit - * @param ndxdotdp_implicit number of nonzero elements dxdotdp_implicit */ Model_DAE(const int nx_rdata, const int nxtrue_rdata, const int nx_solver, const int nxtrue_solver, const int nx_solver_reinit, const int ny, const int nytrue, const int nz, const int nztrue, const int ne, const int nJ, - const int nw, const int ndwdx, const int ndwdp, const int ndxdotdw, - std::vector ndJydy, const int nnz, const int ubw, - const int lbw, const SecondOrderMode o2mode, + const int nw, const int ndwdx, const int ndwdp, const int ndwdw, + const int ndxdotdw, std::vector ndJydy, const int nnz, + const int ubw, const int lbw, const SecondOrderMode o2mode, std::vector const &p, std::vector const &k, - std::vector const &plist, std::vector const &idlist, + std::vector const &plist, + std::vector const &idlist, std::vector const &z2event, const bool pythonGenerated=false, - const int ndxdotdp_explicit=0, const int ndxdotdp_implicit=0) - : Model(nx_rdata, nxtrue_rdata, nx_solver, nxtrue_solver, nx_solver_reinit, ny, nytrue, - nz, nztrue, ne, nJ, nw, ndwdx, ndwdp, ndxdotdw, std::move(ndJydy), - nnz, ubw, lbw, o2mode, p, k, plist, idlist, z2event, - pythonGenerated, ndxdotdp_explicit, ndxdotdp_implicit) { - M = SUNMatrixWrapper(nx_solver, nx_solver); + const int ndxdotdp_explicit=0) + : Model(nx_rdata, nxtrue_rdata, nx_solver, nxtrue_solver, + nx_solver_reinit, ny, nytrue, nz, nztrue, ne, nJ, nw, ndwdx, + ndwdp, ndwdw, ndxdotdw, std::move(ndJydy), nnz, ubw, lbw, + o2mode, p, k, plist, idlist, z2event, pythonGenerated, + ndxdotdp_explicit) { + M_ = SUNMatrixWrapper(nx_solver, nx_solver); } void fJ(realtype t, realtype cj, const AmiVector &x, const AmiVector &dx, @@ -320,45 +323,6 @@ class Model_DAE : public Model { std::unique_ptr getSolver() override; protected: - /** - * @brief Model specific implementation for fJ - * @param J Matrix to which the Jacobian will be written - * @param t timepoint - * @param x Vector with the states - * @param p parameter vector - * @param k constants vector - * @param h heavyside vector - * @param cj scaling factor, inverse of the step size - * @param dx Vector with the derivative states - * @param w vector with helper variables - * @param dwdx derivative of w wrt x - **/ - virtual void fJ(realtype *J, realtype t, const realtype *x, const double *p, - const double *k, const realtype *h, realtype cj, - const realtype *dx, const realtype *w, - const realtype *dwdx) = 0; - - /** - * @brief Model specific implementation for fJB - * @param JB Matrix to which the Jacobian will be written - * @param t timepoint - * @param x Vector with the states - * @param p parameter vector - * @param k constants vector - * @param h heavyside vector - * @param cj scaling factor, inverse of the step size - * @param xB Vector with the adjoint states - * @param dx Vector with the derivative states - * @param dxB Vector with the adjoint derivative states - * @param w vector with helper variables - * @param dwdx derivative of w wrt x - **/ - virtual void fJB(realtype *JB, realtype t, const realtype *x, - const double *p, const double *k, const realtype *h, - realtype cj, const realtype *xB, const realtype *dx, - const realtype *dxB, const realtype *w, - const realtype *dwdx); - /** * @brief Model specific implementation for fJSparse * @param JSparse Matrix to which the Jacobian will be written @@ -366,7 +330,7 @@ class Model_DAE : public Model { * @param x Vector with the states * @param p parameter vector * @param k constants vector - * @param h heavyside vector + * @param h Heaviside vector * @param cj scaling factor, inverse of the step size * @param dx Vector with the derivative states * @param w vector with helper variables @@ -377,68 +341,6 @@ class Model_DAE : public Model { const realtype *h, realtype cj, const realtype *dx, const realtype *w, const realtype *dwdx) = 0; - /** - * @brief Model specific implementation for fJSparseB - * @param JSparseB Matrix to which the Jacobian will be written - * @param t timepoint - * @param x Vector with the states - * @param p parameter vector - * @param k constants vector - * @param h heavyside vector - * @param cj scaling factor, inverse of the step size - * @param xB Vector with the adjoint states - * @param dx Vector with the derivative states - * @param dxB Vector with the adjoint derivative states - * @param w vector with helper variables - * @param dwdx derivative of w wrt x - **/ - virtual void fJSparseB(SUNMatrixContent_Sparse JSparseB, const realtype t, - const realtype *x, const double *p, const double *k, - const realtype *h, const realtype cj, - const realtype *xB, const realtype *dx, - const realtype *dxB, const realtype *w, - const realtype *dwdx); - - /** - * @brief Model specific implementation for fJDiag - * @param JDiag array to which the Jacobian diagonal will be written - * @param t timepoint - * @param x Vector with the states - * @param p parameter vector - * @param k constants vector - * @param h heavyside vector - * @param cj scaling factor, inverse of the step size - * @param dx Vector with the derivative states - * @param w vector with helper variables - * @param dwdx derivative of w wrt x - **/ - virtual void fJDiag(realtype *JDiag, realtype t, const realtype *x, - const realtype *p, const realtype *k, const realtype *h, - realtype cj, const realtype *dx, const realtype *w, - const realtype *dwdx); - - /** - * @brief Model specific implementation for fJvB - * @param JvB Matrix vector product of JB with a vector v - * @param t timepoint - * @param x Vector with the states - * @param p parameter vector - * @param k constants vector - * @param h heavyside vector - * @param cj scaling factor, inverse of the step size - * @param xB Vector with the adjoint states - * @param dx Vector with the derivative states - * @param dxB Vector with the adjoint derivative states - * @param vB Vector with which the Jacobian is multiplied - * @param w vector with helper variables - * @param dwdx derivative of w wrt x - **/ - virtual void fJvB(realtype *JvB, realtype t, const realtype *x, - const double *p, const double *k, const realtype *h, - realtype cj, const realtype *xB, const realtype *dx, - const realtype *dxB, const realtype *vB, - const realtype *w, const realtype *dwdx); - /** * @brief Model specific implementation for froot * @param root values of the trigger function @@ -446,7 +348,7 @@ class Model_DAE : public Model { * @param x Vector with the states * @param p parameter vector * @param k constants vector - * @param h heavyside vector + * @param h Heaviside vector * @param dx Vector with the derivative states **/ virtual void froot(realtype *root, realtype t, const realtype *x, @@ -460,7 +362,7 @@ class Model_DAE : public Model { * @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 dx Vector with the derivative states **/ @@ -475,7 +377,7 @@ class Model_DAE : public Model { * @param x Vector with the states * @param p parameter vector * @param k constants vector - * @param h heavyside vector + * @param h Heaviside vector * @param ip parameter index * @param dx Vector with the derivative states * @param w vector with helper variables @@ -495,7 +397,7 @@ class Model_DAE : public Model { * @param k constants vector */ virtual void fM(realtype *M, const realtype t, const realtype *x, - const realtype *p, const realtype *k){}; + const realtype *p, const realtype *k); }; } // namespace amici diff --git a/deps/AMICI/include/amici/model_ode.h b/deps/AMICI/include/amici/model_ode.h index 038e5967d..10b3b98f2 100644 --- a/deps/AMICI/include/amici/model_ode.h +++ b/deps/AMICI/include/amici/model_ode.h @@ -22,7 +22,7 @@ class CVodeSolver; * * The model does not contain any data, but represents the state * of the model at a specific time t. The states must not always be - * in sync, but may be updated asynchroneously. + * in sync, but may be updated asynchronously. */ class Model_ODE : public Model { public: @@ -49,6 +49,8 @@ class Model_ODE : public Model { * repeating elements * @param ndwdp number of nonzero elements in the p derivative of the * repeating elements + * @param ndwdw number of nonzero elements in the w derivative of the + * repeating elements * @param ndxdotdw number of nonzero elements dxdotdw * @param ndJydy number of nonzero elements dJydy * @param nnz number of nonzero elements in Jacobian @@ -62,23 +64,26 @@ class Model_ODE : public Model { * @param z2event mapping of event outputs to events * @param pythonGenerated flag indicating matlab or python wrapping * @param ndxdotdp_explicit number of nonzero elements dxdotdp_explicit - * @param ndxdotdp_implicit number of nonzero elements dxdotdp_implicit + * @param ndxdotdx_explicit number of nonzero elements dxdotdx_explicit + * @param w_recursion_depth Recursion depth of fw */ Model_ODE(const int nx_rdata, const int nxtrue_rdata, const int nx_solver, const int nxtrue_solver, const int nx_solver_reinit, const int ny, const int nytrue, const int nz, const int nztrue, const int ne, const int nJ, - const int nw, const int ndwdx, const int ndwdp, - const int ndxdotdw, std::vector ndJydy, - const int nnz, const int ubw, const int lbw, - const SecondOrderMode o2mode, std::vector const &p, - std::vector const &k, std::vector const &plist, + const int nw, const int ndwdx, const int ndwdp, const int ndwdw, + const int ndxdotdw, std::vector ndJydy, const int nnz, + const int ubw, const int lbw, const SecondOrderMode o2mode, + std::vector const &p, std::vector const &k, + std::vector const &plist, std::vector const &idlist, std::vector const &z2event, const bool pythonGenerated=false, - const int ndxdotdp_explicit=0, const int ndxdotdp_implicit=0) - : Model(nx_rdata, nxtrue_rdata, nx_solver, nxtrue_solver, nx_solver_reinit, ny, nytrue, - nz, nztrue, ne, nJ, nw, ndwdx, ndwdp, ndxdotdw, std::move(ndJydy), - nnz, ubw, lbw, o2mode, p, k, plist, idlist, z2event, - pythonGenerated, ndxdotdp_explicit, ndxdotdp_implicit) {} + const int ndxdotdp_explicit=0, const int ndxdotdx_explicit=0, + const int w_recursion_depth=0) + : Model(nx_rdata, nxtrue_rdata, nx_solver, nxtrue_solver, + nx_solver_reinit, ny, nytrue, nz, nztrue, ne, nJ, nw, ndwdx, + ndwdp, ndwdw, ndxdotdw, std::move(ndJydy), nnz, ubw, lbw, + o2mode, p, k, plist, idlist, z2event, pythonGenerated, + ndxdotdp_explicit, ndxdotdx_explicit, w_recursion_depth) {} void fJ(realtype t, realtype cj, const AmiVector &x, const AmiVector &dx, const AmiVector &xdot, SUNMatrix J) override; @@ -193,7 +198,7 @@ class Model_ODE : public Model { /** * @brief Implementation of froot at the N_Vector level * This function provides an interface to the model specific routines for - * the solver implementation aswell as the AmiVector level implementation + * the solver implementation as well as the AmiVector level implementation * @param t timepoint * @param x Vector with the states * @param root array with root function values @@ -206,7 +211,7 @@ class Model_ODE : public Model { /** * @brief Implementation of fxdot at the N_Vector level, this function * provides an interface to the model specific routines for the solver - * implementation aswell as the AmiVector level implementation + * implementation as well as the AmiVector level implementation * @param t timepoint * @param x Vector with the states * @param xdot Vector with the right hand side @@ -272,21 +277,6 @@ class Model_ODE : public Model { const AmiVector &xB, const AmiVector &dxB, const AmiVector &xBdot) override; - /** - * @brief Sensitivity of dx/dt wrt model parameters w - * @param t timepoint - * @param x Vector with the states - */ - void fdxdotdw(realtype t, const N_Vector x); - - /** Explicit sensitivity of dx/dt wrt model parameters p - * @param t timepoint - * @param x Vector with the states - */ - void fdxdotdp(realtype t, const N_Vector x); - - void fdxdotdp(realtype t, const AmiVector &x, const AmiVector &dx) override; - void fsxdot(realtype t, const AmiVector &x, const AmiVector &dx, int ip, const AmiVector &sx, const AmiVector &sdx, AmiVector &sxdot) override; @@ -304,46 +294,15 @@ class Model_ODE : public Model { std::unique_ptr getSolver() override; protected: - /** - * @brief Model specific implementation for fJ - * @param J Matrix to which the Jacobian will be written - * @param t timepoint - * @param x Vector with the states - * @param p parameter vector - * @param k constants vector - * @param h heavyside vector - * @param w vector with helper variables - * @param dwdx derivative of w wrt x - **/ - virtual void fJ(realtype *J, realtype t, const realtype *x, - const realtype *p, const realtype *k, const realtype *h, - const realtype *w, const realtype *dwdx) = 0; /** - * @brief Model specific implementation for fJB - * @param JB Matrix to which the Jacobian will be written - * @param t timepoint - * @param x Vector with the states - * @param p parameter vector - * @param k constants vector - * @param h heavyside vector - * @param xB Vector with the adjoint states - * @param w vector with helper variables - * @param dwdx derivative of w wrt x - **/ - virtual void fJB(realtype *JB, realtype t, const realtype *x, - const realtype *p, const realtype *k, const realtype *h, - const realtype *xB, const realtype *w, - const realtype *dwdx); - - /** - * @brief Model specific implementation for fJSparse + * @brief Model specific implementation for fJSparse (Matlab) * @param JSparse Matrix to which the Jacobian will be written * @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 dwdx derivative of w wrt x **/ @@ -353,13 +312,13 @@ class Model_ODE : public Model { const realtype *w, const realtype *dwdx); /** - * @brief Model specific implementation for fJSparse, data only + * @brief Model specific implementation for fJSparse, data only (Py) * @param JSparse Matrix to which the Jacobian will be written * @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 dwdx derivative of w wrt x **/ @@ -370,77 +329,15 @@ class Model_ODE : public Model { /** * @brief Model specific implementation for fJSparse, column pointers - * @param indexptrs column pointers - **/ - virtual void fJSparse_colptrs(sunindextype *indexptrs); - - /** - * @brief Model specific implementation for fJSparse, row values - * @param indexvals row values - **/ - virtual void fJSparse_rowvals(sunindextype *indexvals); - - /** - * @brief Model specific implementation for fJSparseB - * @param JSparseB Matrix to which the Jacobian will be written - * @param t timepoint - * @param x Vector with the states - * @param p parameter vector - * @param k constants vector - * @param h heavyside vector - * @param xB Vector with the adjoint states - * @param w vector with helper variables - * @param dwdx derivative of w wrt x - **/ - virtual void fJSparseB(SUNMatrixContent_Sparse JSparseB, realtype t, - const realtype *x, const realtype *p, - const realtype *k, const realtype *h, - const realtype *xB, const realtype *w, - const realtype *dwdx); - - /** - * @brief Model specific implementation for fJSparseB - * @param JSparseB data array - * @param t timepoint - * @param x Vector with the states - * @param p parameter vector - * @param k constants vector - * @param h heavyside vector - * @param xB Vector with the adjoint states - * @param w vector with helper variables - * @param dwdx derivative of w wrt x - **/ - virtual void fJSparseB(realtype *JSparseB, realtype t, const realtype *x, - const realtype *p, const realtype *k, - const realtype *h, const realtype *xB, - const realtype *w, const realtype *dwdx); - - /** - * @brief Model specific implementation for fJSparse, column pointers - * @param indexptrs column pointers + * @param JSparse sparse matrix to which colptrs will be written **/ - virtual void fJSparseB_colptrs(sunindextype *indexptrs); + virtual void fJSparse_colptrs(SUNMatrixWrapper &JSparse); /** * @brief Model specific implementation for fJSparse, row values - * @param indexvals row values - **/ - virtual void fJSparseB_rowvals(sunindextype *indexvals); - - /** - * @brief Model specific implementation for fJDiag - * @param JDiag Matrix to which the Jacobian will be written - * @param t timepoint - * @param x Vector with the states - * @param p parameter vector - * @param k constants vector - * @param h heavyside vector - * @param w vector with helper variables - * @param dwdx derivative of w wrt x + * @param JSparse sparse matrix to which rowvals will be written **/ - virtual void fJDiag(realtype *JDiag, realtype t, const realtype *x, - const realtype *p, const realtype *k, const realtype *h, - const realtype *w, const realtype *dwdx); + virtual void fJSparse_rowvals(SUNMatrixWrapper &JSparse); /** * @brief Model specific implementation for froot @@ -449,7 +346,7 @@ class Model_ODE : public Model { * @param x Vector with the states * @param p parameter vector * @param k constants vector - * @param h heavyside vector + * @param h Heaviside vector **/ virtual void froot(realtype *root, realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h); @@ -461,7 +358,7 @@ class Model_ODE : public Model { * @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 **/ virtual void fxdot(realtype *xdot, realtype t, const realtype *x, @@ -475,7 +372,7 @@ class Model_ODE : public Model { * @param x Vector with the states * @param p parameter vector * @param k constants vector - * @param h heavyside vector + * @param h Heaviside vector * @param ip parameter index * @param w vector with helper variables * @param dwdp derivative of w wrt p @@ -492,7 +389,7 @@ class Model_ODE : public Model { * @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 */ virtual void fdxdotdp_explicit(realtype *dxdotdp_explicit, realtype t, @@ -502,27 +399,42 @@ class Model_ODE : public Model { /** * @brief Model specific implementation of fdxdotdp_explicit, colptrs part - * @param indexptrs column pointers + * @param dxdotdp sparse matrix to which colptrs will be written */ - virtual void fdxdotdp_explicit_colptrs(sunindextype *indexptrs); + virtual void fdxdotdp_explicit_colptrs(SUNMatrixWrapper &dxdotdp); /** * @brief Model specific implementation of fdxdotdp_explicit, rowvals part - * @param indexvals row values + * @param dxdotdp sparse matrix to which rowvals will be written + */ + virtual void fdxdotdp_explicit_rowvals(SUNMatrixWrapper &dxdotdp); + + /** + * @brief Model specific implementation of fdxdotdx_explicit, no w chainrule (Py) + * @param dxdotdx_explicit partial derivative xdot wrt x + * @param t timepoint + * @param x Vector with the states + * @param p parameter vector + * @param k constants vector + * @param h heavyside vector + * @param w vector with helper variables */ - virtual void fdxdotdp_explicit_rowvals(sunindextype *indexvals); + virtual void fdxdotdx_explicit(realtype *dxdotdx_explicit, realtype t, + const realtype *x, const realtype *p, + const realtype *k, const realtype *h, + const realtype *w); /** - * @brief Model specific implementation of fdxdotdp_implicit, colptrs part - * @param indexptrs column pointers + * @brief Model specific implementation of fdxdotdx_explicit, colptrs part + * @param dxdotdx sparse matrix to which colptrs will be written */ - virtual void fdxdotdp_implicit_colptrs(sunindextype *indexptrs); + virtual void fdxdotdx_explicit_colptrs(SUNMatrixWrapper &dxdotdx); /** - * @brief Model specific implementation of fdxdotdp_implicit, rowvals part - * @param indexvals row values + * @brief Model specific implementation of fdxdotdx_explicit, rowvals part + * @param dxdotdx sparse matrix to which rowvals will be written */ - virtual void fdxdotdp_implicit_rowvals(sunindextype *indexvals); + virtual void fdxdotdx_explicit_rowvals(SUNMatrixWrapper &dxdotdx); /** * @brief Model specific implementation of fdxdotdw, data part @@ -531,7 +443,7 @@ class Model_ODE : public Model { * @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 */ virtual void fdxdotdw(realtype *dxdotdw, realtype t, const realtype *x, @@ -540,15 +452,30 @@ class Model_ODE : public Model { /** * @brief Model specific implementation of fdxdotdw, colptrs part - * @param indexptrs column pointers + * @param dxdotdw sparse matrix to which colptrs will be written */ - virtual void fdxdotdw_colptrs(sunindextype *indexptrs); + virtual void fdxdotdw_colptrs(SUNMatrixWrapper &dxdotdw); /** * @brief Model specific implementation of fdxdotdw, rowvals part - * @param indexvals row values + * @param dxdotdw sparse matrix to which rowvals will be written */ - virtual void fdxdotdw_rowvals(sunindextype *indexvals); + virtual void fdxdotdw_rowvals(SUNMatrixWrapper &dxdotdw); + + /** + * @brief Sensitivity of dx/dt wrt model parameters w + * @param t timepoint + * @param x Vector with the states + */ + void fdxdotdw(realtype t, const N_Vector x); + + /** Explicit sensitivity of dx/dt wrt model parameters p + * @param t timepoint + * @param x Vector with the states + */ + void fdxdotdp(realtype t, const N_Vector x); + + void fdxdotdp(realtype t, const AmiVector &x, const AmiVector &dx) override; }; } // namespace amici diff --git a/deps/AMICI/include/amici/newton_solver.h b/deps/AMICI/include/amici/newton_solver.h index 7ce6a2a73..73a924a97 100644 --- a/deps/AMICI/include/amici/newton_solver.h +++ b/deps/AMICI/include/amici/newton_solver.h @@ -60,14 +60,14 @@ class NewtonSolver { * @param sx pointer to state variable sensitivities */ void computeNewtonSensis(AmiVectorArray &sx); - + /** * @brief Accessor for numlinsteps * * @return numlinsteps */ const std::vector &getNumLinSteps() const { - return numlinsteps; + return num_lin_steps_; } /** @@ -102,35 +102,35 @@ class NewtonSolver { /** maximum number of allowed linear steps per Newton step for steady state * computation */ - int maxlinsteps = 0; + int max_lin_steps_ {0}; /** maximum number of allowed Newton steps for steady state computation */ - int maxsteps = 0; + int max_steps {0}; /** absolute tolerance */ - double atol = 1e-16; + realtype atol_ {1e-16}; /** relative tolerance */ - double rtol = 1e-8; + realtype rtol_ {1e-8}; /** damping factor flag */ - NewtonDampingFactorMode dampingFactorMode = NewtonDampingFactorMode::on; + NewtonDampingFactorMode damping_factor_mode_ {NewtonDampingFactorMode::on}; /** damping factor lower bound */ - double dampingFactorLowerBound = 1e-8; + realtype damping_factor_lower_bound {1e-8}; protected: /** time variable */ - realtype *t; + realtype *t_; /** pointer to the model object */ - Model *model; + Model *model_; /** right hand side AmiVector */ - AmiVector xdot; + AmiVector xdot_; /** current state */ - AmiVector *x; + AmiVector *x_; /** current state time derivative (DAE) */ - AmiVector dx; + AmiVector dx_; /** history of number of linear steps */ - std::vector numlinsteps; + std::vector num_lin_steps_; /** current adjoint state */ - AmiVector xB; + AmiVector xB_; /** current adjoint state time derivative (DAE) */ - AmiVector dxB; + AmiVector dxB_; }; /** @@ -151,6 +151,9 @@ class NewtonSolverDense : public NewtonSolver { */ NewtonSolverDense(realtype *t, AmiVector *x, Model *model); + + NewtonSolverDense(const NewtonSolverDense&) = delete; + ~NewtonSolverDense() override; /** @@ -183,10 +186,10 @@ class NewtonSolverDense : public NewtonSolver { private: /** temporary storage of Jacobian */ - SUNMatrixWrapper Jtmp; + SUNMatrixWrapper Jtmp_; /** dense linear solver */ - SUNLinearSolver linsol = nullptr; + SUNLinearSolver linsol_ {nullptr}; }; /** @@ -206,6 +209,9 @@ class NewtonSolverSparse : public NewtonSolver { * @param model pointer to the model object */ NewtonSolverSparse(realtype *t, AmiVector *x, Model *model); + + NewtonSolverSparse(const NewtonSolverSparse&) = delete; + ~NewtonSolverSparse() override; /** @@ -238,10 +244,10 @@ class NewtonSolverSparse : public NewtonSolver { private: /** temporary storage of Jacobian */ - SUNMatrixWrapper Jtmp; + SUNMatrixWrapper Jtmp_; /** sparse linear solver */ - SUNLinearSolver linsol = nullptr; + SUNLinearSolver linsol_ {nullptr}; }; /** @@ -259,6 +265,7 @@ class NewtonSolverIterative : public NewtonSolver { * @param model pointer to the model object */ NewtonSolverIterative(realtype *t, AmiVector *x, Model *model); + ~NewtonSolverIterative() override = default; /** @@ -306,31 +313,31 @@ class NewtonSolverIterative : public NewtonSolver { private: /** number of tries */ - int newton_try = 0; + int newton_try_ {0}; /** number of iterations */ - int i_newton = 0; + int i_newton_ {0}; /** ??? */ - AmiVector ns_p; + AmiVector ns_p_; /** ??? */ - AmiVector ns_h; + AmiVector ns_h_; /** ??? */ - AmiVector ns_t; + AmiVector ns_t_; /** ??? */ - AmiVector ns_s; + AmiVector ns_s_; /** ??? */ - AmiVector ns_r; + AmiVector ns_r_; /** ??? */ - AmiVector ns_rt; + AmiVector ns_rt_; /** ??? */ - AmiVector ns_v; + AmiVector ns_v_; /** ??? */ - AmiVector ns_Jv; + AmiVector ns_Jv_; /** ??? */ - AmiVector ns_tmp; + AmiVector ns_tmp_; /** ??? */ - AmiVector ns_Jdiag; + AmiVector ns_Jdiag_; /** temporary storage of Jacobian */ - SUNMatrixWrapper ns_J; + SUNMatrixWrapper ns_J_; }; diff --git a/deps/AMICI/include/amici/rdata.h b/deps/AMICI/include/amici/rdata.h index 414db1029..06e3eacc2 100644 --- a/deps/AMICI/include/amici/rdata.h +++ b/deps/AMICI/include/amici/rdata.h @@ -21,7 +21,7 @@ class SteadystateProblem; namespace boost { namespace serialization { template -void serialize(Archive &ar, amici::ReturnData &u, unsigned int version); +void serialize(Archive &ar, amici::ReturnData &r, unsigned int version); } } // namespace boost @@ -89,8 +89,7 @@ class ReturnData { * appropriately initialize fields * @param preeq simulated preequilibration problem, pass nullptr to ignore * @param fwd simulated forward problem, pass nullptr to ignore - * @param bwd simulat - * ed backward problem, pass nullptr to ignore + * @param bwd simulated backward problem, pass nullptr to ignore * @param posteq simulated postequilibration problem, pass nullptr to ignore * @param model matching model instance * @param solver matching solver instance @@ -204,13 +203,13 @@ class ReturnData { /** number of right hand side evaluations forward problem (dimension: nt) */ std::vector numrhsevals; - /** number of right hand side evaluations backwad problem (dimension: nt) */ + /** number of right hand side evaluations backward problem (dimension: nt) */ std::vector numrhsevalsB; /** number of error test failures forward problem (dimension: nt) */ std::vector numerrtestfails; - /** number of error test failures backwad problem (dimension: nt) */ + /** number of error test failures backward problem (dimension: nt) */ std::vector numerrtestfailsB; /** @@ -219,7 +218,7 @@ class ReturnData { std::vector numnonlinsolvconvfails; /** - * number of linear solver convergence failures backwad problem (dimension: + * number of linear solver convergence failures backward problem (dimension: * nt) */ std::vector numnonlinsolvconvfailsB; @@ -360,7 +359,7 @@ class ReturnData { /** number of states in the unaugmented system */ int nxtrue{0}; - /** number of solver states to be reinitilized after preequilibration */ + /** number of solver states to be reinitialized after preequilibration */ int nx_solver_reinit{0}; /** number of observables */ @@ -384,7 +383,7 @@ class ReturnData { /** number of parameter for which sensitivities were requested */ int nplist{0}; - /** maximal number of occuring events (for every event type) */ + /** maximal number of occurring events (for every event type) */ int nmaxevent{0}; /** number of considered timepoints */ @@ -424,28 +423,28 @@ class ReturnData { protected: /** timepoint for model evaluation*/ - realtype t; + realtype t_; /** partial state vector, excluding states eliminated from conservation laws */ - AmiVector x_solver; + AmiVector x_solver_; /** partial time derivative of state vector, excluding states eliminated from conservation laws */ - AmiVector dx_solver; + AmiVector dx_solver_; /** partial sensitivity state vector array, excluding states eliminated from * conservation laws */ - AmiVectorArray sx_solver; + AmiVectorArray sx_solver_; /** full state vector, including states eliminated from conservation laws */ - AmiVector x_rdata; + AmiVector x_rdata_; /** full sensitivity state vector array, including states eliminated from * conservation laws */ - AmiVectorArray sx_rdata; + AmiVectorArray sx_rdata_; /** array of number of found roots for a certain event type * (dimension: ne) */ - std::vector nroots; + std::vector nroots_; /** * @brief initializes storage for likelihood reporting mode @@ -527,14 +526,14 @@ class ReturnData { AmiVector xdot(nx_solver); if (!this->xdot.empty() || !this->J.empty()) - model.fxdot(t, x_solver, dx_solver, xdot); + model.fxdot(t_, x_solver_, dx_solver_, xdot); if (!this->xdot.empty()) writeSlice(xdot, this->xdot); if (!this->J.empty()) { SUNMatrixWrapper J(nx_solver, nx_solver); - model.fJ(t, 0.0, x_solver, dx_solver, xdot, J.get()); + model.fJ(t_, 0.0, x_solver_, dx_solver_, xdot, J.get()); // CVODES uses colmajor, so we need to transform to rowmajor for (int ix = 0; ix < model.nx_solver; ix++) for (int jx = 0; jx < model.nx_solver; jx++) @@ -668,7 +667,7 @@ class ReturnData { AmiVector &xQB) const; /** - * @brief Updates contribution to likelihood for inital state sensitivities + * @brief Updates contribution to likelihood for initial state sensitivities * (llhS0), if no preequilibration was run or if forward sensitivities were used * @param model model that was used for forward/backward simulation * @param llhS0 contribution to likelihood for initial state sensitivities @@ -705,8 +704,8 @@ class ModelContext : public ContextManager { void restore(); private: - Model *model = nullptr; - ModelState original_state; + Model *model_ {nullptr}; + ModelState original_state_; }; diff --git a/deps/AMICI/include/amici/returndata_matlab.h b/deps/AMICI/include/amici/returndata_matlab.h index becf41796..c4944622f 100644 --- a/deps/AMICI/include/amici/returndata_matlab.h +++ b/deps/AMICI/include/amici/returndata_matlab.h @@ -17,15 +17,15 @@ namespace amici { mxArray *getReturnDataMatlabFromAmiciCall(ReturnData const *rdata); /** - * @brief allocates and initialises solution mxArray with the corresponding + * @brief allocates and initializes solution mxArray with the corresponding * fields * @param rdata ReturnDataObject * @return Solution mxArray */ mxArray *initMatlabReturnFields(ReturnData const *rdata); - + /** - * @brief allocates and initialises diagnosis mxArray with the corresponding + * @brief allocates and initializes diagnosis mxArray with the corresponding * fields * @param rdata ReturnDataObject * @return Diagnosis mxArray @@ -33,22 +33,22 @@ mxArray *initMatlabReturnFields(ReturnData const *rdata); mxArray *initMatlabDiagnosisFields(ReturnData const *rdata); /** - * @brief initialise vector and attach to the field + * @brief initialize vector and attach to the field * @param matlabStruct pointer of the field to which the vector will be * attached * @param fieldName Name of the field to which the vector will be attached - * @param fieldData Data wich will be stored in the field + * @param fieldData Data which will be stored in the field */ template void writeMatlabField0(mxArray *matlabStruct, const char *fieldName, T fieldData); - + /** - * @brief initialise vector and attach to the field + * @brief initialize vector and attach to the field * @param matlabStruct pointer of the field to which the vector will be * attached * @param fieldName Name of the field to which the vector will be attached - * @param fieldData Data wich will be stored in the field + * @param fieldData Data which will be stored in the field * @param dim0 Number of elements in the vector */ template @@ -56,10 +56,10 @@ void writeMatlabField1(mxArray *matlabStruct, const char *fieldName, std::vector const &fieldData, const int dim0); /** - * @brief initialise matrix, attach to the field and write data + * @brief initialize matrix, attach to the field and write data * @param matlabStruct Pointer to the matlab structure * @param fieldName Name of the field to which the tensor will be attached - * @param fieldData Data wich will be stored in the field + * @param fieldData Data which will be stored in the field * @param dim0 Number of rows in the tensor * @param dim1 Number of columns in the tensor * @param perm reordering of dimensions (i.e., transposition) @@ -68,12 +68,12 @@ template void writeMatlabField2(mxArray *matlabStruct, const char *fieldName, std::vector const &fieldData, int dim0, int dim1, std::vector perm); - + /** - * @brief initialise 3D tensor, attach to the field and write data + * @brief initialize 3D tensor, attach to the field and write data * @param matlabStruct Pointer to the matlab structure * @param fieldName Name of the field to which the tensor will be attached - * @param fieldData Data wich will be stored in the field + * @param fieldData Data which will be stored in the field * @param dim0 number of rows in the tensor * @param dim1 number of columns in the tensor * @param dim2 number of elements in the third dimension of the tensor @@ -85,10 +85,10 @@ void writeMatlabField3(mxArray *matlabStruct, const char *fieldName, int dim2, std::vector perm); /** - * @brief initialise 4D tensor, attach to the field and write data + * @brief initialize 4D tensor, attach to the field and write data * @param matlabStruct Pointer to the matlab structure * @param fieldName Name of the field to which the tensor will be attached - * @param fieldData Data wich will be stored in the field + * @param fieldData Data which will be stored in the field * @param dim0 number of rows in the tensor * @param dim1 number of columns in the tensor * @param dim2 number of elements in the third dimension of the tensor @@ -101,7 +101,7 @@ void writeMatlabField4(mxArray *matlabStruct, const char *fieldName, int dim2, int dim3, std::vector perm); /** - * @brief initialises the field fieldName in matlabStruct with dimension dim + * @brief initializes the field fieldName in matlabStruct with dimension dim * @param matlabStruct Pointer to the matlab structure * @param fieldName Name of the field to which the tensor will be attached * @param dim vector of field dimensions diff --git a/deps/AMICI/include/amici/serialization.h b/deps/AMICI/include/amici/serialization.h index 02e270aa9..c055c18c3 100644 --- a/deps/AMICI/include/amici/serialization.h +++ b/deps/AMICI/include/amici/serialization.h @@ -19,10 +19,17 @@ #include #include -/* Helper functions and forward declarations for boost::serialization */ +/** @file serialization.h Helper functions and forward declarations for + * boost::serialization */ namespace boost { namespace serialization { +/** + * @brief Serialize a raw array to a boost archive + * @param ar archive + * @param p Pointer to array + * @param size Size of p + */ template void archiveVector(Archive &ar, T **p, int size) { if (Archive::is_loading::value) { @@ -37,91 +44,106 @@ void archiveVector(Archive &ar, T **p, int size) { ar &make_array(*p, size); } +#ifndef EXHALE_DOXYGEN_SHOULD_SKIP_THIS +/** + * @brief Serialize amici::Solver to boost archive + * @param ar Archive + * @param s Solver instance to serialize + */ template -void serialize(Archive &ar, amici::Solver &u, const unsigned int version) { - ar &u.sensi; - ar &u.atol; - ar &u.rtol; - ar &u.atolB; - ar &u.rtolB; - ar &u.atol_fsa; - ar &u.rtol_fsa; - ar &u.quad_atol; - ar &u.quad_rtol; - ar &u.ss_atol; - ar &u.ss_rtol; - ar &u.ss_atol_sensi; - ar &u.ss_rtol_sensi; - ar &u.maxsteps; - ar &u.maxstepsB; - ar &u.requires_preequilibration; - ar &u.newton_maxsteps; - ar &u.newton_maxlinsteps; - ar &u.newton_damping_factor_mode; - ar &u.newton_damping_factor_lower_bound; - ar &u.ism; - ar &u.sensi_meth; - ar &u.linsol; - ar &u.interpType; - ar &u.lmm; - ar &u.iter; - ar &u.stldet; - ar &u.ordering; - ar &u.cpu_time; - ar &u.cpu_timeB; - ar &u.rdata_mode; +void serialize(Archive &ar, amici::Solver &s, const unsigned int /*version*/) { + ar &s.sensi_; + ar &s.atol_; + ar &s.rtol_; + ar &s.atolB_; + ar &s.rtolB_; + ar &s.atol_fsa_; + ar &s.rtol_fsa_; + ar &s.quad_atol_; + ar &s.quad_rtol_; + ar &s.ss_atol_; + ar &s.ss_rtol_; + ar &s.ss_atol_sensi_; + ar &s.ss_rtol_sensi_; + ar &s.maxsteps_; + ar &s.maxstepsB_; + ar &s.requires_preequilibration_; + ar &s.newton_maxsteps_; + ar &s.newton_maxlinsteps_; + ar &s.newton_damping_factor_mode_; + ar &s.newton_damping_factor_lower_bound_; + ar &s.ism_; + ar &s.sensi_meth_; + ar &s.linsol_; + ar &s.interp_type_; + ar &s.lmm_; + ar &s.iter_; + ar &s.stldet_; + ar &s.ordering_; + ar &s.cpu_time_; + ar &s.cpu_timeB_; + ar &s.rdata_mode_; } - +/** + * @brief Serialize amici::CVodeSolver to boost archive + * @param ar Archive + * @param s Solver instance to serialize + */ template -void serialize(Archive &ar, amici::CVodeSolver &u, const unsigned int version) { - ar & static_cast(u); +void serialize(Archive &ar, amici::CVodeSolver &s, const unsigned int /*version*/) { + ar & static_cast(s); } +/** + * @brief Serialize amici::Model to boost archive + * @param ar Archive + * @param m Model instance to serialize + */ template -void serialize(Archive &ar, amici::Model &u, const unsigned int version) { - ar &u.nx_rdata; - ar &u.nxtrue_rdata; - ar &u.nx_solver; - ar &u.nxtrue_solver; - ar &u.nx_solver_reinit; - ar &u.ny; - ar &u.nytrue; - ar &u.nz; - ar &u.nztrue; - ar &u.ne; - ar &u.nw; - ar &u.ndwdx; - ar &u.ndwdp; - ar &u.ndxdotdw; - ar &u.nnz; - ar &u.nJ; - ar &u.ubw; - ar &u.lbw; - ar &u.o2mode; - ar &u.z2event; - ar &u.idlist; - ar &u.state.h; - ar &u.state.unscaledParameters; - ar &u.originalParameters; - ar &u.state.fixedParameters; - ar &u.reinitializeFixedParameterInitialStates; - ar &u.state.plist; - ar &u.x0data; - ar &u.sx0data; - ar &u.ts; - ar &u.nmaxevent; - ar &u.pscale; - ar &u.tstart; - ar &u.stateIsNonNegative; - ar &u.pythonGenerated; - ar &u.ndxdotdp_explicit; - ar &u.ndxdotdp_implicit; +void serialize(Archive &ar, amici::Model &m, const unsigned int /*version*/) { + ar &m.nx_rdata; + ar &m.nxtrue_rdata; + ar &m.nx_solver; + ar &m.nxtrue_solver; + ar &m.nx_solver_reinit; + ar &m.ny; + ar &m.nytrue; + ar &m.nz; + ar &m.nztrue; + ar &m.ne; + ar &m.nw; + ar &m.nnz; + ar &m.nJ; + ar &m.ubw; + ar &m.lbw; + ar &m.o2mode; + ar &m.z2event_; + ar &m.idlist; + ar &m.state_.h; + ar &m.state_.unscaledParameters; + ar &m.original_parameters_; + ar &m.state_.fixedParameters; + ar &m.reinitialize_fixed_parameter_initial_states_; + ar &m.state_.plist; + ar &m.x0data_; + ar &m.sx0data_; + ar &m.ts_; + ar &m.nmaxevent_; + ar &m.pscale_; + ar &m.tstart_; + ar &m.state_is_non_negative_; + ar &m.pythonGenerated; } +/** + * @brief Serialize amici::ReturnData to boost archive + * @param ar Archive + * @param r ReturnData instance to serialize + */ template -void serialize(Archive &ar, amici::ReturnData &r, const unsigned int version) { +void serialize(Archive &ar, amici::ReturnData &r, const unsigned int /*version*/) { ar &r.np; ar &r.nk; ar &r.nx; @@ -190,22 +212,23 @@ void serialize(Archive &ar, amici::ReturnData &r, const unsigned int version) { ar &r.status; } - +#endif } // namespace serialization } // namespace boost namespace amici { +/** + * @brief Serialize object to char array + * + * @param data input object + * @param size maximum char length + * + * @return The object serialized as char + */ template char *serializeToChar(T const& data, int *size) { - /** - * @brief Serialize object to char array - * - * @param data input object - * @param size maximum char length - * - * @return The object serialized as char - */ + try { std::string serialized; ::boost::iostreams::back_insert_device inserter(serialized); @@ -228,17 +251,17 @@ char *serializeToChar(T const& data, int *size) { } +/** + * @brief Deserialize object that has been serialized using serializeToChar + * + * @param buffer serialized object + * @param size length of buffer + * + * @return The deserialized object + */ template T deserializeFromChar(const char *buffer, int size) { - /** - * @brief Deserialize object that has been serialized using serializeToChar - * - * @param buffer serialized object - * @param size length of buffer - * - * @return The deserialized object - */ try { ::boost::iostreams::basic_array_source device(buffer, size); ::boost::iostreams::stream<::boost::iostreams::basic_array_source> s( @@ -253,16 +276,16 @@ T deserializeFromChar(const char *buffer, int size) { } } +/** + * @brief Serialize object to string + * + * @param data input object + * + * @return The object serialized as string + */ template std::string serializeToString(T const& data) { - /** - * @brief Serialize object to string - * - * @param data input object - * - * @return The object serialized as string - */ try { std::string serialized; ::boost::iostreams::back_insert_device inserter(serialized); @@ -280,15 +303,16 @@ std::string serializeToString(T const& data) { } } +/** + * @brief Serialize object to std::vector + * + * @param data input object + * + * @return The object serialized as std::vector + */ + template std::vector serializeToStdVec(T const& data) { - /** - * @brief Serialize object to std::vector - * - * @param data input object - * - * @return The object serialized as std::vector - */ try{ std::string serialized; ::boost::iostreams::back_insert_device inserter(serialized); @@ -307,15 +331,16 @@ std::vector serializeToStdVec(T const& data) { } } +/** + * @brief Deserialize object that has been serialized using serializeToString + * + * @param serialized serialized object + * + * @return The deserialized object + */ + template T deserializeFromString(std::string const& serialized) { - /** - * @brief Deserialize object that has been serialized using serializeToString - * - * @param serialized serialized object - * - * @return The deserialized object - */ try{ ::boost::iostreams::basic_array_source device(serialized.data(), serialized.size()); diff --git a/deps/AMICI/include/amici/solver.h b/deps/AMICI/include/amici/solver.h index 8f7c12958..b679abcf7 100644 --- a/deps/AMICI/include/amici/solver.h +++ b/deps/AMICI/include/amici/solver.h @@ -27,7 +27,7 @@ extern AmiciApplication defaultContext; namespace boost { namespace serialization { template -void serialize(Archive &ar, amici::Solver &u, unsigned int version); +void serialize(Archive &ar, amici::Solver &s, unsigned int version); } } // namespace boost::serialization @@ -72,7 +72,7 @@ class Solver { /** * @brief runs a forward simulation until the specified timepoint * - * @param tout next timepooint + * @param tout next timepoint * @return status flag */ int run(realtype tout) const; @@ -80,7 +80,7 @@ class Solver { /** * @brief makes a single step in the simulation * - * @param tout next timepooint + * @param tout next timepoint * @return status flag */ int step(realtype tout) const; @@ -88,12 +88,12 @@ class Solver { /** * @brief runs a backward simulation until the specified timepoint * - * @param tout next timepooint + * @param tout next timepoint */ void runB(realtype tout) const; /** - * @brief Initialises the ami memory object and applies specified options + * @brief Initializes the ami memory object and applies specified options * @param t0 initial timepoint * @param model pointer to the model instance * @param x0 initial states @@ -107,7 +107,7 @@ class Solver { const AmiVectorArray &sdx0) const; /** - * @brief Initialises the AMI memory object for the backwards problem + * @brief Initializes the AMI memory object for the backwards problem * @param which index of the backward problem, will be set by this routine * @param tf final timepoint (initial timepoint for the bwd problem) * @param model pointer to the model instance @@ -120,7 +120,7 @@ class Solver { const AmiVector &dxB0, const AmiVector &xQB0) const; /** - * @brief Initialises the ami memory for quadrature computation + * @brief Initializes the ami memory for quadrature computation * @param t0 initial timepoint * @param model pointer to the model instance * @param x0 initial states @@ -143,10 +143,10 @@ class Solver { void updateAndReinitStatesAndSensitivities(Model *model); /** - * getRootInfo extracts information which event occured + * getRootInfo extracts information which event occurred * * @param rootsfound array with flags indicating whether the respective - * event occured + * event occurred */ virtual void getRootInfo(int *rootsfound) const = 0; @@ -275,13 +275,13 @@ class Solver { void setNewtonDampingFactorLowerBound(double dampingFactorLowerBound); /** - * @brief Get sensitvity order + * @brief Get sensitivity order * @return sensitivity order */ SensitivityOrder getSensitivityOrder() const; /** - * @brief Set the sensitvity order + * @brief Set the sensitivity order * @param sensi sensitivity order */ void setSensitivityOrder(SensitivityOrder sensi); @@ -464,7 +464,7 @@ class Solver { /** * @brief sets the maximum number of solver steps for the forward problem - * @param maxsteps maximum number of solver steps (non-negative number) + * @param maxsteps maximum number of solver steps (positive number) */ void setMaxSteps(long int maxsteps); @@ -477,7 +477,11 @@ class Solver { /** * @brief sets the maximum number of solver steps for the backward problem + * * @param maxsteps maximum number of solver steps (non-negative number) + * + * @note default behaviour (100 times the value for the forward problem) can + * be restored by passing maxsteps=0 */ void setMaxStepsBackwardProblem(long int maxsteps); @@ -539,15 +543,15 @@ class Solver { /** * @brief returns stability limit detection mode - * @return stldet can be amici.FALSE (deactivated) or amici.TRUE (activated) + * @return stldet can be false (deactivated) or true (activated) */ - booleantype getStabilityLimitFlag() const; + bool getStabilityLimitFlag() const; /** * @brief set stability limit detection mode - * @param stldet can be amici.FALSE (deactivated) or amici.TRUE (activated) + * @param stldet can be false (deactivated) or true (activated) */ - void setStabilityLimitFlag(booleantype stldet); + void setStabilityLimitFlag(bool stldet); /** * @brief getLinearSolver @@ -660,18 +664,18 @@ class Solver { const AmiVector &getQuadrature(realtype t) const; /** - * @brief Reinitializes the states in the solver after an event occurence + * @brief Reinitializes the states in the solver after an event occurrence * * @param t0 reinitialization timepoint - * @param yy0 inital state variables + * @param yy0 initial state variables * @param yp0 initial derivative state variables (DAE only) */ virtual void reInit(realtype t0, const AmiVector &yy0, const AmiVector &yp0) const = 0; /** - * @brief Reinitializes the state sensitivites in the solver after an - * event occurence + * @brief Reinitializes the state sensitivities in the solver after an + * event occurrence * * @param yyS0 new state sensitivity * @param ypS0 new derivative state sensitivities (DAE only) @@ -680,13 +684,13 @@ class Solver { const AmiVectorArray &ypS0) const = 0; /** - * @brief Switches off computation of state sensitivites without + * @brief Switches off computation of state sensitivities without * deallocating the memory for sensitivities */ virtual void sensToggleOff() const = 0; /** - * @brief Reinitializes the adjoint states after an event occurence + * @brief Reinitializes the adjoint states after an event occurrence * * @param which identifier of the backwards problem * @param tB0 reinitialization timepoint @@ -697,7 +701,7 @@ class Solver { const AmiVector &ypB0) const = 0; /** - * @brief Reinitialize the adjoint states after an event occurence + * @brief Reinitialize the adjoint states after an event occurrence * * @param which identifier of the backwards problem * @param yQB0 new adjoint quadrature state @@ -711,13 +715,13 @@ class Solver { realtype gett() const; /** - * @brief Reads out the cpu time needed for forward solve + * @brief Reads out the CPU time needed for forward solve * @return cpu_time */ realtype getCpuTime() const; /** - * @brief Reads out the cpu time needed for bavkward solve + * @brief Reads out the CPU time needed for backward solve * @return cpu_timeB */ realtype getCpuTimeB() const; @@ -780,7 +784,7 @@ class Solver { * @return ns */ std::vector const& getNumSteps() const { - return ns; + return ns_; } /** @@ -788,7 +792,7 @@ class Solver { * @return nsB */ std::vector const& getNumStepsB() const { - return nsB; + return nsB_; } /** @@ -796,7 +800,7 @@ class Solver { * @return nrhs */ std::vector const& getNumRhsEvals() const { - return nrhs; + return nrhs_; } /** @@ -804,7 +808,7 @@ class Solver { * @return nrhsB */ std::vector const& getNumRhsEvalsB() const { - return nrhsB; + return nrhsB_; } /** @@ -812,7 +816,7 @@ class Solver { * @return netf */ std::vector const& getNumErrTestFails() const { - return netf; + return netf_; } /** @@ -820,7 +824,7 @@ class Solver { * @return netfB */ std::vector const& getNumErrTestFailsB() const { - return netfB; + return netfB_; } /** @@ -828,7 +832,7 @@ class Solver { * @return nnlscf */ std::vector const& getNumNonlinSolvConvFails() const { - return nnlscf; + return nnlscf_; } /** @@ -836,7 +840,7 @@ class Solver { * @return nnlscfB */ std::vector const& getNumNonlinSolvConvFailsB() const { - return nnlscfB; + return nnlscfB_; } /** @@ -844,17 +848,17 @@ class Solver { * @return order */ std::vector const& getLastOrder() const { - return order; + return order_; } /** * @brief Serialize Solver (see boost::serialization::serialize) * @param ar Archive to serialize to - * @param r Data to serialize + * @param s Data to serialize * @param version Version number */ template - friend void boost::serialization::serialize(Archive &ar, Solver &r, + friend void boost::serialization::serialize(Archive &ar, Solver &s, unsigned int version); /** @@ -940,7 +944,7 @@ class Solver { virtual void getQuad(realtype &t) const = 0; /** - * @brief Initialises the states at the specified initial timepoint + * @brief Initializes the states at the specified initial timepoint * * @param t0 initial timepoint * @param x0 initial states @@ -950,7 +954,7 @@ class Solver { const AmiVector &dx0) const = 0; /** - * @brief Initialises the states at the specified initial timepoint + * @brief Initializes the states at the specified initial timepoint * * @param t0 initial timepoint * @param x0 initial states @@ -960,15 +964,15 @@ class Solver { const AmiVector &dx0) const = 0; /** - * @brief initialises the forward sensitivities - * @param sx0 initial states semsitivities + * @brief Initializes the forward sensitivities + * @param sx0 initial states sensitivities * @param sdx0 initial derivative states sensitivities */ virtual void sensInit1(const AmiVectorArray &sx0, const AmiVectorArray &sdx0) const = 0; /** - * @brief Initialise the adjoint states at the specified final timepoint + * @brief Initialize the adjoint states at the specified final timepoint * * @param which identifier of the backwards problem * @param tf final timepoint @@ -979,15 +983,15 @@ class Solver { const AmiVector &dxB0) const = 0; /** - * @brief Initialise the quadrature states at the specified final timepoint + * @brief Initialize the quadrature states at the specified final timepoint * * @param which identifier of the backwards problem - * @param xQB0 intial adjoint quadrature state + * @param xQB0 initial adjoint quadrature state */ virtual void qbinit(int which, const AmiVector &xQB0) const = 0; /** - * @brief Initialises the rootfinding for events + * @brief Initializes the rootfinding for events * * @param ne number of different events */ @@ -1072,7 +1076,7 @@ class Solver { * sensitivity variables * * @param rtol relative tolerances - * @param atol array of absolute tolerances for every sensitivy variable + * @param atol array of absolute tolerances for every sensitivity variable */ virtual void setSensSStolerances(double rtol, const double *atol) const = 0; @@ -1130,6 +1134,7 @@ class Solver { * problem * * @param mxsteps number of steps + * @note in contrast to the SUNDIALS method, this sets the overall maximum, not the maximum between output times. */ virtual void setMaxNumSteps(long int mxsteps) const = 0; @@ -1139,6 +1144,7 @@ class Solver { * * @param which identifier of the backwards problem * @param mxstepsB number of steps + * @note in contrast to the SUNDIALS method, this sets the overall maximum, not the maximum between output times. */ virtual void setMaxNumStepsB(int which, long int mxstepsB) const = 0; @@ -1179,7 +1185,7 @@ class Solver { * @brief specifies the scaling and indexes for sensitivity * computation * - * @param p paramaters + * @param p parameters * @param pbar parameter scaling constants * @param plist parameter index list */ @@ -1452,7 +1458,7 @@ class Solver { * @param nx new number of state variables * @param nplist new number of sensitivity parameters * @param nquad new number of quadratures (only differs from nplist for - * higher order senisitivity computation) + * higher order sensitivity computation) */ void resetMutableMemory(int nx, int nplist, int nquad) const; @@ -1501,59 +1507,59 @@ class Solver { void applyQuadTolerances() const; /** - * @brief updates all senstivivity solver tolerances according to the + * @brief updates all sensitivity solver tolerances according to the * currently specified member variables */ void applySensitivityTolerances() const; /** pointer to solver memory block */ - mutable std::unique_ptr> solverMemory; + mutable std::unique_ptr> solver_memory_; /** pointer to solver memory block */ mutable std::vector>> - solverMemoryB; + solver_memory_B_; /** internal sensitivity method flag used to select the sensitivity solution * method. Only applies for Forward Sensitivities. */ - InternalSensitivityMethod ism = InternalSensitivityMethod::simultaneous; + InternalSensitivityMethod ism_ {InternalSensitivityMethod::simultaneous}; /** specifies the linear multistep method. */ - LinearMultistepMethod lmm = LinearMultistepMethod::BDF; + LinearMultistepMethod lmm_ {LinearMultistepMethod::BDF}; /** * specifies the type of nonlinear solver iteration */ - NonlinearSolverIteration iter = NonlinearSolverIteration::newton; + NonlinearSolverIteration iter_ {NonlinearSolverIteration::newton}; /** interpolation type for the forward problem solution which * is then used for the backwards problem. */ - InterpolationType interpType = InterpolationType::hermite; + InterpolationType interp_type_ {InterpolationType::hermite}; /** maximum number of allowed integration steps */ - long int maxsteps = 10000; + long int maxsteps_ {10000}; /** linear solver for the forward problem */ - mutable std::unique_ptr linearSolver; + mutable std::unique_ptr linear_solver_; /** linear solver for the backward problem */ - mutable std::unique_ptr linearSolverB; + mutable std::unique_ptr linear_solver_B_; /** non-linear solver for the forward problem */ - mutable std::unique_ptr nonLinearSolver; + mutable std::unique_ptr non_linear_solver_; /** non-linear solver for the backward problem */ - mutable std::unique_ptr nonLinearSolverB; + mutable std::unique_ptr non_linear_solver_B_; /** non-linear solver for the sensitivities */ - mutable std::unique_ptr nonLinearSolverSens; + mutable std::unique_ptr non_linear_solver_sens_; /** flag indicating whether the forward solver has been called */ - mutable bool solverWasCalledF = false; + mutable bool solver_was_called_F_ {false}; /** flag indicating whether the backward solver has been called */ - mutable bool solverWasCalledB = false; + mutable bool solver_was_called_B_ {false}; /** * @brief sets that memory for the forward problem has been allocated @@ -1601,178 +1607,190 @@ class Solver { bool preequilibration) const; /** state (dimension: nx_solver) */ - mutable AmiVector x = AmiVector(0); + mutable AmiVector x_ {0}; /** state interface variable (dimension: nx_solver) */ - mutable AmiVector dky = AmiVector(0); + mutable AmiVector dky_ {0}; /** state derivative dummy (dimension: nx_solver) */ - mutable AmiVector dx = AmiVector(0); + mutable AmiVector dx_ {0}; - /** state sensititivities interface variable (dimension: nx_solver x nplist) + /** state sensitivities interface variable (dimension: nx_solver x nplist) */ - mutable AmiVectorArray sx = AmiVectorArray(0, 0); - /** state derivative sensititivities dummy (dimension: nx_solver x nplist) + mutable AmiVectorArray sx_ {0, 0}; + /** state derivative sensitivities dummy (dimension: nx_solver x nplist) */ - mutable AmiVectorArray sdx = AmiVectorArray(0, 0); + mutable AmiVectorArray sdx_ {0, 0}; /** adjoint state interface variable (dimension: nx_solver) */ - mutable AmiVector xB = AmiVector(0); + mutable AmiVector xB_ {0}; /** adjoint derivative dummy variable (dimension: nx_solver) */ - mutable AmiVector dxB = AmiVector(0); + mutable AmiVector dxB_ {0}; /** adjoint quadrature interface variable (dimension: nJ x nplist) */ - mutable AmiVector xQB = AmiVector(0); + mutable AmiVector xQB_ {0}; /** forward quadrature interface variable (dimension: nx_solver) */ - mutable AmiVector xQ = AmiVector(0); + mutable AmiVector xQ_ {0}; /** integration time of the forward problem */ - mutable realtype t = std::nan(""); + mutable realtype t_ {std::nan("")}; /** flag to force reInitPostProcessF before next call to solve */ - mutable bool forceReInitPostProcessF = false; + mutable bool force_reinit_postprocess_F_ {false}; /** flag to force reInitPostProcessB before next call to solveB */ - mutable bool forceReInitPostProcessB = false; + mutable bool force_reinit_postprocess_B_ {false}; private: + + /** + * @brief applies total number of steps for next solver call + */ + void apply_max_num_steps() const; + + /** + * @brief applies total number of steps for next backwards solver call + */ + void apply_max_num_steps_B() const; + + /** method for sensitivity computation */ - SensitivityMethod sensi_meth = SensitivityMethod::forward; + SensitivityMethod sensi_meth_ {SensitivityMethod::forward}; /** method for sensitivity computation in preequilibration */ - SensitivityMethod sensi_meth_preeq = SensitivityMethod::forward; + SensitivityMethod sensi_meth_preeq_ {SensitivityMethod::forward}; /** flag controlling stability limit detection */ - booleantype stldet = true; + booleantype stldet_ {true}; /** state ordering */ - int ordering = static_cast(SUNLinSolKLU::StateOrdering::AMD); + int ordering_ {static_cast(SUNLinSolKLU::StateOrdering::AMD)}; /** maximum number of allowed Newton steps for steady state computation */ - long int newton_maxsteps = 0; + long int newton_maxsteps_ {0L}; /** maximum number of allowed linear steps per Newton step for steady state * computation */ - long int newton_maxlinsteps = 0; + long int newton_maxlinsteps_ {0L}; /** Damping factor state used int the Newton method */ - NewtonDampingFactorMode newton_damping_factor_mode = - NewtonDampingFactorMode::on; + NewtonDampingFactorMode newton_damping_factor_mode_ + {NewtonDampingFactorMode::on}; /** Lower bound of the damping factor. */ - double newton_damping_factor_lower_bound = 1e-8; + realtype newton_damping_factor_lower_bound_ {1e-8}; /** Enable model preequilibration */ - bool requires_preequilibration = false; + bool requires_preequilibration_ {false}; /** linear solver specification */ - LinearSolver linsol = LinearSolver::KLU; + LinearSolver linsol_ {LinearSolver::KLU}; /** absolute tolerances for integration */ - realtype atol = 1e-16; + realtype atol_ {1e-16}; /** relative tolerances for integration */ - realtype rtol = 1e-8; + realtype rtol_ {1e-8}; /** absolute tolerances for forward sensitivity integration */ - realtype atol_fsa = NAN; + realtype atol_fsa_ {NAN}; /** relative tolerances for forward sensitivity integration */ - realtype rtol_fsa = NAN; + realtype rtol_fsa_ {NAN}; /** absolute tolerances for adjoint sensitivity integration */ - realtype atolB = NAN; + realtype atolB_ {NAN}; /** relative tolerances for adjoint sensitivity integration */ - realtype rtolB = NAN; + realtype rtolB_ {NAN}; /** absolute tolerances for backward quadratures */ - realtype quad_atol = 1e-12; + realtype quad_atol_ {1e-12}; /** relative tolerances for backward quadratures */ - realtype quad_rtol = 1e-8; + realtype quad_rtol_ {1e-8}; /** absolute tolerances for steadystate computation */ - realtype ss_atol = NAN; + realtype ss_atol_ {NAN}; /** relative tolerances for steadystate computation */ - realtype ss_rtol = NAN; + realtype ss_rtol_ {NAN}; /** absolute tolerances for steadystate computation */ - realtype ss_atol_sensi = NAN; + realtype ss_atol_sensi_ {NAN}; /** relative tolerances for steadystate computation */ - realtype ss_rtol_sensi = NAN; + realtype ss_rtol_sensi_ {NAN}; - RDataReporting rdata_mode = RDataReporting::full; + RDataReporting rdata_mode_ {RDataReporting::full}; /** CPU time, forward solve */ - mutable realtype cpu_time = 0.0; + mutable realtype cpu_time_ {0.0}; /** CPU time, backward solve */ - mutable realtype cpu_timeB = 0.0; + mutable realtype cpu_timeB_ {0.0}; /** maximum number of allowed integration steps for backward problem */ - long int maxstepsB = 0; + long int maxstepsB_ {0L}; /** flag indicating whether sensitivities are supposed to be computed */ - SensitivityOrder sensi = SensitivityOrder::none; + SensitivityOrder sensi_ {SensitivityOrder::none}; /** flag indicating whether init was called */ - mutable bool initialized = false; + mutable bool initialized_ {false}; /** flag indicating whether sensInit1 was called */ - mutable bool sensInitialized = false; + mutable bool sens_initialized_ {false}; /** flag indicating whether adjInit was called */ - mutable bool adjInitialized = false; + mutable bool adj_initialized_ {false}; /** flag indicating whether (forward) quadInit was called */ - mutable bool quadInitialized = false; + mutable bool quad_initialized_ {false}; /** vector of flags indicating whether binit was called for respective which */ - mutable std::vector initializedB{false}; + mutable std::vector initializedB_{false}; /** vector of flags indicating whether qbinit was called for respective which */ - mutable std::vector initializedQB{false}; + mutable std::vector initializedQB_{false}; /** number of checkpoints in the forward problem */ - mutable int ncheckPtr = 0; + mutable int ncheckPtr_ {0}; /** number of integration steps forward problem (dimension: nt) */ - mutable std::vector ns; + mutable std::vector ns_; /** number of integration steps backward problem (dimension: nt) */ - mutable std::vector nsB; + mutable std::vector nsB_; /** number of right hand side evaluations forward problem (dimension: nt) */ - mutable std::vector nrhs; + mutable std::vector nrhs_; /** number of right hand side evaluations backward problem (dimension: nt) */ - mutable std::vector nrhsB; + mutable std::vector nrhsB_; /** number of error test failures forward problem (dimension: nt) */ - mutable std::vector netf; + mutable std::vector netf_; /** number of error test failures backward problem (dimension: nt) */ - mutable std::vector netfB; + mutable std::vector netfB_; /** * number of linear solver convergence failures forward problem (dimension: * nt) */ - mutable std::vector nnlscf; + mutable std::vector nnlscf_; /** * number of linear solver convergence failures backward problem (dimension: * nt) */ - mutable std::vector nnlscfB; + mutable std::vector nnlscfB_; /** employed order forward problem (dimension: nt) */ - mutable std::vector order; + mutable std::vector order_; }; bool operator==(const Solver &a, const Solver &b); @@ -1782,8 +1800,8 @@ bool operator==(const Solver &a, const Solver &b); * passes them to the specified output function * * @param error_code error identifier - * @param module name of the module in which the error occured - * @param function name of the function in which the error occured + * @param module name of the module in which the error occurred + * @param function name of the function in which the error occurred * @param msg error message * @param eh_data amici::Solver as void* */ diff --git a/deps/AMICI/include/amici/solver_cvodes.h b/deps/AMICI/include/amici/solver_cvodes.h index e17be1967..1f4e64d8c 100644 --- a/deps/AMICI/include/amici/solver_cvodes.h +++ b/deps/AMICI/include/amici/solver_cvodes.h @@ -18,14 +18,20 @@ class CVodeSolver; namespace boost { namespace serialization { template -void serialize(Archive &ar, amici::CVodeSolver &u, unsigned int version); +void serialize(Archive &ar, amici::CVodeSolver &s, unsigned int version); } } // namespace boost::serialization namespace amici { +/** + * @brief The CVodeSolver class is a wrapper around the SUNDIALS CVODES solver. + */ + class CVodeSolver : public Solver { public: + using Solver::Solver; + ~CVodeSolver() override = default; /** @@ -71,10 +77,11 @@ class CVodeSolver : public Solver { const Model *getModel() const override; +#if !defined(EXHALE_DOXYGEN_SHOULD_SKIP_THIS) using Solver::setLinearSolver; using Solver::setLinearSolverB; - +#endif void setLinearSolver() const override; void setLinearSolverB(int which) const override; @@ -105,7 +112,14 @@ class CVodeSolver : public Solver { void reInitPostProcessB(realtype tnext) const override; - void reInitPostProcess(void *ami_mem, realtype *t, AmiVector *yout, + /** + * @brief Postprocessing of the solver memory after a discontinuity + * @param cv_mem pointer to CVODES solver memory object + * @param t pointer to integration time + * @param yout new state vector + * @param tout anticipated next integration timepoint. + */ + void reInitPostProcess(void *cv_mem, realtype *t, AmiVector *yout, realtype tout) const; void allocateSolver() const override; @@ -137,6 +151,11 @@ class CVodeSolver : public Solver { void setSuppressAlg(bool flag) const override; + /** + * @brief resetState reset the CVODES solver to restart integration after a rhs discontinuity. + * @param cv_mem pointer to CVODES solver memory object + * @param y0 new state vector + */ void resetState(void *cv_mem, const_N_Vector y0) const; void setSensParams(const realtype *p, const realtype *pbar, @@ -145,7 +164,7 @@ class CVodeSolver : public Solver { void adjInit() const override; void quadInit(const AmiVector &xQ0) const override; - + void allocateSolverB(int *which) const override; void setSStolerancesB(int which, realtype relTolB, @@ -178,10 +197,21 @@ class CVodeSolver : public Solver { void *getAdjBmem(void *ami_mem, int which) const override; + /** + * @brief Serialize amici::CVodeSolver to boost archive + * @param ar Archive + * @param s Solver instance to serialize + */ template - friend void boost::serialization::serialize(Archive &ar, CVodeSolver &r, - unsigned int version); + friend void boost::serialization::serialize(Archive &ar, CVodeSolver &s, + unsigned int /*version*/); + /** + * @brief Equality operator + * @param a + * @param b + * @return Whether a and b are equal + */ friend bool operator==(const CVodeSolver &a, const CVodeSolver &b); void init(realtype t0, const AmiVector &x0, diff --git a/deps/AMICI/include/amici/solver_idas.h b/deps/AMICI/include/amici/solver_idas.h index 0d77708e8..a90a12406 100644 --- a/deps/AMICI/include/amici/solver_idas.h +++ b/deps/AMICI/include/amici/solver_idas.h @@ -16,14 +16,19 @@ class IDASolver; namespace boost { namespace serialization { template -void serialize(Archive &ar, amici::IDASolver &u, unsigned int version); +void serialize(Archive &ar, amici::IDASolver &s, unsigned int version); } } // namespace boost::serialization namespace amici { +/** + * @brief The IDASolver class is a wrapper around the SUNDIALS IDAS solver. + */ class IDASolver : public Solver { public: + using Solver::Solver; + ~IDASolver() override = default; /** @@ -102,7 +107,15 @@ class IDASolver : public Solver { void setNonLinearSolverB(int which) const override; protected: - void reInitPostProcess(void *ami_mem, realtype *t, AmiVector *yout, + /** + * @brief Postprocessing of the solver memory after a discontinuity + * @param ida_mem pointer to IDAS solver memory object + * @param t pointer to integration time + * @param yout new state vector + * @param ypout new state derivative vector + * @param tout anticipated next integration timepoint. + */ + void reInitPostProcess(void *ida_mem, realtype *t, AmiVector *yout, AmiVector *ypout, realtype tout) const; void allocateSolver() const override; @@ -135,6 +148,12 @@ class IDASolver : public Solver { void setSuppressAlg(bool flag) const override; + /** + * @brief resetState reset the IDAS solver to restart integration after a rhs discontinuity. + * @param ida_mem pointer to IDAS solver memory object + * @param yy0 new state vector + * @param yp0 new state derivative vector + */ void resetState(void *ida_mem, const_N_Vector yy0, const_N_Vector yp0) const; diff --git a/deps/AMICI/include/amici/spline.h b/deps/AMICI/include/amici/spline.h index 60614bfe3..bd21b6a4a 100644 --- a/deps/AMICI/include/amici/spline.h +++ b/deps/AMICI/include/amici/spline.h @@ -4,8 +4,10 @@ namespace amici { +#ifndef EXHALE_DOXYGEN_SHOULD_SKIP_THIS int spline(int n, int end1, int end2, double slope1, double slope2, double x[], double y[], double b[], double c[], double d[]); +#endif double seval(int n, double u, double x[], double y[], double b[], double c[], double d[]); diff --git a/deps/AMICI/include/amici/steadystateproblem.h b/deps/AMICI/include/amici/steadystateproblem.h index 92bdc7b4d..f1db7b0d8 100644 --- a/deps/AMICI/include/amici/steadystateproblem.h +++ b/deps/AMICI/include/amici/steadystateproblem.h @@ -171,8 +171,7 @@ class SteadystateProblem { * @brief Runs the Newton solver iterations and checks for convergence * to steady state * @param model pointer to the model object - * @param newtonSolver pointer to the NewtonSolver object @type - * NewtonSolver + * @param newtonSolver pointer to the NewtonSolver object * @param newton_retry flag indicating if Newton solver is rerun */ void applyNewtonsMethod(Model *model, NewtonSolver *newtonSolver, @@ -231,7 +230,7 @@ class SteadystateProblem { * @return stored SimulationState */ const SimulationState &getFinalSimulationState() const { - return state; + return state_; }; /** @@ -239,14 +238,14 @@ class SteadystateProblem { * @return xQB Vector with quadratures */ const AmiVector &getEquilibrationQuadratures() const { - return xQB; + return xQB_; } /** * @brief Returns state at steadystate * @return x */ const AmiVector &getState() const { - return x; + return x_; }; @@ -255,7 +254,7 @@ class SteadystateProblem { * @return sx */ const AmiVectorArray &getStateSensitivity() const { - return sx; + return sx_; }; /** @@ -263,57 +262,57 @@ class SteadystateProblem { * @return dJydx */ std::vector const& getDJydx() const { - return dJydx; + return dJydx_; } /** * @brief Accessor for run_time of the forward problem * @return run_time */ - double getCPUTime() const { return cpu_time; } + double getCPUTime() const { return cpu_time_; } /** * @brief Accessor for run_time of the backward problem * @return run_time */ - double getCPUTimeB() const { return cpu_timeB; } + double getCPUTimeB() const { return cpu_timeB_; } /** * @brief Accessor for steady_state_status * @return steady_state_status */ std::vector const& getSteadyStateStatus() const - { return steady_state_status; } + { return steady_state_status_; } /** * @brief Accessor for t * @return t */ - realtype getSteadyStateTime() const { return t; } + realtype getSteadyStateTime() const { return t_; } /** * @brief Accessor for wrms * @return wrms */ - realtype getResidualNorm() const { return wrms; } + realtype getResidualNorm() const { return wrms_; } /** * @brief Accessor for numsteps * @return numsteps */ - const std::vector &getNumSteps() const { return numsteps; } + const std::vector &getNumSteps() const { return numsteps_; } /** * @brief Accessor for numstepsB * @return numstepsB */ - const int getNumStepsB() const { return numstepsB; } + int getNumStepsB() const { return numstepsB_; } /** * @brief Accessor for numlinsteps * @return numlinsteps */ - const std::vector &getNumLinSteps() const { return numlinsteps; } + const std::vector &getNumLinSteps() const { return numlinsteps_; } /** * @brief computes adjoint updates dJydx according to provided model and expdata @@ -326,90 +325,90 @@ class SteadystateProblem { * @brief Accessor for xQB * @return xQB */ - AmiVector const& getAdjointQuadrature() const { return xQB; } + AmiVector const& getAdjointQuadrature() const { return xQB_; } /** * @brief Accessor for hasQuadrature_ * @return hasQuadrature_ */ - const bool hasQuadrature() const { return hasQuadrature_; } + bool hasQuadrature() const { return hasQuadrature_; } /** * @brief computes adjoint updates dJydx according to provided model and expdata - * @return covergence of steady state solver + * @return convergence of steady state solver */ bool checkSteadyStateSuccess() const; private: /** time variable for simulation steadystate finding */ - realtype t; + realtype t_; /** newton step */ - AmiVector delta; + AmiVector delta_; /** error weights for solver state, dimension nx_solver */ AmiVector ewt_; /** error weights for backward quadratures, dimension nplist() */ AmiVector ewtQB_; - /** container for relative error calcuation? */ - AmiVector rel_x_newton; - /** container for absolute error calcuation? */ - AmiVector x_newton; + /** container for relative error calculation? */ + AmiVector rel_x_newton_; + /** container for absolute error calculation? */ + AmiVector x_newton_; /** state vector */ - AmiVector x; + AmiVector x_; /** old state vector */ - AmiVector x_old; + AmiVector x_old_; /** differential state vector */ - AmiVector dx; + AmiVector dx_; /** time derivative state vector */ - AmiVector xdot; + AmiVector xdot_; /** old time derivative state vector */ - AmiVector xdot_old; + AmiVector xdot_old_; /** state sensitivities */ - AmiVectorArray sx; + AmiVectorArray sx_; /** state differential sensitivities */ - AmiVectorArray sdx; + AmiVectorArray sdx_; /** adjoint state vector */ - AmiVector xB; + AmiVector xB_; /** integral over adjoint state vector */ - AmiVector xQ; + AmiVector xQ_; /** quadrature state vector */ - AmiVector xQB; + AmiVector xQB_; /** quadrature state vector */ - AmiVector xQBdot; + AmiVector xQBdot_; /** maximum number of steps for Newton solver for allocating numlinsteps */ - int maxSteps = 0; + int max_steps_ {0}; /** weighted root-mean-square error */ - realtype wrms = NAN; + realtype wrms_ {NAN}; /** state derivative of data likelihood * (dimension nJ x nx x nt, ordering =?) */ - std::vector dJydx; + std::vector dJydx_; - SimulationState state; + SimulationState state_; /** stores diagnostic information about employed number of steps */ - std::vector numsteps = std::vector (3, 0); + std::vector numsteps_ {std::vector(3, 0)}; /** stores diagnostic information about employed number of linear steps */ - std::vector numlinsteps; + std::vector numlinsteps_; /** stores information about employed number of backward steps */ - int numstepsB = 0; + int numstepsB_ {0}; /** stores diagnostic information about runtime */ - double cpu_time = 0.0; + double cpu_time_ {0.0}; /** stores diagnostic information about runtime backward */ - double cpu_timeB = 0.0; + double cpu_timeB_ {0.0}; /** flag indicating whether backward mode was run */ - bool hasQuadrature_ = false; + bool hasQuadrature_ {false}; /** stores diagnostic information about execution success of the different * approaches [newton, simulation, newton] (length = 3) */ - std::vector steady_state_status; + std::vector steady_state_status_; }; } // namespace amici diff --git a/deps/AMICI/include/amici/sundials_linsol_wrapper.h b/deps/AMICI/include/amici/sundials_linsol_wrapper.h index 181cdafff..86b67fed2 100644 --- a/deps/AMICI/include/amici/sundials_linsol_wrapper.h +++ b/deps/AMICI/include/amici/sundials_linsol_wrapper.h @@ -111,7 +111,7 @@ class SUNLinSolWrapper { /** * @brief Returns the integer and real workspace sizes for the linear solver * @param lenrwLS output argument for size of real workspace - * @param leniwLS output argument for size of interger workspace + * @param leniwLS output argument for size of integer workspace * @return workspace size */ int space(long int *lenrwLS, long int *leniwLS) const; @@ -131,7 +131,7 @@ class SUNLinSolWrapper { int initialize(); /** Wrapped solver */ - SUNLinearSolver solver = nullptr; + SUNLinearSolver solver_ {nullptr}; }; @@ -160,7 +160,7 @@ class SUNLinSolBand : public SUNLinSolWrapper { private: /** Matrix A for solver, only if created by here. */ - SUNMatrixWrapper A; + SUNMatrixWrapper A_; }; @@ -179,7 +179,7 @@ class SUNLinSolDense : public SUNLinSolWrapper { private: /** Matrix A for solver, only if created by here. */ - SUNMatrixWrapper A; + SUNMatrixWrapper A_; }; @@ -233,7 +233,7 @@ class SUNLinSolKLU : public SUNLinSolWrapper { private: /** Sparse matrix A for solver, only if created by here. */ - SUNMatrixWrapper A; + SUNMatrixWrapper A_; }; #ifdef SUNDIALS_SUPERLUMT @@ -727,7 +727,7 @@ class SUNNonLinSolWrapper { * @return */ int Solve(N_Vector y0, N_Vector y, N_Vector w, realtype tol, - booleantype callLSetup, void *mem); + bool callLSetup, void *mem); /** * @brief Set function to evaluate the nonlinear residual function F(y) = 0 diff --git a/deps/AMICI/include/amici/sundials_matrix_wrapper.h b/deps/AMICI/include/amici/sundials_matrix_wrapper.h index 3eceb4752..88e7e9882 100644 --- a/deps/AMICI/include/amici/sundials_matrix_wrapper.h +++ b/deps/AMICI/include/amici/sundials_matrix_wrapper.h @@ -30,14 +30,15 @@ class SUNMatrixWrapper { * @param NNZ Number of nonzeros * @param sparsetype Sparse type */ - SUNMatrixWrapper(int M, int N, int NNZ, int sparsetype); + SUNMatrixWrapper(sunindextype M, sunindextype N, sunindextype NNZ, + int sparsetype); /** * @brief Create dense matrix. See SUNDenseMatrix in sunmatrix_dense.h * @param M Number of rows * @param N Number of columns */ - SUNMatrixWrapper(int M, int N); + SUNMatrixWrapper(sunindextype M, sunindextype N); /** * @brief Create banded matrix. See SUNBandMatrix in sunmatrix_band.h @@ -45,7 +46,7 @@ class SUNMatrixWrapper { * @param ubw Upper bandwidth * @param lbw Lower bandwidth */ - SUNMatrixWrapper(int M, int ubw, int lbw); + SUNMatrixWrapper(sunindextype M, sunindextype ubw, sunindextype lbw); /** * @brief Create sparse matrix from dense or banded matrix. See @@ -91,59 +92,146 @@ class SUNMatrixWrapper { * @return */ SUNMatrixWrapper &operator=(SUNMatrixWrapper &&other); - + /** - * @brief Access raw data - * @return raw data pointer + * @brief Reallocate space for sparse matrix according to specified nnz + * @param nnz new number of nonzero entries */ - realtype *data() const; + void reallocate(sunindextype nnz); + + /** + * @brief Reallocate space for sparse matrix to used space according to last entry in indexptrs + */ + void realloc(); /** * @brief Get the wrapped SUNMatrix - * @return SlsMat + * @return raw SunMatrix object + * @note Even though the returned matrix_ pointer is const qualified, matrix_->content will not be const. + * This is a shortcoming in the underlying C library, which we cannot address and it is not intended that + * any of those values are modified externally. If matrix_->content is manipulated, + * cpp:meth:SUNMatrixWrapper:`refresh` needs to be called. */ - SUNMatrix get() const; + const SUNMatrix get() const; /** * @brief Get the number of rows - * @return number + * @return number of rows */ sunindextype rows() const; /** * @brief Get the number of columns - * @return number + * @return number of columns */ sunindextype columns() const; /** - * @brief Get the number of non-zero elements (sparse matrices only) - * @return number + * @brief Get the number of specified non-zero elements (sparse matrices only) + * @note value will be 0 before indexptrs are set. + * @return number of nonzero entries */ - sunindextype nonzeros() const; - + sunindextype num_nonzeros() const; + /** - * @brief Get the index values of a sparse matrix - * @return index array + * @brief Get the number of indexptrs that can be specified (sparse matrices only) + * @return number of indexptrs */ - sunindextype *indexvals() const; - + sunindextype num_indexptrs() const; + + /** + * @brief Get the number of allocated data elements + * @return number of allocated entries + */ + sunindextype capacity() const; + + /** + * @brief Get raw data of a sparse matrix + * @return pointer to first data entry + */ + realtype *data(); + /** - * @brief Get the index pointers of a sparse matrix - * @return index array + * @brief Get const raw data of a sparse matrix + * @return pointer to first data entry */ - sunindextype *indexptrs() const; + const realtype *data() const; + + /** + * @brief Get data of a sparse matrix + * @param idx data index + * @return idx-th data entry + */ + realtype get_data(sunindextype idx) const; + + /** + * @brief Get data entry for a dense matrix + * @param irow row + * @param icol col + * @return A(irow,icol) + */ + realtype get_data(sunindextype irow, sunindextype icol) const; + + /** + * @brief Set data entry for a sparse matrix + * @param idx data index + * @param data data for idx-th entry + */ + void set_data(sunindextype idx, realtype data); + + /** + * @brief Set data entry for a dense matrix + * @param irow row + * @param icol col + * @param data data for idx-th entry + */ + void set_data(sunindextype irow, sunindextype icol, realtype data); /** - * @brief Get the type of sparse matrix - * @return index array + * @brief Get the index value of a sparse matrix + * @param idx data index + * @return row (CSC) or column (CSR) for idx-th data entry */ - int sparsetype() const; + sunindextype get_indexval(sunindextype idx) const; + + /** + * @brief Set the index value of a sparse matrix + * @param idx data index + * @param val row (CSC) or column (CSR) for idx-th data entry + */ + void set_indexval(sunindextype idx, sunindextype val); + + /** + * @brief Set the index values of a sparse matrix + * @param vals rows (CSC) or columns (CSR) for data entries + */ + void set_indexvals(const gsl::span vals); + + /** + * @brief Get the index pointer of a sparse matrix + * @param ptr_idx pointer index + * @return index where the ptr_idx-th column (CSC) or row (CSR) starts + */ + sunindextype get_indexptr(sunindextype ptr_idx) const; + + /** + * @brief Set the index pointer of a sparse matrix + * @param ptr_idx pointer index + * @param ptr data-index where the ptr_idx-th column (CSC) or row (CSR) starts + */ + void set_indexptr(sunindextype ptr_idx, sunindextype ptr); + + /** + * @brief Set the index pointers of a sparse matrix + * @param ptrs starting data-indices where the columns (CSC) or rows (CSR) start + */ + void set_indexptrs(const gsl::span ptrs); /** - * @brief reset data to zeroes + * @brief Get the type of sparse matrix + * @return matrix type */ - void reset(); + int sparsetype() const; /** * @brief multiply with a scalar (in-place) @@ -190,30 +278,165 @@ class SUNMatrixWrapper { bool transpose) const; /** - * @brief Perform matrix matrix multiplication - C[:, :] += A * B - for sparse A, B, C - * @param C output matrix, may already contain values + * @brief Perform matrix matrix multiplication C = A * B for sparse A, B, C + * @param C output matrix, * @param B multiplication matrix + * @note will overwrite existing data, indexptrs, indexvals for C, but will use preallocated space for these vars + */ + void sparse_multiply(SUNMatrixWrapper &C, + const SUNMatrixWrapper &B) const; + + /** + * @brief Perform sparse matrix matrix addition C = alpha * A + beta * B + * @param A addition matrix + * @param alpha scalar A + * @param B addition matrix + * @param beta scalar B + * @note will overwrite existing data, indexptrs, indexvals for C, but will use preallocated space for these vars + */ + void sparse_add(const SUNMatrixWrapper &A, realtype alpha, + const SUNMatrixWrapper &B, realtype beta); + + /** + * @brief Perform matrix-matrix addition A = sum(mats(0)...mats(len(mats))) + * @param mats vector of sparse matrices + * @note will overwrite existing data, indexptrs, indexvals for A, but will use preallocated space for these vars + */ + void sparse_sum(const std::vector &mats); + + /** + * @brief Compute x = x + beta * A(:,k), where x is a dense vector and A(:,k) is sparse, and update + * the sparsity pattern for C(:,j) if applicable + * + * This function currently has two purposes: + * - perform parts of sparse matrix-matrix multiplication C(:,j)=A(:,k)*B(k,j) + * enabled by passing beta=B(k,j), x=C(:,j), C=C, w=sparsity of C(:,j) from B(k,0...j-1), nnz=nnz(C(:,0...j-1) + * - add the k-th column of the sparse matrix A multiplied by beta to the dense vector x. + * enabled by passing beta=*, x=x, C=nullptr, w=nullptr, nnz=* + * + * @param k column index + * @param beta scaling factor + * @param w index workspace, (w[i] x, + const sunindextype mark, + SUNMatrixWrapper *C, sunindextype nnz) const; + + /** + * @brief Compute transpose A' of sparse matrix A and writes it to the matrix C = alpha * A' + * + * @param C output matrix (sparse or dense) + * @param alpha scalar multiplier + * @param blocksize blocksize for transposition. For full matrix transpose set to ncols/nrows */ - void sparse_multiply(SUNMatrixWrapper *C, - SUNMatrixWrapper *B) const; + void transpose(SUNMatrixWrapper &C, const realtype alpha, + sunindextype blocksize) const; + + /** + * @brief Writes a sparse matrix A to a dense matrix D. + * + * @param D dense output matrix + */ + void to_dense(SUNMatrixWrapper &D) const; + + /** + * @brief Writes the diagonal of sparse matrix A to a dense vector v. + * + * @param v dense outut vector + */ + void to_diag(N_Vector v) const; /** - * @brief Set to 0.0 + * @brief Set to 0.0, for sparse matrices also resets indexptr/indexvals */ void zero(); - + + /** + * @brief Get matrix id + * @return SUNMatrix_ID + */ + SUNMatrix_ID matrix_id() const {return id_;}; + + /** + * @brief Update internal cache, needs to be called after external manipulation of matrix_->content + */ + void refresh(); + private: - void update_ptrs(); /** - * @brief CSC matrix to which all methods are applied + * @brief SUNMatrix to which all methods are applied + */ + SUNMatrix matrix_ {nullptr}; + + /** + * @brief cache for SUNMatrixGetId(matrix_) + */ + SUNMatrix_ID id_ {SUNMATRIX_CUSTOM}; + + /** + * @brief cache for SUNMatrixGetId(matrix_) + */ + int sparsetype_ {CSC_MAT}; + + /** + * @brief cache for SM_INDEXPTRS_S(matrix_)[SM_NP_S(matrix_)] + */ + sunindextype num_nonzeros_ {0}; + /** + * @brief cache for SM_NNZ_S(matrix_) + */ + sunindextype capacity_ {0}; + + /** + * @brief cache for SM_DATA_S(matrix_) + */ + realtype *data_ {nullptr}; + /** + * @brief cache for SM_INDEXPTRS_S(matrix_) + */ + sunindextype *indexptrs_ {nullptr}; + /** + * @brief cache for SM_INDEXVALS_S(matrix_) + */ + sunindextype *indexvals_ {nullptr}; + + /** + * @brief cache for SM_ROWS_X(matrix_) + */ + sunindextype num_rows_ {0}; + /** + * @brief cache for SM_COLUMS_X(matrix_) + */ + sunindextype num_columns_ {0}; + /** + * @brief cache for SM_NP_S(matrix_) + */ + sunindextype num_indexptrs_ {0}; + + /** + * @brief call update_ptrs & update_size + */ + void finish_init(); + /** + * @brief update data_, indexptrs_, indexvals_ if applicable + */ + void update_ptrs(); + /** + * @brief update num_rows_, num_columns_, num_indexptrs if applicable + */ + void update_size(); + /** + * @brief indicator whether this wrapper allocated matrix_ and is responsible for deallocation */ - SUNMatrix matrix = nullptr; - realtype *data_ptr = nullptr; - sunindextype *indexptrs_ptr = nullptr; - sunindextype *indexvals_ptr = nullptr; + bool ownmat = true; }; } // namespace amici @@ -221,8 +444,8 @@ class SUNMatrixWrapper { namespace gsl { /** * @brief Create span from SUNMatrix - * @param nv - * @return + * @param m SUNMatrix + * @return Created span */ inline span make_span(SUNMatrix m) { diff --git a/deps/AMICI/include/amici/vector.h b/deps/AMICI/include/amici/vector.h index 44a7b83ce..02513aaf6 100644 --- a/deps/AMICI/include/amici/vector.h +++ b/deps/AMICI/include/amici/vector.h @@ -33,8 +33,8 @@ class AmiVector { * @param length number of elements in vector */ explicit AmiVector(const long int length) - : vec(static_cast(length), 0.0), - nvec(N_VMake_Serial(length, vec.data())) {} + : vec_(static_cast(length), 0.0), + nvec_(N_VMake_Serial(length, vec_.data())) {} /** Moves data from std::vector and constructs an nvec that points to the * data @@ -42,8 +42,8 @@ class AmiVector { * @param rvec vector from which the data will be moved */ explicit AmiVector(std::vector rvec) - : vec(std::move(rvec)), - nvec(N_VMake_Serial(static_cast(vec.size()), vec.data())) {} + : vec_(std::move(rvec)), + nvec_(N_VMake_Serial(static_cast(vec_.size()), vec_.data())) {} /** Copy data from gsl::span and constructs a vector * @brief constructor from gsl::span, @@ -56,11 +56,25 @@ class AmiVector { * @brief copy constructor * @param vold vector from which the data will be copied */ - AmiVector(const AmiVector &vold) : vec(vold.vec) { - nvec = - N_VMake_Serial(static_cast(vold.vec.size()), vec.data()); + AmiVector(const AmiVector &vold) : vec_(vold.vec_) { + nvec_ = + N_VMake_Serial(static_cast(vold.vec_.size()), vec_.data()); } + /** + * @brief move constructor + * @param other vector from which the data will be moved + */ + AmiVector(AmiVector&& other) noexcept : nvec_(nullptr) { + vec_ = std::move(other.vec_); + synchroniseNVector(); + } + + /** + * @brief destructor + */ + ~AmiVector(); + /** * @brief copy assignment operator * @param other right hand side @@ -105,9 +119,9 @@ class AmiVector { int getLength() const; /** - * @brief resets the Vector by filling with zero values + * @brief fills vector with zero values */ - void reset(); + void zero(); /** * @brief changes the sign of data elements @@ -146,17 +160,12 @@ class AmiVector { */ void copy(const AmiVector &other); - /** - * @brief destructor - */ - ~AmiVector(); - private: /** main data storage */ - std::vector vec; + std::vector vec_; - /** N_Vector, will be synchronised such that it points to data in vec */ - N_Vector nvec = nullptr; + /** N_Vector, will be synchronized such that it points to data in vec */ + N_Vector nvec_ {nullptr}; /** * @brief reconstructs nvec such that data pointer points to vec data array @@ -187,13 +196,15 @@ class AmiVectorArray { * @param length_outer number of vectors */ AmiVectorArray(long int length_inner, long int length_outer); - + /** * @brief copy constructor * @param vaold object to copy from */ AmiVectorArray(const AmiVectorArray &vaold); + ~AmiVectorArray() = default; + /** * @brief copy assignment operator * @param other right hand side @@ -249,7 +260,7 @@ class AmiVectorArray { * @param pos index of corresponding AmiVector * @return N_Vector */ - const_N_Vector getNVector(int pos) const; + const N_Vector getNVector(int pos) const; /** * @brief accessor to AmiVector elements @@ -272,9 +283,9 @@ class AmiVectorArray { int getLength() const; /** - * @brief resets every AmiVector in AmiVectorArray + * @brief set every AmiVector in AmiVectorArray to zero */ - void reset(); + void zero(); /** * @brief flattens the AmiVectorArray to a vector in row-major format @@ -289,17 +300,15 @@ class AmiVectorArray { */ void copy(const AmiVectorArray &other); - ~AmiVectorArray() = default; - private: /** main data storage */ - std::vector vec_array; + std::vector vec_array_; /** - * N_Vector array, will be synchronised such that it points to + * N_Vector array, will be synchronized such that it points to * respective elements in the vec_array */ - std::vector nvec_array; + std::vector nvec_array_; }; } // namespace amici diff --git a/deps/AMICI/matlab/@amievent/setHflag.m b/deps/AMICI/matlab/@amievent/setHflag.m index da22d6527..2dd5f1b73 100644 --- a/deps/AMICI/matlab/@amievent/setHflag.m +++ b/deps/AMICI/matlab/@amievent/setHflag.m @@ -1,12 +1,12 @@ function this = setHflag(this,hflag) - % gethflag sets the hflag property. + % setHflag sets the hflag property. % % Parameters: - % hflag: value for the hflag property @type double + % hflag: value for the hflag property, type double % % Return values: % this: updated event definition object @type amievent - + try if(all(size(this.bolus) == size(hflag))) if(isa(hflag,'double')) @@ -21,4 +21,4 @@ end catch error('provided hflag does not match the bolus dimension!'); - end \ No newline at end of file + end diff --git a/deps/AMICI/matlab/@amifun/gccode.m b/deps/AMICI/matlab/@amifun/gccode.m index 66b2476a2..a00724b3b 100644 --- a/deps/AMICI/matlab/@amifun/gccode.m +++ b/deps/AMICI/matlab/@amifun/gccode.m @@ -96,11 +96,6 @@ cstr = regexprep(cstr,'var_v_([0-9]+)', 'v[$1]'); cstr = regexprep(cstr,'var_vB_([0-9]+)', 'vB[$1]'); cstr = regexprep(cstr,'var_JSparse_([0-9]+)', 'JSparse->data[$1]'); - cstr = regexprep(cstr,'J_([0-9]+)', 'J[$1]'); - cstr = regexprep(cstr,'var_JSparseB_([0-9]+)', 'JSparseB->data[$1]'); - cstr = regexprep(cstr,'JB_([0-9]+)', 'JB[$1]'); - cstr = regexprep(cstr,'var_Jv_([0-9]+)', 'Jv[$1]'); - cstr = regexprep(cstr,'var_JvB_([0-9]+)', 'JvB[$1]'); cstr = regexprep(cstr,'var_x0_([0-9]+)','x0[$1]'); cstr = regexprep(cstr,'var_dx0_([0-9]+)','dx0[$1]'); cstr = regexprep(cstr,'var_sx0_([0-9]+)','sx0[$1]'); diff --git a/deps/AMICI/matlab/@amifun/getArgs.m b/deps/AMICI/matlab/@amifun/getArgs.m index 8973601fb..65499d43a 100644 --- a/deps/AMICI/matlab/@amifun/getArgs.m +++ b/deps/AMICI/matlab/@amifun/getArgs.m @@ -35,20 +35,8 @@ case 'x0' this.argstr = '(realtype *x0, const realtype t, const realtype *p, const realtype *k)'; case 'dx0' - case 'Jv' - this.argstr = ['(realtype *Jv, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h' cj dx ', const realtype *v, const realtype *w, const realtype *dwdx)']; - case 'JvB' - this.argstr = ['(realtype *JvB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h' cj ', const realtype *xB' dx dxB ', const realtype *vB, const realtype *w, const realtype *dwdx)']; - case 'J' - this.argstr = ['(realtype *J, const realtype t, const realtype *x, const double *p, const double *k, const realtype *h' cj dx ', const realtype *w, const realtype *dwdx)']; - case 'JDiag' - this.argstr = ['(realtype *JDiag, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h' cj dx ', const realtype *w, const realtype *dwdx)']; case 'JSparse' this.argstr = ['(SUNMatrixContent_Sparse JSparse, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h' cj dx ', const realtype *w, const realtype *dwdx)']; - case 'JB' - this.argstr = ['(realtype *JB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h' cj ', const realtype *xB' dx dxB ', const realtype *w, const realtype *dwdx)']; - case 'JSparseB' - this.argstr = ['(SUNMatrixContent_Sparse JSparseB, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h' cj ', const realtype *xB' dx dxB ', const realtype *w, const realtype *dwdx)']; case 'sxdot' this.argstr = ['(realtype *sxdot, const realtype t, const realtype *x, const realtype *p, const realtype *k, const realtype *h, const int ip' dx ', const realtype *sx' sdx ', const realtype *w, const realtype *dwdx, const realtype *J' M ', const realtype *dxdotdp)']; case 'sx0' diff --git a/deps/AMICI/matlab/@amifun/getCVar.m b/deps/AMICI/matlab/@amifun/getCVar.m index f9f68cf48..323303925 100644 --- a/deps/AMICI/matlab/@amifun/getCVar.m +++ b/deps/AMICI/matlab/@amifun/getCVar.m @@ -7,18 +7,8 @@ % this: updated function definition object @type amifun switch(this.funstr) - case 'J' - this.cvar = 'J'; case 'JSparse' this.cvar = 'var_JSparse'; - case 'Jv' - this.cvar = 'var_Jv'; - case 'JvB' - this.cvar = 'var_JvB'; - case 'JB' - this.cvar = 'JB'; - case 'JSparseB' - this.cvar = 'var_JSparseB'; case 'M' this.cvar = 'M'; case 'dfdx' diff --git a/deps/AMICI/matlab/@amifun/getDeps.m b/deps/AMICI/matlab/@amifun/getDeps.m index efb5cb09d..800f4ccb9 100644 --- a/deps/AMICI/matlab/@amifun/getDeps.m +++ b/deps/AMICI/matlab/@amifun/getDeps.m @@ -25,9 +25,6 @@ this.deps = {'xdot','x','dwdx'}; end - case 'JB' - this.deps = {'J'}; - case 'dxdotdp' this.deps = {'xdot','p','dwdp'}; @@ -164,12 +161,6 @@ case 'JSparse' this.deps = {'J'}; - case 'JSparseB' - this.deps = {'JB'}; - - case 'JDiag' - this.deps = {'J'}; - case 'y' this.deps = {'x','p','k'}; diff --git a/deps/AMICI/matlab/@amifun/getSyms.m b/deps/AMICI/matlab/@amifun/getSyms.m index 425268bab..ad741a818 100644 --- a/deps/AMICI/matlab/@amifun/getSyms.m +++ b/deps/AMICI/matlab/@amifun/getSyms.m @@ -322,18 +322,6 @@ this.sym = diag(model.fun.J.sym); this = makeStrSyms(this); - case 'JB' - this.sym = sym(zeros(model.nx, model.nx)); - % Augmentation needs a transposition in the submatrices - if(model.nx>0) - for ix = 1 : model.ng - for jx = 1 : model.ng - this.sym((ix-1)*model.nxtrue+1:ix*model.nxtrue, (jx-1)*model.nxtrue+1:jx*model.nxtrue) = ... - -transpose(model.fun.J.sym((ix-1)*model.nxtrue+1:ix*model.nxtrue, (jx-1)*model.nxtrue+1:jx*model.nxtrue)); - end - end - end - case 'dxdotdp' if(~isempty(w)) this.sym=jacobian(model.fun.xdot.sym,p) + jacobian(model.fun.xdot.sym,w)*model.fun.dwdp.strsym; @@ -383,30 +371,6 @@ % create cell array of same size this = makeStrSyms(this); - case 'Jv' - % create cell array of same size - vs = cell(nx,1); - % fill cells - for j=1:nx - vs{j} = sprintf('var_v_%i',j-1); - end - % transform to symbolic variable - vs = sym(vs); - % multiply - this.sym = model.fun.J.sym*vs; - - case 'JvB' - % create cell array of same size - vs = cell(nx,1); - % fill cells - for j=1:nx - vs{j} = sprintf('var_vB_%i',j-1); - end - % transform to symbolic variable - vs = sym(vs); - % multiply - this.sym = model.fun.JB.sym*vs; - case 'xBdot' if(strcmp(model.wtype,'iw')) syms t @@ -741,8 +705,6 @@ %do nothing case 'JSparse' %do nothing - case 'JSparseB' - %do nothing case 'Jy' this.sym = model.sym.Jy; diff --git a/deps/AMICI/matlab/@amifun/writeCcode.m b/deps/AMICI/matlab/@amifun/writeCcode.m index 1b36ed48c..d74709e95 100644 --- a/deps/AMICI/matlab/@amifun/writeCcode.m +++ b/deps/AMICI/matlab/@amifun/writeCcode.m @@ -18,10 +18,6 @@ function writeCcode(this,model,fid) tmpfun = this; tmpfun.sym = model.fun.J.sym(model.sparseidx); tmpfun.gccode(model,fid); -elseif(strcmp(this.funstr,'JSparseB')) - tmpfun = this; - tmpfun.sym = model.fun.JB.sym(model.sparseidxB); - tmpfun.gccode(model,fid); elseif(ismember(this.funstr,{'rz','z','sz','srz'})) if(any(nonzero)) fprintf(fid,' switch(ie) { \n'); diff --git a/deps/AMICI/matlab/@amimodel/generateC.m b/deps/AMICI/matlab/@amimodel/generateC.m index 38581515e..44b112dbe 100644 --- a/deps/AMICI/matlab/@amimodel/generateC.m +++ b/deps/AMICI/matlab/@amimodel/generateC.m @@ -23,9 +23,6 @@ function generateC(this) if(strcmp(ifun{1},'JSparse')) bodyNotEmpty = any(this.fun.J.sym(:)~=0); end - if(strcmp(ifun{1},'JSparseB')) - bodyNotEmpty = any(this.fun.JB.sym(:)~=0); - end if(bodyNotEmpty) fprintf([ifun{1} ' | ']); @@ -34,7 +31,7 @@ function generateC(this) fprintf(fid,'#include "amici/symbolic_functions.h"\n'); fprintf(fid,'#include "amici/defines.h" //realtype definition\n'); - if(ismember(ifun{1},{'JSparse','JSparseB'})) + if(ismember(ifun{1},{'JSparse'})) fprintf(fid,'#include //SUNMatrixContent_Sparse definition\n'); end @@ -56,14 +53,6 @@ function generateC(this) fprintf(fid,[' JSparse->indexptrs[' num2str(i-1) '] = ' num2str(this.colptrs(i)) ';\n']); end end - if(strcmp(ifun{1},'JSparseB')) - for i = 1:length(this.rowvalsB) - fprintf(fid,[' JSparseB->indexvals[' num2str(i-1) '] = ' num2str(this.rowvalsB(i)) ';\n']); - end - for i = 1:length(this.colptrsB) - fprintf(fid,[' JSparseB->indexptrs[' num2str(i-1) '] = ' num2str(this.colptrsB(i)) ';\n']); - end - end if(strcmp(ifun{1},'JBand')) fprintf(fid,['return(J_' this.modelname removeTypes(this.fun.J.argstr) ');']); @@ -174,6 +163,7 @@ function generateC(this) fprintf(fid,[' ' num2str(this.ndwdx) ',\n']); fprintf(fid,[' ' num2str(this.ndwdp) ',\n']); fprintf(fid,[' 0,\n']); +fprintf(fid,[' 0,\n']); fprintf(fid,[' {},\n']); fprintf(fid,[' ' num2str(this.nnz) ',\n']); fprintf(fid,[' ' num2str(this.ubw) ',\n']); diff --git a/deps/AMICI/matlab/@amimodel/parseModel.m b/deps/AMICI/matlab/@amimodel/parseModel.m index 722f890c0..bff57e791 100644 --- a/deps/AMICI/matlab/@amimodel/parseModel.m +++ b/deps/AMICI/matlab/@amimodel/parseModel.m @@ -119,13 +119,13 @@ function parseModel(this) end % compute functions -funs = {'xdot','w','dwdx','J','x0','JSparse','JDiag','y','z','rz','deltax','root','Jy','Jz','Jrz','sigma_y','sigma_z'}; +funs = {'xdot','w','dwdx','x0','JSparse','y','z','rz','deltax','root','Jy','Jz','Jrz','sigma_y','sigma_z'}; if(this.forward) funs = {funs{:},'sx0','sz','deltasx','stau','srz','dJydy','dJydsigma','dJzdz','dJzdsigma','dJrzdz','dJrzdsigma','dwdp','dxdotdp','dydp','dsigma_ydp','dsigma_zdp','dydx','dzdx','dzdp','drzdx','drzdp'}; end if(this.adjoint) - funs = {funs{:},'JB','JSparseB','dydx','dzdx','dzdp','drzdx','drzdp','deltaxB','deltaqB','dsigma_ydp','dsigma_zdp','sx0','dJydy','dJydsigma','dJzdz','dJzdsigma','dJrzdz','dJrzdsigma','dwdp','dxdotdp','dydp'}; + funs = {funs{:},'dydx','dzdx','dzdp','drzdx','drzdp','deltaxB','deltaqB','dsigma_ydp','dsigma_zdp','sx0','dJydy','dJydsigma','dJzdz','dJzdsigma','dJrzdz','dJrzdsigma','dwdp','dxdotdp','dydp'}; end if(strcmp(this.wtype,'iw')) diff --git a/deps/AMICI/matlab/@amioption/amioption.m b/deps/AMICI/matlab/@amioption/amioption.m index 6945ba4ea..6dcfdaf2b 100644 --- a/deps/AMICI/matlab/@amioption/amioption.m +++ b/deps/AMICI/matlab/@amioption/amioption.m @@ -3,9 +3,9 @@ % @brief definition of amioption class % classdef amioption < matlab.mixin.CustomDisplay - %AMIOPTION provides an option container to pass simulation parameters to the - %simulation routine. - + % AMIOPTION provides an option container to pass simulation parameters to the + % simulation routine. + properties % absolute integration tolerace atol = 1e-16; @@ -72,10 +72,10 @@ % Mode for for computing sensitivities ({0: Newton}, 1: Simulation) steadyStateSensitivityMode = 0; end - + methods function obj = amioption(varargin) - %amioptions Construct a new amioptions object + % amioptions Construct a new amioptions object % OPTS = amioption() creates a set of options with each option set to its % default value. % @@ -95,11 +95,11 @@ % Return values: % obj: amioption object constructed from inputs % - + % adapted from SolverOptions - - if nargin > 0 - + + if nargin > 0 + % Deal with the case where the first input to the % constructor is a amioptions/struct object. if isa(varargin{1},'amioption') @@ -135,7 +135,7 @@ else firstInputObj = false; end - + % Extract the options that the caller of the constructor % wants to set. if firstInputObj @@ -143,7 +143,7 @@ else pvPairs = varargin; end - + % Loop through each param-value pair and just try to set % the option. When the option has been fully specified with % the correct case, this is fast. The catch clause deals @@ -153,7 +153,7 @@ try obj.(pvPairs{i}) = pvPairs{i+1}; catch ME %#ok - + % Create the input parser if we haven't already. We % do it here to avoid creating it if possible, as % it is slow to set up. @@ -175,11 +175,11 @@ end haveCreatedInputParser = true; end - + % Get the p-v pair to parse. thisPair = pvPairs(i:min(i+1, length(pvPairs))); ip.parse(thisPair{:}); - + % Determine the option that was specified in p-v pairs. % These options will now be matched even if only partially % specified (by 13a). Now set the specified value in the @@ -189,16 +189,16 @@ end end end - - + + end - + function this = set.sensi_meth(this,value) if(ischar(value)) switch(value) case 'forward' this.sensi_meth = 1; - case 'adjoint' + case 'adjoint' this.sensi_meth = 2; case 'ss' this.sensi_meth = 3; @@ -213,34 +213,34 @@ this.sensi_meth = value; end end - + function this = set.sensi(this,value) assert(isnumeric(value),'The option sensi must have a numeric value!') assert(floor(value)==value,'The option sensi must be an integer!') assert(value<=4,'Only 0, 1, 2 are valid options for sensi!') this.sensi = value; end - + function this = set.pscale(this,value) if(~isempty(value)) if(isnumeric(value)) arrayfun(@(x) assert(x == 0 || x == 1 || x == 2, ... 'No valid parametrisation chosen! Valid integer options are 0 (lin), 1 (log), 2 (log10).'), value); elseif(ischar(value)) - value = getIntegerPScale(value); + value = amioption.getIntegerPScale(value); else - value = arrayfun(@(x) getIntegerPScale(x), value); + value = arrayfun(@(x) amioption.getIntegerPScale(x), value); end end this.pscale = value; end - + function this = set.newton_maxsteps(this,value) assert(isnumeric(value),'The option newtons_maxsteps must have a numeric value!') assert(floor(value)==value,'The option newton_maxsteps must be an integer!') this.newton_maxsteps = value; end - + function this = set.newton_maxlinsteps(this,value) assert(isnumeric(value),'The option newton_maxlinsteps must have a numeric value!') assert(floor(value)==value,'The option newton_maxlinsteps must be an integer!') @@ -258,18 +258,29 @@ this.newton_preeq = value; end end -end -function pscaleInt = getIntegerPScale(pscaleString) - switch (pscaleString) - case 'lin' - pscaleInt = 0; - case 'log' - pscaleInt = 1; - case 'log10' - pscaleInt = 2; - otherwise - assert(0, ... - 'No valid parametrisation chosen! Valid string options are "log", "log10" and "lin".') + methods(Static) + function pscaleInt = getIntegerPScale(pscaleString) + % pscaleInt converts a parameter scaling string into the + % corresponding integer representation + % + % Parameters: + % pscaleString: parameter scaling string + % + % Return values: + % int + switch (pscaleString) + case 'lin' + pscaleInt = 0; + case 'log' + pscaleInt = 1; + case 'log10' + pscaleInt = 2; + otherwise + assert(0, ... + 'No valid parametrisation chosen! Valid string options are "log", "log10" and "lin".') + end + end end -end \ No newline at end of file + +end diff --git a/deps/AMICI/matlab/amiwrap.m b/deps/AMICI/matlab/amiwrap.m index fa820871b..842b3a3a5 100644 --- a/deps/AMICI/matlab/amiwrap.m +++ b/deps/AMICI/matlab/amiwrap.m @@ -4,24 +4,24 @@ function amiwrap( varargin ) % Parameters: % varargin: % modelname: specifies the name of the model which will be later used for the naming of the simulation file @type string - % symfun: specifies a function which executes model definition see @ref matlab_interface for details @type string. + % symfun: specifies a function which executes model definition @type string. % tdir: target directory where the simulation file should be placed @type string @default $AMICIDIR/models/modelname % o2flag: boolean whether second order sensitivities should be enabled @type boolean @default false % % Return values: % void - + matVer = ver('MATLAB'); if(str2double(matVer.Version) >= 9.4) - error('MATLAB R2018a or higher is currently not supported (see https://github.com/ICB-DCM/AMICI/issues/307)') + error('MATLAB R2018a or higher is currently not supported (see https://github.com/AMICI-dev/AMICI/issues/307)') end - - %% + + %% % check for MSVS if(~isempty(strfind(mex.getCompilerConfigurations('c++').Name,'Microsoft Windows')) || ~isempty(strfind(mex.getCompilerConfigurations('c++').Name,'Microsoft Visual'))) warning('AMICI does not officially support Microsoft Visual Studio Compilers. If the compilation fails, we recommend using MinGW.') end - + %% % check inputs if(nargin<2) @@ -37,7 +37,7 @@ function amiwrap( varargin ) else tdir = pwd; end - + if nargin > 3 o2flag = varargin{4}; if(~ismember(o2flag,[0,1,2])) @@ -46,8 +46,8 @@ function amiwrap( varargin ) else o2flag = false; end - - + + if(isempty(mex.getCompilerConfigurations('C'))) error('No C compiler setup. Please install and configure with MATLAB') end @@ -56,26 +56,26 @@ function amiwrap( varargin ) error('provided tdir is not a valid path') end end - + warningreset = warning; warning('off','symbolic:mupadmex:MuPADTextWarning') warning('off','MATLAB:dispatcher:nameConflict') warning('off','symbolic:sym:sym:DeprecateExpressions') warning('off','symbolic:generate:FunctionNotVerifiedToBeValid') - - %% + + %% % Display AMICI version disp(['amiwrap version ' getCommitHash(fileparts(mfilename('fullpath')))]) - - %% + + %% % computations matlabRootPath=fileparts(mfilename('fullpath')); amiciRootPath=fileparts(matlabRootPath); - + addpath(genpath(fullfile(matlabRootPath,'auxiliary'))); addpath(fullfile(matlabRootPath,'symbolic')); - - + + % try to load if(~isstruct(symfun)) if(exist(symfun,'file')==2) @@ -86,9 +86,9 @@ function amiwrap( varargin ) else model_hash = []; end - + commit_hash = getCommitHash(amiciRootPath); - + if(~exist(fullfile(amiciRootPath,'models',modelname),'dir')) mkdir(fullfile(amiciRootPath,'models',modelname)); end @@ -100,33 +100,33 @@ function amiwrap( varargin ) % update wrap_path to this function call model.updateWrapPath(amiciRootPath); end - + if(~exist('model','var')) disp('Generating model struct ...') model = amimodel(symfun,modelname); - + if(~isempty(model_hash) && ~isempty(commit_hash)) save(fullfile(amiciRootPath,'models',modelname,[commit_hash '_' model_hash]),'model') end end - + switch(o2flag) - case 0 + case 0 o2string = []; case 1 o2string = 'o2'; case 2 o2string = 'o2vec'; end - + if(~isempty(o2string)) o2_hash = CalcMD5(fullfile(matlabRootPath,'@amimodel',['augment' o2string '.m']),'File'); try if(~exist(fullfile(amiciRootPath,'models',[modelname '_' o2string]),'dir')) mkdir(fullfile(amiciRootPath,'models',[modelname '_' o2string])); end - addpath(fullfile(amiciRootPath,'models',[modelname '_' o2string])); + addpath(fullfile(amiciRootPath,'models',[modelname '_' o2string])); end if(exist([commit_hash '_' model_hash '_' o2_hash '.mat'],'file')==2); load([commit_hash '_' model_hash '_' o2_hash '.mat']); @@ -138,14 +138,14 @@ function amiwrap( varargin ) if(~exist('modelo2','var')) disp('Augmenting to second order ...') modelo2 = feval(['augment' o2string],model); - - + + if(~isempty(model_hash) && ~isempty(commit_hash)) save(fullfile(amiciRootPath,'models',[modelname '_' o2string],[commit_hash '_' model_hash '_' o2_hash]),'modelo2') end end end - + disp('Parsing model struct ...') model.parseModel(); if(o2flag) @@ -158,14 +158,14 @@ function amiwrap( varargin ) if(o2flag) modelo2.generateC(); end - + % compile the previously generated C code disp('Compiling mex file ...') model.compileC(); if(o2flag) modelo2.compileC(); end - + % generate the matlab wrapper disp('Generating M code ...') if(o2flag) @@ -173,7 +173,7 @@ function amiwrap( varargin ) else model.generateM([]); end - + if(~isempty(tdir)) clear(['simulate_' modelname ]); clear(['ami_' modelname ]); diff --git a/deps/AMICI/matlab/mtoc/config/Doxyfile.template b/deps/AMICI/matlab/mtoc/config/Doxyfile.template index db3486ef8..a50605b07 100644 --- a/deps/AMICI/matlab/mtoc/config/Doxyfile.template +++ b/deps/AMICI/matlab/mtoc/config/Doxyfile.template @@ -1,161 +1,145 @@ ############################################################################ -# DOXYGEN CONFIGURATION FILE TEMPLATE (Doxygen version => 1.8.2) -############################################################################ + +# Doxyfile 1.9.0 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. # -# IMPORTANT NOTICE: This file is included with the tool "mtoc++", and contains some changes -# in order to make mtoc++ run together with doxygen. The settings in this file are a default -# configuration for Doxygen which we thought might be useful in a MatLab setting/project. -# USING MTOC++ DOES NOT EXCLUDE THE REQUIREMENT TO KNOW AND UNDERSTAND DOXYGEN ITSELF! -# We've had lots of feedback and problem reports which actually had to do with settings purely -# regarding doxygen, so we strongly recommend having a look through this file before contacting -# us. Thanks! +# All text after a double hash (##) is considered a comment and is placed in +# front of the TAG it is preceding. # +# All text after a single hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists, items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (\" \"). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the configuration +# file that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# https://www.gnu.org/software/libiconv/ for the list of possible encodings. +# The default value is: UTF-8. + +############################################################################ ############################################################################ ################# mtoc++ related information ############################### ############################################################################ -# Feel free to make any changes within this doxygen configuration file to -# taylor the output towards your needs. Any changes made by us to the doxygen -# config file in order to have mtoc++ running smoothly have been moved to the -# END of the file in order to easily keep custom changes over new mtoc++ versions. -# -# Depending on the output preferred style, checkout the -# OPTIMIZE_OUTPUT_FOR_C and OPTIMIZE_OUTPUT_FOR_JAVA settings. -# -# Most importantly, this file gets processed (when using our tools, e.g. -# MatlabDocMaker) in order to replace some values: -# - _ProjectName_: The project name configured in the tools -# (in MatlabDocMaker:MatlabDocMaker.getProjectVersion) -# - _ProjectVersion_: Is substituted by the value returned by -# MatlabDocMaker.getProjectVersion inside MatLab. We decided to keep -# this flexible as project versions change over time and the documentation -# should of course reflect that with minimum effort (thus, only a change -# inside Matlab is necessary, where you're expected to be working anyways) -# - _ProjectDescription_: A short description of the project -# - _ProjectLogo_: An absolute path to an image file to include as project logo -# - _OutputDir_: The output directory for the created documentation -# - _SourceDir_: The source directory containing the files of the project -# - _ConfDir_: The configuration directory for mtoc++, containing this file -# and some more. -# - _FileSep_: The file separator character, "/" for linux and "\" for windows. -# - _GenLatex_: Switch to tell doxygen to also generate LaTeX output. -# - _HaveDot_: "YES" or "NO" depending on automatic GraphViz detection on MatlabDocMaker.create -# Use these tags wherever you would insert the respective values. -# -# Furthermore, there are some settings that are included as convenience -# (e.g. the @new tags) that can be removed (but will likely cause errors if -# done wrongly). Check the ALIASES setting in the doxygen documentation. -# -# We recommend to leave -# EXTRACT_PRIVATE = NO -# if you make extensive use of classes as these methods are of course not -# thought to be public (cunning, isn't it?) and blow up the documentation. -# -# Last, have a look at DOCSET_FEEDNAME and DOCSET_BUNDLE_ID. -# -# Enjoy! -# ########################################################################### ################## List of changes: ####################################### -# -# mtoc++ 1.4: - Updated the doxyfile config to version 1.8. -# - Added placeholders for project description and logo -# - Set SOURCE_BROWSER = YES and FILTER_SOURCE_FILES = YES in -# order to have automatic inclusion of call graphs in the generated documentation. -# - Set EXLUDE_SYMLINKS = YES as default -# -# mtoc++ 1.4: - Added alias for an @events tag, creating a page of all events -# - Changed naming convention for alias-tags new and change as newer doxygen -# versions seem not to recognize \1\2-like combinations of arguments any more (?) -# now pages named "newfeat\1_\2" with underscore are created, please update your static -# references in your misc documentation files -# -# mtoc++ 1.3: - Changed the default value of SHOW_FILES to YES in order to avoid more -# confusion about what mtoc++ actually does (NOT replacing the -# requirement to know doxygen) -# - Included a warning in the beginning of this file -# -# mtoc++ 1.3: Included a new placeholder "_FILESEP_", as doxygen itself can manage -# using only "/" as file separator, however, the EXTRA_PACKAGES command -# leads to an inclusion line inside latex, which is not that tolerant. -# -# mtoc++ 1.2: Restructured this file during tests for Windows doc creation. -# - Config stuff is now at the END of the file. -# - New macro _MTOCFILTER_ for .sh and .bat file support. -# -# mtoc++ 1.2: First version to contain this file. -# ################################################################################ - ############### DEFAULT (DOXYGEN ONLY) CONFIGURATION ########################### -# The following settings can be adjusted to customize doxygen's behaviour and -# hence the output when using the tools like MatlabDocMaker ################################################################################ -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" "). - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. DOXYFILE_ENCODING = UTF-8 -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by +# double-quotes, unless you are using Doxywizard) that should identify the +# project for which the documentation is generated. This name is used in the +# title of most generated pages and in a few other places. +# The default value is: My Project. + +############### MTOC++ RELATED CONFIGURATION ################################### +################################################################################ + +PROJECT_NAME = "_ProjectName_" + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. This +# could be handy for archiving the generated documentation or if some version +# control system is used. + +PROJECT_NUMBER = _ProjectVersion_ + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer a +# quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = "_ProjectDescription_" + +# With the PROJECT_LOGO tag one can specify a logo or an icon that is included +# in the documentation. The maximum height of the logo should not exceed 55 +# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy +# the logo to the output directory. + +PROJECT_LOGO = "_ProjectLogo_" + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path +# into which the generated documentation will be written. If a relative path is +# entered, it will be relative to the location where doxygen was started. If +# left blank the current directory will be used. + +OUTPUT_DIRECTORY = "_OutputDir_" + +# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- +# directories (in 2 levels) under the output directory of each output format and +# will distribute the generated files over these directories. Enabling this +# option can be useful when feeding doxygen a huge amount of source files, where +# putting all generated files in the same directory would otherwise causes +# performance problems for the file system. +# The default value is: NO. CREATE_SUBDIRS = NO +# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII +# characters to appear in the names of generated files. If set to NO, non-ASCII +# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode +# U+3044. +# The default value is: NO. + +ALLOW_UNICODE_NAMES = NO + # The OUTPUT_LANGUAGE tag is used to specify the language in which all # documentation generated by doxygen is written. Doxygen will use this # information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. +# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, +# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), +# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, +# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), +# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, +# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, +# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, +# Ukrainian and Vietnamese. +# The default value is: English. OUTPUT_LANGUAGE = English -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. +# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all generated output in the proper direction. +# Possible values are: None, LTR, RTL and Context. +# The default value is: None. + +OUTPUT_TEXT_DIRECTION = None + +# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member +# descriptions after the members that are listed in the file and class +# documentation (similar to Javadoc). Set to NO to disable this. +# The default value is: YES. BRIEF_MEMBER_DESC = YES -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief +# description of a member or function before the detailed description +# +# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the # brief descriptions will be completely suppressed. +# The default value is: YES. REPEAT_BRIEF = NO -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" +# This tag implements a quasi-intelligent brief description abbreviator that is +# used to form the text in various listings. Each string in this list, if found +# as the leading text of the brief description, will be stripped from the text +# and the result, after processing the whole list, is used as the annotated +# text. Otherwise, the brief description is used as-is. If left blank, the +# following values are used ($name is automatically replaced with the name of +# the entity):The $name class, The $name widget, The $name file, is, provides, +# specifies, contains, represents, a, an and the. ABBREVIATE_BRIEF = "The $name class" \ "The $name widget" \ @@ -170,8 +154,9 @@ ABBREVIATE_BRIEF = "The $name class" \ the # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief +# doxygen will generate a detailed section even if there is only a brief # description. +# The default value is: NO. ALWAYS_DETAILED_SEC = NO @@ -179,495 +164,772 @@ ALWAYS_DETAILED_SEC = NO # inherited members of a class in the documentation of that class as if those # members were ordinary class members. Constructors, destructors and assignment # operators of the base classes will not be shown. +# The default value is: NO. INLINE_INHERITED_MEMB = NO -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. +# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path +# before files name in the file list and in the header files. If set to NO the +# shortest path that makes the file name unique will be used +# The default value is: YES. FULL_PATH_NAMES = NO -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. +# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. +# Stripping is only done if one of the specified strings matches the left-hand +# part of the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the path to +# strip. +# +# Note that you can specify absolute paths here, but also relative paths, which +# will be relative from the directory where doxygen is started. +# This tag requires that the tag FULL_PATH_NAMES is set to YES. STRIP_FROM_PATH = -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the +# path mentioned in the documentation of a class, which tells the reader which +# header file to include in order to use a class. If left blank only the name of +# the header file containing the class definition is used. Otherwise one should +# specify the list of include paths that are normally passed to the compiler +# using the -I flag. STRIP_FROM_INC_PATH = -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful if your file system -# doesn't support long names like on DOS, Mac, or CD-ROM. +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but +# less readable) file names. This can be useful is your file systems doesn't +# support long names like on DOS, Mac, or CD-ROM. +# The default value is: NO. SHORT_NAMES = NO -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) +# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the +# first line (until the first dot) of a Javadoc-style comment as the brief +# description. If set to NO, the Javadoc-style will behave just like regular Qt- +# style comments (thus requiring an explicit @brief command for a brief +# description.) +# The default value is: NO. JAVADOC_AUTOBRIEF = NO -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) +# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line +# such as +# /*************** +# as being the beginning of a Javadoc-style comment "banner". If set to NO, the +# Javadoc-style will behave just like regular comments and it will not be +# interpreted by doxygen. +# The default value is: NO. + +JAVADOC_BANNER = NO + +# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first +# line (until the first dot) of a Qt-style comment as the brief description. If +# set to NO, the Qt-style will behave just like regular Qt-style comments (thus +# requiring an explicit \brief command for a brief description.) +# The default value is: NO. QT_AUTOBRIEF = NO -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a +# multi-line C++ special comment block (i.e. a block of //! or /// comments) as +# a brief description. This used to be the default behavior. The new default is +# to treat a multi-line C++ comment block as a detailed description. Set this +# tag to YES if you prefer the old behavior instead. +# +# Note that setting this tag to YES also means that rational rose comments are +# not recognized any more. +# The default value is: NO. MULTILINE_CPP_IS_BRIEF = YES -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. +# By default Python docstrings are displayed as preformatted text and doxygen's +# special commands cannot be used. By setting PYTHON_DOCSTRING to NO the +# doxygen's special commands can be used and the contents of the docstring +# documentation blocks is shown as doxygen documentation. +# The default value is: YES. + +PYTHON_DOCSTRING = YES + +# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the +# documentation from any documented member that it re-implements. +# The default value is: YES. INHERIT_DOCS = YES -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. +# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new +# page for each member. If set to NO, the documentation of a member will be part +# of the file/class/namespace that contains it. +# The default value is: NO. SEPARATE_MEMBER_PAGES = NO -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. +# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen +# uses this value to replace tabs by spaces in code fragments. +# Minimum value: 1, maximum value: 16, default value: 4. TAB_SIZE = 4 -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding -# "class=itcl::class" will allow you to use the command class in the -# itcl::class meaning. +# This tag can be used to specify a number of aliases that act as commands in +# the documentation. An alias has the form: +# name=value +# For example adding +# "sideeffect=@par Side Effects:\n" +# will allow you to put the command \sideeffect (or @sideeffect) in the +# documentation, which will result in a user-defined paragraph with heading +# "Side Effects:". You can put \n's in the value part of an alias to insert +# newlines (in the resulting output). You can put ^^ in the value part of an +# alias to insert a newline as if a physical newline was in the original file. +# When you need a literal { or } or , in the value part of an alias you have to +# escape them by means of a backslash (\), this can lead to conflicts with the +# commands \{ and \} for these it is advised to use the version @{ and @} or use +# a double escape (\\{ and \\}) -TCL_SUBST = +ALIASES = "synupdate=\xrefitem synupdate \"Syntax Update\" \"Syntax needs to be updated\"" \ + "docupdate=\xrefitem docupdate \"Documentation Update\" \"Documentation needs to be updated\"" \ + "event=\xrefitem event \"Events\" \"List of all Events\"" \ + "default=\par Default:\n" \ + "type=
Type: " \ + "changexref{2}=\xrefitem changelog\1_\2 \"Change in \1.\2\" \"Changes in _ProjectName_ Version \1.\2\"" \ + "change{4} = \changexref{\1,\2} (\ref \3, \4) " \ + "change{3} = \changexref{\1,\2} (\ref \3, undated) " \ + "newxref{2}=\xrefitem newfeat\1_\2 \"New in \1.\2\" \"New features in _ProjectName_ Version \1.\2\"" \ + "new{4} = \newxref{\1,\2} (\ref \3, \4) " \ + "new{3} = \newxref{\1,\2} (\ref \3, undated) " \ + "propclass{1}=\xrefitem propclass_\1 \"Property class \1\" \"Properties with level \1\"" -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources +# only. Doxygen will then generate output that is more tailored for C. For +# instance, some of the names that are used will be different. The list of all +# members will be omitted, etc. +# The default value is: NO. OPTIMIZE_OUTPUT_FOR_C = NO -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or +# Python sources only. Doxygen will then generate output that is more tailored +# for that language. For instance, namespaces will be presented as packages, +# qualified scopes will look different, etc. +# The default value is: NO. OPTIMIZE_OUTPUT_JAVA = YES # Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. +# sources. Doxygen will then generate output that is tailored for Fortran. +# The default value is: NO. OPTIMIZE_FOR_FORTRAN = NO # Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. +# sources. Doxygen will then generate output that is tailored for VHDL. +# The default value is: NO. OPTIMIZE_OUTPUT_VHDL = NO -# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all -# comments according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you -# can mix doxygen, HTML, and XML commands with Markdown formatting. -# Disable only in case of backward compatibilities issues. +# Set the OPTIMIZE_OUTPUT_SLICE tag to YES if your project consists of Slice +# sources only. Doxygen will then generate output that is more tailored for that +# language. For instance, namespaces will be presented as modules, types will be +# separated into more groups, etc. +# The default value is: NO. + +OPTIMIZE_OUTPUT_SLICE = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given +# extension. Doxygen has a built-in mapping, but you can override or extend it +# using this tag. The format is ext=language, where ext is a file extension, and +# language is one of the parsers supported by doxygen: IDL, Java, JavaScript, +# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice, VHDL, +# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran: +# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser +# tries to guess whether the code is fixed or free formatted code, this is the +# default for Fortran type files). For instance to make doxygen treat .inc files +# as Fortran files (default is PHP), and .f files as C (default is Fortran), +# use: inc=Fortran f=C. +# +# Note: For files without extension you can use no_extension as a placeholder. +# +# Note that for custom extensions you also need to set FILE_PATTERNS otherwise +# the files are not read by doxygen. + +############### CRITICAL MTOC++ RELATED CONFIGURATION ########################## +################################################################################ + +EXTENSION_MAPPING = .m=C++ + +# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments +# according to the Markdown format, which allows for more readable +# documentation. See https://daringfireball.net/projects/markdown/ for details. +# The output of markdown processing is further processed by doxygen, so you can +# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in +# case of backward compatibilities issues. +# The default value is: YES. MARKDOWN_SUPPORT = YES -# When enabled doxygen tries to link words that correspond to documented classes, -# or namespaces to their corresponding documentation. Such a link can be -# prevented in individual cases by by putting a % sign in front of the word or +# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up +# to that level are automatically included in the table of contents, even if +# they do not have an id attribute. +# Note: This feature currently applies only to Markdown headings. +# Minimum value: 0, maximum value: 99, default value: 5. +# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. + +TOC_INCLUDE_HEADINGS = 5 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or # globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. AUTOLINK_SUPPORT = YES # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration # diagrams that involve STL classes more complete and accurate. +# The default value is: NO. BUILTIN_STL_SUPPORT = YES # If you use Microsoft's C++/CLI language, you should set this option to YES to # enable parsing support. +# The default value is: NO. CPP_CLI_SUPPORT = NO -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. +# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: +# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen +# will parse them like normal C++ but will assume all classes use public instead +# of private inheritance when no explicit protection keyword is present. +# The default value is: NO. SIP_SUPPORT = NO -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. +# For Microsoft's IDL there are propget and propput attributes to indicate +# getter and setter methods for a property. Setting this option to YES will make +# doxygen to replace the get and set methods by a property in the documentation. +# This will only work if the methods are indeed getting or setting a simple +# type. If this is not the case, or you want to show the methods anyway, you +# should set this option to NO. +# The default value is: YES. IDL_PROPERTY_SUPPORT = YES # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first +# tag is set to YES then doxygen will reuse the documentation of the first # member in the group (if any) for the other members of the group. By default # all members of a group must be documented explicitly. +# The default value is: NO. DISTRIBUTE_GROUP_DOC = NO -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. +# If one adds a struct or class to a group and this option is enabled, then also +# any nested class or struct is added to the same group. By default this option +# is disabled and one has to add nested compounds explicitly via \ingroup. +# The default value is: NO. + +GROUP_NESTED_COMPOUNDS = NO + +# Set the SUBGROUPING tag to YES to allow class member groups of the same type +# (for instance a group of public functions) to be put as a subgroup of that +# type (e.g. under the Public Functions section). Set it to NO to prevent +# subgrouping. Alternatively, this can be done per class using the +# \nosubgrouping command. +# The default value is: YES. SUBGROUPING = YES -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions +# are shown inside the group in which they are included (e.g. using \ingroup) +# instead of on a separate page (for HTML and Man pages) or section (for LaTeX +# and RTF). +# +# Note that this feature does not work in combination with +# SEPARATE_MEMBER_PAGES. +# The default value is: NO. + +INLINE_GROUPED_CLASSES = NO + +# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions +# with only public data fields or simple typedef fields will be shown inline in +# the documentation of the scope in which they are defined (i.e. file, +# namespace, or group documentation), provided this scope is documented. If set +# to NO, structs, classes, and unions are shown on a separate page (for HTML and +# Man pages) or section (for LaTeX and RTF). +# The default value is: NO. + +INLINE_SIMPLE_STRUCTS = NO + +# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or +# enum is documented as struct, union, or enum with the name of the typedef. So # typedef struct TypeS {} TypeT, will appear in the documentation as a struct # with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound +# namespace, or class. And the struct will be named TypeS. This can typically be +# useful for C code in case the coding convention dictates that all compound # types are typedef'ed and only the typedef is referenced, never the tag name. +# The default value is: NO. TYPEDEF_HIDES_STRUCT = YES -# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be -# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given -# their name and scope. Since this can be an expensive process and often the -# same symbol appear multiple times in the code, doxygen keeps a cache of -# pre-resolved symbols. If the cache is too small doxygen will become slower. -# If the cache is too large, memory is wasted. The cache size is given by this -# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. LOOKUP_CACHE_SIZE = 0 +# The NUM_PROC_THREADS specifies the number threads doxygen is allowed to use +# during processing. When set to 0 doxygen will based this on the number of +# cores available in the system. You can set it explicitly to a value larger +# than 0 to get more control over the balance between CPU load and processing +# speed. At this moment only the input processing can be done using multiple +# threads. Since this is still an experimental feature the default is set to 1, +# which efficively disables parallel processing. Please report any issues you +# encounter. Generating dot graphs in parallel is controlled by the +# DOT_NUM_THREADS setting. +# Minimum value: 0, maximum value: 32, default value: 1. + +NUM_PROC_THREADS = 0 + #--------------------------------------------------------------------------- # Build related configuration options #--------------------------------------------------------------------------- -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. EXTRACT_ALL = NO -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. EXTRACT_PRIVATE = NO -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. +# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual +# methods of a class will be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIV_VIRTUAL = NO + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = NO + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. EXTRACT_STATIC = YES -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. EXTRACT_LOCAL_CLASSES = YES -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. +# This flag is only useful for Objective-C code. If set to YES, local methods, +# which are defined in the implementation section but not in the interface are +# included in the documentation. If set to NO, only methods in the interface are +# included. +# The default value is: NO. EXTRACT_LOCAL_METHODS = YES # If this flag is set to YES, the members of anonymous namespaces will be # extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespaces are hidden. +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. EXTRACT_ANON_NSPACES = NO -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. HIDE_UNDOC_MEMBERS = NO -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. HIDE_UNDOC_CLASSES = NO -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# declarations. If set to NO, these declarations will be included in the # documentation. +# The default value is: NO. HIDE_FRIEND_COMPOUNDS = YES -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. HIDE_IN_BODY_DOCS = NO -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. INTERNAL_DOCS = NO -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also # allowed. This is useful if you have classes or files whose names only differ # in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. +# (including Cygwin) and Mac users are advised to set this option to NO. +# The default value is: system dependent. CASE_SENSE_NAMES = NO -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. HIDE_SCOPE_NAMES = YES -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. SHOW_INCLUDE_FILES = YES -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. FORCE_LOCAL_INCLUDES = NO -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. INLINE_INFO = YES -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. SORT_MEMBER_DOCS = NO -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. SORT_BRIEF_DOCS = NO -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. SORT_MEMBERS_CTORS_1ST = NO -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. SORT_GROUP_NAMES = NO -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. SORT_BY_SCOPE_NAME = YES -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to -# do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even -# if there is only one candidate or it is obvious which candidate to choose -# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen -# will still accept a match between prototype and implementation in such cases. +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. STRICT_PROTO_MATCHING = NO -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. GENERATE_TODOLIST = YES -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. GENERATE_TESTLIST = NO -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. GENERATE_BUGLIST = YES -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. GENERATE_DEPRECATEDLIST= YES -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. ENABLED_SECTIONS = -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or macro consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and macros in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. MAX_INITIALIZER_LINES = 30 -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the # list will mention the files that were used to generate the documentation. +# The default value is: YES. SHOW_USED_FILES = NO -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. SHOW_FILES = YES -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. -# This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. SHOW_NAMESPACES = YES # The FILE_VERSION_FILTER tag can be used to specify a program or script that # doxygen should invoke to get the current version for each file (typically from # the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. FILE_VERSION_FILTER = # The LAYOUT_FILE tag can be used to specify a layout file which will be parsed # by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. The create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. LAYOUT_FILE = +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + #--------------------------------------------------------------------------- -# configuration options related to warning and progress messages +# Configuration options related to warning and progress messages #--------------------------------------------------------------------------- -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. QUIET = NO # The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. WARNINGS = YES -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. WARN_IF_UNDOCUMENTED = YES -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. WARN_IF_DOC_ERROR = YES -# The WARN_NO_PARAMDOC option can be enabled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. +# The default value is: NO. WARN_NO_PARAMDOC = YES -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. WARN_FORMAT = "$file:$line: $text" +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = + #--------------------------------------------------------------------------- -# configuration options related to the input files +# Configuration options related to the input files #--------------------------------------------------------------------------- +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = "_SourceDir_/README.md" \ + "_SourceDir_/LICENSE.md" \ + "_SourceDir_/INSTALL.md" \ + "_SourceDir_/documentation/MATLAB_.md" \ + "_SourceDir_/documentation/CPP_.md" \ + "_SourceDir_/include" \ + "_SourceDir_/matlab" + + # This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. +# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses +# libiconv (or the iconv built into libc) for the transcoding. See the libiconv +# documentation (see: https://www.gnu.org/software/libiconv/) for the list of +# possible encodings. +# The default value is: UTF-8. INPUT_ENCODING = UTF-8 -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and +# *.h) to filter out the source-files in the directories. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# read by doxygen. +# +# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, +# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, +# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, +# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment), +# *.doc (to be provided as doxygen C comment), *.txt (to be provided as doxygen +# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f18, *.f, *.for, *.vhd, +# *.vhdl, *.ucf, *.qsf and *.ice. + +FILE_PATTERNS = *.m \ + *.c \ + *.cc \ + *.cpp \ + *.mex \ + *.h \ + *.hh \ + *.hpp \ + *.dox \ + *.md + +# The RECURSIVE tag can be used to specify whether or not subdirectories should +# be searched for input files as well. +# The default value is: NO. RECURSIVE = YES -# The EXCLUDE tag can be used to specify files and/or directories that should +# The EXCLUDE tag can be used to specify files and/or directories that should be # excluded from the INPUT source files. This way you can easily exclude a # subdirectory from a directory tree whose root is specified with the INPUT tag. +# +# Note that relative paths are relative to the directory from which doxygen is +# run. EXCLUDE = "src/solver_cvodes.cpp" \ "src/solver_idas.cpp" \ @@ -677,17 +939,19 @@ EXCLUDE = "src/solver_cvodes.cpp" \ "include/amici/solver_idas.h" \ "python/amici/setup.template.py" -# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded # from the input. +# The default value is: NO. EXCLUDE_SYMLINKS = YES # If the value of the INPUT tag contains directories, you can use the # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* +# certain files from those directories. +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories for example use the pattern */test/* EXCLUDE_PATTERNS = "_SourceDir_/models/*" \ "_SourceDir_/tests/*" \ @@ -696,7 +960,7 @@ EXCLUDE_PATTERNS = "_SourceDir_/models/*" \ "_SourceDir_/matlab/examples/*" \ "_SourceDir_/matlab/mtoc/*" \ "_SourceDir_/matlab/auxiliary/*" \ - "_SourceDir_/matlab/SBMLImporter/*" \ + "_SourceDir_/matlab/SBMLimporter/*" \ "_SourceDir_/matlab/tests/*" \ "_SourceDir_/python/tests/*" \ "_SourceDir_/python/sdist/*" \ @@ -711,679 +975,1189 @@ EXCLUDE_PATTERNS = "_SourceDir_/models/*" \ # output. The symbol name can be a fully qualified name, a word, or if the # wildcard * is used, a substring. Examples: ANamespace, AClass, # AClass::ANamespace, ANamespace::*Test +# +# Note that the wildcards are matched against the file with absolute path, so to +# exclude all test directories use the pattern */test/* EXCLUDE_SYMBOLS = -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). +# The EXAMPLE_PATH tag can be used to specify one or more files or directories +# that contain example code fragments that are included (see the \include +# command). EXAMPLE_PATH = # If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and +# *.h) to filter out the source-files in the directories. If left blank all +# files are included. EXAMPLE_PATTERNS = * # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. +# searched for input files to be used with the \include or \dontinclude commands +# irrespective of the value of the RECURSIVE tag. +# The default value is: NO. EXAMPLE_RECURSIVE = NO -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). +# The IMAGE_PATH tag can be used to specify one or more files or directories +# that contain images that are to be included in the documentation (see the +# \image command). IMAGE_PATH = # The INPUT_FILTER tag can be used to specify a program that doxygen should # invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. -# If FILTER_PATTERNS is specified, this tag will be -# ignored. +# by executing (via popen()) the command: +# +# +# +# where is the value of the INPUT_FILTER tag, and is the +# name of an input file. Doxygen will then use the output that the filter +# program writes to standard output. If FILTER_PATTERNS is specified, this tag +# will be ignored. +# +# Note that the filter must not add or remove lines; it is applied before the +# code is scanned, but not when the output code is generated. If lines are added +# or removed, the anchors will not be placed correctly. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. INPUT_FILTER = +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. The filters are a list of the form: pattern=filter +# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how +# filters are used. If the FILTER_PATTERNS tag is empty or if none of the +# patterns match the file name, INPUT_FILTER is applied. +# +# Note that for custom extensions or not directly supported extensions you also +# need to set EXTENSION_MAPPING for the extension otherwise the files are not +# properly processed by doxygen. + +FILTER_PATTERNS = "*.m=_MTOCFILTER_" + # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). +# INPUT_FILTER) will also be used to filter the input files that are used for +# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). +# The default value is: NO. FILTER_SOURCE_FILES = YES # The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) -# and it is also possible to disable source filtering for a specific pattern -# using *.ext= (so without naming a filter). This option only has effect when -# FILTER_SOURCE_FILES is enabled. +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and +# it is also possible to disable source filtering for a specific pattern using +# *.ext= (so without naming a filter). +# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. FILTER_SOURCE_PATTERNS = +# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that +# is part of the input, its contents will be placed on the main page +# (index.html). This can be useful if you have a project on for instance GitHub +# and want to reuse the introduction page also for the doxygen output. + +USE_MDFILE_AS_MAINPAGE = "_SourceDir_/README.md" + #--------------------------------------------------------------------------- -# configuration options related to source browsing +# Configuration options related to source browsing #--------------------------------------------------------------------------- -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. +# If the SOURCE_BROWSER tag is set to YES then a list of source files will be +# generated. Documented entities will be cross-referenced with these sources. +# +# Note: To get rid of all source code in the generated output, make sure that +# also VERBATIM_HEADERS is set to NO. +# The default value is: NO. SOURCE_BROWSER = YES -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. +# Setting the INLINE_SOURCES tag to YES will include the body of functions, +# classes and enums directly into the documentation. +# The default value is: NO. INLINE_SOURCES = NO -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C and C++ comments will always remain visible. +# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any +# special comment blocks from generated source code fragments. Normal C, C++ and +# Fortran comments will always remain visible. +# The default value is: YES. STRIP_CODE_COMMENTS = YES -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. +# If the REFERENCED_BY_RELATION tag is set to YES then for each documented +# entity all documented functions referencing it will be listed. +# The default value is: NO. REFERENCED_BY_RELATION = NO -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. +# If the REFERENCES_RELATION tag is set to YES then for each documented function +# all documented entities called/used by that function will be listed. +# The default value is: NO. REFERENCES_RELATION = NO -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. -# Otherwise they will link to the documentation. +# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set +# to YES then the hyperlinks from functions in REFERENCES_RELATION and +# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will +# link to the documentation. +# The default value is: YES. REFERENCES_LINK_SOURCE = YES -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. +# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the +# source code will show a tooltip with additional information such as prototype, +# brief description and links to the definition and documentation. Since this +# will make the HTML file larger and loading of large files a bit slower, you +# can opt to disable this feature. +# The default value is: YES. +# This tag requires that the tag SOURCE_BROWSER is set to YES. + +SOURCE_TOOLTIPS = YES + +# If the USE_HTAGS tag is set to YES then the references to source code will +# point to the HTML generated by the htags(1) tool instead of doxygen built-in +# source browser. The htags tool is part of GNU's global source tagging system +# (see https://www.gnu.org/software/global/global.html). You will need version +# 4.8.6 or higher. +# +# To use it do the following: +# - Install the latest version of global +# - Enable SOURCE_BROWSER and USE_HTAGS in the configuration file +# - Make sure the INPUT points to the root of the source tree +# - Run doxygen as normal +# +# Doxygen will invoke htags (and that will in turn invoke gtags), so these +# tools must be available from the command line (i.e. in the search path). +# +# The result: instead of the source browser generated by doxygen, the links to +# source code will now point to the output of htags. +# The default value is: NO. +# This tag requires that the tag SOURCE_BROWSER is set to YES. USE_HTAGS = NO -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. +# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a +# verbatim copy of the header file for each class for which an include is +# specified. Set to NO to disable this. +# See also: Section \class. +# The default value is: YES. VERBATIM_HEADERS = NO #--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index +# Configuration options related to the alphabetical class index #--------------------------------------------------------------------------- -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all +# compounds will be generated. Enable this if the project contains a lot of +# classes, structs, unions or interfaces. +# The default value is: YES. ALPHABETICAL_INDEX = NO -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) +# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in +# which the alphabetical index list will be split. +# Minimum value: 1, maximum value: 20, default value: 5. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. COLS_IN_ALPHA_INDEX = 5 -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. +# In case all classes in a project start with a common prefix, all classes will +# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag +# can be used to specify a prefix (or a list of prefixes) that should be ignored +# while generating the index headers. +# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. IGNORE_PREFIX = #--------------------------------------------------------------------------- -# configuration options related to the HTML output +# Configuration options related to the HTML output #--------------------------------------------------------------------------- -# See on bottom of file for mtoc++ related HTML settings. -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. +# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output +# The default value is: YES. + +GENERATE_HTML = YES + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a +# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of +# it. +# The default directory is: html. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_OUTPUT = "_OutputDir_" + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each +# generated HTML page (for example: .htm, .php, .asp). +# The default value is: .html. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_FILE_EXTENSION = .html -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. Note that when using a custom header you are responsible -# for the proper inclusion of any scripts and style sheets that doxygen -# needs, which is dependent on the configuration options used. -# It is adviced to generate a default header using "doxygen -w html -# header.html footer.html stylesheet.css YourConfigFile" and then modify -# that header. Note that the header is subject to change so you typically -# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW! +# The HTML_HEADER tag can be used to specify a user-defined HTML header file for +# each generated HTML page. If the tag is left blank doxygen will generate a +# standard header. +# +# To get valid HTML the header file that includes any scripts and style sheets +# that doxygen needs, which is dependent on the configuration options used (e.g. +# the setting GENERATE_TREEVIEW). It is highly recommended to start with a +# default header using +# doxygen -w html new_header.html new_footer.html new_stylesheet.css +# YourConfigFile +# and then modify the file new_header.html. See also section "Doxygen usage" +# for information on how to generate the default header that doxygen normally +# uses. +# Note: The header is subject to change so you typically have to regenerate the +# default header when upgrading to a newer version of doxygen. For a description +# of the possible markers and block names see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_HEADER = -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. +# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each +# generated HTML page. If the tag is left blank doxygen will generate a standard +# footer. See HTML_HEADER for more information on how to generate a default +# footer and what special commands can be used inside the footer. See also +# section "Doxygen usage" for information on how to generate the default footer +# that doxygen normally uses. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_FOOTER = -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# stylesheet in the HTML output directory as well, or it will be erased! +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style +# sheet that is used by each HTML page. It can be used to fine-tune the look of +# the HTML output. If left blank doxygen will generate a default style sheet. +# See also section "Doxygen usage" for information on how to generate the style +# sheet that doxygen normally uses. +# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as +# it is more robust and this tag (HTML_STYLESHEET) will in the future become +# obsolete. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_STYLESHEET = "_ConfDir_/customdoxygen.css" +# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined +# cascading style sheets that are included after the standard style sheets +# created by doxygen. Using this option one can overrule certain style aspects. +# This is preferred over using HTML_STYLESHEET since it does not replace the +# standard style sheet and is therefore more robust against future updates. +# Doxygen will copy the style sheet files to the output directory. +# Note: The order of the extra style sheet files is of importance (e.g. the last +# style sheet in the list overrules the setting of the previous ones in the +# list). For an example see the documentation. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_EXTRA_STYLESHEET = + # The HTML_EXTRA_FILES tag can be used to specify one or more extra images or # other source files which should be copied to the HTML output directory. Note # that these files will be copied to the base HTML output directory. Use the -# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that -# the files will be copied as-is; there are no commands or markers available. +# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that the +# files will be copied as-is; there are no commands or markers available. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_EXTRA_FILES = -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the stylesheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen +# will adjust the colors in the style sheet and background images according to +# this color. Hue is specified as an angle on a colorwheel, see +# https://en.wikipedia.org/wiki/Hue for more information. For instance the value +# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 +# purple, and 360 is red again. +# Minimum value: 0, maximum value: 359, default value: 220. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_HUE = 220 -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors +# in the HTML output. For a value of 0 the output will use grayscales only. A +# value of 255 will produce the most vivid colors. +# Minimum value: 0, maximum value: 255, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_SAT = 100 -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the +# luminance component of the colors in the HTML output. Values below 100 +# gradually make the output lighter, whereas values above 100 make the output +# darker. The value divided by 100 is the actual gamma applied, so 80 represents +# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not +# change the gamma. +# Minimum value: 40, maximum value: 240, default value: 80. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_COLORSTYLE_GAMMA = 80 # If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. +# page will contain the date and time when the page was generated. Setting this +# to YES can help to show when doxygen was last run and thus if the +# documentation is up to date. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_TIMESTAMP = YES +# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML +# documentation will contain a main index with vertical navigation menus that +# are dynamically created via JavaScript. If disabled, the navigation index will +# consists of multiple levels of tabs that are statically embedded in every HTML +# page. Disable this option to support browsers that do not have JavaScript, +# like the Qt help browser. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_DYNAMIC_MENUS = YES + # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML # documentation will contain sections that can be hidden and shown after the -# page has loaded. For this to work a browser that supports -# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox -# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). +# page has loaded. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. HTML_DYNAMIC_SECTIONS = YES -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. +# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries +# shown in the various tree structured indices initially; the user can expand +# and collapse entries dynamically later on. Doxygen will expand the tree to +# such a level that at most the specified number of entries are visible (unless +# a fully collapsed tree already exceeds this amount). So setting the number of +# entries 1 will produce a full collapsed tree by default. 0 is a special value +# representing an infinite number of entries and will result in a full expanded +# tree by default. +# Minimum value: 0, maximum value: 9999, default value: 100. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_INDEX_NUM_ENTRIES = 100 + +# If the GENERATE_DOCSET tag is set to YES, additional index files will be +# generated that can be used as input for Apple's Xcode 3 integrated development +# environment (see: https://developer.apple.com/xcode/), introduced with OSX +# 10.5 (Leopard). To create a documentation set, doxygen will generate a +# Makefile in the HTML output directory. Running make will produce the docset in +# that directory and running make install will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at +# startup. See https://developer.apple.com/library/archive/featuredarticles/Doxy +# genXcode/_index.html for more information. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_DOCSET = NO -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. +# This tag determines the name of the docset feed. A documentation feed provides +# an umbrella under which multiple documentation sets from a single provider +# (such as a company or product suite) can be grouped. +# The default value is: Doxygen generated docs. +# This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_FEEDNAME = "_ProjectName_ documentation" -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. +# This tag specifies a string that should uniquely identify the documentation +# set bundle. This should be a reverse domain-name style string, e.g. +# com.mycompany.MyDocSet. Doxygen will append .docset to the name. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_BUNDLE_ID = _ProjectName_._ProjectVersion_ -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify # the documentation publisher. This should be a reverse domain-name style # string, e.g. com.mycompany.MyDocSet.documentation. +# The default value is: org.doxygen.Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_ID = org.doxygen.Publisher -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. +# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. +# The default value is: Publisher. +# This tag requires that the tag GENERATE_DOCSET is set to YES. DOCSET_PUBLISHER_NAME = _ProjectName_ -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. +# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three +# additional HTML index files: index.hhp, index.hhc, and index.hhk. The +# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop +# (see: https://www.microsoft.com/en-us/download/details.aspx?id=21138) on +# Windows. +# +# The HTML Help Workshop contains a compiler that can convert all HTML output +# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML +# files are now used as the Windows 98 help format, and will replace the old +# Windows help format (.hlp) on all Windows platforms in the future. Compressed +# HTML files also contain an index, a table of contents, and you can search for +# words in the documentation. The HTML workshop also contains a viewer for +# compressed HTML files. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_HTMLHELP = NO -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be +# The CHM_FILE tag can be used to specify the file name of the resulting .chm +# file. You can add a path in front of the file if the result should not be # written to the html output directory. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_FILE = -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. +# The HHC_LOCATION tag can be used to specify the location (absolute path +# including file name) of the HTML help compiler (hhc.exe). If non-empty, +# doxygen will try to run the HTML help compiler on the generated index.hhp. +# The file has to be specified with full path. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. HHC_LOCATION = -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). +# The GENERATE_CHI flag controls if a separate .chi index file is generated +# (YES) or that it should be included in the main .chm file (NO). +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. GENERATE_CHI = NO -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. +# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) +# and project file content. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. CHM_INDEX_ENCODING = -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. +# The BINARY_TOC flag controls whether a binary table of contents is generated +# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it +# enables the Previous and Next buttons. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. BINARY_TOC = NO -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. +# The TOC_EXPAND flag can be set to YES to add extra items for group members to +# the table of contents of the HTML help documentation and to the tree view. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTMLHELP is set to YES. TOC_EXPAND = NO # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that +# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help +# (.qch) of the generated HTML documentation. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_QHP = NO -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify +# the file name of the resulting .qch file. The path specified is relative to +# the HTML output folder. +# This tag requires that the tag GENERATE_QHP is set to YES. QCH_FILE = -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace +# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help +# Project output. For more information please see Qt Help Project / Namespace +# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace). +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_QHP is set to YES. QHP_NAMESPACE = org.doxygen.Project -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt +# Help Project output. For more information please see Qt Help Project / Virtual +# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual- +# folders). +# The default value is: doc. +# This tag requires that the tag GENERATE_QHP is set to YES. QHP_VIRTUAL_FOLDER = doc -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters +# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom +# filter to add. For more information please see Qt Help Project / Custom +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_NAME = -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. +# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see Qt Help Project / Custom +# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom- +# filters). +# This tag requires that the tag GENERATE_QHP is set to YES. QHP_CUST_FILTER_ATTRS = # The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. +# project's filter section matches. Qt Help Project / Filter Attributes (see: +# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes). +# This tag requires that the tag GENERATE_QHP is set to YES. QHP_SECT_FILTER_ATTRS = -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. +# The QHG_LOCATION tag can be used to specify the location of Qt's +# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the +# generated .qhp file. +# This tag requires that the tag GENERATE_QHP is set to YES. QHG_LOCATION = -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be +# generated, together with the HTML files, they form an Eclipse help plugin. To +# install this plugin and make it available under the help contents menu in +# Eclipse, the contents of the directory containing the HTML and XML files needs +# to be copied into the plugins directory of eclipse. The name of the directory +# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. +# After copying Eclipse needs to be restarted before the help appears. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_ECLIPSEHELP = NO -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. +# A unique identifier for the Eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have this +# name. Each documentation set should have its own identifier. +# The default value is: org.doxygen.Project. +# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. ECLIPSE_DOC_ID = org.doxygen.Project -# The DISABLE_INDEX tag can be used to turn on/off the condensed index at -# top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. +# If you want full control over the layout of the generated HTML pages it might +# be necessary to disable the index and replace it with your own. The +# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top +# of each HTML page. A value of NO enables the index and the value YES disables +# it. Since the tabs in the index contain the same information as the navigation +# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. DISABLE_INDEX = NO -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values -# (range [0,1..20]) that doxygen will group on one line in the generated HTML -# documentation. Note that a value of 0 will completely suppress the enum -# values from appearing in the overview section. - -ENUM_VALUES_PER_LINE = 4 - # The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. +# structure should be generated to display hierarchical information. If the tag +# value is set to YES, a side panel will be generated containing a tree-like +# index structure (just like the one that is generated for HTML Help). For this +# to work a browser that supports JavaScript, DHTML, CSS and frames is required +# (i.e. any modern browser). Windows users are probably better off using the +# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can +# further fine-tune the look of the index. As an example, the default style +# sheet generated by doxygen has an example that shows how to put an image at +# the root of the tree instead of the PROJECT_NAME. Since the tree basically has +# the same information as the tab index, you could consider setting +# DISABLE_INDEX to YES when enabling this option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. GENERATE_TREEVIEW = ALL -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that +# doxygen will group on one line in the generated HTML documentation. +# +# Note that a value of 0 will completely suppress the enum values from appearing +# in the overview section. +# Minimum value: 0, maximum value: 20, default value: 4. +# This tag requires that the tag GENERATE_HTML is set to YES. + +ENUM_VALUES_PER_LINE = 4 + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used +# to set the initial width (in pixels) of the frame in which the tree is shown. +# Minimum value: 0, maximum value: 1500, default value: 250. +# This tag requires that the tag GENERATE_HTML is set to YES. TREEVIEW_WIDTH = 250 -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. +# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to +# external symbols imported via tag files in a separate window. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. EXT_LINKS_IN_WINDOW = NO -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. +# If the HTML_FORMULA_FORMAT option is set to svg, doxygen will use the pdf2svg +# tool (see https://github.com/dawbarton/pdf2svg) or inkscape (see +# https://inkscape.org) to generate formulas as SVG images instead of PNGs for +# the HTML output. These images will generally look nicer at scaled resolutions. +# Possible values are: png (the default) and svg (looks nicer but requires the +# pdf2svg or inkscape tool). +# The default value is: png. +# This tag requires that the tag GENERATE_HTML is set to YES. + +HTML_FORMULA_FORMAT = png + +# Use this tag to change the font size of LaTeX formulas included as images in +# the HTML documentation. When you change the font size after a successful +# doxygen run you need to manually remove any form_*.png images from the HTML +# output directory to force them to be regenerated. +# Minimum value: 8, maximum value: 50, default value: 10. +# This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_FONTSIZE = 10 -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. +# Use the FORMULA_TRANSPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are not +# supported properly for IE 6.0, but are supported on all modern browsers. +# +# Note that when changing this option you need to delete any form_*.png files in +# the HTML output directory before the changes have effect. +# The default value is: YES. +# This tag requires that the tag GENERATE_HTML is set to YES. FORMULA_TRANSPARENT = YES -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the -# rendering instead of using prerendered bitmaps. Use this if you do not -# have LaTeX installed or if you want to formulas look prettier in the HTML -# output. When enabled you also need to install MathJax separately and -# configure the path to it using the MATHJAX_RELPATH option. +# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands +# to create new LaTeX commands to be used in formulas as building blocks. See +# the section "Including formulas" for details. + +FORMULA_MACROFILE = + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see +# https://www.mathjax.org) which uses client side JavaScript for the rendering +# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX +# installed or if you want to formulas look prettier in the HTML output. When +# enabled you may also need to install MathJax separately and configure the path +# to it using the MATHJAX_RELPATH option. +# The default value is: NO. +# This tag requires that the tag GENERATE_HTML is set to YES. USE_MATHJAX = NO -# When MathJax is enabled you need to specify the location relative to the -# HTML output directory using the MATHJAX_RELPATH option. The destination -# directory should contain the MathJax.js script. For instance, if the mathjax -# directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the -# mathjax.org site, so you can quickly see the result without installing -# MathJax, but it is strongly recommended to install a local copy of MathJax -# before deployment. +# When MathJax is enabled you can set the default output format to be used for +# the MathJax output. See the MathJax site (see: +# http://docs.mathjax.org/en/latest/output.html) for more details. +# Possible values are: HTML-CSS (which is slower, but has the best +# compatibility), NativeMML (i.e. MathML) and SVG. +# The default value is: HTML-CSS. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_FORMAT = HTML-CSS + +# When MathJax is enabled you need to specify the location relative to the HTML +# output directory using the MATHJAX_RELPATH option. The destination directory +# should contain the MathJax.js script. For instance, if the mathjax directory +# is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax +# Content Delivery Network so you can quickly see the result without installing +# MathJax. However, it is strongly recommended to install a local copy of +# MathJax from https://www.mathjax.org before deployment. +# The default value is: https://cdn.jsdelivr.net/npm/mathjax@2. +# This tag requires that the tag USE_MATHJAX is set to YES. MATHJAX_RELPATH = http://www.mathjax.org/mathjax -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. +# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax +# extension names that should be enabled during MathJax rendering. For example +# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_EXTENSIONS = + +# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces +# of code that will be used on startup of the MathJax code. See the MathJax site +# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an +# example see the documentation. +# This tag requires that the tag USE_MATHJAX is set to YES. + +MATHJAX_CODEFILE = + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box for +# the HTML output. The underlying search engine uses javascript and DHTML and +# should work on any modern browser. Note that when using HTML help +# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) +# there is already a search function so this one should typically be disabled. +# For large projects the javascript based search engine can be slow, then +# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to +# search using the keyboard; to jump to the search box use + S +# (what the is depends on the OS and browser, but it is typically +# , /