├── .gitignore ├── AUTHORS ├── BUGFIXES ├── COPYING ├── ChangeLog ├── INSTALL ├── INSTALL_SOLARIS ├── INSTALL_WIN.txt ├── KNOWN_BUGS ├── Makefile.am ├── NEWS ├── OUTLOOK ├── Perlen └── AddLegend.pl ├── README ├── SOS_Win32 ├── SBW_odeSolver │ ├── SBWOdeSolver.cpp │ ├── SBWOdeSolver.h │ ├── SBW_odeSolver.vcproj │ └── main.c ├── SOSLib │ └── SOSLib.vcproj ├── SOS_CommandLine │ └── SOS_CommandLine.vcproj └── SOS_Win32.sln ├── SOSlib.doxy ├── TODO ├── Test ├── simple.sh └── testsuite │ ├── README │ ├── odeSolver-wrapper-once.pl │ ├── odeSolver-wrapper.bsh │ ├── testlist.txt │ ├── testlog.txt │ └── workingtests.txt ├── VERSION.txt ├── Win32 ├── CompleteSOSLib │ └── CompleteSOSLib.sln ├── Examples │ ├── ASTIndexTest │ │ ├── .cvsignore │ │ ├── ASTIndexTest.sln │ │ └── ASTIndexTest.vcproj │ ├── ChangingIntegratorInstance │ │ ├── .cvsignore │ │ ├── ChangingIntegratorInstance.sln │ │ └── ChangingIntegratorInstance.vcproj │ ├── ChangingParameterIntegrator │ │ ├── .cvsignore │ │ ├── ChangingParameterIntegrator.sln │ │ └── ChangingParameterIntegrator.vcproj │ ├── IntegratorInstance │ │ ├── .cvsignore │ │ ├── IntegratorInstance.sln │ │ └── IntegratorInstance.vcproj │ ├── ParameterScanner │ │ ├── .cvsignore │ │ ├── ParameterScanner.sln │ │ └── ParameterScanner.vcproj │ ├── Sense │ │ ├── Sense.sln │ │ └── Sense │ │ │ └── Sense.vcproj │ ├── Sensitivity │ │ ├── Sensitivity.sln │ │ └── Sensitivity.vcproj │ ├── SharingIntegratorInstance │ │ ├── .cvsignore │ │ ├── SharingIntegratorInstance.sln │ │ └── SharingIntegratorInstance.vcproj │ └── TwinIntegratorInstance │ │ ├── TwinIntegratorInstance.sln │ │ └── TwinIntegratorInstance.vcproj ├── README.txt ├── README_FOR_RELEASE.txt ├── SBML_odeSolver │ ├── .cvsignore │ ├── SBML_odeSolver.sln │ ├── SBML_odeSolver │ │ ├── .cvsignore │ │ ├── ReadMe.txt │ │ ├── SBML_odeSolver.cpp │ │ └── SBML_odeSolver.vcproj │ └── include │ │ └── config.h ├── SBML_odeSolverApp │ ├── .cvsignore │ ├── SBML_odeSolverApp.sln │ └── SBML_odeSolverApp │ │ ├── .cvsignore │ │ ├── SBML_odeSolverApp.vcproj │ │ ├── getopt.h │ │ ├── my_getopt.c │ │ └── my_getopt.h ├── TODO.txt ├── WinCVODE │ ├── .cvsignore │ ├── CVODE │ │ └── include │ │ │ ├── iterativ.h │ │ │ └── llnltyps.h │ ├── WinCVODE.sln │ ├── WinCVODE │ │ ├── .cvsignore │ │ ├── ReadMe.txt │ │ ├── WinCVODE.cpp │ │ ├── WinCVODE.h │ │ └── WinCVODE.vcproj │ └── sundials │ │ ├── INSTALL_NOTES │ │ ├── Makefile │ │ ├── Makefile.in │ │ ├── README │ │ ├── config.h │ │ ├── config.hin │ │ ├── config.log │ │ ├── config.status │ │ ├── config │ │ ├── config.guess │ │ ├── config.sub │ │ ├── fortran_update.in │ │ ├── install-sh │ │ ├── ltmain.sh │ │ ├── sundials_config.h │ │ └── sundials_config.in │ │ ├── configure │ │ ├── cvode │ │ ├── LICENSE │ │ ├── README │ │ ├── doc │ │ │ ├── cv_examples.pdf │ │ │ ├── cv_examples.ps │ │ │ ├── cv_guide.pdf │ │ │ └── cv_guide.ps │ │ ├── examples_ser │ │ │ ├── Makefile │ │ │ ├── Makefile.in │ │ │ ├── README │ │ │ ├── cvbx.c │ │ │ ├── cvbx.out │ │ │ ├── cvdemd.c │ │ │ ├── cvdemd.out │ │ │ ├── cvdemk.c │ │ │ ├── cvdemk.out │ │ │ ├── cvdx.c │ │ │ ├── cvdx.out │ │ │ ├── cvdxe.c │ │ │ ├── cvdxe.out │ │ │ ├── cvkx.c │ │ │ ├── cvkx.out │ │ │ ├── cvkxb.c │ │ │ └── cvkxb.out │ │ ├── fcmix │ │ │ ├── Makefile │ │ │ ├── Makefile.in │ │ │ ├── examples_ser │ │ │ │ ├── Makefile.in │ │ │ │ ├── README │ │ │ │ ├── cvbandf.f │ │ │ │ ├── cvbandf.out │ │ │ │ ├── cvdensef.f │ │ │ │ ├── cvdensef.out │ │ │ │ ├── cvkrybf.f │ │ │ │ ├── cvkrybf.out │ │ │ │ ├── cvkryf.f │ │ │ │ └── cvkryf.out │ │ │ ├── fcvband.c │ │ │ ├── fcvbbd.c │ │ │ ├── fcvbbd.h │ │ │ ├── fcvbp.c │ │ │ ├── fcvbp.h │ │ │ ├── fcvdense.c │ │ │ ├── fcvewt.c │ │ │ ├── fcvjtimes.c │ │ │ ├── fcvode.c │ │ │ ├── fcvode.h │ │ │ ├── fcvpreco.c │ │ │ ├── fcvroot.c │ │ │ └── fcvroot.h │ │ ├── include │ │ │ ├── cvband.h │ │ │ ├── cvbandpre.h │ │ │ ├── cvbbdpre.h │ │ │ ├── cvdense.h │ │ │ ├── cvdiag.h │ │ │ ├── cvode.h │ │ │ └── cvspgmr.h │ │ └── source │ │ │ ├── Makefile │ │ │ ├── Makefile.in │ │ │ ├── cvband.c │ │ │ ├── cvband_impl.h │ │ │ ├── cvbandpre.c │ │ │ ├── cvbandpre_impl.h │ │ │ ├── cvbbdpre.c │ │ │ ├── cvbbdpre_impl.h │ │ │ ├── cvdense.c │ │ │ ├── cvdense_impl.h │ │ │ ├── cvdiag.c │ │ │ ├── cvdiag_impl.h │ │ │ ├── cvode.c │ │ │ ├── cvode_impl.h │ │ │ ├── cvodeio.c │ │ │ ├── cvspgmr.c │ │ │ └── cvspgmr_impl.h │ │ ├── cvodes │ │ ├── LICENSE │ │ ├── README │ │ ├── doc │ │ │ ├── cvs_examples.pdf │ │ │ ├── cvs_examples.ps │ │ │ ├── cvs_guide.pdf │ │ │ └── cvs_guide.ps │ │ ├── examples_ser │ │ │ ├── Makefile │ │ │ ├── Makefile.in │ │ │ ├── README │ │ │ ├── cvabx.c │ │ │ ├── cvabx.out │ │ │ ├── cvadx.c │ │ │ ├── cvadx.out │ │ │ ├── cvakx.c │ │ │ ├── cvakx.out │ │ │ ├── cvakxb.c │ │ │ ├── cvakxb.out │ │ │ ├── cvbx.c │ │ │ ├── cvbx.out │ │ │ ├── cvdemd.c │ │ │ ├── cvdemd.out │ │ │ ├── cvdemk.c │ │ │ ├── cvdemk.out │ │ │ ├── cvdx.c │ │ │ ├── cvdx.out │ │ │ ├── cvdxe.c │ │ │ ├── cvdxe.out │ │ │ ├── cvfdx.c │ │ │ ├── cvfdx.out1 │ │ │ ├── cvfdx.out2 │ │ │ ├── cvfkx.c │ │ │ ├── cvfkx.out1 │ │ │ ├── cvfkx.out2 │ │ │ ├── cvfnx.c │ │ │ ├── cvfnx.out1 │ │ │ ├── cvfnx.out2 │ │ │ ├── cvkx.c │ │ │ ├── cvkx.out │ │ │ ├── cvkxb.c │ │ │ └── cvkxb.out │ │ ├── include │ │ │ ├── cvband.h │ │ │ ├── cvbandpre.h │ │ │ ├── cvbbdpre.h │ │ │ ├── cvdense.h │ │ │ ├── cvdiag.h │ │ │ ├── cvodea.h │ │ │ ├── cvodes.h │ │ │ └── cvspgmr.h │ │ └── source │ │ │ ├── Makefile │ │ │ ├── Makefile.in │ │ │ ├── cvband.c │ │ │ ├── cvband_impl.h │ │ │ ├── cvbandpre.c │ │ │ ├── cvbandpre_impl.h │ │ │ ├── cvbbdpre.c │ │ │ ├── cvbbdpre_impl.h │ │ │ ├── cvdense.c │ │ │ ├── cvdense_impl.h │ │ │ ├── cvdiag.c │ │ │ ├── cvdiag_impl.h │ │ │ ├── cvodea.c │ │ │ ├── cvodea_impl.h │ │ │ ├── cvodes.c │ │ │ ├── cvodes_impl.h │ │ │ ├── cvodesio.c │ │ │ ├── cvspgmr.c │ │ │ └── cvspgmr_impl.h │ │ ├── ida │ │ ├── LICENSE │ │ ├── README │ │ ├── doc │ │ │ ├── ida_examples.pdf │ │ │ ├── ida_examples.ps │ │ │ ├── ida_guide.pdf │ │ │ └── ida_guide.ps │ │ ├── examples_ser │ │ │ ├── Makefile │ │ │ ├── Makefile.in │ │ │ ├── README │ │ │ ├── iheatsb.c │ │ │ ├── iheatsb.out │ │ │ ├── iheatsk.c │ │ │ ├── iheatsk.out │ │ │ ├── irobx.c │ │ │ ├── irobx.out │ │ │ ├── iwebsb.c │ │ │ └── iwebsb.out │ │ ├── include │ │ │ ├── ida.h │ │ │ ├── idaband.h │ │ │ ├── idabbdpre.h │ │ │ ├── idadense.h │ │ │ └── idaspgmr.h │ │ └── source │ │ │ ├── Makefile │ │ │ ├── Makefile.in │ │ │ ├── ida.c │ │ │ ├── ida_impl.h │ │ │ ├── idaband.c │ │ │ ├── idaband_impl.h │ │ │ ├── idabbdpre.c │ │ │ ├── idabbdpre_impl.h │ │ │ ├── idadense.c │ │ │ ├── idadense_impl.h │ │ │ ├── idaic.c │ │ │ ├── idaio.c │ │ │ ├── idaspgmr.c │ │ │ └── idaspgmr_impl.h │ │ ├── libtool │ │ ├── nvec_ser │ │ ├── Makefile │ │ ├── Makefile.in │ │ ├── README │ │ ├── fnvector_serial.c │ │ ├── fnvector_serial.h │ │ ├── nvector_serial.c │ │ └── nvector_serial.h │ │ └── shared │ │ ├── LICENSE │ │ ├── README │ │ ├── include │ │ ├── band.h │ │ ├── dense.h │ │ ├── iterative.h │ │ ├── nvector.h │ │ ├── smalldense.h │ │ ├── spgmr.h │ │ ├── sundialsmath.h │ │ └── sundialstypes.h │ │ └── source │ │ ├── Makefile │ │ ├── Makefile.in │ │ ├── band.c │ │ ├── dense.c │ │ ├── iterative.c │ │ ├── nvector.c │ │ ├── smalldense.c │ │ ├── spgmr.c │ │ └── sundialsmath.c ├── bin │ ├── .cvsignore │ └── tcc │ │ ├── include │ │ ├── _mingw.h │ │ ├── assert.h │ │ ├── conio.h │ │ ├── ctype.h │ │ ├── dir.h │ │ ├── direct.h │ │ ├── dirent.h │ │ ├── dos.h │ │ ├── errno.h │ │ ├── excpt.h │ │ ├── fcntl.h │ │ ├── fenv.h │ │ ├── float.h │ │ ├── inttypes.h │ │ ├── io.h │ │ ├── limits.h │ │ ├── locale.h │ │ ├── malloc.h │ │ ├── math.h │ │ ├── mem.h │ │ ├── memory.h │ │ ├── process.h │ │ ├── sbml │ │ │ └── SBMLTypes.h │ │ ├── sbmlsolver │ │ │ ├── band.h │ │ │ ├── cvdense.h │ │ │ ├── cvode.h │ │ │ ├── dense.h │ │ │ ├── fnvector_serial.h │ │ │ ├── iterative.h │ │ │ ├── nvector.h │ │ │ ├── nvector_serial.h │ │ │ ├── smalldense.h │ │ │ ├── spgmr.h │ │ │ ├── sundials_config.h │ │ │ ├── sundialsmath.h │ │ │ └── sundialstypes.h │ │ ├── setjmp.h │ │ ├── share.h │ │ ├── signal.h │ │ ├── stdarg.h │ │ ├── stdbool.h │ │ ├── stddef.h │ │ ├── stdint.h │ │ ├── stdio.h │ │ ├── stdlib.h │ │ ├── string.h │ │ ├── tchar.h │ │ ├── time.h │ │ ├── unistd.h │ │ ├── values.h │ │ ├── varargs.h │ │ ├── wchar.h │ │ ├── wctype.h │ │ └── winapi │ │ │ ├── basetsd.h │ │ │ ├── basetyps.h │ │ │ ├── winbase.h │ │ │ ├── wincon.h │ │ │ ├── windef.h │ │ │ ├── windows.h │ │ │ ├── winerror.h │ │ │ ├── wingdi.h │ │ │ ├── winnetwk.h │ │ │ ├── winnls.h │ │ │ ├── winnt.h │ │ │ ├── winreg.h │ │ │ ├── winsvc.h │ │ │ ├── winuser.h │ │ │ └── winver.h │ │ ├── lib │ │ ├── gdi32.def │ │ ├── kernel32.def │ │ ├── libtcc1.a │ │ ├── msvcrt.def │ │ └── user32.def │ │ └── tcc.exe └── binary │ ├── MSVCRT.DLL │ ├── libsbml.dll │ ├── msvcp71.dll │ ├── msvcr71.dll │ └── xerces-c_2_5_0.dll ├── bindings ├── Makefile.am ├── R │ ├── interface.c │ └── interface.h ├── README ├── perl │ ├── LibODES.i │ ├── Makefile.PL.in │ ├── Makefile.am │ └── t │ │ ├── 01__LoadModule.t │ │ └── 02__Integrate.t └── swig │ ├── Makefile.am │ └── libodes.i ├── config ├── cvode.m4 ├── grace.m4 ├── graphviz.m4 ├── sbml.m4 ├── sundials.m4 └── tcc.m4 ├── configure.ac ├── cvode_failures.txt ├── cvode_statistics.txt ├── doc ├── Makefile.am ├── README ├── SBML_odeSolver.1.in ├── libODES.texinfo ├── os_v1-0.pdf └── os_v1-5.pdf ├── examples.doxy ├── examples ├── ASTIndexTest.c ├── ASTgetIndexTest.c ├── ChangingIntegratorInstance.c ├── ChangingParameterIntegrator.c ├── FIMtest.c ├── MAPK.linobjfun ├── MAPK.objfun ├── MAPK.xml ├── MAPK_10000pt.dat ├── MAPK_10000pt.objfun ├── MAPK_1000pt.dat ├── MAPK_1000pt.objfun ├── MAPK_100pt.dat ├── MAPK_100pt.objfun ├── MAPK_10pt.dat ├── MAPK_10pt.objfun ├── MAPK_withData.objfun ├── Makefile.am ├── ParameterScanner.c ├── README ├── Sense.c ├── SharingIntegratorInstance.c ├── TwinIntegratorInstance.c ├── adj_sensitivity.c ├── adjsenstest.c ├── adjsenstest_ContDiscData.c ├── analyzeJacobian.c ├── analyzeSensitivity.c ├── basic-model1-forward-l2.xml ├── basic.xml ├── batch_integrate.c ├── bistability.c ├── definedTimeSeries.c ├── events-1-event-1-assignment-l2.xml ├── events-2-events-1-assignment-l2.xml ├── findRoot.c ├── huang96.xml ├── integrate.c ├── integrateODEs.c ├── printODEModel.c ├── repressilator.objfun ├── repressilator.xml ├── repressilator_data.txt ├── sensitivity.c ├── senstest.c ├── simpleIntegratorInstance.c ├── testCompiler.c ├── testrun └── testrun.out ├── odeSolver.doxy ├── odeSolver ├── Makefile.am ├── commandLine.c ├── commandLine.h ├── getopt.c ├── getopt.h ├── getopt1.c ├── interactive.c ├── interactive.h ├── main.c ├── options.c ├── options.h ├── printModel.c └── printModel.h ├── sbml ├── sbml-l1v1.xsd ├── sbml-l1v2.xsd └── sbml-l2v1.xsd ├── scripts ├── gnuplotscript.awk └── xmgracefile.pl ├── src ├── ASTIndexNameNode.c ├── Makefile.am ├── arithmeticCompiler.c ├── charBuffer.c ├── compiler.c ├── cvodeData.c ├── cvodeSolver.c ├── daeSolver.c ├── drawGraph.c ├── evaluateAST.c ├── integratorInstance.c ├── integratorSettings.c ├── interpol.c ├── libODES.pc.in ├── modelSimplify.c ├── nullSolver.c ├── odeConstruct.c ├── odeModel.c ├── odeSolver.c ├── private │ ├── data.c │ ├── data.h │ ├── error.c │ ├── error.h │ └── macro.h ├── processAST.c ├── sbml.c ├── sbmlResults.c ├── sbmlsolver │ ├── ASTCompiler │ │ ├── Makefile │ │ ├── arithmeticCompiler.c │ │ ├── arithmeticCompilerTest.c │ │ └── interfaceSimulation.c │ ├── ASTIndexNameNode.h │ ├── arithmeticCompiler.h │ ├── charBuffer.h │ ├── compiler.h │ ├── cvodeData.h │ ├── cvodeSolver.h │ ├── daeSolver.h │ ├── drawGraph.h │ ├── exportdefs.h │ ├── integratorInstance.h │ ├── integratorSettings.h │ ├── interpol.h │ ├── modelSimplify.h │ ├── nullSolver.h │ ├── odeConstruct.h │ ├── odeModel.h │ ├── odeSolver.h │ ├── processAST.h │ ├── sbml.h │ ├── sbmlResults.h │ ├── sensSolver.h │ ├── solverError.h │ ├── util.h │ └── variableIndex.h ├── sensSolver.c ├── solverError.c └── util.c ├── tokyo_release.png ├── tutorial ├── Goodwin_SomoS.xml ├── MAPK-l2.xml ├── MAPK.xml ├── Makefile.am ├── evaluateast.c ├── integrate.c ├── integrate.pl ├── integrateODES.pl ├── integratorinstance.c ├── odemodel.c └── setvariablevalue.c └── unittest ├── Makefile.am ├── main.c ├── test_ASTIndexNameNode.c ├── test_charBuffer.c ├── test_cvodeData.c ├── test_cvodeSolver.c ├── test_daeSolver.c ├── test_integratorInstance.c ├── test_integratorSettings.c ├── test_interpol.c ├── test_modelSimplify.c ├── test_nullSolver.c ├── test_odeConstruct.c ├── test_odeModel.c ├── test_odeSolver.c ├── test_processAST.c ├── test_sbml.c ├── test_sbmlResults.c ├── test_sensSolver.c ├── test_solverError.c ├── test_util.c └── unittest.h /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | Makefile.in 3 | aclocal.m4 4 | autom4te.cache/ 5 | build-aux/ 6 | config/libtool.m4 7 | config/ltoptions.m4 8 | config/ltsugar.m4 9 | config/ltversion.m4 10 | config/lt~obsolete.m4 11 | configure 12 | examples/Makefile.in 13 | odeSolver/Makefile.in 14 | src/Makefile.in 15 | src/config.h.in 16 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | === SOSlib Active Developers === 2 | 3 | Please see the website 4 | http://www.tbi.univie.ac.at/~raim/odeSolver for full credits! 5 | 6 | The SBML_odeSolver has been developed mainly by: 7 | 8 | Rainer Machne, 1 9 | raim@tbi.univie.ac.at, http://www.tbi.univie.ac.at/~raim 10 | 11 | Andrew Finney, 2 12 | afinney@physiomics-plc.com 13 | 14 | Christoph Flamm, 1 15 | xtof@tbi.univie.ac.at, http://www.tbi.univie.ac.at/~xtof 16 | 17 | Stefan Mueller, 3 18 | stefan@tbi.univie.ac.at, http://www.tbi.univie.ac.at/~stefan 19 | 20 | 21 | Addresses: 22 | 1: 23 | Theoretical Biochemistry Group, Institute for Theoretical Chemistry, 24 | University of Vienna, Waehringerstrasse 17, 1090 Vienna, Austria 25 | 2: 26 | Physiomics PLC, Magdalen Centre, Oxford Science Park, Oxford, OX4 4GA, UK 27 | 3: 28 | Johann Radon Institute for Computational and Applied Mathematics (RICAM), 29 | Austrian Academy of Sciences, Altenbergerstrasse 69, 4040 Linz, Austria 30 | -------------------------------------------------------------------------------- /BUGFIXES: -------------------------------------------------------------------------------- 1 | * The old suspect AST_replaceFunctionDefinition indeed caused problems. 2 | Thanks to Andrew Finneys observations and the new libSBML function 3 | ASTNode_swapChildren, this bug could be resolved. June 8, 2005 4 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 2010-09-28 Rainer Machne 2 | * added lib64 search in config/*.m4 files, patch by Takeshi Abe 3 | 4 | 2009-02-13 Christoph Flamm 5 | * changed automake/autoconf framework to produce both the static 6 | and shared library in a portable manner 7 | 8 | 2007-09-20 Rainer Machne 9 | * implemented thread-save sensitivity - BREAKING SENSE INTERFACES!: 10 | ** moved sensitivity structures from odeModel_t to new odeSense_t 11 | ** separated compilation of odeModel and odeSense functions, therefore 12 | ** removed TCC (doesn't support multiple code states) online compilation 13 | * added CV_NORMAL_TSTOP mode for CVODES forward solver 14 | ** added CvodeSettings_setTStop to allow saver dynamic value update 15 | ** automatic usage of TSTOP for event and discontinuous models 16 | 17 | 2007-08-22 Christoph Flamm 18 | * added gcc compilation on-the-fly capability. This solves the 19 | 32/64 bit architecture problems we had with TCC. 20 | 21 | 2007-06-20 James Lu and Stefan Mueller 22 | * implemented adjoint solver for discrete observation data 23 | * etc. ?? 24 | 25 | 2007-06-12 Christoph Flamm 26 | * updated library sources to work with sundials suit v2.3.0 27 | 28 | 2007-05-11 Rainer Machne 29 | * added Tiny C Compiler (TCC) compilation on-the-fly 30 | capability (problems: TCC only works for 32 bit architecture). 31 | 32 | 2008-03-10 Rainer Machne 33 | * repaired varySettings and batch integration for design points 34 | as initially intended by Witold Eryk Wolski 35 | -------------------------------------------------------------------------------- /KNOWN_BUGS: -------------------------------------------------------------------------------- 1 | SBMLDocument_free() in main() causes a segmentation fault, 2 | when the sbml file is read from a remote computer 3 | and constructODEs(m) has been called ??? 4 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/NEWS -------------------------------------------------------------------------------- /Perlen/AddLegend.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # -*-Perl-*- 3 | # Last changed Time-stamp: <2005-08-30 18:31:41 xtof> 4 | # $Id: AddLegend.pl,v 1.3 2005/08/30 16:33:56 chfl Exp $ 5 | 6 | use Getopt::Long; 7 | use File::Basename; 8 | use strict; 9 | 10 | # some globals 11 | my @LOC = (0.20, 0.90); 12 | my $FSIZE = .5; 13 | my $LEG = 'on'; 14 | 15 | usage() unless GetOptions("loc=s" => sub{local $_ = $_[1]; @LOC = split}, 16 | "lfs=f" => \$FSIZE, 17 | "noLeg" => sub{$LEG = 'off'}, 18 | "h" => \&usage); 19 | 20 | my $FILENAME = $ARGV[0] || "stdin"; 21 | 22 | make_legend(search_legend()); 23 | while (<>) {print} 24 | 25 | #--- 26 | sub search_legend { local $_; while ((<>)) { last if m/^\#t/ } return $_ } 27 | 28 | #--- 29 | sub make_legend { 30 | local $_ = shift; 31 | my @F = split; 32 | shift @F; 33 | print << "EOL"; 34 | @ title "$FILENAME" 35 | @ legend $LEG 36 | @ legend loctype view 37 | @ legend $LOC[0], $LOC[1] 38 | @ legend box color 1 39 | @ legend box pattern 1 40 | @ legend box linewidth 1.0 41 | @ legend box linestyle 1 42 | @ legend box fill color 0 43 | @ legend box fill pattern 1 44 | @ legend font 8 45 | @ legend char size $FSIZE 46 | @ legend color 1 47 | @ legend length 4 48 | @ legend vgap 1 49 | @ legend hgap 2 50 | @ legend invert false 51 | EOL 52 | 53 | my $i = 0; 54 | foreach my $species (@F) { 55 | print "\@ s$i legend \"$species\"\n"; 56 | $i++; 57 | } 58 | } 59 | 60 | #--- 61 | sub usage { 62 | print STDERR 63 | "\n Usage: @{[basename($0)]} [options]\n"; 64 | print STDERR 65 | " -loc Set location of legend box (upper left corner)\n", 66 | " (default: @LOC)\n", 67 | " -lfs Sets size of legend label characters\n", 68 | " (default: $FSIZE)\n", 69 | " -h display help message\n\n"; 70 | exit(0); 71 | } 72 | 73 | 74 | 75 | __END__ 76 | -------------------------------------------------------------------------------- /SOS_Win32/SBW_odeSolver/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include "SBWOdeSolver.h" 5 | 6 | 7 | using namespace SystemsBiologyWorkbench; 8 | using namespace std; 9 | 10 | int main(int argc, char*argv[]) 11 | { 12 | try 13 | { 14 | ModuleImpl modImpl("SBWOdeSolver", "SBWOdeSolver", UniqueModule); 15 | modImpl.addService("SBWOdeSolver", "SBWOdeSolver", "plugin/simulator/level1", "SBWOdeSolver Simulator"); 16 | modImpl.addServiceObject("SBWOdeSolver", "SBWOdeSolver", "plugin/simulator/level1", new SBWOdeSolver()); 17 | modImpl.run(argc,argv); 18 | } 19 | catch(SBWException *ex) 20 | { 21 | cerr << "Exception occured: " << ex->getMessage() << endl; 22 | } 23 | catch(...) 24 | { 25 | } 26 | } -------------------------------------------------------------------------------- /SOS_Win32/SOS_Win32.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SBML_odeSolver", "SOSLib\SOSLib.vcproj", "{7FD00D97-BE5E-43FA-B27B-7DEA35A3E152}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SBML_odeSolverApp", "SOS_CommandLine\SOS_CommandLine.vcproj", "{53BCE0E5-7515-46A7-BA1B-D4B72918E810}" 7 | ProjectSection(ProjectDependencies) = postProject 8 | {7FD00D97-BE5E-43FA-B27B-7DEA35A3E152} = {7FD00D97-BE5E-43FA-B27B-7DEA35A3E152} 9 | EndProjectSection 10 | EndProject 11 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SBW_odeSolver", "SBW_odeSolver\SBW_odeSolver.vcproj", "{2C00BD88-AD89-49B6-BC5B-768F51C2E7C1}" 12 | ProjectSection(ProjectDependencies) = postProject 13 | {7FD00D97-BE5E-43FA-B27B-7DEA35A3E152} = {7FD00D97-BE5E-43FA-B27B-7DEA35A3E152} 14 | EndProjectSection 15 | EndProject 16 | Global 17 | GlobalSection(SolutionConfiguration) = preSolution 18 | Debug = Debug 19 | Release = Release 20 | EndGlobalSection 21 | GlobalSection(ProjectDependencies) = postSolution 22 | EndGlobalSection 23 | GlobalSection(ProjectConfiguration) = postSolution 24 | {7FD00D97-BE5E-43FA-B27B-7DEA35A3E152}.Debug.ActiveCfg = Debug|Win32 25 | {7FD00D97-BE5E-43FA-B27B-7DEA35A3E152}.Debug.Build.0 = Debug|Win32 26 | {7FD00D97-BE5E-43FA-B27B-7DEA35A3E152}.Release.ActiveCfg = Release|Win32 27 | {7FD00D97-BE5E-43FA-B27B-7DEA35A3E152}.Release.Build.0 = Release|Win32 28 | {53BCE0E5-7515-46A7-BA1B-D4B72918E810}.Debug.ActiveCfg = Debug|Win32 29 | {53BCE0E5-7515-46A7-BA1B-D4B72918E810}.Debug.Build.0 = Debug|Win32 30 | {53BCE0E5-7515-46A7-BA1B-D4B72918E810}.Release.ActiveCfg = Release|Win32 31 | {53BCE0E5-7515-46A7-BA1B-D4B72918E810}.Release.Build.0 = Release|Win32 32 | {2C00BD88-AD89-49B6-BC5B-768F51C2E7C1}.Debug.ActiveCfg = Debug|Win32 33 | {2C00BD88-AD89-49B6-BC5B-768F51C2E7C1}.Debug.Build.0 = Debug|Win32 34 | {2C00BD88-AD89-49B6-BC5B-768F51C2E7C1}.Release.ActiveCfg = Release|Win32 35 | {2C00BD88-AD89-49B6-BC5B-768F51C2E7C1}.Release.Build.0 = Release|Win32 36 | EndGlobalSection 37 | GlobalSection(ExtensibilityGlobals) = postSolution 38 | EndGlobalSection 39 | GlobalSection(ExtensibilityAddIns) = postSolution 40 | EndGlobalSection 41 | EndGlobal 42 | -------------------------------------------------------------------------------- /Test/testsuite/README: -------------------------------------------------------------------------------- 1 | This folder contains scripts for testing with the SBML SEMANTIC TEST SUITE, 2 | and result and log files for tests with the version 3 | released on Tue, 19 Oct 2004. 4 | 5 | To reproduce the result files, download and unpack the SBML Semantic Test Suite 6 | from http://www.cds.caltech.edu/~afinney/semantic-test-suite.tar.gz 7 | unpack, and 8 | 9 | edit the file `odeSolver-wrapper-once.pl' 10 | 11 | to add the correct path for the odeSolver application. Then 12 | 13 | copy odeSolver-wrapper.bsh and odeSolver-wrapper-once.pl 14 | 15 | to the folder semantic-test-suite/AUTOMATION/wrappers, change to the directory 16 | semantic-test-suite and run 17 | 18 | `./runtests.bsh -vwrapper=AUTOMATION/wrappers/odeSolver-wrapper.bsh >> testlog.txt' 19 | 20 | in a bash or shell. 21 | 22 | 23 | 24 | odeSolver-wrapper.bsh: 25 | A bash script to call odeSolver-wrapper-once.pl several times, 26 | if the previous run failed, passing a lower absolute error treshold. 27 | This script is called from the scripts provided by the Test Suite, 28 | and adds the absolute error value. It start with a very low error, 29 | and tries again with higher error tolerance if the SBML_odeSolver 30 | failed. 31 | odeSolver-wrapper-once.pl: 32 | A Perl script that calls the SBML_odeSolver, with time/printstep 33 | values passed by the calling Test Suite script (runtests.bsh/test.bsh) 34 | and an error value added by the script odeSolver-wrapper.bsh. 35 | It then reads the output of the SBML_odeSolver, and writes 36 | results to testout.csv needed by the Test Suite scripts. 37 | If CVODE fails, it writes TRY AGAIN as a message to the calling 38 | script, to try again with higher error tolerance. 39 | It also writes a log file "testlog.txt" of SBML_odeSolver output 40 | during the test run. 41 | testlog.txt: 42 | A log file from one test run with all provided tests of the 43 | SBML Semantic Test Suite, produced by calling the runtests.bsh 44 | script with `runtests.bsh -vwrapper=odeSolver-wrapper.bsh >> testlog.txt. 45 | Thus this file contains the outputs of 46 | a) runtests.bsh 47 | b) the wrapper script odeSolver-wrapper-once.pl, and 48 | c) the odeSolver itself (via (b)). 49 | workingtest.txt: 50 | Text file used by runtests.txt, contains all tests that tested 51 | correctly with the SBML_odeSolver; not working tests are commented 52 | out by removing `TEST' and `.test' text. 53 | testlist.txt: 54 | Original testlist provided by the SBML Semantic Test Suite 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /Test/testsuite/odeSolver-wrapper-once.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | #use lib "$ENV{HOME}/perl/L"; 4 | #use LibSBML; 5 | 6 | my $steps = 0; 7 | my $flag6 = 0; 8 | my $error = ""; 9 | my $test = ""; 10 | 11 | ($test = $ARGV[1]) =~ s/(-l2)?\.xml/\.test/g; 12 | 13 | open(LOGFILE, ">>testlog.txt"); 14 | print LOGFILE "\nTEST $test\n"; 15 | 16 | print(LOGFILE "../../../odeSolver/odeSolver $ARGV[1] --time=$ARGV[2] --printstep=$ARGV[3] --error=$ARGV[0] --rerror=1e-10\n"); 17 | open(TESTRUN, 18 | "../../../odeSolver/odeSolver $ARGV[1] --time=$ARGV[2] --printstep=$ARGV[3] --error=$ARGV[0] --rerror=1e-10 2>> \"singletestlog\" |"); 19 | 20 | `cat singletestlog >> testlog.txt`; 21 | 22 | while() 23 | { 24 | @values = split(/ /, $_); 25 | 26 | if ( $#values > 1 && $values[0] eq "#t" ) 27 | { 28 | foreach $num (1 .. $#values-1) 29 | { 30 | $SPECIES[$num] = sprintf $values[$num]; 31 | } 32 | } 33 | 34 | if ($#values > 1 && $values[0]=~/^\d.*/ ) 35 | { 36 | foreach $num (1 .. $#values-1) 37 | { 38 | $VAL{$values[0]}{$SPECIES[$num]} = $values[$num]; 39 | $time[$steps] = $values[0]; 40 | } 41 | $steps++; 42 | } 43 | 44 | if ($_=~/CVODES ERROR/) 45 | { 46 | $flag6 =1; 47 | $error = $_; 48 | print $_; 49 | } 50 | } 51 | close TESTRUN; 52 | 53 | open(TESTERROR, ") 55 | { 56 | if ($_=~/CVODES ERROR/) 57 | { 58 | $flag6 =1; 59 | $error = $_; 60 | print $_; 61 | } 62 | } 63 | unlink("singletestlog"); 64 | unlink($ARGV[4]); 65 | open(CSVFILE, ">$ARGV[4]" ); 66 | 67 | 68 | if ( $flag6 == 1 ) 69 | { 70 | print CSVFILE "TRY AGAIN"; 71 | print LOGFILE "CVODE FAILURE using --error $ARGV[0]: $error"; 72 | } 73 | else 74 | { 75 | print CSVFILE "time"; 76 | foreach $argnum (6 .. $#ARGV) 77 | { 78 | print CSVFILE ",$ARGV[$argnum]"; 79 | } 80 | print CSVFILE "\n"; 81 | 82 | foreach $stepnum (0 .. $#time) 83 | { 84 | print CSVFILE "$time[$stepnum]"; 85 | foreach $argnum (6 .. $#ARGV) 86 | { 87 | print CSVFILE ",$VAL{$time[$stepnum]}{$ARGV[$argnum]}"; 88 | } 89 | print CSVFILE "\n"; 90 | } 91 | print LOGFILE "SUCCESS, using --error $ARGV[0]\n"; 92 | } 93 | print LOGFILE "\n"; 94 | 95 | close CSVFILE; 96 | close LOGFILE; 97 | 98 | -------------------------------------------------------------------------------- /Test/testsuite/odeSolver-wrapper.bsh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | odeSolver-wrapper-once.pl 1e-22 $@ 4 | if grep "TRY AGAIN" $4; then 5 | echo trying error 1e-21 6 | odeSolver-wrapper-once.pl 1e-21 $@ 7 | fi 8 | if grep "TRY AGAIN" $4; then 9 | echo trying error 1e-20 10 | odeSolver-wrapper-once.pl 1e-20 $@ 11 | fi 12 | if grep "TRY AGAIN" $4; then 13 | echo trying error 1e-19 14 | odeSolver-wrapper-once.pl 1e-19 $@ 15 | fi 16 | if grep "TRY AGAIN" $4; then 17 | echo trying error 1e-18 18 | odeSolver-wrapper-once.pl 1e-18 $@ 19 | fi 20 | if grep "TRY AGAIN" $4; then 21 | echo trying error 1e-17 22 | odeSolver-wrapper-once.pl 1e-17 $@ 23 | fi 24 | if grep "TRY AGAIN" $4; then 25 | echo trying error 1e-16 26 | odeSolver-wrapper-once.pl 1e-16 $@ 27 | fi 28 | if grep "TRY AGAIN" $4; then 29 | echo trying error 1e-15 30 | odeSolver-wrapper-once.pl 1e-15 $@ 31 | fi 32 | if grep "TRY AGAIN" $4; then 33 | echo trying error 1e-14 34 | odeSolver-wrapper-once.pl 1e-14 $@ 35 | fi 36 | -------------------------------------------------------------------------------- /Test/testsuite/testlog.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/Test/testsuite/testlog.txt -------------------------------------------------------------------------------- /VERSION.txt: -------------------------------------------------------------------------------- 1 | 1.7.0beta 2 | -------------------------------------------------------------------------------- /Win32/Examples/ASTIndexTest/.cvsignore: -------------------------------------------------------------------------------- 1 | *.ncb Debug Release *suo 2 | -------------------------------------------------------------------------------- /Win32/Examples/ASTIndexTest/ASTIndexTest.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ASTIndexTest", "ASTIndexTest.vcproj", "{FE015A25-A902-4E2A-A6AB-5E888ADFA786}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {FE015A25-A902-4E2A-A6AB-5E888ADFA786}.Debug.ActiveCfg = Debug|Win32 13 | {FE015A25-A902-4E2A-A6AB-5E888ADFA786}.Debug.Build.0 = Debug|Win32 14 | {FE015A25-A902-4E2A-A6AB-5E888ADFA786}.Release.ActiveCfg = Release|Win32 15 | {FE015A25-A902-4E2A-A6AB-5E888ADFA786}.Release.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /Win32/Examples/ChangingIntegratorInstance/.cvsignore: -------------------------------------------------------------------------------- 1 | *.ncb Debug Release *suo 2 | -------------------------------------------------------------------------------- /Win32/Examples/ChangingIntegratorInstance/ChangingIntegratorInstance.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ChangingIntegratorInstance", "ChangingIntegratorInstance.vcproj", "{5D4FE4DA-B72F-4DC2-A58C-1089E19B50FD}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {5D4FE4DA-B72F-4DC2-A58C-1089E19B50FD}.Debug.ActiveCfg = Debug|Win32 13 | {5D4FE4DA-B72F-4DC2-A58C-1089E19B50FD}.Debug.Build.0 = Debug|Win32 14 | {5D4FE4DA-B72F-4DC2-A58C-1089E19B50FD}.Release.ActiveCfg = Release|Win32 15 | {5D4FE4DA-B72F-4DC2-A58C-1089E19B50FD}.Release.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /Win32/Examples/ChangingParameterIntegrator/.cvsignore: -------------------------------------------------------------------------------- 1 | *.ncb Debug Release *suo 2 | -------------------------------------------------------------------------------- /Win32/Examples/ChangingParameterIntegrator/ChangingParameterIntegrator.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ChangingParameterIntegrator", "ChangingParameterIntegrator.vcproj", "{E2FF2B20-8F0A-45E3-AA8B-8B14D8B6F3F6}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {E2FF2B20-8F0A-45E3-AA8B-8B14D8B6F3F6}.Debug.ActiveCfg = Debug|Win32 13 | {E2FF2B20-8F0A-45E3-AA8B-8B14D8B6F3F6}.Debug.Build.0 = Debug|Win32 14 | {E2FF2B20-8F0A-45E3-AA8B-8B14D8B6F3F6}.Release.ActiveCfg = Release|Win32 15 | {E2FF2B20-8F0A-45E3-AA8B-8B14D8B6F3F6}.Release.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /Win32/Examples/IntegratorInstance/.cvsignore: -------------------------------------------------------------------------------- 1 | *.ncb *suo Debug Release 2 | -------------------------------------------------------------------------------- /Win32/Examples/IntegratorInstance/IntegratorInstance.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IntegratorInstance", "IntegratorInstance.vcproj", "{D10002CA-EDC6-4DDB-B549-124BE27169B8}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {D10002CA-EDC6-4DDB-B549-124BE27169B8}.Debug.ActiveCfg = Debug|Win32 13 | {D10002CA-EDC6-4DDB-B549-124BE27169B8}.Debug.Build.0 = Debug|Win32 14 | {D10002CA-EDC6-4DDB-B549-124BE27169B8}.Release.ActiveCfg = Release|Win32 15 | {D10002CA-EDC6-4DDB-B549-124BE27169B8}.Release.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /Win32/Examples/ParameterScanner/.cvsignore: -------------------------------------------------------------------------------- 1 | *.ncb Debug Release *suo 2 | -------------------------------------------------------------------------------- /Win32/Examples/ParameterScanner/ParameterScanner.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ParameterScanner", "ParameterScanner.vcproj", "{8810FEBB-4FC6-4A76-A6D2-9F0DC6857296}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {8810FEBB-4FC6-4A76-A6D2-9F0DC6857296}.Debug.ActiveCfg = Debug|Win32 13 | {8810FEBB-4FC6-4A76-A6D2-9F0DC6857296}.Debug.Build.0 = Debug|Win32 14 | {8810FEBB-4FC6-4A76-A6D2-9F0DC6857296}.Release.ActiveCfg = Release|Win32 15 | {8810FEBB-4FC6-4A76-A6D2-9F0DC6857296}.Release.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /Win32/Examples/Sense/Sense.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sense", "Sense\Sense.vcproj", "{03DC8D62-3859-454C-92E0-7AE4008A7186}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {03DC8D62-3859-454C-92E0-7AE4008A7186}.Debug.ActiveCfg = Debug|Win32 13 | {03DC8D62-3859-454C-92E0-7AE4008A7186}.Debug.Build.0 = Debug|Win32 14 | {03DC8D62-3859-454C-92E0-7AE4008A7186}.Release.ActiveCfg = Release|Win32 15 | {03DC8D62-3859-454C-92E0-7AE4008A7186}.Release.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /Win32/Examples/Sensitivity/Sensitivity.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Sensitivity", "Sensitivity.vcproj", "{59FB2163-EBD4-4327-8783-57AF993A07B9}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {59FB2163-EBD4-4327-8783-57AF993A07B9}.Debug.ActiveCfg = Debug|Win32 13 | {59FB2163-EBD4-4327-8783-57AF993A07B9}.Debug.Build.0 = Debug|Win32 14 | {59FB2163-EBD4-4327-8783-57AF993A07B9}.Release.ActiveCfg = Release|Win32 15 | {59FB2163-EBD4-4327-8783-57AF993A07B9}.Release.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /Win32/Examples/SharingIntegratorInstance/.cvsignore: -------------------------------------------------------------------------------- 1 | *.ncb *suo Debug Release 2 | -------------------------------------------------------------------------------- /Win32/Examples/SharingIntegratorInstance/SharingIntegratorInstance.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SharingIntegratorInstance", "SharingIntegratorInstance.vcproj", "{1851E442-5EFB-487E-A51F-679364CF62D7}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {1851E442-5EFB-487E-A51F-679364CF62D7}.Debug.ActiveCfg = Debug|Win32 13 | {1851E442-5EFB-487E-A51F-679364CF62D7}.Debug.Build.0 = Debug|Win32 14 | {1851E442-5EFB-487E-A51F-679364CF62D7}.Release.ActiveCfg = Release|Win32 15 | {1851E442-5EFB-487E-A51F-679364CF62D7}.Release.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /Win32/Examples/TwinIntegratorInstance/TwinIntegratorInstance.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TwinIntegratorInstance", "TwinIntegratorInstance.vcproj", "{D10F3973-6591-4FA5-BB77-4E1472E3E5CD}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {D10F3973-6591-4FA5-BB77-4E1472E3E5CD}.Debug.ActiveCfg = Debug|Win32 13 | {D10F3973-6591-4FA5-BB77-4E1472E3E5CD}.Debug.Build.0 = Debug|Win32 14 | {D10F3973-6591-4FA5-BB77-4E1472E3E5CD}.Release.ActiveCfg = Release|Win32 15 | {D10F3973-6591-4FA5-BB77-4E1472E3E5CD}.Release.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /Win32/SBML_odeSolver/.cvsignore: -------------------------------------------------------------------------------- 1 | *.ncb 2 | *.suo 3 | *~ -------------------------------------------------------------------------------- /Win32/SBML_odeSolver/SBML_odeSolver.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SBML_odeSolver", "SBML_odeSolver\SBML_odeSolver.vcproj", "{B243A4E8-8F40-40CD-BAB0-34B002545CA0}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {B243A4E8-8F40-40CD-BAB0-34B002545CA0}.Debug.ActiveCfg = Debug|Win32 13 | {B243A4E8-8F40-40CD-BAB0-34B002545CA0}.Debug.Build.0 = Debug|Win32 14 | {B243A4E8-8F40-40CD-BAB0-34B002545CA0}.Release.ActiveCfg = Release|Win32 15 | {B243A4E8-8F40-40CD-BAB0-34B002545CA0}.Release.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /Win32/SBML_odeSolver/SBML_odeSolver/.cvsignore: -------------------------------------------------------------------------------- 1 | Debug 2 | Release -------------------------------------------------------------------------------- /Win32/SBML_odeSolver/SBML_odeSolver/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | DYNAMIC LINK LIBRARY : SBML_odeSolver Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this SBML_odeSolver DLL for you. 6 | This file contains a summary of what you will find in each of the files that 7 | make up your SBML_odeSolver application. 8 | 9 | 10 | SBML_odeSolver.vcproj 11 | This is the main project file for VC++ projects generated using an Application Wizard. 12 | It contains information about the version of Visual C++ that generated the file, and 13 | information about the platforms, configurations, and project features selected with the 14 | Application Wizard. 15 | 16 | SBML_odeSolver.cpp 17 | This is the main DLL source file. 18 | 19 | ///////////////////////////////////////////////////////////////////////////// 20 | Other standard files: 21 | 22 | StdAfx.h, StdAfx.cpp 23 | These files are used to build a precompiled header (PCH) file 24 | named SBML_odeSolver.pch and a precompiled types file named StdAfx.obj. 25 | 26 | ///////////////////////////////////////////////////////////////////////////// 27 | Other notes: 28 | 29 | AppWizard uses "TODO:" comments to indicate parts of the source code you 30 | should add to or customize. 31 | 32 | ///////////////////////////////////////////////////////////////////////////// 33 | -------------------------------------------------------------------------------- /Win32/SBML_odeSolver/SBML_odeSolver/SBML_odeSolver.cpp: -------------------------------------------------------------------------------- 1 | // SBML_odeSolver.cpp : Defines the entry point for the DLL application. 2 | // 3 | #include 4 | 5 | BOOL APIENTRY DllMain( HANDLE hModule, 6 | DWORD ul_reason_for_call, 7 | LPVOID lpReserved 8 | ) 9 | { 10 | switch (ul_reason_for_call) 11 | { 12 | case DLL_PROCESS_ATTACH: 13 | case DLL_THREAD_ATTACH: 14 | case DLL_THREAD_DETACH: 15 | case DLL_PROCESS_DETACH: 16 | break; 17 | } 18 | return TRUE; 19 | } 20 | /* examples of use of export macros 21 | // This is an example of an exported variable 22 | SBML_ODESOLVER_API int nSBML_odeSolver=0; 23 | 24 | // This is an example of an exported function. 25 | SBML_ODESOLVER_API int fnSBML_odeSolver(void) 26 | { 27 | return 42; 28 | } 29 | 30 | // This is the constructor of a class that has been exported. 31 | // see SBML_odeSolver.h for the class definition 32 | CSBML_odeSolver::CSBML_odeSolver() 33 | { 34 | return; 35 | } 36 | */ 37 | -------------------------------------------------------------------------------- /Win32/SBML_odeSolver/include/config.h: -------------------------------------------------------------------------------- 1 | /* manually created file for MSVC++ 7.1 thats a substitute for the one normally created in UNIX 2 | environments */ 3 | 4 | /* Define to 1 if you have the header file. */ 5 | #define HAVE_ERRNO_H 1 6 | 7 | /* Define to 1 if you have the header file. */ 8 | #undef HAVE_INTTYPES_H 9 | 10 | /* Define to 1 if you have the `m' library (-lm). */ 11 | #define HAVE_LIBM 1 12 | 13 | /* Define to 1 if you have the header file. */ 14 | #define HAVE_MATH_H 1 15 | 16 | /* Define to 1 if you have the header file. */ 17 | #define HAVE_MEMORY_H 1 18 | 19 | /* Define to 1 if you have the header file. */ 20 | #undef HAVE_STDINT_H 21 | 22 | /* Define to 1 if you have the header file. */ 23 | #define HAVE_STDLIB_H 1 24 | 25 | /* Define to 1 if you have the header file. */ 26 | #undef HAVE_STRINGS_H 27 | 28 | /* Define to 1 if you have the header file. */ 29 | #define HAVE_STRING_H 1 30 | 31 | /* Define to 1 if you have the header file. */ 32 | #define HAVE_SYS_STAT_H 1 33 | 34 | /* Define to 1 if you have the header file. */ 35 | #define HAVE_SYS_TYPES_H 1 36 | 37 | /* Define to 1 if you have the header file. */ 38 | #undef HAVE_UNISTD_H 39 | 40 | /* Define to 1 to use SBML Library version < 2.2.0 */ 41 | #undef OLD_LIBSBML 42 | 43 | /* Name of package */ 44 | #undef PACKAGE 45 | 46 | /* Define to the address where bug reports for this package should be sent. */ 47 | #undef PACKAGE_BUGREPORT 48 | 49 | /* Define to the full name of this package. */ 50 | #undef PACKAGE_NAME 51 | 52 | /* Define to the full name and version of this package. */ 53 | #undef PACKAGE_STRING 54 | 55 | /* Define to the one symbol short name of this package. */ 56 | #undef PACKAGE_TARNAME 57 | 58 | /* Define to the version of this package. */ 59 | #undef PACKAGE_VERSION 60 | 61 | /* Define to 1 if you have the ANSI C header files. */ 62 | #undef STDC_HEADERS 63 | 64 | /* Define to 1 to use the CVODE Library */ 65 | #define USE_CVODE 1 66 | 67 | /* Define to 1 to use the GRACE Library */ 68 | #undef USE_GRACE 69 | 70 | /* Define to 1 to use the GRAPHVIZ Library */ 71 | #undef USE_GRAPHVIZ 72 | 73 | /* Define to 1 to use the SBML Library */ 74 | #define USE_SBML 1 75 | 76 | /* Version number of package */ 77 | #define VERSION 1 78 | 79 | /* Define to 1 if your processor stores words with the most significant byte 80 | first (like Motorola and SPARC, unlike Intel and VAX). */ 81 | #undef WORDS_BIGENDIAN 82 | 83 | /* Define to empty if `const' does not conform to ANSI C. */ 84 | #undef const 85 | 86 | /* Define to `unsigned' if does not define. */ 87 | #undef size_t 88 | -------------------------------------------------------------------------------- /Win32/SBML_odeSolverApp/.cvsignore: -------------------------------------------------------------------------------- 1 | *.ncb 2 | *.suo 3 | *~ -------------------------------------------------------------------------------- /Win32/SBML_odeSolverApp/SBML_odeSolverApp.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SBML_odeSolverApp", "SBML_odeSolverApp\SBML_odeSolverApp.vcproj", "{984CF58B-1E42-4298-A1A5-F334345C6320}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {984CF58B-1E42-4298-A1A5-F334345C6320}.Debug.ActiveCfg = Debug|Win32 13 | {984CF58B-1E42-4298-A1A5-F334345C6320}.Debug.Build.0 = Debug|Win32 14 | {984CF58B-1E42-4298-A1A5-F334345C6320}.Release.ActiveCfg = Release|Win32 15 | {984CF58B-1E42-4298-A1A5-F334345C6320}.Release.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /Win32/SBML_odeSolverApp/SBML_odeSolverApp/.cvsignore: -------------------------------------------------------------------------------- 1 | Debug 2 | Release -------------------------------------------------------------------------------- /Win32/SBML_odeSolverApp/SBML_odeSolverApp/getopt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * getopt.h - cpp wrapper for my_getopt to make it look like getopt. 3 | * Copyright 1997, 2000, 2001, 2002, Benjamin Sittler 4 | * 5 | * Permission is hereby granted, free of charge, to any person 6 | * obtaining a copy of this software and associated documentation 7 | * files (the "Software"), to deal in the Software without 8 | * restriction, including without limitation the rights to use, copy, 9 | * modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | * DEALINGS IN THE SOFTWARE. 24 | */ 25 | 26 | #ifndef MY_WRAPPER_GETOPT_H_INCLUDED 27 | #define MY_WRAPPER_GETOPT_H_INCLUDED 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | #include "my_getopt.h" 34 | 35 | #undef getopt 36 | #define getopt my_getopt 37 | #undef getopt_long 38 | #define getopt_long my_getopt_long 39 | #undef getopt_long_only 40 | #define getopt_long_only my_getopt_long_only 41 | #undef _getopt_internal 42 | #define _getopt_internal _my_getopt_internal 43 | #undef opterr 44 | #define opterr my_opterr 45 | #undef optind 46 | #define optind my_optind 47 | #undef optopt 48 | #define optopt my_optopt 49 | #undef optarg 50 | #define optarg my_optarg 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif /* MY_WRAPPER_GETOPT_H_INCLUDED */ 57 | -------------------------------------------------------------------------------- /Win32/SBML_odeSolverApp/SBML_odeSolverApp/my_getopt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * my_getopt.h - interface to my re-implementation of getopt. 3 | * Copyright 1997, 2000, 2001, 2002, Benjamin Sittler 4 | * 5 | * Permission is hereby granted, free of charge, to any person 6 | * obtaining a copy of this software and associated documentation 7 | * files (the "Software"), to deal in the Software without 8 | * restriction, including without limitation the rights to use, copy, 9 | * modify, merge, publish, distribute, sublicense, and/or sell copies 10 | * of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be 14 | * included in all copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | * DEALINGS IN THE SOFTWARE. 24 | */ 25 | 26 | #ifndef MY_GETOPT_H_INCLUDED 27 | #define MY_GETOPT_H_INCLUDED 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | /* UNIX-style short-argument parser */ 34 | extern int my_getopt(int argc, char * argv[], const char *opts); 35 | 36 | extern int my_optind, my_opterr, my_optopt; 37 | extern char *my_optarg; 38 | 39 | struct option { 40 | const char *name; 41 | int has_arg; 42 | int *flag; 43 | int val; 44 | }; 45 | 46 | /* human-readable values for has_arg */ 47 | #undef no_argument 48 | #define no_argument 0 49 | #undef required_argument 50 | #define required_argument 1 51 | #undef optional_argument 52 | #define optional_argument 2 53 | 54 | /* GNU-style long-argument parsers */ 55 | extern int my_getopt_long(int argc, char * argv[], const char *shortopts, 56 | const struct option *longopts, int *longind); 57 | 58 | extern int my_getopt_long_only(int argc, char * argv[], const char *shortopts, 59 | const struct option *longopts, int *longind); 60 | 61 | extern int _my_getopt_internal(int argc, char * argv[], const char *shortopts, 62 | const struct option *longopts, int *longind, 63 | int long_only); 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* MY_GETOPT_H_INCLUDED */ 70 | -------------------------------------------------------------------------------- /Win32/TODO.txt: -------------------------------------------------------------------------------- 1 | Work remaining on SBML_odeSolver for Microsoft Visual C++ 7.1 2 | ============================================================= 3 | 4 | Find a way to avoid including the CVODE code within the project. 5 | Its included at the moment because its patched to export functions to 6 | SBML_odeSolver. 7 | 8 | Create a proper installer 9 | 10 | Clean up headers so that its possible to create a useable library release rather than 11 | just an .exe release. -------------------------------------------------------------------------------- /Win32/WinCVODE/.cvsignore: -------------------------------------------------------------------------------- 1 | *.ncb 2 | *.suo 3 | *~ -------------------------------------------------------------------------------- /Win32/WinCVODE/WinCVODE.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WinCVODE", "WinCVODE\WinCVODE.vcproj", "{E92D4874-0AB6-472D-B7FD-8CD9866B85CC}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | EndProjectSection 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfiguration) = preSolution 8 | Debug = Debug 9 | Release = Release 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {E92D4874-0AB6-472D-B7FD-8CD9866B85CC}.Debug.ActiveCfg = Debug|Win32 13 | {E92D4874-0AB6-472D-B7FD-8CD9866B85CC}.Debug.Build.0 = Debug|Win32 14 | {E92D4874-0AB6-472D-B7FD-8CD9866B85CC}.Release.ActiveCfg = Release|Win32 15 | {E92D4874-0AB6-472D-B7FD-8CD9866B85CC}.Release.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /Win32/WinCVODE/WinCVODE/.cvsignore: -------------------------------------------------------------------------------- 1 | Debug 2 | Release -------------------------------------------------------------------------------- /Win32/WinCVODE/WinCVODE/ReadMe.txt: -------------------------------------------------------------------------------- 1 | ======================================================================== 2 | DYNAMIC LINK LIBRARY : WinCVODE Project Overview 3 | ======================================================================== 4 | 5 | AppWizard has created this WinCVODE DLL for you. 6 | This file contains a summary of what you will find in each of the files that 7 | make up your WinCVODE application. 8 | 9 | 10 | WinCVODE.vcproj 11 | This is the main project file for VC++ projects generated using an Application Wizard. 12 | It contains information about the version of Visual C++ that generated the file, and 13 | information about the platforms, configurations, and project features selected with the 14 | Application Wizard. 15 | 16 | WinCVODE.cpp 17 | This is the main DLL source file. 18 | 19 | ///////////////////////////////////////////////////////////////////////////// 20 | Other notes: 21 | 22 | AppWizard uses "TODO:" comments to indicate parts of the source code you 23 | should add to or customize. 24 | 25 | ///////////////////////////////////////////////////////////////////////////// 26 | -------------------------------------------------------------------------------- /Win32/WinCVODE/WinCVODE/WinCVODE.cpp: -------------------------------------------------------------------------------- 1 | // WinCVODE.cpp : Defines the entry point for the DLL application. 2 | // 3 | 4 | #include 5 | 6 | BOOL APIENTRY DllMain( HANDLE hModule, 7 | DWORD ul_reason_for_call, 8 | LPVOID lpReserved 9 | ) 10 | { 11 | switch (ul_reason_for_call) 12 | { 13 | case DLL_PROCESS_ATTACH: 14 | case DLL_THREAD_ATTACH: 15 | case DLL_THREAD_DETACH: 16 | case DLL_PROCESS_DETACH: 17 | break; 18 | } 19 | return TRUE; 20 | } 21 | 22 | /* examples 23 | // This is an example of an exported variable 24 | WINCVODE_API int nWinCVODE=0; 25 | 26 | // This is an example of an exported function. 27 | WINCVODE_API int fnWinCVODE(void) 28 | { 29 | return 42; 30 | } 31 | 32 | // This is the constructor of a class that has been exported. 33 | // see WinCVODE.h for the class definition 34 | CWinCVODE::CWinCVODE() 35 | { 36 | return; 37 | } 38 | */ -------------------------------------------------------------------------------- /Win32/WinCVODE/WinCVODE/WinCVODE.h: -------------------------------------------------------------------------------- 1 | // The following ifdef block is the standard way of creating macros which make exporting 2 | // from a DLL simpler. All files within this DLL are compiled with the WINCVODE_EXPORTS 3 | // symbol defined on the command line. this symbol should not be defined on any project 4 | // that uses this DLL. This way any other project whose source files include this file see 5 | // WINCVODE_API functions as being imported from a DLL, whereas this DLL sees symbols 6 | // defined with this macro as being exported. 7 | #ifdef WINCVODE_EXPORTS 8 | #define WINCVODE_API __declspec(dllexport) 9 | #else 10 | #define WINCVODE_API __declspec(dllimport) 11 | #endif 12 | 13 | /* examples ... 14 | // This class is exported from the WinCVODE.dll 15 | class WINCVODE_API CWinCVODE { 16 | public: 17 | CWinCVODE(void); 18 | // TODO: add your methods here. 19 | }; 20 | 21 | extern WINCVODE_API int nWinCVODE; 22 | 23 | WINCVODE_API int fnWinCVODE(void); 24 | */ 25 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/config/sundials_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.1 $ 4 | * $Date: 2005/10/27 13:11:25 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer(s): Aaron Collier @ LLNL 7 | * ----------------------------------------------------------------- 8 | * Copyright (c) 2005, The Regents of the University of California. 9 | * Produced at the Lawrence Livermore National Laboratory. 10 | * All rights reserved. 11 | * For details, see sundials/shared/LICENSE. 12 | *------------------------------------------------------------------ 13 | * SUNDIALS configuration header file 14 | *------------------------------------------------------------------ 15 | */ 16 | 17 | /* Define SUNDIALS version number */ 18 | #define SUNDIALS_PACKAGE_VERSION "2.1.1" 19 | 20 | /* FCMIX: Define Fortran name-mangling macro */ 21 | 22 | 23 | /* FCMIX: Define case of function names */ 24 | 25 | 26 | /* FCMIX: Define number of underscores to append to function names */ 27 | 28 | 29 | /* Define precision of SUNDIALS data type 'realtype' */ 30 | #define SUNDIALS_DOUBLE_PRECISION 1 31 | 32 | /* Use generic math functions */ 33 | #define SUNDIALS_USE_GENERIC_MATH 1 34 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/config/sundials_config.in: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.1 $ 4 | * $Date: 2005/10/27 13:11:25 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer(s): Aaron Collier @ LLNL 7 | * ----------------------------------------------------------------- 8 | * Copyright (c) 2005, The Regents of the University of California. 9 | * Produced at the Lawrence Livermore National Laboratory. 10 | * All rights reserved. 11 | * For details, see sundials/shared/LICENSE. 12 | *------------------------------------------------------------------ 13 | * SUNDIALS configuration header file 14 | *------------------------------------------------------------------ 15 | */ 16 | 17 | /* Define SUNDIALS version number */ 18 | #define SUNDIALS_PACKAGE_VERSION "@PACKAGE_VERSION@" 19 | 20 | /* FCMIX: Define Fortran name-mangling macro */ 21 | @F77_MANGLE_MACRO@ 22 | 23 | /* FCMIX: Define case of function names */ 24 | @F77_CASE@ 25 | 26 | /* FCMIX: Define number of underscores to append to function names */ 27 | @F77_UNDERSCORES@ 28 | 29 | /* Define precision of SUNDIALS data type 'realtype' */ 30 | @PRECISION_LEVEL@ 31 | 32 | /* Use generic math functions */ 33 | @GENERIC_MATH_LIB@ 34 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvode/doc/cv_examples.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/Win32/WinCVODE/sundials/cvode/doc/cv_examples.pdf -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvode/doc/cv_guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/Win32/WinCVODE/sundials/cvode/doc/cv_guide.pdf -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvode/examples_ser/README: -------------------------------------------------------------------------------- 1 | List of serial CVODE examples 2 | 3 | cvdx : dense example 4 | cvbx : banded example 5 | cvkx : Krylov example 6 | cvkxb : Krylov example with banded preconditioner 7 | cvdemd : demonstration program for direct methods 8 | cvdemk : demonstration program for Krylov methods 9 | 10 | Sample results: 11 | 12 | SUNDIALS was built with the following options: 13 | 14 | ./configure CC=gcc F77=g77 15 | 16 | System Architecture: IA-32 17 | Processor Type: Intel Pentium 4 Xeon DP (i686) 18 | Operating System: Red Hat Enterprise Linux WS 3 19 | C/Fortran Compilers: gcc/g77 v3.2.3-39 (Red Hat) 20 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvode/examples_ser/cvbx.out: -------------------------------------------------------------------------------- 1 | 2 | 2-D Advection-Diffusion Equation 3 | Mesh dimensions = 10 X 5 4 | Total system size = 50 5 | Tolerance parameters: reltol = 0 abstol = 1e-05 6 | 7 | At t = 0 max.norm(u) = 8.954716e+01 8 | At t = 0.10 max.norm(u) = 4.132889e+00 nst = 85 9 | At t = 0.20 max.norm(u) = 1.039294e+00 nst = 103 10 | At t = 0.30 max.norm(u) = 2.979829e-01 nst = 113 11 | At t = 0.40 max.norm(u) = 8.765774e-02 nst = 120 12 | At t = 0.50 max.norm(u) = 2.625637e-02 nst = 126 13 | At t = 0.60 max.norm(u) = 7.830425e-03 nst = 130 14 | At t = 0.70 max.norm(u) = 2.329387e-03 nst = 134 15 | At t = 0.80 max.norm(u) = 6.953434e-04 nst = 137 16 | At t = 0.90 max.norm(u) = 2.115983e-04 nst = 140 17 | At t = 1.00 max.norm(u) = 6.556853e-05 nst = 142 18 | 19 | Final Statistics: 20 | nst = 142 nfe = 173 nsetups = 23 nfeB = 0 njeB = 3 21 | nni = 170 ncfn = 0 netf = 3 22 | 23 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvode/examples_ser/cvdx.out: -------------------------------------------------------------------------------- 1 | 2 | 3-species kinetics problem 3 | 4 | At t = 2.6391e-01 y = 9.899653e-01 3.470564e-05 1.000000e-02 5 | rootsfound[] = 0 1 6 | At t = 4.0000e-01 y = 9.851641e-01 3.386242e-05 1.480205e-02 7 | At t = 4.0000e+00 y = 9.055097e-01 2.240338e-05 9.446793e-02 8 | At t = 4.0000e+01 y = 7.157952e-01 9.183486e-06 2.841956e-01 9 | At t = 4.0000e+02 y = 4.505420e-01 3.222963e-06 5.494548e-01 10 | At t = 4.0000e+03 y = 1.831878e-01 8.941319e-07 8.168113e-01 11 | At t = 4.0000e+04 y = 3.897868e-02 1.621567e-07 9.610212e-01 12 | At t = 4.0000e+05 y = 4.940023e-03 1.985716e-08 9.950600e-01 13 | At t = 4.0000e+06 y = 5.165107e-04 2.067097e-09 9.994835e-01 14 | At t = 2.0807e+07 y = 1.000000e-04 4.000395e-10 9.999000e-01 15 | rootsfound[] = 1 0 16 | At t = 4.0000e+07 y = 5.201457e-05 2.080690e-10 9.999480e-01 17 | At t = 4.0000e+08 y = 5.207182e-06 2.082883e-11 9.999948e-01 18 | At t = 4.0000e+09 y = 5.105811e-07 2.042325e-12 9.999995e-01 19 | At t = 4.0000e+10 y = 4.511312e-08 1.804525e-13 1.000000e-00 20 | 21 | Final Statistics: 22 | nst = 515 nfe = 754 nsetups = 110 nfeD = 0 njeD = 12 23 | nni = 751 ncfn = 0 netf = 26 nge = 543 24 | 25 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvode/examples_ser/cvdxe.out: -------------------------------------------------------------------------------- 1 | 2 | 3-species kinetics problem 3 | 4 | At t = 2.6391e-01 y = 9.899653e-01 3.470564e-05 1.000000e-02 5 | rootsfound[] = 0 1 6 | At t = 4.0000e-01 y = 9.851641e-01 3.386242e-05 1.480205e-02 7 | At t = 4.0000e+00 y = 9.055097e-01 2.240338e-05 9.446793e-02 8 | At t = 4.0000e+01 y = 7.157952e-01 9.183486e-06 2.841956e-01 9 | At t = 4.0000e+02 y = 4.505420e-01 3.222963e-06 5.494548e-01 10 | At t = 4.0000e+03 y = 1.831878e-01 8.941319e-07 8.168113e-01 11 | At t = 4.0000e+04 y = 3.897868e-02 1.621567e-07 9.610212e-01 12 | At t = 4.0000e+05 y = 4.940023e-03 1.985716e-08 9.950600e-01 13 | At t = 4.0000e+06 y = 5.165107e-04 2.067097e-09 9.994835e-01 14 | At t = 2.0807e+07 y = 1.000000e-04 4.000395e-10 9.999000e-01 15 | rootsfound[] = 1 0 16 | At t = 4.0000e+07 y = 5.201457e-05 2.080690e-10 9.999480e-01 17 | At t = 4.0000e+08 y = 5.207182e-06 2.082883e-11 9.999948e-01 18 | At t = 4.0000e+09 y = 5.105811e-07 2.042325e-12 9.999995e-01 19 | At t = 4.0000e+10 y = 4.511312e-08 1.804525e-13 1.000000e-00 20 | 21 | Final Statistics: 22 | nst = 515 nfe = 754 nsetups = 110 nfeD = 0 njeD = 12 23 | nni = 751 ncfn = 0 netf = 26 nge = 543 24 | 25 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvode/fcmix/examples_ser/README: -------------------------------------------------------------------------------- 1 | List of serial CVODE FCMIX examples 2 | 3 | cvdensef : chemical kinetics example (BDF/DENSE) 4 | cvbandf : advection-diffusion example (BDF/BAND) 5 | cvkrybf : kinetics-transport example (BDF/BAND) 6 | cvkryf : kinetics-transport example (BDF/SPGMR) 7 | 8 | Sample results: 9 | 10 | SUNDIALS was built with the following options: 11 | 12 | ./configure CC=gcc F77=g77 13 | 14 | System Architecture: IA-32 15 | Processor Type: Intel Pentium 4 Xeon DP (i686) 16 | Operating System: Red Hat Enterprise Linux WS 3 17 | C/Fortran Compilers: gcc/g77 v3.2.3-39 (Red Hat) 18 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvode/fcmix/examples_ser/cvbandf.out: -------------------------------------------------------------------------------- 1 | Band example problem: 2 | 3 | Advection-diffusion, NEQ = 50 4 | 5 | 6 | At t = 0.00 max.norm(u) = 0.895472E+02 7 | At t = 0.10 max.norm(u) = 0.413289E+01 NST = 85 8 | At t = 0.20 max.norm(u) = 0.103929E+01 NST = 103 9 | At t = 0.30 max.norm(u) = 0.297983E+00 NST = 113 10 | At t = 0.40 max.norm(u) = 0.876577E-01 NST = 120 11 | At t = 0.50 max.norm(u) = 0.262564E-01 NST = 126 12 | At t = 0.60 max.norm(u) = 0.783042E-02 NST = 130 13 | At t = 0.70 max.norm(u) = 0.232939E-02 NST = 134 14 | At t = 0.80 max.norm(u) = 0.695343E-03 NST = 137 15 | At t = 0.90 max.norm(u) = 0.211598E-03 NST = 140 16 | At t = 1.00 max.norm(u) = 0.655685E-04 NST = 142 17 | 18 | 19 | Final statistics: 20 | 21 | No. steps = 142 No. f-s = 173 No. J-s = 3 No. LU-s = 23 22 | No. nonlinear iterations = 170 23 | No. nonlinear convergence failures = 0 24 | No. error test failures = 3 25 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvode/fcmix/examples_ser/cvdensef.out: -------------------------------------------------------------------------------- 1 | Dense example problem: 2 | 3 | Robertson kinetics, NEQ = 3 4 | 5 | 6 | At t = 0.2639E+00 y = 0.989965E+00 0.347056E-04 0.100000E-01 7 | Above is a root, INFO() = 0 1 8 | At t = 0.4000E+00 y = 0.985164E+00 0.338624E-04 0.148021E-01 9 | At t = 0.4000E+01 y = 0.905510E+00 0.224034E-04 0.944679E-01 10 | At t = 0.4000E+02 y = 0.715795E+00 0.918349E-05 0.284196E+00 11 | At t = 0.4000E+03 y = 0.450542E+00 0.322296E-05 0.549455E+00 12 | At t = 0.4000E+04 y = 0.183188E+00 0.894132E-06 0.816811E+00 13 | At t = 0.4000E+05 y = 0.389787E-01 0.162157E-06 0.961021E+00 14 | At t = 0.4000E+06 y = 0.494002E-02 0.198572E-07 0.995060E+00 15 | At t = 0.4000E+07 y = 0.516511E-03 0.206710E-08 0.999483E+00 16 | At t = 0.2081E+08 y = 0.100000E-03 0.400039E-09 0.999900E+00 17 | Above is a root, INFO() = 1 0 18 | At t = 0.4000E+08 y = 0.520146E-04 0.208069E-09 0.999948E+00 19 | At t = 0.4000E+09 y = 0.520718E-05 0.208288E-10 0.999995E+00 20 | At t = 0.4000E+10 y = 0.510581E-06 0.204233E-11 0.999999E+00 21 | At t = 0.4000E+11 y = 0.451131E-07 0.180452E-12 0.100000E+01 22 | 23 | Final value of ydot = -0.851851E-18 -0.340740E-23 0.851854E-18 24 | 25 | 26 | Final statistics: 27 | 28 | No. steps = 515 No. f-s = 754 No. J-s = 12 No. LU-s = 110 29 | No. nonlinear iterations = 751 30 | No. nonlinear convergence failures = 0 31 | No. error test failures = 26 32 | No. root function evals = 541 33 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvode/fcmix/fcvewt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.1 $ 4 | * $Date: 2005/10/27 13:22:58 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer: Radu Serban @ LLNL 7 | * ----------------------------------------------------------------- 8 | * Copyright (c) 2002, The Regents of the University of California. 9 | * Produced at the Lawrence Livermore National Laboratory. 10 | * All rights reserved. 11 | * For details, see sundials/cvode/LICENSE. 12 | * ----------------------------------------------------------------- 13 | * Fortran/C interface routines for CVODE, for the case of a 14 | * user-supplied error weight calculation routine. 15 | * ----------------------------------------------------------------- 16 | */ 17 | 18 | #include 19 | #include 20 | 21 | #include "fcvode.h" /* actual fn. names, prototypes and global vars. */ 22 | #include "nvector.h" /* definitions of type N_Vector and vector macros */ 23 | #include "sundialstypes.h" /* definition of type realtype */ 24 | 25 | /***************************************************************************/ 26 | 27 | /* Prototype of the Fortran routine */ 28 | 29 | #ifdef __cplusplus /* wrapper to enable C++ usage */ 30 | extern "C" { 31 | #endif 32 | extern void FCV_EWT(realtype*, realtype*, int*); 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | /***************************************************************************/ 38 | 39 | void FCV_EWTSET(int *flag, int *ier) 40 | { 41 | if (*flag == 1) 42 | *ier = CVodeSetEwtFn(CV_cvodemem, FCVEwtSet, NULL); 43 | } 44 | 45 | /***************************************************************************/ 46 | 47 | /* 48 | * C function to interface between CVODE and a Fortran subroutine FCVEWT. 49 | */ 50 | 51 | int FCVEwtSet(N_Vector y, N_Vector ewt, void *e_data) 52 | { 53 | int ier = 0; 54 | realtype *ydata, *ewtdata; 55 | 56 | ydata = N_VGetArrayPointer(y); 57 | ewtdata = N_VGetArrayPointer(ewt); 58 | 59 | FCV_EWT(ydata, ewtdata, &ier); 60 | 61 | return(ier); 62 | } 63 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvode/fcmix/fcvroot.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.1 $ 4 | * $Date: 2005/10/27 13:22:58 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer(s): Aaron Collier @ LLNL 7 | * ----------------------------------------------------------------- 8 | * Copyright (c) 2002, The Regents of the University of California. 9 | * Produced at the Lawrence Livermore National Laboratory. 10 | * All rights reserved. 11 | * For details, see sundials/cvode/LICENSE. 12 | * ----------------------------------------------------------------- 13 | * The FCVROOT module contains the routines necessary to use 14 | * the rootfinding feature of the CVODE module and to interface 15 | * with the user-supplied Fortran subroutine. 16 | * ----------------------------------------------------------------- 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #include "cvode.h" /* CVODE constants and prototypes */ 23 | #include "fcvode.h" /* actual function names, prototypes and 24 | global variables */ 25 | #include "fcvroot.h" /* prototypes of interfaces to CVROOT */ 26 | #include "nvector.h" /* definition of type N_Vector */ 27 | #include "sundialstypes.h" /* definition of SUNDIALS type realtype */ 28 | 29 | /***************************************************************************/ 30 | 31 | /* Prototype of the Fortran routine */ 32 | 33 | #ifdef __cplusplus /* wrapper to enable C++ usage */ 34 | extern "C" { 35 | #endif 36 | extern void FCV_ROOTFN(realtype *, realtype*, realtype*); 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | 41 | /***************************************************************************/ 42 | 43 | void FCV_ROOTINIT(int *nrtfn, int *ier) 44 | { 45 | *ier = CVodeRootInit(CV_cvodemem, *nrtfn, (CVRootFn) FCVrootfunc, NULL); 46 | CV_nrtfn = *nrtfn; 47 | 48 | return; 49 | } 50 | 51 | /***************************************************************************/ 52 | 53 | void FCV_ROOTINFO(int *nrtfn, int *info, int *ier) 54 | { 55 | *ier = CVodeGetRootInfo(CV_cvodemem, info); 56 | return; 57 | } 58 | 59 | /***************************************************************************/ 60 | 61 | void FCV_ROOTFREE(void) 62 | { 63 | CVodeRootInit(CV_cvodemem, 0, NULL, NULL); 64 | 65 | return; 66 | } 67 | 68 | /***************************************************************************/ 69 | 70 | void FCVrootfunc(realtype t, N_Vector y, realtype *gout, void *g_data) 71 | { 72 | realtype *ydata; 73 | 74 | ydata = N_VGetArrayPointer(y); 75 | 76 | FCV_ROOTFN(&t, ydata, gout); 77 | 78 | return; 79 | } 80 | 81 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvode/source/cvbandpre_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.1 $ 4 | * $Date: 2005/10/27 13:26:31 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer(s): Michael Wittman, Alan C. Hindmarsh and 7 | * Radu Serban @ LLNL 8 | * ----------------------------------------------------------------- 9 | * Copyright (c) 2002, The Regents of the University of California. 10 | * Produced at the Lawrence Livermore National Laboratory. 11 | * All rights reserved. 12 | * For details, see sundials/cvode/LICENSE. 13 | * ----------------------------------------------------------------- 14 | * Implementation header file for the CVBANDPRE module. 15 | * ----------------------------------------------------------------- 16 | */ 17 | 18 | #ifndef _CVBANDPRE_IMPL_H 19 | #define _CVBANDPRE_IMPL_H 20 | 21 | #ifdef __cplusplus /* wrapper to enable C++ usage */ 22 | extern "C" { 23 | #endif 24 | 25 | #include "cvbandpre.h" 26 | 27 | #include "band.h" 28 | #include "nvector.h" 29 | #include "sundialstypes.h" 30 | 31 | /* 32 | * ----------------------------------------------------------------- 33 | * Type: CVBandPrecData 34 | * ----------------------------------------------------------------- 35 | */ 36 | 37 | typedef struct { 38 | 39 | /* Data set by user in CVBandPrecAlloc: */ 40 | long int N; 41 | long int ml, mu; 42 | 43 | /* Data set by CVBandPrecSetup: */ 44 | BandMat savedJ; 45 | BandMat savedP; 46 | long int *pivots; 47 | 48 | /* Rhs calls */ 49 | long int nfeBP; 50 | 51 | /* Pointer to cvode_mem */ 52 | void *cvode_mem; 53 | 54 | } *CVBandPrecData; 55 | 56 | /* Error Messages */ 57 | 58 | #define _CVBALLOC_ "CVBandPreAlloc-- " 59 | #define MSGBP_CVMEM_NULL _CVBALLOC_ "Integrator memory is NULL.\n\n" 60 | #define MSGBP_BAD_NVECTOR _CVBALLOC_ "A required vector operation is not implemented.\n\n" 61 | 62 | #define MSGBP_PDATA_NULL "CVBandPrecGet*-- BandPrecData is NULL.\n\n" 63 | 64 | #define MSGBP_NO_PDATA "CVBPSpgmr-- BandPrecData is NULL.\n\n" 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvode/source/cvbbdpre_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.1 $ 4 | * $Date: 2005/10/27 13:26:31 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer(s): Michael Wittman, Alan C. Hindmarsh and 7 | * Radu Serban @ LLNL 8 | * ----------------------------------------------------------------- 9 | * Copyright (c) 2002, The Regents of the University of California. 10 | * Produced at the Lawrence Livermore National Laboratory. 11 | * All rights reserved. 12 | * For details, see sundials/cvode/LICENSE. 13 | * ----------------------------------------------------------------- 14 | * Implementation header file for the CVBBDPRE module. 15 | * ----------------------------------------------------------------- 16 | */ 17 | 18 | #ifndef _CVBBDPRE_IMPL_H 19 | #define _CVBBDPRE_IMPL_H 20 | 21 | #ifdef __cplusplus /* wrapper to enable C++ usage */ 22 | extern "C" { 23 | #endif 24 | 25 | #include "cvbbdpre.h" 26 | 27 | #include "band.h" 28 | #include "nvector.h" 29 | #include "sundialstypes.h" 30 | 31 | /* 32 | * ----------------------------------------------------------------- 33 | * Type: CVBBDPrecData 34 | * ----------------------------------------------------------------- 35 | */ 36 | 37 | typedef struct { 38 | 39 | /* passed by user to CVBBDPrecAlloc, used by PrecSetup/PrecSolve */ 40 | long int mudq, mldq, mukeep, mlkeep; 41 | realtype dqrely; 42 | CVLocalFn gloc; 43 | CVCommFn cfn; 44 | 45 | /* set by CVBBDPrecSetup and used by CVBBDPrecSolve */ 46 | BandMat savedJ; 47 | BandMat savedP; 48 | long int *pivots; 49 | 50 | /* set by CVBBDPrecAlloc and used by CVBBDPrecSetup */ 51 | long int n_local; 52 | 53 | /* available for optional output: */ 54 | long int rpwsize; 55 | long int ipwsize; 56 | long int nge; 57 | 58 | /* Pointer to cvode_mem */ 59 | void *cvode_mem; 60 | 61 | } *CVBBDPrecData; 62 | 63 | 64 | /* Error Messages */ 65 | 66 | #define _CVBBDALLOC_ "CVBBDAlloc-- " 67 | #define MSGBBDP_CVMEM_NULL _CVBBDALLOC_ "Integrator memory is NULL.\n\n" 68 | #define MSGBBDP_BAD_NVECTOR _CVBBDALLOC_ "A required vector operation is not implemented.\n\n" 69 | 70 | #define MSGBBDP_PDATA_NULL "CVBBDPrecGet*-- BBDPrecData is NULL.\n\n" 71 | 72 | #define MSGBBDP_NO_PDATA "CVBBDSpgmr-- BBDPrecData is NULL.\n\n" 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvode/source/cvdiag_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.1 $ 4 | * $Date: 2005/10/27 13:26:31 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer(s): Scott D. Cohen, Alan C. Hindmarsh and 7 | * Radu Serban @ LLNL 8 | * ----------------------------------------------------------------- 9 | * Copyright (c) 2002, The Regents of the University of California. 10 | * Produced at the Lawrence Livermore National Laboratory. 11 | * All rights reserved. 12 | * For details, see sundials/cvode/LICENSE. 13 | * ----------------------------------------------------------------- 14 | * Implementation header file for the diagonal linear solver, CVDIAG. 15 | * ----------------------------------------------------------------- 16 | */ 17 | 18 | #ifndef _CVDIAG_IMPL_H 19 | #define _CVDIAG_IMPL_H 20 | 21 | #ifdef __cplusplus /* wrapper to enable C++ usage */ 22 | extern "C" { 23 | #endif 24 | 25 | #include 26 | 27 | #include "cvdiag.h" 28 | 29 | #include "nvector.h" 30 | #include "sundialstypes.h" 31 | 32 | /* 33 | * ----------------------------------------------------------------- 34 | * Types: CVDiagMemRec, CVDiagMem 35 | * ----------------------------------------------------------------- 36 | * The type CVDiagMem is pointer to a CVDiagMemRec. 37 | * This structure contains CVDiag solver-specific data. 38 | * ----------------------------------------------------------------- 39 | */ 40 | 41 | typedef struct { 42 | 43 | realtype di_gammasv; /* gammasv = gamma at the last call to setup */ 44 | /* or solve */ 45 | 46 | N_Vector di_M; /* M = (I - gamma J)^{-1} , gamma = h / l1 */ 47 | 48 | N_Vector di_bit; /* temporary storage vector */ 49 | 50 | N_Vector di_bitcomp; /* temporary storage vector */ 51 | 52 | long int di_nfeDI; /* no. of calls to f due to difference 53 | quotient diagonal Jacobian approximation */ 54 | 55 | int di_last_flag; /* last error return flag */ 56 | 57 | } CVDiagMemRec, *CVDiagMem; 58 | 59 | /* Error Messages */ 60 | 61 | #define _CVDIAG_ "CVDiag-- " 62 | #define MSGDG_CVMEM_NULL _CVDIAG_ "Integrator memory is NULL.\n\n" 63 | #define MSGDG_BAD_NVECTOR _CVDIAG_ "A required vector operation is not implemented.\n\n" 64 | #define MSGDG_MEM_FAIL _CVDIAG_ "A memory request failed.\n\n" 65 | 66 | #define MSGDG_SETGET_CVMEM_NULL "CVDiagGet*-- Integrator memory is NULL.\n\n" 67 | 68 | #define MSGDG_SETGET_LMEM_NULL "CVDiagGet*-- cvdiag memory is NULL.\n\n" 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvodes/doc/cvs_examples.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/Win32/WinCVODE/sundials/cvodes/doc/cvs_examples.pdf -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvodes/doc/cvs_guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/Win32/WinCVODE/sundials/cvodes/doc/cvs_guide.pdf -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvodes/examples_ser/README: -------------------------------------------------------------------------------- 1 | List of serial CVODES examples 2 | 3 | (1) Simulation 4 | 5 | cvdx : dense example 6 | cvbx : banded example 7 | cvkx : Krylov example 8 | cvkxb : Krylov example with banded preconditioner 9 | cvdemd : demonstration program for direct methods 10 | cvdemk : demonstration program for Krylov methods 11 | 12 | (2) Forward sensitivity 13 | 14 | cvfnx : 1-D advection difusion PDE - 15 | Adams with Functional iteration 16 | cvfdx : chemical kinetics ODEs - 17 | BDF with Newton Dense 18 | cvfkx : 2-D 2-species diurnal advection-diffusion PDE - 19 | BDF with Newton GMRES 20 | 21 | (3) Adjoint sensitivity 22 | 23 | cvadx : chemical kinetics - adjoint sensitivity 24 | cvabx : advection-diffusion - adjoint sensitivity 25 | cvakx : food web - adjoint sensitivity for G 26 | cvakxb : food web - adjoint sensitivity for g 27 | 28 | Sample results: 29 | 30 | SUNDIALS was built with the following options: 31 | 32 | ./configure CC=gcc F77=g77 33 | 34 | System Architecture: IA-32 35 | Processor Type: Intel Pentium 4 Xeon DP (i686) 36 | Operating System: Red Hat Enterprise Linux WS 3 37 | C/Fortran Compilers: gcc/g77 v3.2.3-39 (Red Hat) 38 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvodes/examples_ser/cvabx.out: -------------------------------------------------------------------------------- 1 | Create and allocate CVODES memory for forward runs 2 | 3 | Allocate global memory 4 | 5 | Forward integration 6 | 7 | Create and allocate CVODES memory for backward run 8 | 9 | Backward integration 10 | 11 | Maximum sensitivity 12 | lambda max = 1.128855e-01 13 | at 14 | x = 1.170732e+00 15 | y = 4.761905e-01 16 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvodes/examples_ser/cvadx.out: -------------------------------------------------------------------------------- 1 | Adjoint Sensitivity Example for Chemical Kinetics 2 | ------------------------------------------------- 3 | 4 | ODE: dy1/dt = -p1*y1 + p2*y2*y3 5 | dy2/dt = p1*y1 - p2*y2*y3 - p3*(y2)^2 6 | dy3/dt = p3*(y2)^2 7 | 8 | Find dG/dp for 9 | G = int_t0^tB0 g(t,p,y) dt 10 | g(t,p,y) = y3 11 | 12 | 13 | Create and allocate CVODES memory for forward runs 14 | Allocate global memory 15 | Forward integration ... done. ncheck = 5 G: 3.9983e+07 16 | 17 | Create and allocate CVODES memory for backward run 18 | Integrate backwards 19 | -------------------------------------------------------- 20 | tB0: 4.0000e+07 21 | dG/dp: 7.6843e+05 -3.0691e+00 5.1150e-04 22 | lambda(t0): 3.9967e+07 3.9967e+07 3.9967e+07 23 | -------------------------------------------------------- 24 | 25 | Re-initialize CVODES memory for backward run 26 | Integrate backwards 27 | -------------------------------------------------------- 28 | tB0: 4.0000e+07 29 | dG/dp: 1.7341e+02 -5.0590e-04 8.4320e-08 30 | lambda(t0): 8.4190e+00 1.6097e+01 1.6097e+01 31 | -------------------------------------------------------- 32 | 33 | Free memory 34 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvodes/examples_ser/cvakx.out: -------------------------------------------------------------------------------- 1 | Create and allocate CVODE memory for forward run 2 | 3 | Allocate global memory 4 | 5 | Forward integration ... done (ncheck = 2) 6 | 7 | G = int_t int_x int_y c6(t,x,y) dx dy dt = 422296.125734 8 | 9 | 10 | Create and allocate CVODES memory for backward run 11 | 12 | Backward integration 13 | 14 | Maximum sensitivity with respect to I.C. of species 1 15 | lambda max = 9.566140e+02 16 | at 17 | x = 1.000000e+00 18 | y = 1.000000e+00 19 | 20 | Maximum sensitivity with respect to I.C. of species 2 21 | lambda max = 9.376469e+02 22 | at 23 | x = 1.000000e+00 24 | y = 1.000000e+00 25 | 26 | Maximum sensitivity with respect to I.C. of species 3 27 | lambda max = 9.197261e+02 28 | at 29 | x = 1.000000e+00 30 | y = 1.000000e+00 31 | 32 | Maximum sensitivity with respect to I.C. of species 4 33 | lambda max = -3.405877e-03 34 | at 35 | x = 1.000000e+00 36 | y = 0.000000e+00 37 | 38 | Maximum sensitivity with respect to I.C. of species 5 39 | lambda max = -3.403802e-03 40 | at 41 | x = 1.000000e+00 42 | y = 0.000000e+00 43 | 44 | Maximum sensitivity with respect to I.C. of species 6 45 | lambda max = 2.456960e-01 46 | at 47 | x = 0.000000e+00 48 | y = 0.000000e+00 49 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvodes/examples_ser/cvakxb.out: -------------------------------------------------------------------------------- 1 | Create and allocate CVODES memory for forward run 2 | 3 | Allocate global memory 4 | 5 | Forward integration ... done (ncheck = 10) 6 | 7 | g = int_x int_y c6(Tfinal,x,y) dx dy = 35988.918560 8 | 9 | 10 | Create and allocate CVODES memory for backward run 11 | 12 | Backward integration 13 | 14 | Maximum sensitivity with respect to I.C. of species 1 15 | mu max = 5.060721e-04 16 | at 17 | x = 9.473684e-01 18 | y = 1.000000e+00 19 | 20 | Maximum sensitivity with respect to I.C. of species 2 21 | mu max = 4.819976e-04 22 | at 23 | x = 9.473684e-01 24 | y = 1.000000e+00 25 | 26 | Maximum sensitivity with respect to I.C. of species 3 27 | mu max = 4.598256e-04 28 | at 29 | x = 9.473684e-01 30 | y = 1.000000e+00 31 | 32 | Maximum sensitivity with respect to I.C. of species 4 33 | mu max = 1.152169e-11 34 | at 35 | x = 0.000000e+00 36 | y = 0.000000e+00 37 | 38 | Maximum sensitivity with respect to I.C. of species 5 39 | mu max = 1.100880e-11 40 | at 41 | x = 0.000000e+00 42 | y = 0.000000e+00 43 | 44 | Maximum sensitivity with respect to I.C. of species 6 45 | mu max = 2.099096e-11 46 | at 47 | x = 1.000000e+00 48 | y = 1.000000e+00 49 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvodes/examples_ser/cvbx.out: -------------------------------------------------------------------------------- 1 | 2 | 2-D Advection-Diffusion Equation 3 | Mesh dimensions = 10 X 5 4 | Total system size = 50 5 | Tolerance parameters: reltol = 0 abstol = 1e-05 6 | 7 | At t = 0 max.norm(u) = 8.954716e+01 8 | At t = 0.10 max.norm(u) = 4.132889e+00 nst = 85 9 | At t = 0.20 max.norm(u) = 1.039294e+00 nst = 103 10 | At t = 0.30 max.norm(u) = 2.979829e-01 nst = 113 11 | At t = 0.40 max.norm(u) = 8.765774e-02 nst = 120 12 | At t = 0.50 max.norm(u) = 2.625637e-02 nst = 126 13 | At t = 0.60 max.norm(u) = 7.830425e-03 nst = 130 14 | At t = 0.70 max.norm(u) = 2.329387e-03 nst = 134 15 | At t = 0.80 max.norm(u) = 6.953434e-04 nst = 137 16 | At t = 0.90 max.norm(u) = 2.115983e-04 nst = 140 17 | At t = 1.00 max.norm(u) = 6.556853e-05 nst = 142 18 | 19 | Final Statistics: 20 | nst = 142 nfe = 173 nsetups = 23 nfeB = 0 njeB = 3 21 | nni = 170 ncfn = 0 netf = 3 22 | 23 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvodes/examples_ser/cvdx.out: -------------------------------------------------------------------------------- 1 | 2 | 3-species kinetics problem 3 | 4 | At t = 2.6391e-01 y = 9.899653e-01 3.470564e-05 1.000000e-02 5 | rootsfound[] = 0 1 6 | At t = 4.0000e-01 y = 9.851641e-01 3.386242e-05 1.480205e-02 7 | At t = 4.0000e+00 y = 9.055097e-01 2.240338e-05 9.446793e-02 8 | At t = 4.0000e+01 y = 7.157952e-01 9.183486e-06 2.841956e-01 9 | At t = 4.0000e+02 y = 4.505420e-01 3.222963e-06 5.494548e-01 10 | At t = 4.0000e+03 y = 1.831878e-01 8.941319e-07 8.168113e-01 11 | At t = 4.0000e+04 y = 3.897868e-02 1.621567e-07 9.610212e-01 12 | At t = 4.0000e+05 y = 4.940023e-03 1.985716e-08 9.950600e-01 13 | At t = 4.0000e+06 y = 5.165107e-04 2.067097e-09 9.994835e-01 14 | At t = 2.0807e+07 y = 1.000000e-04 4.000395e-10 9.999000e-01 15 | rootsfound[] = 1 0 16 | At t = 4.0000e+07 y = 5.201457e-05 2.080690e-10 9.999480e-01 17 | At t = 4.0000e+08 y = 5.207182e-06 2.082883e-11 9.999948e-01 18 | At t = 4.0000e+09 y = 5.105811e-07 2.042325e-12 9.999995e-01 19 | At t = 4.0000e+10 y = 4.511312e-08 1.804525e-13 1.000000e-00 20 | 21 | Final Statistics: 22 | nst = 515 nfe = 754 nsetups = 110 nfeD = 0 njeD = 12 23 | nni = 751 ncfn = 0 netf = 26 nge = 543 24 | 25 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvodes/examples_ser/cvdxe.out: -------------------------------------------------------------------------------- 1 | 2 | 3-species kinetics problem 3 | 4 | At t = 2.6391e-01 y = 9.899653e-01 3.470564e-05 1.000000e-02 5 | rootsfound[] = 0 1 6 | At t = 4.0000e-01 y = 9.851641e-01 3.386242e-05 1.480205e-02 7 | At t = 4.0000e+00 y = 9.055097e-01 2.240338e-05 9.446793e-02 8 | At t = 4.0000e+01 y = 7.157952e-01 9.183486e-06 2.841956e-01 9 | At t = 4.0000e+02 y = 4.505420e-01 3.222963e-06 5.494548e-01 10 | At t = 4.0000e+03 y = 1.831878e-01 8.941319e-07 8.168113e-01 11 | At t = 4.0000e+04 y = 3.897868e-02 1.621567e-07 9.610212e-01 12 | At t = 4.0000e+05 y = 4.940023e-03 1.985716e-08 9.950600e-01 13 | At t = 4.0000e+06 y = 5.165107e-04 2.067097e-09 9.994835e-01 14 | At t = 2.0807e+07 y = 1.000000e-04 4.000395e-10 9.999000e-01 15 | rootsfound[] = 1 0 16 | At t = 4.0000e+07 y = 5.201457e-05 2.080690e-10 9.999480e-01 17 | At t = 4.0000e+08 y = 5.207182e-06 2.082883e-11 9.999948e-01 18 | At t = 4.0000e+09 y = 5.105811e-07 2.042325e-12 9.999995e-01 19 | At t = 4.0000e+10 y = 4.511312e-08 1.804525e-13 1.000000e-00 20 | 21 | Final Statistics: 22 | nst = 515 nfe = 754 nsetups = 110 nfeD = 0 njeD = 12 23 | nni = 751 ncfn = 0 netf = 26 nge = 543 24 | 25 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvodes/source/cvbandpre_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.1 $ 4 | * $Date: 2005/10/27 13:37:27 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer(s): Michael Wittman, Alan C. Hindmarsh and 7 | * Radu Serban @ LLNL 8 | * ----------------------------------------------------------------- 9 | * Copyright (c) 2002, The Regents of the University of California. 10 | * Produced at the Lawrence Livermore National Laboratory. 11 | * All rights reserved. 12 | * For details, see sundials/cvodes/LICENSE. 13 | * ----------------------------------------------------------------- 14 | * Implementation header file for the CVBANDPRE module. 15 | * ----------------------------------------------------------------- 16 | */ 17 | 18 | #ifndef _CVBANDPRE_IMPL_H 19 | #define _CVBANDPRE_IMPL_H 20 | 21 | #ifdef __cplusplus /* wrapper to enable C++ usage */ 22 | extern "C" { 23 | #endif 24 | 25 | #include "cvbandpre.h" 26 | 27 | #include "band.h" 28 | #include "nvector.h" 29 | #include "sundialstypes.h" 30 | 31 | /* 32 | * ----------------------------------------------------------------- 33 | * Type: CVBandPrecData 34 | * ----------------------------------------------------------------- 35 | */ 36 | 37 | typedef struct { 38 | 39 | /* Data set by user in CVBandPrecAlloc: */ 40 | long int N; 41 | long int ml, mu; 42 | 43 | /* Data set by CVBandPrecSetup: */ 44 | BandMat savedJ; 45 | BandMat savedP; 46 | long int *pivots; 47 | 48 | /* Rhs calls */ 49 | long int nfeBP; 50 | 51 | /* Pointer to cvode_mem */ 52 | void *cvode_mem; 53 | 54 | } *CVBandPrecData; 55 | 56 | /* Error Messages */ 57 | 58 | #define _CVBALLOC_ "CVBandPreAlloc-- " 59 | #define MSGBP_CVMEM_NULL _CVBALLOC_ "Integrator memory is NULL.\n\n" 60 | #define MSGBP_BAD_NVECTOR _CVBALLOC_ "A required vector operation is not implemented.\n\n" 61 | 62 | #define MSGBP_PDATA_NULL "CVBandPrecGet*-- BandPrecData is NULL.\n\n" 63 | 64 | #define MSGBP_NO_PDATA "CVBPSpgmr-- BandPrecData is NULL.\n\n" 65 | 66 | #ifdef __cplusplus 67 | } 68 | #endif 69 | 70 | #endif 71 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvodes/source/cvbbdpre_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.1 $ 4 | * $Date: 2005/10/27 13:37:27 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer(s): Michael Wittman, Alan C. Hindmarsh and 7 | * Radu Serban @ LLNL 8 | * ----------------------------------------------------------------- 9 | * Copyright (c) 2002, The Regents of the University of California. 10 | * Produced at the Lawrence Livermore National Laboratory. 11 | * All rights reserved. 12 | * For details, see sundials/cvodes/LICENSE. 13 | * ----------------------------------------------------------------- 14 | * Implementation header file for the CVBBDPRE module. 15 | * ----------------------------------------------------------------- 16 | */ 17 | 18 | #ifndef _CVBBDPRE_IMPL_H 19 | #define _CVBBDPRE_IMPL_H 20 | 21 | #ifdef __cplusplus /* wrapper to enable C++ usage */ 22 | extern "C" { 23 | #endif 24 | 25 | #include "cvbbdpre.h" 26 | 27 | #include "band.h" 28 | #include "nvector.h" 29 | #include "sundialstypes.h" 30 | 31 | /* 32 | * ----------------------------------------------------------------- 33 | * Type: CVBBDPrecData 34 | * ----------------------------------------------------------------- 35 | */ 36 | 37 | typedef struct { 38 | 39 | /* passed by user to CVBBDPrecAlloc, used by PrecSetup/PrecSolve */ 40 | long int mudq, mldq, mukeep, mlkeep; 41 | realtype dqrely; 42 | CVLocalFn gloc; 43 | CVCommFn cfn; 44 | 45 | /* set by CVBBDPrecSetup and used by CVBBDPrecSolve */ 46 | BandMat savedJ; 47 | BandMat savedP; 48 | long int *pivots; 49 | 50 | /* set by CVBBDPrecAlloc and used by CVBBDPrecSetup */ 51 | long int n_local; 52 | 53 | /* available for optional output: */ 54 | long int rpwsize; 55 | long int ipwsize; 56 | long int nge; 57 | 58 | /* Pointer to cvode_mem */ 59 | void *cvode_mem; 60 | 61 | } *CVBBDPrecData; 62 | 63 | 64 | /* Error Messages */ 65 | 66 | #define _CVBBDALLOC_ "CVBBDAlloc-- " 67 | #define MSGBBDP_CVMEM_NULL _CVBBDALLOC_ "Integrator memory is NULL.\n\n" 68 | #define MSGBBDP_BAD_NVECTOR _CVBBDALLOC_ "A required vector operation is not implemented.\n\n" 69 | 70 | #define MSGBBDP_PDATA_NULL "CVBBDPrecGet*-- BBDPrecData is NULL.\n\n" 71 | 72 | #define MSGBBDP_NO_PDATA "CVBBDSpgmr-- BBDPrecData is NULL.\n\n" 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/cvodes/source/cvdiag_impl.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.1 $ 4 | * $Date: 2005/10/27 13:37:27 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer(s): Scott D. Cohen, Alan C. Hindmarsh and 7 | * Radu Serban @ LLNL 8 | * ----------------------------------------------------------------- 9 | * Copyright (c) 2002, The Regents of the University of California. 10 | * Produced at the Lawrence Livermore National Laboratory. 11 | * All rights reserved. 12 | * For details, see sundials/cvodes/LICENSE. 13 | * ----------------------------------------------------------------- 14 | * Implementation header file for the diagonal linear solver, CVDIAG. 15 | * ----------------------------------------------------------------- 16 | */ 17 | 18 | #ifndef _CVDIAG_IMPL_H 19 | #define _CVDIAG_IMPL_H 20 | 21 | #ifdef __cplusplus /* wrapper to enable C++ usage */ 22 | extern "C" { 23 | #endif 24 | 25 | #include 26 | 27 | #include "cvdiag.h" 28 | 29 | #include "nvector.h" 30 | #include "sundialstypes.h" 31 | 32 | /* 33 | * ----------------------------------------------------------------- 34 | * Types: CVDiagMemRec, CVDiagMem 35 | * ----------------------------------------------------------------- 36 | * The type CVDiagMem is pointer to a CVDiagMemRec. 37 | * This structure contains CVDiag solver-specific data. 38 | * ----------------------------------------------------------------- 39 | */ 40 | 41 | typedef struct { 42 | 43 | realtype di_gammasv; /* gammasv = gamma at the last call to setup */ 44 | /* or solve */ 45 | 46 | N_Vector di_M; /* M = (I - gamma J)^{-1} , gamma = h / l1 */ 47 | 48 | N_Vector di_bit; /* temporary storage vector */ 49 | 50 | N_Vector di_bitcomp; /* temporary storage vector */ 51 | 52 | long int di_nfeDI; /* no. of calls to f due to difference 53 | quotient diagonal Jacobian approximation */ 54 | 55 | int di_last_flag; /* last error return flag */ 56 | 57 | } CVDiagMemRec, *CVDiagMem; 58 | 59 | /* Error Messages */ 60 | 61 | #define _CVDIAG_ "CVDiag-- " 62 | #define MSGDG_CVMEM_NULL _CVDIAG_ "Integrator memory is NULL.\n\n" 63 | #define MSGDG_BAD_NVECTOR _CVDIAG_ "A required vector operation is not implemented.\n\n" 64 | #define MSGDG_MEM_FAIL _CVDIAG_ "A memory request failed.\n\n" 65 | 66 | #define MSGDG_SETGET_CVMEM_NULL "CVDiagGet*-- Integrator memory is NULL.\n\n" 67 | 68 | #define MSGDG_SETGET_LMEM_NULL "CVDiagGet*-- cvdiag memory is NULL.\n\n" 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/ida/doc/ida_examples.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/Win32/WinCVODE/sundials/ida/doc/ida_examples.pdf -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/ida/doc/ida_guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/Win32/WinCVODE/sundials/ida/doc/ida_guide.pdf -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/ida/examples_ser/Makefile: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------- 2 | # $Revision: 1.1 $ 3 | # $Date: 2005/10/27 13:41:33 $ 4 | # ----------------------------------------------------------------- 5 | # Programmer(s): Radu Serban and Aaron Collier @ LLNL 6 | # ----------------------------------------------------------------- 7 | # Copyright (c) 2002, The Regents of the University of California. 8 | # Produced at the Lawrence Livermore National Laboratory. 9 | # All rights reserved. 10 | # For details, see sundials/ida/LICENSE. 11 | # ----------------------------------------------------------------- 12 | # Makefile for IDA serial examples 13 | # 14 | # ida/examples_ser/Makefile. Generated from Makefile.in by configure. 15 | # ----------------------------------------------------------------- 16 | 17 | SHELL = /bin/bash 18 | 19 | srcdir = . 20 | builddir = . 21 | top_builddir = ../../ 22 | prefix = /cygdrive/h/SFORGE_CVS/SBML_odeSolver/Win32/WinCVODE/sundials 23 | exec_prefix = ${prefix} 24 | includedir = ${prefix}/include 25 | libdir = ${exec_prefix}/lib 26 | 27 | 28 | 29 | CPP = /usr/bin/cc -E 30 | CPPFLAGS = 31 | CC = /usr/bin/cc 32 | CFLAGS = -g -O2 33 | LDFLAGS = 34 | LIBS = -lm 35 | 36 | COMPILER_PREFIX = 37 | LINKER_PREFIX = 38 | 39 | SUNDIALS_INC_DIR = $(includedir) 40 | SUNDIALS_LIB_DIR = $(libdir) 41 | SUNDIALS_LIBS = -lsundials_ida -lsundials_nvecserial -lsundials_shared 42 | 43 | EXEC_FILES = irobx iheatsb iheatsk iwebsb 44 | 45 | all: $(EXEC_FILES) 46 | 47 | irobx: $(srcdir)/irobx.c 48 | $(COMPILER_PREFIX) $(CC) $(CPPFLAGS) -I$(SUNDIALS_INC_DIR) $(CFLAGS) -c $(srcdir)/irobx.c 49 | $(LINKER_PREFIX) $(CC) -o $(builddir)/irobx $(builddir)/irobx.o $(LDFLAGS) -L$(SUNDIALS_LIB_DIR) $(SUNDIALS_LIBS) $(LIBS) 50 | iheatsb: $(srcdir)/iheatsb.c 51 | $(COMPILER_PREFIX) $(CC) $(CPPFLAGS) -I$(SUNDIALS_INC_DIR) $(CFLAGS) -c $(srcdir)/iheatsb.c 52 | $(LINKER_PREFIX) $(CC) -o $(builddir)/iheatsb $(builddir)/iheatsb.o $(LDFLAGS) -L$(SUNDIALS_LIB_DIR) $(SUNDIALS_LIBS) $(LIBS) 53 | iheatsk: $(srcdir)/iheatsk.c 54 | $(COMPILER_PREFIX) $(CC) $(CPPFLAGS) -I$(SUNDIALS_INC_DIR) $(CFLAGS) -c $(srcdir)/iheatsk.c 55 | $(LINKER_PREFIX) $(CC) -o $(builddir)/iheatsk $(builddir)/iheatsk.o $(LDFLAGS) -L$(SUNDIALS_LIB_DIR) $(SUNDIALS_LIBS) $(LIBS) 56 | iwebsb: $(srcdir)/iwebsb.c 57 | $(COMPILER_PREFIX) $(CC) $(CPPFLAGS) -I$(SUNDIALS_INC_DIR) $(CFLAGS) -c $(srcdir)/iwebsb.c 58 | $(LINKER_PREFIX) $(CC) -o $(builddir)/iwebsb $(builddir)/iwebsb.o $(LDFLAGS) -L$(SUNDIALS_LIB_DIR) $(SUNDIALS_LIBS) $(LIBS) 59 | 60 | clean: 61 | rm -rf .libs 62 | rm -f *.lo 63 | rm -f *.o 64 | 65 | uninstall: clean 66 | rm -f $(EXEC_FILES) 67 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/ida/examples_ser/Makefile.in: -------------------------------------------------------------------------------- 1 | # ----------------------------------------------------------------- 2 | # $Revision: 1.1 $ 3 | # $Date: 2005/10/27 13:41:33 $ 4 | # ----------------------------------------------------------------- 5 | # Programmer(s): Radu Serban and Aaron Collier @ LLNL 6 | # ----------------------------------------------------------------- 7 | # Copyright (c) 2002, The Regents of the University of California. 8 | # Produced at the Lawrence Livermore National Laboratory. 9 | # All rights reserved. 10 | # For details, see sundials/ida/LICENSE. 11 | # ----------------------------------------------------------------- 12 | # Makefile for IDA serial examples 13 | # 14 | # @configure_input@ 15 | # ----------------------------------------------------------------- 16 | 17 | SHELL = @SHELL@ 18 | 19 | srcdir = @srcdir@ 20 | builddir = @builddir@ 21 | top_builddir = @top_builddir@ 22 | prefix = @prefix@ 23 | exec_prefix = @exec_prefix@ 24 | includedir = @includedir@ 25 | libdir = @libdir@ 26 | 27 | @LIBTOOL_CMD@ 28 | 29 | CPP = @CPP@ 30 | CPPFLAGS = @CPPFLAGS@ 31 | CC = @CC@ 32 | CFLAGS = @CFLAGS@ 33 | LDFLAGS = @LDFLAGS@ 34 | LIBS = @LIBS@ 35 | 36 | COMPILER_PREFIX = @COMPILER_PREFIX@ 37 | LINKER_PREFIX = @LINKER_PREFIX@ 38 | 39 | SUNDIALS_INC_DIR = $(includedir) 40 | SUNDIALS_LIB_DIR = $(libdir) 41 | SUNDIALS_LIBS = -lsundials_ida -lsundials_nvecserial -lsundials_shared 42 | 43 | EXEC_FILES = irobx iheatsb iheatsk iwebsb 44 | 45 | all: $(EXEC_FILES) 46 | 47 | irobx: $(srcdir)/irobx.c 48 | $(COMPILER_PREFIX) $(CC) $(CPPFLAGS) -I$(SUNDIALS_INC_DIR) $(CFLAGS) -c $(srcdir)/irobx.c 49 | $(LINKER_PREFIX) $(CC) -o $(builddir)/irobx $(builddir)/irobx.o $(LDFLAGS) -L$(SUNDIALS_LIB_DIR) $(SUNDIALS_LIBS) $(LIBS) 50 | iheatsb: $(srcdir)/iheatsb.c 51 | $(COMPILER_PREFIX) $(CC) $(CPPFLAGS) -I$(SUNDIALS_INC_DIR) $(CFLAGS) -c $(srcdir)/iheatsb.c 52 | $(LINKER_PREFIX) $(CC) -o $(builddir)/iheatsb $(builddir)/iheatsb.o $(LDFLAGS) -L$(SUNDIALS_LIB_DIR) $(SUNDIALS_LIBS) $(LIBS) 53 | iheatsk: $(srcdir)/iheatsk.c 54 | $(COMPILER_PREFIX) $(CC) $(CPPFLAGS) -I$(SUNDIALS_INC_DIR) $(CFLAGS) -c $(srcdir)/iheatsk.c 55 | $(LINKER_PREFIX) $(CC) -o $(builddir)/iheatsk $(builddir)/iheatsk.o $(LDFLAGS) -L$(SUNDIALS_LIB_DIR) $(SUNDIALS_LIBS) $(LIBS) 56 | iwebsb: $(srcdir)/iwebsb.c 57 | $(COMPILER_PREFIX) $(CC) $(CPPFLAGS) -I$(SUNDIALS_INC_DIR) $(CFLAGS) -c $(srcdir)/iwebsb.c 58 | $(LINKER_PREFIX) $(CC) -o $(builddir)/iwebsb $(builddir)/iwebsb.o $(LDFLAGS) -L$(SUNDIALS_LIB_DIR) $(SUNDIALS_LIBS) $(LIBS) 59 | 60 | clean: 61 | rm -rf .libs 62 | rm -f *.lo 63 | rm -f *.o 64 | 65 | uninstall: clean 66 | rm -f $(EXEC_FILES) 67 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/ida/examples_ser/README: -------------------------------------------------------------------------------- 1 | List of serial IDA examples 2 | 3 | irobx : 3-species Robertson kinetics system 4 | iheatsb : 2-D heat equation, banded Jacobian 5 | iheatsk : 2-D heat equation, diagonal preconditioner 6 | iwebsb : 2-D food web system, banded Jacobian 7 | 8 | Sample results: 9 | 10 | SUNDIALS was built with the following options: 11 | 12 | ./configure CC=gcc F77=g77 13 | 14 | System Architecture: IA-32 15 | Processor Type: Intel Pentium 4 Xeon DP (i686) 16 | Operating System: Red Hat Enterprise Linux WS 3 17 | C/Fortran Compilers: gcc/g77 v3.2.3-39 (Red Hat) 18 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/ida/examples_ser/iheatsb.out: -------------------------------------------------------------------------------- 1 | iheatsb: Heat equation, serial example problem for IDA 2 | Discretized heat equation on 2D unit square. 3 | Zero boundary conditions, polynomial initial conditions. 4 | Mesh dimensions: 10 x 10 Total system size: 100 5 | 6 | Tolerance parameters: rtol = 0 atol = 0.001 7 | Constraints set to force all solution components >= 0. 8 | Linear solver: IDABAND, banded direct solver 9 | difference quotient Jacobian, half-bandwidths = 10 10 | IDACalcIC called with input boundary values = 0.1 11 | 12 | Output Summary (umax = max-norm of solution) 13 | 14 | time umax k nst nni nje nre nreB h 15 | . . . . . . . . . . . . . . . . . . . . . 16 | 0.00 9.75461e-01 0 0 3 2 5 42 1.00e-05 17 | 0.01 8.24602e-01 2 13 20 9 22 189 2.56e-03 18 | 0.02 6.88908e-01 2 15 23 10 25 210 5.12e-03 19 | 0.04 4.71178e-01 3 19 28 10 30 210 5.12e-03 20 | 0.08 2.16305e-01 3 23 33 10 35 210 1.02e-02 21 | 0.16 4.53754e-02 4 29 41 11 43 231 2.05e-02 22 | 0.32 1.78933e-03 4 36 50 12 52 252 4.10e-02 23 | 0.64 1.27055e-20 1 41 59 14 61 294 1.64e-01 24 | 1.28 2.59193e-33 1 43 61 16 63 336 6.55e-01 25 | 2.56 8.36114e-36 1 44 62 17 64 357 1.31e+00 26 | 5.12 1.50863e-37 1 45 63 18 65 378 2.62e+00 27 | 10.24 1.77347e-39 1 46 64 19 66 399 5.24e+00 28 | 29 | netf = 0, ncfn = 0 30 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/ida/examples_ser/irobx.out: -------------------------------------------------------------------------------- 1 | 2 | irobx: Robertson kinetics DAE serial example problem for IDA 3 | Three equation chemical kinetics problem. 4 | 5 | Linear solver: IDADENSE, with user-supplied Jacobian. 6 | Tolerance parameters: rtol = 0.0001 atol = 1e-06 1e-10 1e-06 7 | Initial conditions y0 = (1 0 0) 8 | Constraints and id not used. 9 | 10 | --------------------------------------------------------------------- 11 | t y1 y2 y3 | nst k h 12 | --------------------------------------------------------------------- 13 | 4.00e-01 9.8517e-01 3.3864e-05 1.4795e-02 | 77 3 1.1431e-01 14 | 4.00e+00 9.0551e-01 2.2403e-05 9.4470e-02 | 91 4 3.7037e-01 15 | 4.00e+01 7.1582e-01 9.1854e-06 2.8417e-01 | 127 4 2.9630e+00 16 | 4.00e+02 4.5051e-01 3.2227e-06 5.4949e-01 | 177 3 1.2405e+01 17 | 4.00e+03 1.8316e-01 8.9396e-07 8.1684e-01 | 228 3 2.7646e+02 18 | 4.00e+04 3.8985e-02 1.6218e-07 9.6101e-01 | 278 5 2.6140e+03 19 | 4.00e+05 4.9388e-03 1.9852e-08 9.9506e-01 | 324 5 2.7701e+04 20 | 4.00e+06 5.1763e-04 2.0716e-09 9.9948e-01 | 355 4 3.9788e+05 21 | 4.00e+07 5.1907e-05 2.0764e-10 9.9995e-01 | 380 3 6.3661e+06 22 | 4.00e+08 5.8818e-06 2.3527e-11 9.9999e-01 | 394 1 9.1671e+07 23 | 4.00e+09 7.0539e-07 2.8216e-12 1.0000e-00 | 402 1 1.4667e+09 24 | 4.00e+10 -7.3001e-07 -2.9200e-12 1.0000e+00 | 407 1 2.3468e+10 25 | 26 | Final Run Statistics: 27 | 28 | Number of steps = 407 29 | Number of residual evaluations = 557 30 | Number of Jacobian evaluations = 65 31 | Number of nonlinear iterations = 557 32 | Number of error test failures = 6 33 | Number of nonlinear conv. failures = 0 34 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/ida/examples_ser/iwebsb.out: -------------------------------------------------------------------------------- 1 | 2 | iwebsb: Predator-prey DAE serial example problem for IDA 3 | 4 | Number of species ns: 2 Mesh dimensions: 20 x 20 System size: 800 5 | Tolerance parameters: rtol = 1e-05 atol = 1e-05 6 | Linear solver: IDABAND, Band parameters mu = 40, ml = 40 7 | CalcIC called to correct initial predator concentrations. 8 | 9 | ----------------------------------------------------------- 10 | t bottom-left top-right | nst k h 11 | ----------------------------------------------------------- 12 | 13 | 0.00e+00 1.0000e+01 9.9949e+04 | 0 0 1.6310e-08 14 | 9.9999e+04 9.9949e+04 | 15 | 16 | 1.00e-03 1.0318e+01 1.0822e+05 | 32 4 1.0823e-04 17 | 1.0319e+05 1.0822e+05 | 18 | 19 | 1.00e-02 1.6189e+02 1.9735e+06 | 135 4 1.7964e-04 20 | 1.6189e+06 1.9735e+06 | 21 | 22 | 1.00e-01 2.4019e+02 2.7072e+06 | 231 1 4.4212e-02 23 | 2.4019e+06 2.7072e+06 | 24 | 25 | 4.00e-01 2.4019e+02 2.7072e+06 | 233 1 1.7685e-01 26 | 2.4019e+06 2.7072e+06 | 27 | 28 | 7.00e-01 2.4019e+02 2.7072e+06 | 234 1 3.5370e-01 29 | 2.4019e+06 2.7072e+06 | 30 | 31 | 1.00e+00 2.4019e+02 2.7072e+06 | 235 1 7.0740e-01 32 | 2.4019e+06 2.7072e+06 | 33 | 34 | ----------------------------------------------------------- 35 | Final run statistics: 36 | 37 | Number of steps = 235 38 | Number of residual evaluations = 3319 39 | Number of Jacobian evaluations = 36 40 | Number of nonlinear iterations = 401 41 | Number of error test failures = 5 42 | Number of nonlinear conv. failures = 0 43 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/nvec_ser/fnvector_serial.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.1 $ 4 | * $Date: 2005/10/27 13:45:31 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer(s): Radu Serban @ LLNL 7 | * ----------------------------------------------------------------- 8 | * Copyright (c) 2002, The Regents of the University of California. 9 | * Produced at the Lawrence Livermore National Laboratory. 10 | * All rights reserved. 11 | * For details, see sundials/shared/LICENSE. 12 | * ----------------------------------------------------------------- 13 | * This file (companion of nvector_serial.h) contains the 14 | * implementation needed for the Fortran initialization of serial 15 | * vector operations. 16 | * ----------------------------------------------------------------- 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #include "fnvector_serial.h" 23 | #include "nvector_serial.h" 24 | #include "sundialstypes.h" 25 | 26 | /* Define global variable F2C_vec */ 27 | N_Vector F2C_vec; 28 | 29 | /* Fortran callable interfaces */ 30 | 31 | void FNV_INITS(long int *neq, int *ier) 32 | { 33 | F2C_vec = N_VNew_Serial(*neq); 34 | 35 | *ier = (F2C_vec == NULL) ? -1 : 0 ; 36 | } 37 | 38 | void FNV_FREES(void) 39 | { 40 | N_VDestroy_Serial(F2C_vec); 41 | } 42 | 43 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/nvec_ser/fnvector_serial.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.1 $ 4 | * $Date: 2005/10/27 13:45:31 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer(s): Radu Serban and Aaron Collier @ LLNL 7 | * ----------------------------------------------------------------- 8 | * Copyright (c) 2002, The Regents of the University of California. 9 | * Produced at the Lawrence Livermore National Laboratory. 10 | * All rights reserved. 11 | * For details, see sundials/shared/LICENSE. 12 | * ----------------------------------------------------------------- 13 | * This file (companion of nvector_serial.h) contains the 14 | * definitions needed for the initialization of serial 15 | * vector operations in Fortran. 16 | * ----------------------------------------------------------------- 17 | */ 18 | 19 | #ifndef _FNVECTOR_SERIAL_H 20 | #define _FNVECTOR_SERIAL_H 21 | 22 | #ifdef __cplusplus /* wrapper to enable C++ usage */ 23 | extern "C" { 24 | #endif 25 | 26 | #ifndef _SUNDIALS_CONFIG_H 27 | #define _SUNDIALS_CONFIG_H 28 | #include "sundials_config.h" 29 | #endif 30 | 31 | #if defined(F77_FUNC) 32 | 33 | #define FNV_INITS F77_FUNC(fnvinits, FNVINITS) 34 | #define FNV_FREES F77_FUNC(fnvfrees, FNVFREES) 35 | 36 | #elif defined(SUNDIALS_UNDERSCORE_NONE) && defined(SUNDIALS_CASE_LOWER) 37 | 38 | #define FNV_INITS fnvinits 39 | #define FNV_FREES fnvfrees 40 | 41 | #elif defined(SUNDIALS_UNDERSCORE_NONE) && defined(SUNDIALS_CASE_UPPER) 42 | 43 | #define FNV_INITS FNVINITS 44 | #define FNV_FREES FNVFREES 45 | 46 | #elif defined(SUNDIALS_UNDERSCORE_ONE) && defined(SUNDIALS_CASE_LOWER) 47 | 48 | #define FNV_INITS fnvinits_ 49 | #define FNV_FREES fnvfrees_ 50 | 51 | #elif defined(SUNDIALS_UNDERSCORE_ONE) && defined(SUNDIALS_CASE_UPPER) 52 | 53 | #define FNV_INITS FNVINITS_ 54 | #define FNV_FREES FNVFREES_ 55 | 56 | #elif defined(SUNDIALS_UNDERSCORE_TWO) && defined(SUNDIALS_CASE_LOWER) 57 | 58 | #define FNV_INITS fnvinits__ 59 | #define FNV_FREES fnvfrees__ 60 | 61 | #elif defined(SUNDIALS_UNDERSCORE_TWO) && defined(SUNDIALS_CASE_UPPER) 62 | 63 | #define FNV_INITS FNVINITS__ 64 | #define FNV_FREES FNVFREES__ 65 | 66 | #endif 67 | 68 | /* Prototypes of exported funcions */ 69 | 70 | void FNV_INITS(long int *neq, int *ier); 71 | void FNV_FREES(void); 72 | 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/shared/source/dense.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.1 $ 4 | * $Date: 2005/10/27 13:48:52 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer(s): Scott D. Cohen, Alan C. Hindmarsh and 7 | * Radu Serban @ LLNL 8 | * ----------------------------------------------------------------- 9 | * Copyright (c) 2002, The Regents of the University of California. 10 | * Produced at the Lawrence Livermore National Laboratory. 11 | * All rights reserved. 12 | * For details, see sundials/shared/LICENSE. 13 | * ----------------------------------------------------------------- 14 | * This is the implementation file for a generic DENSE linear 15 | * solver package. 16 | * ----------------------------------------------------------------- 17 | */ 18 | 19 | #include 20 | #include 21 | 22 | #include "dense.h" 23 | #include "smalldense.h" 24 | #include "sundialsmath.h" 25 | #include "sundialstypes.h" 26 | 27 | #define ZERO RCONST(0.0) 28 | #define ONE RCONST(1.0) 29 | 30 | /* Implementation */ 31 | 32 | DenseMat DenseAllocMat(long int N) 33 | { 34 | DenseMat A; 35 | 36 | if (N <= 0) return(NULL); 37 | 38 | A = (DenseMat) malloc(sizeof *A); 39 | if (A==NULL) return (NULL); 40 | 41 | A->data = denalloc(N); 42 | if (A->data == NULL) { 43 | free(A); 44 | return(NULL); 45 | } 46 | 47 | A->size = N; 48 | 49 | return(A); 50 | } 51 | 52 | long int *DenseAllocPiv(long int N) 53 | { 54 | if (N <= 0) return(NULL); 55 | 56 | return((long int *) malloc(N * sizeof(long int))); 57 | } 58 | 59 | long int DenseFactor(DenseMat A, long int *p) 60 | { 61 | return(gefa(A->data, A->size, p)); 62 | } 63 | 64 | void DenseBacksolve(DenseMat A, long int *p, realtype *b) 65 | { 66 | gesl(A->data, A->size, p, b); 67 | } 68 | 69 | void DenseZero(DenseMat A) 70 | { 71 | denzero(A->data, A->size); 72 | } 73 | 74 | void DenseCopy(DenseMat A, DenseMat B) 75 | { 76 | dencopy(A->data, B->data, A->size); 77 | } 78 | 79 | void DenseScale(realtype c, DenseMat A) 80 | { 81 | denscale(c, A->data, A->size); 82 | } 83 | 84 | void DenseAddI(DenseMat A) 85 | { 86 | denaddI(A->data, A->size); 87 | } 88 | 89 | void DenseFreeMat(DenseMat A) 90 | { 91 | denfree(A->data); 92 | free(A); 93 | } 94 | 95 | void DenseFreePiv(long int *p) 96 | { 97 | free(p); 98 | } 99 | 100 | void DensePrint(DenseMat A) 101 | { 102 | denprint(A->data, A->size); 103 | } 104 | -------------------------------------------------------------------------------- /Win32/WinCVODE/sundials/shared/source/sundialsmath.c: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.1 $ 4 | * $Date: 2005/10/27 13:48:52 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer(s): Scott D. Cohen, Alan C. Hindmarsh and 7 | * Aaron Collier @ LLNL 8 | * ----------------------------------------------------------------- 9 | * Copyright (c) 2002, The Regents of the University of California. 10 | * Produced at the Lawrence Livermore National Laboratory. 11 | * All rights reserved. 12 | * For details, see sundials/shared/LICENSE. 13 | * ----------------------------------------------------------------- 14 | * This is the implementation file for a simple C-language math 15 | * library. 16 | * ----------------------------------------------------------------- 17 | */ 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | #include "sundialsmath.h" 24 | #include "sundialstypes.h" 25 | 26 | #define ZERO RCONST(0.0) 27 | #define ONE RCONST(1.0) 28 | #define TWO RCONST(2.0) 29 | 30 | realtype RPowerI(realtype base, int exponent) 31 | { 32 | int i, expt; 33 | realtype prod; 34 | 35 | prod = ONE; 36 | expt = abs(exponent); 37 | for(i = 1; i <= expt; i++) prod *= base; 38 | if (exponent < 0) prod = ONE/prod; 39 | return(prod); 40 | } 41 | 42 | realtype RPowerR(realtype base, realtype exponent) 43 | { 44 | if (base <= ZERO) return(ZERO); 45 | 46 | #if defined(SUNDIALS_USE_GENERIC_MATH) 47 | return((realtype) pow((double) base, (double) exponent)); 48 | #elif defined(SUNDIALS_SINGLE_PRECISION) 49 | return(powf(base, exponent)); 50 | #elif defined(SUNDIALS_EXTENDED_PRECISION) 51 | return(powl(base, exponent)); 52 | #endif 53 | } 54 | 55 | realtype RSqrt(realtype x) 56 | { 57 | if (x <= ZERO) return(ZERO); 58 | 59 | #if defined(SUNDIALS_USE_GENERIC_MATH) 60 | return((realtype) sqrt((double) x)); 61 | #elif defined(SUNDIALS_SINGLE_PRECISION) 62 | return(sqrtf(x)); 63 | #elif defined(SUNDIALS_EXTENDED_PRECISION) 64 | return(sqrtl(x)); 65 | #endif 66 | } 67 | 68 | realtype RAbs(realtype x) 69 | { 70 | #if defined(SUNDIALS_USE_GENERIC_MATH) 71 | return((realtype) fabs((double) x)); 72 | #elif defined(SUNDIALS_SINGLE_PRECISION) 73 | return(fabsf(x)); 74 | #elif defined(SUNDIALS_EXTENDED_PRECISION) 75 | return(fabsl(x)); 76 | #endif 77 | } 78 | 79 | realtype RPower2(realtype x) 80 | { 81 | #if defined(SUNDIALS_USE_GENERIC_MATH) 82 | return((realtype) pow((double) x, 2.0)); 83 | #elif defined(SUNDIALS_SINGLE_PRECISION) 84 | return(powf(x, TWO)); 85 | #elif defined(SUNDIALS_EXTENDED_PRECISION) 86 | return(powl(x, TWO)); 87 | #endif 88 | } 89 | -------------------------------------------------------------------------------- /Win32/bin/.cvsignore: -------------------------------------------------------------------------------- 1 | *.* 2 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/_mingw.h: -------------------------------------------------------------------------------- 1 | /* 2 | * _mingw.h 3 | * 4 | * This file is for TCC-PE and not part of the Mingw32 package. 5 | * 6 | * THIS SOFTWARE IS NOT COPYRIGHTED 7 | * 8 | * This source code is offered for use in the public domain. You may 9 | * use, modify or distribute it freely. 10 | * 11 | * This code is distributed in the hope that it will be useful but 12 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 13 | * DISCLAIMED. This includes but is not limited to warranties of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 15 | * 16 | */ 17 | 18 | #ifndef __MINGW_H 19 | #define __MINGW_H 20 | 21 | #define __int64 long long 22 | #define __int32 long 23 | #define __int16 short 24 | #define __int8 char 25 | #define __cdecl __attribute__((__cdecl__)) 26 | #define __stdcall __attribute__((__stdcall__)) 27 | #define __declspec(x) __attribute__((x)) 28 | 29 | #define __MINGW32_VERSION 2.0 30 | #define __MINGW32_MAJOR_VERSION 2 31 | #define __MINGW32_MINOR_VERSION 0 32 | 33 | #define __MSVCRT__ 34 | #define __MINGW_IMPORT extern 35 | #define _CRTIMP 36 | #define __CRT_INLINE extern __inline__ 37 | 38 | #define _WIN32 39 | #define WIN32 40 | 41 | #ifndef _WINT_T 42 | #define _WINT_T 43 | typedef unsigned int wint_t; 44 | #endif 45 | 46 | /* for winapi */ 47 | #define NONAMELESSUNION 48 | #define DECLSPEC_NORETURN 49 | #define WIN32_LEAN_AND_MEAN 50 | 51 | #endif /* __MINGW_H */ 52 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | * assert.h 3 | * 4 | * Define the assert macro for debug output. 5 | * 6 | * This file is part of the Mingw32 package. 7 | * 8 | * Contributors: 9 | * Created by Colin Peters 10 | * 11 | * THIS SOFTWARE IS NOT COPYRIGHTED 12 | * 13 | * This source code is offered for use in the public domain. You may 14 | * use, modify or distribute it freely. 15 | * 16 | * This code is distributed in the hope that it will be useful but 17 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 18 | * DISCLAIMED. This includes but is not limited to warranties of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 20 | * 21 | * $Revision: 1.1 $ 22 | * $Author: afinney $ 23 | * $Date: 2006/03/09 17:23:48 $ 24 | * 25 | */ 26 | 27 | #ifndef _ASSERT_H_ 28 | #define _ASSERT_H_ 29 | 30 | /* All the headers include this file. */ 31 | #include <_mingw.h> 32 | 33 | #ifndef RC_INVOKED 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | #ifdef NDEBUG 40 | 41 | /* 42 | * If not debugging, assert does nothing. 43 | */ 44 | #define assert(x) ((void)0) 45 | 46 | #else /* debugging enabled */ 47 | 48 | /* 49 | * CRTDLL nicely supplies a function which does the actual output and 50 | * call to abort. 51 | */ 52 | void _assert (const char*, const char*, int) 53 | #ifdef __GNUC__ 54 | __attribute__ ((noreturn)) 55 | #endif 56 | ; 57 | 58 | /* 59 | * Definition of the assert macro. 60 | */ 61 | #define assert(e) ((e) ? (void)0 : _assert(#e, __FILE__, __LINE__)) 62 | #endif /* NDEBUG */ 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif /* Not RC_INVOKED */ 69 | 70 | #endif /* Not _ASSERT_H_ */ 71 | 72 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/dir.h: -------------------------------------------------------------------------------- 1 | /* 2 | * dir.h 3 | * 4 | * This file OBSOLESCENT and only provided for backward compatibility. 5 | * Please use io.h instead. 6 | * 7 | * This file is part of the Mingw32 package. 8 | * 9 | * Contributors: 10 | * Created by Colin Peters 11 | * Mumit Khan 12 | * 13 | * THIS SOFTWARE IS NOT COPYRIGHTED 14 | * 15 | * This source code is offered for use in the public domain. You may 16 | * use, modify or distribute it freely. 17 | * 18 | * This code is distributed in the hope that it will be useful but 19 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 20 | * DISCLAIMED. This includes but is not limited to warranties of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 22 | * 23 | */ 24 | 25 | #include 26 | 27 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/direct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * direct.h 3 | * 4 | * Functions for manipulating paths and directories (included from io.h) 5 | * plus functions for setting the current drive. 6 | * 7 | * This file is part of the Mingw32 package. 8 | * 9 | * Contributors: 10 | * Created by Colin Peters 11 | * 12 | * THIS SOFTWARE IS NOT COPYRIGHTED 13 | * 14 | * This source code is offered for use in the public domain. You may 15 | * use, modify or distribute it freely. 16 | * 17 | * This code is distributed in the hope that it will be useful but 18 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 19 | * DISCLAIMED. This includes but is not limited to warranties of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 21 | * 22 | * $Revision: 1.1 $ 23 | * $Author: afinney $ 24 | * $Date: 2006/03/09 17:23:48 $ 25 | * 26 | */ 27 | 28 | #ifndef __STRICT_ANSI__ 29 | 30 | #ifndef _DIRECT_H_ 31 | #define _DIRECT_H_ 32 | 33 | /* All the headers include this file. */ 34 | #include <_mingw.h> 35 | 36 | #define __need_wchar_t 37 | #ifndef RC_INVOKED 38 | #include 39 | #endif /* Not RC_INVOKED */ 40 | 41 | #include 42 | 43 | #ifndef RC_INVOKED 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | #ifndef _DISKFREE_T_DEFINED 50 | /* needed by _getdiskfree (also in dos.h) */ 51 | struct _diskfree_t { 52 | unsigned total_clusters; 53 | unsigned avail_clusters; 54 | unsigned sectors_per_cluster; 55 | unsigned bytes_per_sector; 56 | }; 57 | #define _DISKFREE_T_DEFINED 58 | #endif 59 | 60 | /* 61 | * You really shouldn't be using these. Use the Win32 API functions instead. 62 | * However, it does make it easier to port older code. 63 | */ 64 | int _getdrive (void); 65 | unsigned long _getdrives(void); 66 | int _chdrive (int); 67 | char* _getdcwd (int, char*, int); 68 | unsigned _getdiskfree (unsigned, struct _diskfree_t *); 69 | 70 | #ifndef _NO_OLDNAMES 71 | # define diskfree_t _diskfree_t 72 | #endif 73 | 74 | #ifndef _WDIRECT_DEFINED 75 | /* wide character versions. Also in wchar.h */ 76 | #ifdef __MSVCRT__ 77 | int _wchdir(const wchar_t*); 78 | wchar_t* _wgetcwd(wchar_t*, int); 79 | wchar_t* _wgetdcwd(int, wchar_t*, int); 80 | int _wmkdir(const wchar_t*); 81 | int _wrmdir(const wchar_t*); 82 | #endif /* __MSVCRT__ */ 83 | #define _WDIRECT_DEFINED 84 | #endif 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #endif /* Not RC_INVOKED */ 91 | 92 | #endif /* Not _DIRECT_H_ */ 93 | 94 | #endif /* Not __STRICT_ANSI__ */ 95 | 96 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/excpt.h: -------------------------------------------------------------------------------- 1 | #ifndef _EXCPT_H 2 | #define _EXCPT_H 3 | #if __GNUC__ >=3 4 | #pragma GCC system_header 5 | #endif 6 | 7 | /* FIXME: This will make some code compile. The programs will most 8 | likely crash when an exception is raised, but at least they will 9 | compile. */ 10 | #ifdef __GNUC__ 11 | #define __try 12 | #define __except(x) if (0) /* don't execute handler */ 13 | #define __finally 14 | 15 | #define _try __try 16 | #define _except __except 17 | #define _finally __finally 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/fenv.h: -------------------------------------------------------------------------------- 1 | #ifndef _FENV_H 2 | #define _FENV_H 3 | 4 | /* 5 | For now, support only for the basic abstraction of flags that are 6 | either set or clear. fexcept_t could be structure that holds more info 7 | about the fp environment. 8 | */ 9 | typedef unsigned short fexcept_t; 10 | 11 | /* This 28-byte struct represents the entire floating point 12 | environment as stored by fnstenv or fstenv */ 13 | typedef struct 14 | { 15 | unsigned short __control_word; 16 | unsigned short __unused0; 17 | unsigned short __status_word; 18 | unsigned short __unused1; 19 | unsigned short __tag_word; 20 | unsigned short __unused2; 21 | unsigned int __ip_offset; /* instruction pointer offset */ 22 | unsigned short __ip_selector; 23 | unsigned short __opcode; 24 | unsigned int __data_offset; 25 | unsigned short __data_selector; 26 | unsigned short __unused3; 27 | } fenv_t; 28 | 29 | 30 | /* FPU status word exception flags */ 31 | #define FE_INVALID 0x01 32 | #define FE_DENORMAL 0x02 33 | #define FE_DIVBYZERO 0x04 34 | #define FE_OVERFLOW 0x08 35 | #define FE_UNDERFLOW 0x10 36 | #define FE_INEXACT 0x20 37 | #define FE_ALL_EXCEPT (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO \ 38 | | FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT) 39 | 40 | /* FPU control word rounding flags */ 41 | #define FE_TONEAREST 0x0000 42 | #define FE_DOWNWARD 0x0400 43 | #define FE_UPWARD 0x0800 44 | #define FE_TOWARDZERO 0x0c00 45 | 46 | 47 | /* The default floating point environment */ 48 | #define FE_DFL_ENV ((const fenv_t *)-1) 49 | 50 | 51 | #ifndef RC_INVOKED 52 | #ifdef __cplusplus 53 | extern "C" { 54 | #endif 55 | 56 | 57 | /*TODO: Some of these could be inlined */ 58 | /* 7.6.2 Exception */ 59 | 60 | extern int feclearexcept (int); 61 | extern int fegetexceptflag (fexcept_t * flagp, int excepts); 62 | extern int feraiseexcept (int excepts ); 63 | extern int fesetexceptflag (const fexcept_t *, int); 64 | extern int fetestexcept (int excepts); 65 | 66 | 67 | /* 7.6.3 Rounding */ 68 | 69 | extern int fegetround (void); 70 | extern int fesetround (int mode); 71 | 72 | 73 | /* 7.6.4 Environment */ 74 | 75 | extern int fegetenv (fenv_t * envp); 76 | extern int fesetenv (const fenv_t * ); 77 | extern int feupdateenv (const fenv_t *); 78 | extern int feholdexcept (fenv_t *); 79 | 80 | #ifdef __cplusplus 81 | } 82 | #endif 83 | #endif /* Not RC_INVOKED */ 84 | 85 | #endif /* ndef _FENV_H */ 86 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/malloc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * malloc.h 3 | * 4 | * Support for programs which want to use malloc.h to get memory management 5 | * functions. Unless you absolutely need some of these functions and they are 6 | * not in the ANSI headers you should use the ANSI standard header files 7 | * instead. 8 | * 9 | * This file is part of the Mingw32 package. 10 | * 11 | * Contributors: 12 | * Created by Colin Peters 13 | * 14 | * THIS SOFTWARE IS NOT COPYRIGHTED 15 | * 16 | * This source code is offered for use in the public domain. You may 17 | * use, modify or distribute it freely. 18 | * 19 | * This code is distributed in the hope that it will be useful but 20 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 21 | * DISCLAIMED. This includes but is not limited to warranties of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 23 | * 24 | * $Revision: 1.1 $ 25 | * $Author: afinney $ 26 | * $Date: 2006/03/09 17:23:48 $ 27 | * 28 | */ 29 | 30 | #ifndef __STRICT_ANSI__ 31 | 32 | #ifndef _MALLOC_H_ 33 | #define _MALLOC_H_ 34 | 35 | /* All the headers include this file. */ 36 | #include <_mingw.h> 37 | 38 | #include 39 | 40 | #ifndef RC_INVOKED 41 | 42 | /* 43 | * The structure used to walk through the heap with _heapwalk. 44 | */ 45 | typedef struct _heapinfo 46 | { 47 | int* _pentry; 48 | size_t _size; 49 | int _useflag; 50 | } _HEAPINFO; 51 | 52 | /* Values for _heapinfo.useflag */ 53 | #define _USEDENTRY 0 54 | #define _FREEENTRY 1 55 | 56 | #ifdef __cplusplus 57 | extern "C" { 58 | #endif 59 | /* 60 | The _heap* memory allocation functions are supported on NT 61 | but not W9x. On latter, they always set errno to ENOSYS. 62 | */ 63 | int _heapwalk (_HEAPINFO*); 64 | 65 | #ifndef _NO_OLDNAMES 66 | int heapwalk (_HEAPINFO*); 67 | #endif /* Not _NO_OLDNAMES */ 68 | 69 | int _heapchk (void); /* Verify heap integrety. */ 70 | int _heapmin (void); /* Return unused heap to the OS. */ 71 | int _heapset (unsigned int); 72 | 73 | size_t _msize (void*); 74 | size_t _get_sbh_threshold (void); 75 | int _set_sbh_threshold (size_t); 76 | void * _expand (void*, size_t); 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif /* RC_INVOKED */ 83 | 84 | #endif /* Not _MALLOC_H_ */ 85 | 86 | #endif /* Not __STRICT_ANSI__ */ 87 | 88 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/mem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Mingw32 package. 3 | * 4 | * mem.h maps to string.h 5 | */ 6 | #ifndef __STRICT_ANSI__ 7 | #include 8 | #endif 9 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Mingw32 package. 3 | * 4 | * memory.h maps to the standard string.h header. 5 | */ 6 | #ifndef __STRICT_ANSI__ 7 | #include 8 | #endif 9 | 10 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/sbml/SBMLTypes.h: -------------------------------------------------------------------------------- 1 | /** this is special placeholder header for the tcc compilation of functions for 2 | dynamic compilation by tcc within SOSlib only */ 3 | 4 | #ifndef SBMLTypes_h 5 | #define SBMLTypes_h 6 | 7 | typedef struct SBMLDocument SBMLDocument_t; 8 | typedef struct Model Model_t; 9 | typedef struct ASTNode ASTNode_t ; 10 | typedef struct List List_t ; 11 | 12 | #endif /* SBMLTypes_h */ 13 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/sbmlsolver/fnvector_serial.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.3 $ 4 | * $Date: 2006/04/11 13:10:45 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer(s): Radu Serban and Aaron Collier @ LLNL 7 | * ----------------------------------------------------------------- 8 | * Copyright (c) 2002, The Regents of the University of California. 9 | * Produced at the Lawrence Livermore National Laboratory. 10 | * All rights reserved. 11 | * For details, see sundials/shared/LICENSE. 12 | * ----------------------------------------------------------------- 13 | * This file (companion of nvector_serial.h) contains the 14 | * definitions needed for the initialization of serial 15 | * vector operations in Fortran. 16 | * ----------------------------------------------------------------- 17 | */ 18 | 19 | #ifndef _FNVECTOR_SERIAL_H 20 | #define _FNVECTOR_SERIAL_H 21 | 22 | #ifdef __cplusplus /* wrapper to enable C++ usage */ 23 | extern "C" { 24 | #endif 25 | 26 | #ifndef _SUNDIALS_CONFIG_H 27 | #define _SUNDIALS_CONFIG_H 28 | #include "sundials_config.h" 29 | #endif 30 | 31 | #if defined(F77_FUNC) 32 | 33 | #define FNV_INITS F77_FUNC(fnvinits, FNVINITS) 34 | #define FNV_FREES F77_FUNC(fnvfrees, FNVFREES) 35 | 36 | #elif defined(SUNDIALS_UNDERSCORE_NONE) && defined(SUNDIALS_CASE_LOWER) 37 | 38 | #define FNV_INITS fnvinits 39 | #define FNV_FREES fnvfrees 40 | 41 | #elif defined(SUNDIALS_UNDERSCORE_NONE) && defined(SUNDIALS_CASE_UPPER) 42 | 43 | #define FNV_INITS FNVINITS 44 | #define FNV_FREES FNVFREES 45 | 46 | #elif defined(SUNDIALS_UNDERSCORE_ONE) && defined(SUNDIALS_CASE_LOWER) 47 | 48 | #define FNV_INITS fnvinits_ 49 | #define FNV_FREES fnvfrees_ 50 | 51 | #elif defined(SUNDIALS_UNDERSCORE_ONE) && defined(SUNDIALS_CASE_UPPER) 52 | 53 | #define FNV_INITS FNVINITS_ 54 | #define FNV_FREES FNVFREES_ 55 | 56 | #elif defined(SUNDIALS_UNDERSCORE_TWO) && defined(SUNDIALS_CASE_LOWER) 57 | 58 | #define FNV_INITS fnvinits__ 59 | #define FNV_FREES fnvfrees__ 60 | 61 | #elif defined(SUNDIALS_UNDERSCORE_TWO) && defined(SUNDIALS_CASE_UPPER) 62 | 63 | #define FNV_INITS FNVINITS__ 64 | #define FNV_FREES FNVFREES__ 65 | 66 | #endif 67 | 68 | /* Prototypes of exported funcions */ 69 | 70 | void FNV_INITS(long int *neq, int *ier); 71 | void FNV_FREES(void); 72 | 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/sbmlsolver/sundials_config.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ----------------------------------------------------------------- 3 | * $Revision: 1.3 $ 4 | * $Date: 2006/04/11 13:10:45 $ 5 | * ----------------------------------------------------------------- 6 | * Programmer(s): Aaron Collier @ LLNL 7 | * ----------------------------------------------------------------- 8 | * Copyright (c) 2005, The Regents of the University of California. 9 | * Produced at the Lawrence Livermore National Laboratory. 10 | * All rights reserved. 11 | * For details, see sundials/shared/LICENSE. 12 | *------------------------------------------------------------------ 13 | * SUNDIALS configuration header file 14 | *------------------------------------------------------------------ 15 | */ 16 | 17 | /* Define SUNDIALS version number */ 18 | #define SUNDIALS_PACKAGE_VERSION "2.1.1" 19 | 20 | /* FCMIX: Define Fortran name-mangling macro */ 21 | 22 | 23 | /* FCMIX: Define case of function names */ 24 | 25 | 26 | /* FCMIX: Define number of underscores to append to function names */ 27 | 28 | 29 | /* Define precision of SUNDIALS data type 'realtype' */ 30 | #define SUNDIALS_DOUBLE_PRECISION 1 31 | 32 | /* Use generic math functions */ 33 | #define SUNDIALS_USE_GENERIC_MATH 1 34 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/setjmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * setjmp.h 3 | * 4 | * Declarations supporting setjmp and longjump, a method for avoiding 5 | * the normal function call return sequence. (Bleah!) 6 | * 7 | * This file is part of the Mingw32 package. 8 | * 9 | * Contributors: 10 | * Created by Colin Peters 11 | * 12 | * THIS SOFTWARE IS NOT COPYRIGHTED 13 | * 14 | * This source code is offered for use in the public domain. You may 15 | * use, modify or distribute it freely. 16 | * 17 | * This code is distributed in the hope that it will be useful but 18 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 19 | * DISCLAIMED. This includes but is not limited to warranties of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 21 | * 22 | * $Revision: 1.1 $ 23 | * $Author: afinney $ 24 | * $Date: 2006/03/09 17:23:48 $ 25 | * 26 | */ 27 | 28 | #ifndef _SETJMP_H_ 29 | #define _SETJMP_H_ 30 | 31 | /* All the headers include this file. */ 32 | #include <_mingw.h> 33 | 34 | #ifndef RC_INVOKED 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /* 41 | * The buffer used by setjmp to store the information used by longjmp 42 | * to perform it's evil goto-like work. The size of this buffer was 43 | * determined through experimentation; it's contents are a mystery. 44 | * NOTE: This was determined on an i386 (actually a Pentium). The 45 | * contents could be different on an Alpha or something else. 46 | */ 47 | #define _JBLEN 16 48 | #define _JBTYPE int 49 | typedef _JBTYPE jmp_buf[_JBLEN]; 50 | 51 | /* 52 | * The function provided by CRTDLL which appears to do the actual work 53 | * of setjmp. 54 | */ 55 | int _setjmp (jmp_buf); 56 | 57 | #define setjmp(x) _setjmp(x) 58 | 59 | /* 60 | * Return to the last setjmp call and act as if setjmp had returned 61 | * nVal (which had better be non-zero!). 62 | */ 63 | void longjmp (jmp_buf, int); 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* Not RC_INVOKED */ 70 | 71 | #endif /* Not _SETJMP_H_ */ 72 | 73 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/share.h: -------------------------------------------------------------------------------- 1 | /* 2 | * share.h 3 | * 4 | * Constants for file sharing functions. 5 | * 6 | * This file is part of the Mingw32 package. 7 | * 8 | * Contributors: 9 | * Created by Colin Peters 10 | * 11 | * THIS SOFTWARE IS NOT COPYRIGHTED 12 | * 13 | * This source code is offered for use in the public domain. You may 14 | * use, modify or distribute it freely. 15 | * 16 | * This code is distributed in the hope that it will be useful but 17 | * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY 18 | * DISCLAIMED. This includes but is not limited to warranties of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 20 | * 21 | * $Revision: 1.1 $ 22 | * $Author: afinney $ 23 | * $Date: 2006/03/09 17:23:48 $ 24 | * 25 | */ 26 | 27 | #ifndef __STRICT_ANSI__ 28 | 29 | #ifndef _SHARE_H_ 30 | #define _SHARE_H_ 31 | 32 | /* All the headers include this file. */ 33 | #include <_mingw.h> 34 | 35 | #define SH_COMPAT 0x00 /* Compatibility */ 36 | #define SH_DENYRW 0x10 /* Deny read/write */ 37 | #define SH_DENYWR 0x20 /* Deny write */ 38 | #define SH_DENYRD 0x30 /* Deny read */ 39 | #define SH_DENYNO 0x40 /* Deny nothing */ 40 | 41 | #endif /* Not _SHARE_H_ */ 42 | 43 | #endif /* Not __STRICT_ANSI__ */ 44 | 45 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/stdarg.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDARG_H 2 | #define _STDARG_H 3 | 4 | typedef char *va_list; 5 | 6 | /* only correct for i386 */ 7 | #define va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3) 8 | #define va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3))) 9 | #define va_end(ap) 10 | 11 | /* fix a buggy dependency on GCC in libio.h */ 12 | typedef va_list __gnuc_va_list; 13 | #define _VA_LIST_DEFINED 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/stdbool.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDBOOL_H 2 | #define _STDBOOL_H 3 | 4 | /* ISOC99 boolean */ 5 | 6 | #define bool _Bool 7 | #define true 1 8 | #define false 0 9 | 10 | #endif /* _STDBOOL_H */ 11 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/stddef.h: -------------------------------------------------------------------------------- 1 | #ifndef _STDDEF_H 2 | #define _STDDEF_H 3 | 4 | #define NULL ((void *)0) 5 | typedef __SIZE_TYPE__ size_t; 6 | typedef __WCHAR_TYPE__ wchar_t; 7 | typedef __PTRDIFF_TYPE__ ptrdiff_t; 8 | #define offsetof(type, field) ((size_t) &((type *)0)->field) 9 | 10 | /* need to do that because of glibc 2.1 bug (should have a way to test 11 | presence of 'long long' without __GNUC__, or TCC should define 12 | __GNUC__ ? */ 13 | #if !defined(__int8_t_defined) && !defined(__dietlibc__) 14 | #define __int8_t_defined 15 | typedef char int8_t; 16 | typedef short int int16_t; 17 | typedef int int32_t; 18 | typedef long long int int64_t; 19 | #endif 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/unistd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Mingw32 package. 3 | * 4 | * unistd.h maps (roughly) to io.h 5 | */ 6 | 7 | #ifndef __STRICT_ANSI__ 8 | #include 9 | #endif 10 | 11 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/values.h: -------------------------------------------------------------------------------- 1 | /* 2 | * TODO: Nothing here yet. Should provide UNIX compatibility constants 3 | * comparible to those in limits.h and float.h. 4 | */ 5 | -------------------------------------------------------------------------------- /Win32/bin/tcc/include/varargs.h: -------------------------------------------------------------------------------- 1 | #ifndef _VARARGS_H 2 | #define _VARARGS_H 3 | 4 | #include 5 | 6 | #define va_dcl 7 | #define va_alist __va_alist 8 | #undef va_start 9 | #define va_start(ap) ap = __builtin_varargs_start 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /Win32/bin/tcc/lib/libtcc1.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/Win32/bin/tcc/lib/libtcc1.a -------------------------------------------------------------------------------- /Win32/bin/tcc/tcc.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/Win32/bin/tcc/tcc.exe -------------------------------------------------------------------------------- /Win32/binary/MSVCRT.DLL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/Win32/binary/MSVCRT.DLL -------------------------------------------------------------------------------- /Win32/binary/libsbml.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/Win32/binary/libsbml.dll -------------------------------------------------------------------------------- /Win32/binary/msvcp71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/Win32/binary/msvcp71.dll -------------------------------------------------------------------------------- /Win32/binary/msvcr71.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/Win32/binary/msvcr71.dll -------------------------------------------------------------------------------- /Win32/binary/xerces-c_2_5_0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/Win32/binary/xerces-c_2_5_0.dll -------------------------------------------------------------------------------- /bindings/Makefile.am: -------------------------------------------------------------------------------- 1 | SUBDIRS = swig perl 2 | -------------------------------------------------------------------------------- /bindings/R/interface.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | /*extensiosn to odeSolver.h*/ 17 | 18 | /* 19 | This structure keeps the desing points for which the model is evaluated 20 | 21 | the parameters are the columns of the matrix 22 | the design points are the rows!!! hence 23 | vs->params[desingpointindex][parameterindex] 24 | */ 25 | 26 | 27 | typedef struct 28 | { 29 | int nrdesingpoints; /*defines how many design points are set*/ 30 | int nrparams; 31 | char **id; /* array of SBML ID of the species, compartment or parameter to be varied */ 32 | char **rid; /* SBML Reaction ID, if a local parameter is to be varied */ 33 | double **params; /* two dimensional array with the parmaters */ 34 | int charsize; /* maximal length of character string*/ 35 | }VarySettings2; 36 | 37 | void VarySettings2_free(VarySettings2 *vs); 38 | VarySettings2 * varySettings2_create( 39 | int nrdesingpoints 40 | ,int nrparams 41 | ,int charsize 42 | ); 43 | 44 | 45 | /*extensions to sbmlResults.h*/ 46 | /*This structure contains the results of the model evaluation*/ 47 | typedef struct{ 48 | SBMLResults_t ** resultsArray; 49 | int length; 50 | }SBMLResultsArray_t; 51 | 52 | extern SBMLResultsArray_t * Model_odeSolverDesing(SBMLDocument_t *dd 53 | , cvodeSettings_t *settings 54 | , VarySettings2 *vary 55 | ); 56 | 57 | 58 | extern SBMLResultsArray_t * SBMLResultsArray_create(int size); 59 | extern void SBMLResultsArray_free(SBMLResultsArray_t *results); 60 | 61 | 62 | extern SBMLResults_t * Model_odeSolverM( 63 | Model_t *m 64 | , cvodeSettings_t *set 65 | ); 66 | 67 | 68 | /*stuff needed for R*/ 69 | 70 | extern SEXP SEXPbeCalled(SEXP vs 71 | ,SEXP model 72 | ,SEXP time 73 | ,SEXP printstep 74 | ); 75 | 76 | extern SBMLResultsArray_t * beCalled(char *model 77 | ,double time /* time to which model is integrated */ 78 | ,double printstep /* Number of output steps from 0 to 'Time' ignored if 'Indefinitely'*/ 79 | ,VarySettings2 *vs /* structure with desing points */ 80 | ); 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /bindings/README: -------------------------------------------------------------------------------- 1 | BINDINGS CURRENTLY DO NOT WORK! 2 | HELP IS APPRECIATED! 3 | -------------------------------------------------------------------------------- /bindings/perl/LibODES.i: -------------------------------------------------------------------------------- 1 | /* 2 | Last changed Time-stamp: <2005-03-09 18:08:20 xtof> 3 | $Id: LibODES.i,v 1.1 2005/05/30 19:49:13 raimc Exp $ 4 | */ 5 | 6 | %module LibODES 7 | 8 | %include "../swig/libodes.i" 9 | -------------------------------------------------------------------------------- /bindings/perl/Makefile.PL.in: -------------------------------------------------------------------------------- 1 | # Last changed Time-stamp: <2005-05-23 17:42:02 xtof> 2 | # $Id: Makefile.PL.in,v 1.1 2005/05/30 19:49:13 raimc Exp $ 3 | use ExtUtils::MakeMaker; 4 | 5 | my @Xtralib = map{chomp; $_} ; 6 | WriteMakefile(MAKEFILE => 'Makefile-perl', 7 | NAME => 'LibODES', 8 | LIBS => [join(' ', @Xtralib)], 9 | dynamic_lib => 10 | {LDDLFLAGS=> '@SBML_RPATH@ @SBML_LDFLAGS@ @SBML_LIBS@'}, 11 | INC => '-I../swig -I../../src -I/usr/local/include @SBML_CPPFLAGS@', 12 | MYEXTLIB => '../../src/libODES.a', 13 | OBJECT => 'LibODES_wrap.o', 14 | AUTHOR => 'Christoph Flamm ', 15 | VERSION => '@PACKAGE_VERSION@', 16 | ); 17 | 18 | sub MY::postamble { 19 | return <<'MAKE_FRAG'; 20 | LibODES_wrap.c: 21 | swig -Wall -perl5 -proxy -I../../src/ @SBML_CPPFLAGS@ LibODES.i 22 | MAKE_FRAG 23 | } 24 | 25 | __DATA__ 26 | @CVODE_LDFLAGS@ @CVODE_LIBS@ 27 | @GRACE_LDFLAGS@ @GRACE_LIBS@ 28 | @GRAPHVIZ_LDFLAGS@ @GRAPHVIZ_LIBS@ 29 | @CVODE_LDFLAGS@ @CVODE_LIBS@ 30 | @SBML_LDFLAGS@ @SBML_LIBS@ 31 | -lxerces-c 32 | -lm 33 | -------------------------------------------------------------------------------- /bindings/perl/Makefile.am: -------------------------------------------------------------------------------- 1 | # Last changed Time-stamp: <2005-03-09 22:39:10 xtof> 2 | # $Id: Makefile.am,v 1.1 2005/05/30 19:49:13 raimc Exp $ 3 | SOURCES = LibODES.i Makefile.PL 4 | EXTRA_DIST = LibODES.i Makefile.PL t/*.t 5 | LibODES_wrap.c: LibODES.i 6 | $(SWIG) -Wall -perl5 -proxy -I../../src/ LibODES.i 7 | Makefile-perl: Makefile.PL 8 | $(PERL) Makefile.PL 9 | all-local: LibODES_wrap.c Makefile-perl 10 | $(MAKE) -f Makefile-perl 11 | install-exec-local: all-local 12 | $(MAKE) -f Makefile-perl install 13 | check-local: all-local 14 | $(MAKE) -f Makefile-perl test 15 | mostlyclean-local: Makefile-perl 16 | $(MAKE) -f Makefile-perl clean 17 | -------------------------------------------------------------------------------- /bindings/perl/t/01__LoadModule.t: -------------------------------------------------------------------------------- 1 | # Last changed Time-stamp: <2005-03-09 18:10:07 xtof> 2 | # $Id: 01__LoadModule.t,v 1.1 2005/05/30 19:49:13 raimc Exp $ 3 | 4 | use Test::More tests => 1; 5 | BEGIN { use_ok('LibODES') }; 6 | -------------------------------------------------------------------------------- /bindings/swig/Makefile.am: -------------------------------------------------------------------------------- 1 | SOURCES = libodes.i 2 | EXTRA_DIST = libodes.i 3 | -------------------------------------------------------------------------------- /bindings/swig/libodes.i: -------------------------------------------------------------------------------- 1 | /* 2 | Last changed Time-stamp: <2005-05-31 16:04:04 raim> 3 | $Id: libodes.i,v 1.2 2005/05/31 14:05:46 raimc Exp $ 4 | */ 5 | 6 | %module libodes 7 | 8 | %{ 9 | #include 10 | #include 11 | #include "sbmlsolver/cvodedata.h" 12 | #include "sbmlsolver/sbmlResults.h" 13 | #include "sbmlsolver/batchIntegrator.h" 14 | #include "sbmlsolver/drawGraph.h" 15 | #include "sbmlsolver/odeConstruct.h" 16 | #include "sbmlsolver/options.h" 17 | #include "sbmlsolver/sbml.h" 18 | #include "sbmlsolver/interactive.h" 19 | #include "sbmlsolver/odeIntegrate.h" 20 | #include "sbmlsolver/printModel.h" 21 | #include "sbmlsolver/util.h" 22 | #include "sbmlsolver/modelSimplify.h" 23 | #include "sbmlsolver/odeSolver.h" 24 | #include "sbmlsolver/processAST.h" 25 | %} 26 | 27 | %constant double VERSION = 1.5; 28 | 29 | %include sbmlsolver/cvodedata.h 30 | %include sbmlsolver/sbmlResults.h 31 | %include sbmlsolver/batchIntegrator.h 32 | %include sbmlsolver/drawGraph.h 33 | %include sbmlsolver/odeConstruct.h 34 | %include sbmlsolver/options.h 35 | %include sbmlsolver/sbml.h 36 | %include sbmlsolver/interactive.h 37 | %include sbmlsolver/odeIntegrate.h 38 | %include sbmlsolver/printModel.h 39 | %include sbmlsolver/util.h 40 | %include sbmlsolver/modelSimplify.h 41 | %include sbmlsolver/odeSolver.h 42 | %include sbmlsolver/processAST.h 43 | -------------------------------------------------------------------------------- /cvode_failures.txt: -------------------------------------------------------------------------------- 1 | Please, consult p. 49 ff. of the CVODE User Guide to learn about 2 | the CVode failures. 3 | Here only some short information, taken from there, and personal 4 | experiences with the SBML_odeSolver are given. 5 | 6 | 0 SUCCESS: 7 | CVode completed integration with no errors. 8 | -1 CVODE_NO_MEM: 9 | The cvode_mem argument passed to CVode was null. 10 | Should not happen in SBML_odeSolver. 11 | -2 ILL_INPUT: 12 | One of the inputs to CVode was illegal, including the 13 | situation when one of the error vectors becomes < 0 14 | during CVode's internal time stepping. The printed 15 | error message will give specific information. 16 | In SBML_odeSolver, this failure occurs when e.g. 17 | the outtime passed with --time is `0'. 18 | -3 TOO_MUCH_WORK: 19 | The solver took MXSTEP internal steps but could not 20 | reach outtime. MXSTEP is an argument of the iopt 21 | input array passed to CVode. 22 | In the SBML_odeSolver it is set to 100000, which is 23 | quite high. 24 | -4 TOO_MUCH_ACC: 25 | The solver could not satisfy the accuracy demanded by 26 | SBML_odeSolver (i.e. can currently not be set by the user) 27 | for some internal step. Has so far never occured with the 28 | SBML_odeSolver. 29 | -5 ERR_FAILURE: 30 | Error test failures occured too many times during one internal 31 | time step or occured with |h| = hmin. 32 | Has so far never occured with the SBML_odeSolver. 33 | -6 CONV_FAILURE: 34 | Convergence test failures occurred too many times 35 | (= MXMCF = 10) during one internal time step or occured with 36 | |h| = hmin. 37 | This can sometimes happen with or without use of the 38 | automatically generated Jacobian matrix. For that case 39 | the odeSolver tries to integrate again, but now without or 40 | with use of the Jacobian matrix, i.e. resetting the option 41 | '-j'. 42 | In other cases this error can be avoided if allowing a bigger 43 | error tolerance with command line option '--error'; default 44 | is 1e-18. 45 | -7 SETUP_FAILURE: 46 | The linear solver's setup routine failed in an unrecoverable 47 | manner. Has so far never occured with the SBML_odeSolver. 48 | -8 SOLVE_FAILURE: 49 | The linear solver's solve routine failed in an unrecoverable 50 | manner. Has so far never occured with the SBML_odeSolver. 51 | -------------------------------------------------------------------------------- /cvode_statistics.txt: -------------------------------------------------------------------------------- 1 | The SBML_odeSolver prints some statistics from CVode's integration 2 | procedure after a finished integration. Please consult the 3 | CVODE User Guide for more detailed information. Here is some 4 | short information on the printed statistics, as taken from p. 52 f. 5 | of the User Guide. 6 | 7 | nst cumulative number of internal steps taken by 8 | the solver. 9 | nfe number of calls to the ODE evaluation function `f' 10 | nsetups numver of calls to the linear solver's setup routine 11 | nje numver of Jacobian evalutions, i.e. either calls to the 12 | function that evaluates the automatically generated 13 | Jacobian matrix expressions or the internal approximation 14 | CVDenseDQJac. 15 | nni number of NEWTON iterations performed. 16 | ncfn number of nonlinear convergence failures that have occured. 17 | netf number of local error test failures that have occured. 18 | -------------------------------------------------------------------------------- /doc/Makefile.am: -------------------------------------------------------------------------------- 1 | # $Id: Makefile.am,v 1.1 2005/09/01 14:08:35 chfl Exp $ 2 | info_TEXINFOS = libODES.texinfo 3 | 4 | man_MANS = SBML_odeSolver.1 5 | 6 | EXTRA_DIST = $(man_MANS) 7 | 8 | # End of file 9 | -------------------------------------------------------------------------------- /doc/README: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | USING THE SOSlib COMMANDLINE APPLICATIONS 5 | 6 | The best documentation for both the usage of the command-line application 7 | odeSolver/SBML_odeSolverApp and of some example applications 8 | can be found online at 9 | http://www.tbi.univie.ac.at/~raim/odeSolver/doc/app.html 10 | 11 | The README file in the main directory also gives short instructions. 12 | 13 | Running odeSolver -h will give you an overview of input options. 14 | 15 | 16 | 17 | 18 | USING SOSlib AS A LIBRARY (API) 19 | 20 | You can either run `doxygen SOSlib.doxy' in the main folder, which will 21 | produce documentation files in this folder. 22 | 23 | Alternatively you can access the doxygen documentation online at 24 | http://www.tbi.univie.ac.at/~raim/odeSolver/doc/api.html 25 | 26 | The example applications (folder applications) show how to use 27 | SOSlib as a library. 28 | 29 | The source code of the library (folder src), the main command-line 30 | application (folder odeSolver) and the example applications (folder 31 | examples) is well documented. You can also just see there for 32 | information. 33 | -------------------------------------------------------------------------------- /doc/os_v1-0.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/doc/os_v1-0.pdf -------------------------------------------------------------------------------- /doc/os_v1-5.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/doc/os_v1-5.pdf -------------------------------------------------------------------------------- /examples/MAPK.linobjfun: -------------------------------------------------------------------------------- 1 | MKKK 0 2 | MKKK_P MKKK_P 3 | MKK 0 4 | MKK_P 0 5 | MKK_PP 0 6 | MAPK 0 7 | MAPK_P 0 8 | MAPK_PP 0 -------------------------------------------------------------------------------- /examples/MAPK.objfun: -------------------------------------------------------------------------------- 1 | # Example of a nonlinear objective function used in adjsenstest.c 2 | 1/2* MKKK_P^2 3 | 4 | -------------------------------------------------------------------------------- /examples/MAPK_10000pt.objfun: -------------------------------------------------------------------------------- 1 | # Example of a nonlinear objective function used in adjsenstest_ContDiscData.c 2 | 1/10000 * 100 * 1/2 * ((MKKK - MKKK_data)^2 + (MKKK_P - MKKK_P_data)^2 + (MKK - MKK_data)^2+(MKK_P - MKK_P_data)^2+(MKK_PP - MKK_PP_data)^2 + (MAPK - MAPK_data)^2 + (MAPK_P - MAPK_P_data)^2 + (MAPK_PP - MAPK_PP_data )^2) 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/MAPK_1000pt.objfun: -------------------------------------------------------------------------------- 1 | # Example of a nonlinear objective function used in adjsenstest_ContDiscData.c 2 | 1/1000 * 100 * 1/2 * ((MKKK - MKKK_data)^2 + (MKKK_P - MKKK_P_data)^2 + (MKK - MKK_data)^2+(MKK_P - MKK_P_data)^2+(MKK_PP - MKK_PP_data)^2 + (MAPK - MAPK_data)^2 + (MAPK_P - MAPK_P_data)^2 + (MAPK_PP - MAPK_PP_data )^2) 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/MAPK_100pt.objfun: -------------------------------------------------------------------------------- 1 | # Example of a nonlinear objective function used in adjsenstest_ContDiscData.c 2 | 1/100 * 100 * 1/2*((MKKK-MKKK_data)^2+(MKKK_P-MKKK_P_data)^2+(MKK-MKK_data)^2+(MKK_P-MKK_P_data)^2+(MKK_PP-MKK_PP_data)^2+(MAPK-MAPK_data)^2+(MAPK_P-MAPK_P_data)^2+(MAPK_PP-MAPK_PP_data)^2) 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/MAPK_10pt.dat: -------------------------------------------------------------------------------- 1 | #t MKKK MKKK_P MKK MKK_P MKK_PP MAPK MAPK_P MAPK_PP 2 | ##CONCENTRATIONS 3 | 0 90 10 280 10 10 280 10 10 4 | 10 80.718 19.282 279.662 11.6565 8.68109 279.88 11.1054 9.01507 5 | 20 71.2642 28.7358 277.411 13.8792 8.71021 280.012 11.8575 8.13013 6 | 30 61.6227 38.3773 273.234 16.6896 10.0766 280.05 12.4867 7.4635 7 | 40 51.974 48.026 267.121 20.0773 12.8015 279.667 13.1953 7.13742 8 | 50 42.6595 57.3405 259.105 23.9659 16.9288 278.551 14.1698 7.27936 9 | 60 34.1268 65.8732 249.3 28.2199 22.4801 276.391 15.5743 8.03503 10 | 70 26.824 73.176 237.921 32.6736 29.4052 272.885 17.532 9.58258 11 | 80 21.0614 78.9386 225.277 37.1633 37.5598 267.755 20.1063 12.1388 12 | 90 16.9094 83.0906 211.724 41.5522 46.7239 260.755 23.293 15.9518 13 | 100 14.2049 85.7951 197.611 45.7411 56.6475 251.69 27.0276 21.2823 14 | ##CONCENTRATIONS 15 | #t MKKK MKKK_P MKK MKK_P MKK_PP MAPK MAPK_P MAPK_PP 16 | 17 | 18 | -------------------------------------------------------------------------------- /examples/MAPK_10pt.objfun: -------------------------------------------------------------------------------- 1 | # Example of a nonlinear objective function used in adjsenstest_ContDiscData.c 2 | 1/10 * 100 * 1/2*((MKKK-MKKK_data)^2+(MKKK_P-MKKK_P_data)^2+(MKK-MKK_data)^2+(MKK_P-MKK_P_data)^2+(MKK_PP-MKK_PP_data)^2+(MAPK-MAPK_data)^2+(MAPK_P-MAPK_P_data)^2+(MAPK_PP-MAPK_PP_data)^2) 3 | 4 | 5 | -------------------------------------------------------------------------------- /examples/MAPK_withData.objfun: -------------------------------------------------------------------------------- 1 | # Example of a nonlinear objective function used in adjsenstest_ContDiscData.c 2 | 1/2*((MKKK-MKKK_data)^2+(MKKK_P-MKKK_P_data)^2+(MKK-MKK_data)^2+(MKK_P-MKK_P_data)^2+(MKK_PP-MKK_PP_data)^2+(MAPK-MAPK_data)^2+(MAPK_P-MAPK_P_data)^2+(MAPK_PP-MAPK_PP_data)^2) 3 | -------------------------------------------------------------------------------- /examples/basic-model1-forward-l2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | k_1 24 | S1 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | k_2 44 | S2 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /examples/basic.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | k_1 27 | S1 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | k_2 44 | S2 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /examples/events-1-event-1-assignment-l2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | S1 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | S1 33 | 0.1 34 | 35 | 36 | 37 | 38 | 39 | 40 | 1 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /examples/events-2-events-1-assignment-l2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | S1 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | S1 33 | 0.1 34 | 35 | 36 | 37 | 38 | 39 | 40 | 1 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | S2 51 | 0.5 52 | 53 | 54 | 55 | 56 | 57 | 58 | 0 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /examples/repressilator.objfun: -------------------------------------------------------------------------------- 1 | 1/2*( (x1 - x1_data)^2 + (x2 - x2_data)^2 + (x3 - x3_data)^2 + (y1 - y1_data)^2 + (y2 - y2_data)^2 + (y3 - y3_data)^2 ) -------------------------------------------------------------------------------- /examples/testrun: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | ./ASTIndexTest 3 | sleep 1 4 | ./printODEs 5 | sleep 1 6 | ./integrate MAPK.xml 1000 100 7 | sleep 1 8 | ./batchIntegrate MAPK.xml 1000 2 1 10 5 V1 1 10 10 k4 J3 9 | sleep 1 10 | ./defSeries MAPK.xml 11 | sleep 1 12 | ./simpleIntInst 13 | sleep 1 14 | ./changeIntInst 15 | sleep 1 16 | ./analyzeJacobian 17 | sleep 1 18 | ./analyzeSens 19 | sleep 1 20 | ./sensitivity 21 | sleep 1 22 | ./adj_sensitivity repressilator.xml repressilator.objfun repressilator_data.txt 23 | sleep 1 24 | ./ParameterScanner MAPK.xml 200 50 Ki 0 15 5 MAPK_PP 25 | sleep 1 26 | ./Sense MAPK.xml 200 7.5 p Ki MKKK_P MAPK_PP 27 | sleep 1 28 | ./adjsenstest 29 | sleep 1 30 | ./adjsenstest_ContDiscData 31 | sleep 1 32 | ./senstest 33 | -------------------------------------------------------------------------------- /odeSolver/Makefile.am: -------------------------------------------------------------------------------- 1 | # $Id: Makefile.am,v 1.8 2007/09/20 01:16:12 raimc Exp $ 2 | ## 3 | ## This application is free software; you can redistribute it and/or modify 4 | ## it under the terms of the GNU Lesser General Public License as published 5 | ## by the Free Software Foundation; either version 2.1 of the License, or 6 | ## any later version. 7 | ## 8 | ## This application is distributed in the hope that it will be useful, but 9 | ## WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 10 | ## MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 11 | ## documentation provided hereunder is on an "as is" basis, and the 12 | ## authors have no obligations to provide maintenance, support, 13 | ## updates, enhancements or modifications. In no event shall the 14 | ## authors be liable to any party for direct, indirect, special, 15 | ## incidental or consequential damages, including lost profits, arising 16 | ## out of the use of this software and its documentation, even if the 17 | ## authors have been advised of the possibility of such damage. See 18 | ## the GNU Lesser General Public License for more details. 19 | ## 20 | ## You should have received a copy of the GNU Lesser General Public License 21 | ## along with this library; if not, write to the Free Software Foundation, 22 | ## Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 23 | ## 24 | ## The original code contained here was initially developed by: 25 | ## 26 | ## Rainer Machne 27 | ## 28 | ## Contributor(s): 29 | ## 30 | ## 31 | 32 | AM_CPPFLAGS = -I$(srcdir)/../src @SBML_CPPFLAGS@ @GRACE_CPPFLAGS@ @SUNDIALS_CPPFLAGS@ 33 | AM_CFLAGS = -Wno-unknown-pragmas -Wall -Wextra -ansi -std=iso9899:1990 34 | AM_LDFLAGS = @GRAPHVIZ_RPATH@ @GRACE_RPATH@ @SBML_RPATH@ 35 | bin_PROGRAMS = odeSolver 36 | odeSolver_SOURCES = main.c \ 37 | commandLine.c \ 38 | options.c \ 39 | printModel.c \ 40 | interactive.c \ 41 | getopt.c getopt1.c 42 | odeSolver_LDADD = ../src/libODES.la \ 43 | @SUNDIALS_LIBS@ \ 44 | @SBML_LIBS@ \ 45 | @GRACE_LIBS@ \ 46 | @GRAPHVIZ_LIBS@ 47 | odeSolver_LDFLAGS = @SUNDIALS_LDFLAGS@ \ 48 | @SBML_LDFLAGS@ \ 49 | @GRACE_LDFLAGS@ \ 50 | @GRAPHVIZ_LDFLAGS@ 51 | -------------------------------------------------------------------------------- /odeSolver/commandLine.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | Last changed Time-stamp: <2005-10-26 17:38:04 raim> 4 | $Id: commandLine.h,v 1.3 2005/10/28 09:05:53 afinney Exp $ 5 | */ 6 | /* 7 | * 8 | * This application is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation; either version 2.1 of the License, or 11 | * any later version. 12 | * 13 | * This application is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 15 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 16 | * documentation provided hereunder is on an "as is" basis, and the 17 | * authors have no obligations to provide maintenance, support, 18 | * updates, enhancements or modifications. In no event shall the 19 | * authors be liable to any party for direct, indirect, special, 20 | * incidental or consequential damages, including lost profits, arising 21 | * out of the use of this software and its documentation, even if the 22 | * authors have been advised of the possibility of such damage. See 23 | * the GNU Lesser General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU Lesser General Public License 26 | * along with this library; if not, write to the Free Software Foundation, 27 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 28 | * 29 | * The original code contained here was initially developed by: 30 | * 31 | * Rainer Machne 32 | * 33 | * Contributor(s): 34 | * Christoph Flamm 35 | */ 36 | 37 | #ifndef _COMMANDLINE_H_ 38 | #define _COMMANDLINE_H_ 39 | 40 | #include 41 | 42 | #include "../src/sbmlsolver/integratorInstance.h" 43 | 44 | SBMLDocument_t* parseModelWithArguments(const char *file); 45 | int integrator(integratorInstance_t *engine, int PrintMessage, 46 | int PrintOnTheFly, FILE *outfile); 47 | 48 | int odeSolver (int argc, char *argv[]); 49 | 50 | #endif 51 | 52 | /* End of file */ 53 | -------------------------------------------------------------------------------- /odeSolver/interactive.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | Last changed Time-stamp: <2005-10-26 17:39:26 raim> 4 | $Id: interactive.h,v 1.2 2005/10/26 15:41:56 raimc Exp $ 5 | */ 6 | /* 7 | * 8 | * This application is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation; either version 2.1 of the License, or 11 | * any later version. 12 | * 13 | * This application is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 15 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 16 | * documentation provided hereunder is on an "as is" basis, and the 17 | * authors have no obligations to provide maintenance, support, 18 | * updates, enhancements or modifications. In no event shall the 19 | * authors be liable to any party for direct, indirect, special, 20 | * incidental or consequential damages, including lost profits, arising 21 | * out of the use of this software and its documentation, even if the 22 | * authors have been advised of the possibility of such damage. See 23 | * the GNU Lesser General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU Lesser General Public License 26 | * along with this library; if not, write to the Free Software Foundation, 27 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 28 | * 29 | * The original code contained here was initially developed by: 30 | * 31 | * Rainer Machne 32 | * 33 | * Contributor(s): 34 | * 35 | */ 36 | 37 | #ifndef _INTERACTIVE_H_ 38 | #define _INTERACTIVE_H_ 39 | 40 | void interactive(void); 41 | 42 | #endif 43 | 44 | /* End of file */ 45 | -------------------------------------------------------------------------------- /odeSolver/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/odeSolver/main.c -------------------------------------------------------------------------------- /odeSolver/printModel.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | Last changed Time-stamp: <30-Sep-2010 11:05:29 raim> 4 | $Id: printModel.h,v 1.4 2010/09/30 09:15:16 raimc Exp $ 5 | */ 6 | /* 7 | * 8 | * This application is free software; you can redistribute it and/or modify 9 | * it under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation; either version 2.1 of the License, or 11 | * any later version. 12 | * 13 | * This application is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 15 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 16 | * documentation provided hereunder is on an "as is" basis, and the 17 | * authors have no obligations to provide maintenance, support, 18 | * updates, enhancements or modifications. In no event shall the 19 | * authors be liable to any party for direct, indirect, special, 20 | * incidental or consequential damages, including lost profits, arising 21 | * out of the use of this software and its documentation, even if the 22 | * authors have been advised of the possibility of such damage. See 23 | * the GNU Lesser General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU Lesser General Public License 26 | * along with this library; if not, write to the Free Software Foundation, 27 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 28 | * 29 | * The original code contained here was initially developed by: 30 | * 31 | * Rainer Machne 32 | * 33 | * Contributor(s): 34 | * 35 | */ 36 | 37 | #ifndef _PRINTMODEL_H_ 38 | #define _PRINTMODEL_H_ 39 | 40 | /* print model structures to file */ 41 | void printModel(Model_t *, FILE *); 42 | void printSpecies(Model_t *, FILE *); 43 | void printReactions(Model_t *, FILE *); 44 | void printODEs(odeModel_t *, FILE *); 45 | void printODEsToSBML(Model_t *ode, FILE *); 46 | void printJacobian(odeModel_t *, FILE *); 47 | /* print results of simulation to file */ 48 | void printConcentrationTimeCourse(cvodeData_t *, FILE *); 49 | void printOdeTimeCourse(cvodeData_t *, FILE *); 50 | void printReactionTimeCourse(cvodeData_t *, Model_t *, FILE *); 51 | void printJacobianTimeCourse(cvodeData_t *, FILE *); 52 | void printDeterminantTimeCourse(cvodeData_t *, ASTNode_t *, FILE *); 53 | void printResultsToSBML(Model_t *, cvodeData_t *, FILE *); 54 | 55 | void printPhase(cvodeData_t *); 56 | 57 | #endif 58 | /* End of file */ 59 | -------------------------------------------------------------------------------- /scripts/gnuplotscript.awk: -------------------------------------------------------------------------------- 1 | #!/usr/bin/awk -f 2 | /\#t/ 3 | { 4 | printf("set data style linespoints\n"); 5 | printf("plot"); 6 | n = 0; 7 | for (i = 2; i != ARGC; i++) 8 | { 9 | for (j = 2; j != NF+1; j++) 10 | { 11 | if (ARGV[i] == $(j)) 12 | { 13 | printf(" '"); 14 | printf(ARGV[1]); 15 | printf("'"); 16 | printf(" using 1:"); 17 | printf(j); 18 | printf(" title '"); 19 | printf($(j)); 20 | printf("'"); 21 | 22 | if (i != ARGC - 1) 23 | printf(","); 24 | n++; 25 | } 26 | } 27 | } 28 | exit 0; 29 | } 30 | -------------------------------------------------------------------------------- /scripts/xmgracefile.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # -*-Perl-*- 3 | # Last changed Time-stamp: <2005-08-30 18:31:41 xtof> 4 | # $Id: xmgracefile.pl,v 1.1 2005/12/08 12:13:16 raimc Exp $ 5 | 6 | use Getopt::Long; 7 | use File::Basename; 8 | use strict; 9 | 10 | # some globals 11 | my @LOC = (0.20, 0.90); 12 | my $FSIZE = .5; 13 | my $LEG = 'on'; 14 | 15 | usage() unless GetOptions("loc=s" => sub{local $_ = $_[1]; @LOC = split}, 16 | "lfs=f" => \$FSIZE, 17 | "noLeg" => sub{$LEG = 'off'}, 18 | "h" => \&usage); 19 | 20 | my $FILENAME = $ARGV[0] || "stdin"; 21 | 22 | make_legend(search_legend()); 23 | while (<>) {print} 24 | 25 | #--- 26 | sub search_legend { local $_; while ((<>)) { last if m/^\#t/ } return $_ } 27 | 28 | #--- 29 | sub make_legend { 30 | local $_ = shift; 31 | my @F = split; 32 | shift @F; 33 | print << "EOL"; 34 | @ title "$FILENAME" 35 | @ legend $LEG 36 | @ legend loctype view 37 | @ legend $LOC[0], $LOC[1] 38 | @ legend box color 1 39 | @ legend box pattern 1 40 | @ legend box linewidth 1.0 41 | @ legend box linestyle 1 42 | @ legend box fill color 0 43 | @ legend box fill pattern 1 44 | @ legend font 8 45 | @ legend char size $FSIZE 46 | @ legend color 1 47 | @ legend length 4 48 | @ legend vgap 1 49 | @ legend hgap 2 50 | @ legend invert false 51 | EOL 52 | 53 | my $i = 0; 54 | foreach my $species (@F) { 55 | print "\@ s$i legend \"$species\"\n"; 56 | $i++; 57 | } 58 | } 59 | 60 | #--- 61 | sub usage { 62 | print STDERR 63 | "\n Usage: @{[basename($0)]} [options]\n"; 64 | print STDERR 65 | " -loc Set location of legend box (upper left corner)\n", 66 | " (default: @LOC)\n", 67 | " -lfs Sets size of legend label characters\n", 68 | " (default: $FSIZE)\n", 69 | " -h display help message\n\n"; 70 | exit(0); 71 | } 72 | 73 | 74 | 75 | __END__ 76 | -------------------------------------------------------------------------------- /src/libODES.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: libODES 7 | Description: The SBML ODE Solver library 8 | URL: http://www.tbi.univie.ac.at/~raim/odeSolver/ 9 | Version: @VERSION@ 10 | Requires: libsbml >= 3.4.1 11 | Libs: -L${libdir} -lODES 12 | Libs.private: @SUNDIALS_LDFLAGS@ @SUNDIALS_LIBS@ -lm 13 | Cflags: -I${includedir} @SUNDIALS_CPPFLAGS@ 14 | -------------------------------------------------------------------------------- /src/odeSolver.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/src/odeSolver.c -------------------------------------------------------------------------------- /src/private/data.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | #ifdef HAVE_CONFIG_H 3 | #include "config.h" 4 | #endif 5 | 6 | #include "private/data.h" 7 | 8 | #include "sbmlsolver/util.h" 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | double scan_double(const char *str) 16 | { 17 | char *endp; 18 | double v; 19 | 20 | errno = 0; 21 | v = strtod(str, &endp); 22 | if (str == endp) { /* no conversion is performed */ 23 | fatal(stderr, "could not convert %s to double", str); 24 | } 25 | if (errno != 0) { 26 | if (v == HUGE_VAL || v == -HUGE_VAL) { 27 | fatal(stderr, "overflow found: %s", str); 28 | } else if (v == 0) { 29 | fatal(stderr, "underflow found: %s", str); 30 | } 31 | } 32 | return v; 33 | } 34 | -------------------------------------------------------------------------------- /src/private/data.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | #ifndef PRIVATE_DATA_H_ 3 | #define PRIVATE_DATA_H_ 4 | 5 | double scan_double(const char *str); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /src/private/error.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | #ifdef HAVE_CONFIG_H 3 | #include "config.h" 4 | #endif 5 | 6 | #include "private/error.h" 7 | 8 | #include 9 | #include 10 | 11 | void report_error_and_die(const char *message) 12 | { 13 | fprintf(stderr, "%s\n", message); 14 | exit(EXIT_FAILURE); 15 | } 16 | -------------------------------------------------------------------------------- /src/private/error.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | #ifndef PRIVATE_ERROR_H_ 3 | #define PRIVATE_ERROR_H_ 4 | 5 | /** This function will not return. */ 6 | void report_error_and_die(const char *message); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/private/macro.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | #ifndef PRIVATE_MACRO_H_ 3 | #define PRIVATE_MACRO_H_ 4 | 5 | #define NUMBER_OF_ELEMENTS(x) (sizeof(x)/sizeof(x[0])) 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /src/processAST.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/src/processAST.c -------------------------------------------------------------------------------- /src/sbmlsolver/ASTCompiler/Makefile: -------------------------------------------------------------------------------- 1 | DEFAULT: 2 | gcc -ansi -std=iso9899:1990 arithmeticCompilerTest.c -lm 3 | -------------------------------------------------------------------------------- /src/sbmlsolver/ASTIndexNameNode.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | #ifndef SBMLSOLVER_ASTINDEXNAMENODE_H_ 3 | #define SBMLSOLVER_ASTINDEXNAMENODE_H_ 4 | 5 | #include 6 | 7 | #include 8 | 9 | BEGIN_C_DECLS 10 | 11 | /* creates a new AST node with an index field */ 12 | SBML_ODESOLVER_API ASTNode_t *ASTNode_createIndexName(void); 13 | 14 | /* returns 1 if the node is indexed */ 15 | SBML_ODESOLVER_API int ASTNode_isIndexName(const ASTNode_t *); 16 | 17 | /* assumes node is index node */ 18 | SBML_ODESOLVER_API unsigned int ASTNode_getIndex(const ASTNode_t *); 19 | 20 | /* returns 0 if node isn't index or if index is not set yet */ 21 | SBML_ODESOLVER_API unsigned int ASTNode_isSetIndex(const ASTNode_t *); 22 | 23 | /* assumes node is index node */ 24 | SBML_ODESOLVER_API void ASTNode_setIndex(ASTNode_t *, unsigned int); 25 | 26 | /* returns 0 if node isn't index or if data is not set yet */ 27 | SBML_ODESOLVER_API unsigned int ASTNode_isSetData(const ASTNode_t *); 28 | 29 | /* assumes node is index node, and then sets data */ 30 | SBML_ODESOLVER_API void ASTNode_setData(ASTNode_t *); 31 | 32 | 33 | 34 | 35 | END_C_DECLS 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /src/sbmlsolver/arithmeticCompiler.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | Last changed Time-stamp: <2008-05-09 23:26:31 raim> 4 | $Id: arithmeticCompiler.h,v 1.6 2009/02/10 12:42:39 stefan_tbi Exp $ 5 | */ 6 | /* 7 | * 8 | * This library is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation; either version 2.1 of the License, or 11 | * any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 15 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 16 | * documentation provided hereunder is on an "as is" basis, and the 17 | * authors have no obligations to provide maintenance, support, 18 | * updates, enhancements or modifications. In no event shall the 19 | * authors be liable to any party for direct, indirect, special, 20 | * incidental or consequential damages, including lost profits, arising 21 | * out of the use of this software and its documentation, even if the 22 | * authors have been advised of the possibility of such damage. See 23 | * the GNU Lesser General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU Lesser General Public License 26 | * along with this library; if not, write to the Free Software Foundation, 27 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 28 | * 29 | * The original code contained here was initially developed by: 30 | * Matthias Rosensteiner 31 | * Markus Loeberbauer 32 | * 33 | * Contributor(s): 34 | * Stefan Müller 35 | * Rainer Machne 36 | */ 37 | 38 | #ifndef SBMLSOLVER_ARITHMETICCOMPILER_H_ 39 | #define SBMLSOLVER_ARITHMETICCOMPILER_H_ 40 | 41 | /* #define ARITHMETIC_TEST */ /* comment in test arithmeticCompiler.c */ 42 | 43 | typedef struct directCode directCode_t; 44 | 45 | /*!!!! NOTE: includes need to be below typedef definition to avoid 46 | circular include problem, but struct declarations needs to 47 | be after includes, however some compilers require struct before typedef */ 48 | #include 49 | 50 | struct cvodeData; 51 | 52 | struct directCode 53 | { 54 | int codeSize, FPUstackSize, storageSize; 55 | int codePosition, FPUstackPosition, storagePosition; 56 | unsigned char *prog; 57 | double *FPUstack, *storage; 58 | double (*evaluate)(struct cvodeData *); 59 | ASTNode_t *eqn; 60 | long long *temp; 61 | } ; 62 | 63 | #ifdef __cplusplus 64 | extern "C" { 65 | #endif 66 | 67 | void generateFunction(directCode_t *, ASTNode_t *); 68 | void destructFunction(directCode_t *); 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /src/sbmlsolver/charBuffer.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | Last changed Time-stamp: <2006-06-12 11:04:54 raim> 4 | $Id: charBuffer.h,v 1.4 2009/03/27 15:55:03 fbergmann Exp $ 5 | */ 6 | /* 7 | * 8 | * This library is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation; either version 2.1 of the License, or 11 | * any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 15 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 16 | * documentation provided hereunder is on an "as is" basis, and the 17 | * authors have no obligations to provide maintenance, support, 18 | * updates, enhancements or modifications. In no event shall the 19 | * authors be liable to any party for direct, indirect, special, 20 | * incidental or consequential damages, including lost profits, arising 21 | * out of the use of this software and its documentation, even if the 22 | * authors have been advised of the possibility of such damage. See 23 | * the GNU Lesser General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU Lesser General Public License 26 | * along with this library; if not, write to the Free Software Foundation, 27 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 28 | * 29 | * The original code contained here was initially developed by: 30 | * 31 | * Andrew Finney 32 | * 33 | * Contributor(s): 34 | */ 35 | 36 | #ifndef SBMLSOLVER_CHARBUFFER_H_ 37 | #define SBMLSOLVER_CHARBUFFER_H_ 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | typedef struct charBuffer charBuffer_t; 44 | 45 | charBuffer_t *CharBuffer_create(void); 46 | void CharBuffer_free(charBuffer_t *); 47 | void CharBuffer_append(charBuffer_t *, const char *); 48 | void CharBuffer_appendInt(charBuffer_t *, int); 49 | void CharBuffer_appendDouble(charBuffer_t *, double); 50 | const char *CharBuffer_getBuffer(charBuffer_t *); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /src/sbmlsolver/daeSolver.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | Last changed Time-stamp: <2005-11-03 14:54:35 raim> 4 | $Id: daeSolver.h,v 1.2 2009/03/27 15:55:03 fbergmann Exp $ 5 | */ 6 | /* 7 | * 8 | * This library is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation; either version 2.1 of the License, or 11 | * any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 15 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 16 | * documentation provided hereunder is on an "as is" basis, and the 17 | * authors have no obligations to provide maintenance, support, 18 | * updates, enhancements or modifications. In no event shall the 19 | * authors be liable to any party for direct, indirect, special, 20 | * incidental or consequential damages, including lost profits, arising 21 | * out of the use of this software and its documentation, even if the 22 | * authors have been advised of the possibility of such damage. See 23 | * the GNU Lesser General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU Lesser General Public License 26 | * along with this library; if not, write to the Free Software Foundation, 27 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 28 | * 29 | * The original code contained here was initially developed by: 30 | * 31 | * Rainer Machne 32 | * 33 | * Contributor(s): 34 | * Andrew Finney 35 | */ 36 | 37 | #ifndef SBMLSOLVER_DAESOLVER_H_ 38 | #define SBMLSOLVER_DAESOLVER_H_ 39 | 40 | #include 41 | #include 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | /* IDA SOLVER */ 48 | SBML_ODESOLVER_API int IntegratorInstance_idaOneStep(integratorInstance_t *); 49 | SBML_ODESOLVER_API void IntegratorInstance_printIDAStatistics(integratorInstance_t *, FILE *f); 50 | 51 | /* internal functions that are not part of the API (yet?) */ 52 | int IntegratorInstance_createIDASolverStructures(integratorInstance_t *); 53 | void IntegratorInstance_freeIDASolverStructures(integratorInstance_t *); 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif 60 | 61 | /* End of file */ 62 | -------------------------------------------------------------------------------- /src/sbmlsolver/drawGraph.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | Last changed Time-stamp: <2005-11-17 13:55:39 raim> 4 | $Id: drawGraph.h,v 1.7 2009/03/27 15:55:03 fbergmann Exp $ 5 | */ 6 | #ifndef SBMLSOLVER_DRAWGRAPH_H_ 7 | #define SBMLSOLVER_DRAWGRAPH_H_ 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /* Drawing the model with GraphViz */ 18 | SBML_ODESOLVER_API int drawModel(Model_t *, char *, char*); 19 | SBML_ODESOLVER_API int drawJacoby(cvodeData_t *, char *, char*); 20 | SBML_ODESOLVER_API int drawSensitivity(cvodeData_t *, char *, char*, double); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | 26 | #endif 27 | 28 | /* End of file */ 29 | -------------------------------------------------------------------------------- /src/sbmlsolver/interpol.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/src/sbmlsolver/interpol.h -------------------------------------------------------------------------------- /src/sbmlsolver/modelSimplify.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | Last changed Time-stamp: <2005-10-27 12:46:37 raim> 4 | $Id: modelSimplify.h,v 1.7 2009/03/27 15:55:03 fbergmann Exp $ 5 | */ 6 | /* 7 | * 8 | * This library is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation; either version 2.1 of the License, or 11 | * any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 15 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 16 | * documentation provided hereunder is on an "as is" basis, and the 17 | * authors have no obligations to provide maintenance, support, 18 | * updates, enhancements or modifications. In no event shall the 19 | * authors be liable to any party for direct, indirect, special, 20 | * incidental or consequential damages, including lost profits, arising 21 | * out of the use of this software and its documentation, even if the 22 | * authors have been advised of the possibility of such damage. See 23 | * the GNU Lesser General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU Lesser General Public License 26 | * along with this library; if not, write to the Free Software Foundation, 27 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 28 | * 29 | * The original code contained here was initially developed by: 30 | * 31 | * Rainer Machne 32 | * 33 | * Contributor(s): 34 | * 35 | */ 36 | 37 | #ifndef SBMLSOLVER_MODELSIMPLIFY_H_ 38 | #define SBMLSOLVER_MODELSIMPLIFY_H_ 39 | 40 | #include 41 | 42 | #include 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | SBML_ODESOLVER_API void AST_replaceNameByFormula(ASTNode_t *, const char *, const ASTNode_t *); 49 | SBML_ODESOLVER_API void AST_replaceNameByName(ASTNode_t *, const char *, const char *); 50 | SBML_ODESOLVER_API void AST_replaceNameByValue(ASTNode_t *, const char *, double); 51 | SBML_ODESOLVER_API void AST_replaceNameByParameters(ASTNode_t *, ListOf_t* ); 52 | SBML_ODESOLVER_API void AST_replaceFunctionDefinition(ASTNode_t *, const char *, const ASTNode_t *); 53 | SBML_ODESOLVER_API void AST_replaceConstants(Model_t *, ASTNode_t *); 54 | 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | 62 | /* End of file */ 63 | -------------------------------------------------------------------------------- /src/sbmlsolver/nullSolver.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | Last changed Time-stamp: <2005-11-04 19:04:45 raim> 4 | $Id: nullSolver.h,v 1.3 2009/03/27 15:55:03 fbergmann Exp $ 5 | */ 6 | /* 7 | * 8 | * This library is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation; either version 2.1 of the License, or 11 | * any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 15 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 16 | * documentation provided hereunder is on an "as is" basis, and the 17 | * authors have no obligations to provide maintenance, support, 18 | * updates, enhancements or modifications. In no event shall the 19 | * authors be liable to any party for direct, indirect, special, 20 | * incidental or consequential damages, including lost profits, arising 21 | * out of the use of this software and its documentation, even if the 22 | * authors have been advised of the possibility of such damage. See 23 | * the GNU Lesser General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU Lesser General Public License 26 | * along with this library; if not, write to the Free Software Foundation, 27 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 28 | * 29 | * The original code contained here was initially developed by: 30 | * 31 | * Rainer Machne 32 | * 33 | * Contributor(s): 34 | * 35 | */ 36 | 37 | #ifndef SBMLSOLVER_NULLSOLVER_H_ 38 | #define SBMLSOLVER_NULLSOLVER_H_ 39 | 40 | #include 41 | #include 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | /* KINSOL SOLVER */ 48 | SBML_ODESOLVER_API int IntegratorInstance_nullSolver(integratorInstance_t *); 49 | SBML_ODESOLVER_API void IntegratorInstance_printKINSOLStatistics(integratorInstance_t *, FILE *f); 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | /* internal functions that are not part of the API (yet?) */ 56 | int IntegratorInstance_createKINSolverStructures(integratorInstance_t *); 57 | void IntegratorInstance_freeKINSolverStructures(integratorInstance_t *); 58 | 59 | #endif 60 | 61 | /* End of file */ 62 | -------------------------------------------------------------------------------- /src/sbmlsolver/odeConstruct.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | Last changed Time-stamp: <2006-06-13 14:09:24 raim> 4 | $Id: odeConstruct.h,v 1.11 2009/03/27 15:55:03 fbergmann Exp $ 5 | */ 6 | /* 7 | * 8 | * This library is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation; either version 2.1 of the License, or 11 | * any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 15 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 16 | * documentation provided hereunder is on an "as is" basis, and the 17 | * authors have no obligations to provide maintenance, support, 18 | * updates, enhancements or modifications. In no event shall the 19 | * authors be liable to any party for direct, indirect, special, 20 | * incidental or consequential damages, including lost profits, arising 21 | * out of the use of this software and its documentation, even if the 22 | * authors have been advised of the possibility of such damage. See 23 | * the GNU Lesser General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU Lesser General Public License 26 | * along with this library; if not, write to the Free Software Foundation, 27 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 28 | * 29 | * The original code contained here was initially developed by: 30 | * 31 | * Rainer Machne 32 | * 33 | * Contributor(s): 34 | * 35 | */ 36 | 37 | #ifndef SBMLSOLVER_ODECONSTRUCT_H_ 38 | #define SBMLSOLVER_ODECONSTRUCT_H_ 39 | 40 | #include 41 | 42 | #include 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | SBML_ODESOLVER_API double Model_getValueById(Model_t *, const char *); 49 | SBML_ODESOLVER_API int Model_setValue(Model_t *, const char *, const char *, double); 50 | SBML_ODESOLVER_API Model_t* Model_reduceToOdes(Model_t *); 51 | SBML_ODESOLVER_API ASTNode_t *Species_odeFromReactions(Species_t *, Model_t *); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | 59 | /* End of file */ 60 | -------------------------------------------------------------------------------- /src/sbmlsolver/processAST.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/src/sbmlsolver/processAST.h -------------------------------------------------------------------------------- /src/sbmlsolver/sbml.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | Last changed Time-stamp: <2007-10-26 14:57:16 raim> 4 | $Id: sbml.h,v 1.8 2008/01/28 19:25:27 stefan_tbi Exp $ 5 | */ 6 | /* 7 | * 8 | * This library is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation; either version 2.1 of the License, or 11 | * any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 15 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 16 | * documentation provided hereunder is on an "as is" basis, and the 17 | * authors have no obligations to provide maintenance, support, 18 | * updates, enhancements or modifications. In no event shall the 19 | * authors be liable to any party for direct, indirect, special, 20 | * incidental or consequential damages, including lost profits, arising 21 | * out of the use of this software and its documentation, even if the 22 | * authors have been advised of the possibility of such damage. See 23 | * the GNU Lesser General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU Lesser General Public License 26 | * along with this library; if not, write to the Free Software Foundation, 27 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 28 | * 29 | * The original code contained here was initially developed by: 30 | * 31 | * Rainer Machne 32 | * 33 | * Contributor(s): 34 | * Christoph Flamm 35 | */ 36 | 37 | 38 | #ifndef SBMLSOLVER_SBML_H_ 39 | #define SBMLSOLVER_SBML_H_ 40 | 41 | #include 42 | 43 | #include 44 | 45 | SBMLDocument_t *convertModel (SBMLDocument_t *d1); 46 | 47 | #ifdef __cplusplus 48 | extern "C" { 49 | #endif 50 | 51 | SBML_ODESOLVER_API SBMLDocument_t *parseModel(const char *file, int printMessage, 52 | int validate); 53 | 54 | #endif 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | /* End of file */ 60 | -------------------------------------------------------------------------------- /src/sbmlsolver/variableIndex.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | Last changed Time-stamp: <2008-05-09 17:36:09 raim> 4 | $Id: variableIndex.h,v 1.13 2008/05/09 15:46:37 raimc Exp $ 5 | */ 6 | /* 7 | * 8 | * This library is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation; either version 2.1 of the License, or 11 | * any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 15 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 16 | * documentation provided hereunder is on an "as is" basis, and the 17 | * authors have no obligations to provide maintenance, support, 18 | * updates, enhancements or modifications. In no event shall the 19 | * authors be liable to any party for direct, indirect, special, 20 | * incidental or consequential damages, including lost profits, arising 21 | * out of the use of this software and its documentation, even if the 22 | * authors have been advised of the possibility of such damage. See 23 | * the GNU Lesser General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU Lesser General Public License 26 | * along with this library; if not, write to the Free Software Foundation, 27 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 28 | * 29 | * The original code contained here was initially developed by: 30 | * 31 | * Andrew Finney 32 | * 33 | * Contributor(s): 34 | * Rainer Machne 35 | */ 36 | 37 | #ifndef SBMLSOLVER_VARIABLEINDEX_H_ 38 | #define SBMLSOLVER_VARIABLEINDEX_H_ 39 | 40 | /** variable types */ 41 | enum variableType 42 | { 43 | ODE_VARIABLE, 44 | ASSIGNMENT_VARIABLE, 45 | CONSTANT, 46 | ALGEBRAIC_VARIABLE 47 | } ; 48 | typedef enum variableType variableType_t; 49 | 50 | /** The variableIndex is the main interface to model 51 | variables and constants. 52 | 53 | It can be retrieved from an odeModel, and used to get its name 54 | or associated symbolic constructs from the odeModel structure 55 | AND to get and set the values of all model constants and variables 56 | via the integratorInstance during any time of an integration run. 57 | Please see documentation of these modules to learn about the full 58 | use of variableIndex */ 59 | 60 | 61 | struct variableIndex 62 | { 63 | variableType_t type; 64 | int type_index; 65 | int index ; 66 | } ; 67 | typedef struct variableIndex variableIndex_t; 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /src/sensSolver.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/src/sensSolver.c -------------------------------------------------------------------------------- /tokyo_release.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/raim/SBML_odeSolver/0a1aa2becadceb95b2d61a9fdafa9c3cc620748f/tokyo_release.png -------------------------------------------------------------------------------- /tutorial/Makefile.am: -------------------------------------------------------------------------------- 1 | ## 2 | ## This library is free software; you can redistribute it and/or modify it 3 | ## under the terms of the GNU Lesser General Public License as published 4 | ## by the Free Software Foundation; either version 2.1 of the License, or 5 | ## any later version. 6 | ## 7 | ## This library is distributed in the hope that it will be useful, but 8 | ## WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 9 | ## MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 10 | ## documentation provided hereunder is on an "as is" basis, and the 11 | ## authors have no obligations to provide maintenance, support, 12 | ## updates, enhancements or modifications. In no event shall the 13 | ## authors be liable to any party for direct, indirect, special, 14 | ## incidental or consequential damages, including lost profits, arising 15 | ## out of the use of this software and its documentation, even if the 16 | ## authors have been advised of the possibility of such damage. See 17 | ## the GNU Lesser General Public License for more details. 18 | ## 19 | ## You should have received a copy of the GNU Lesser General Public License 20 | ## along with this library; if not, write to the Free Software Foundation, 21 | ## Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 22 | ## 23 | AM_CPPFLAGS = -I$(srcdir)/../src @SBML_CPPFLAGS@ @SUNDIALS_CPPFLAGS@ 24 | AM_CFLAGS = -Wno-unknown-pragmas -Wall -Wextra -ansi -std=iso9899:1990 25 | AM_LDFLAGS = @SBML_LDFLAGS@ @SUNDIALS_LDFLAGS@ @GRACE_LDFLAGS@ @GRAPHVIZ_LDFLAGS@ 26 | LDADD = ../src/libODES.la @SBML_LIBS@ @SUNDIALS_LIBS@ @GRACE_LIBS@ @GRAPHVIZ_LIBS@ 27 | 28 | noinst_PROGRAMS = evaluateast integrate integratorinstance odemodel setvariablevalue 29 | evaluateast_SOURCES = evaluateast.c 30 | integrate_SOURCES = integrate.c 31 | integratorinstance_SOURCES = integratorinstance.c 32 | odemodel_SOURCES = odemodel.c 33 | setvariablevalue_SOURCES = setvariablevalue.c 34 | -------------------------------------------------------------------------------- /tutorial/integrate.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | Last changed Time-stamp: <2007-09-28 14:01:29 raim> 4 | $Id: integrate.c,v 1.1 2007/09/28 13:14:16 raimc Exp $ 5 | */ 6 | /* 7 | * 8 | * This library is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation; either version 2.1 of the License, or 11 | * any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 15 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 16 | * documentation provided hereunder is on an "as is" basis, and the 17 | * authors have no obligations to provide maintenance, support, 18 | * updates, enhancements or modifications. In no event shall the 19 | * authors be liable to any party for direct, indirect, special, 20 | * incidental or consequential damages, including lost profits, arising 21 | * out of the use of this software and its documentation, even if the 22 | * authors have been advised of the possibility of such damage. See 23 | * the GNU Lesser General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU Lesser General Public License 26 | * along with this library; if not, write to the Free Software Foundation, 27 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 28 | * 29 | * The original code contained here was initially developed by: 30 | * 31 | * Rainer Machne 32 | * 33 | * Contributor(s): 34 | */ 35 | #ifdef HAVE_CONFIG_H 36 | #include "config.h" 37 | #endif 38 | 39 | #include 40 | #include 41 | 42 | #include 43 | #include 44 | 45 | 46 | int main (void) 47 | { 48 | SBMLReader_t *sr = SBMLReader_create(); 49 | SBMLDocument_t *d = SBMLReader_readSBML(sr, "MAPK-l2.xml"); 50 | Model_t *sbml = SBMLDocument_getModel(d); 51 | SBMLReader_free(sr); 52 | 53 | int i; 54 | Species_t *species = Model_getSpeciesById(sbml, "MAPK_PP"); 55 | 56 | cvodeSettings_t *options = CvodeSettings_createWithTime(10000, 1000); 57 | /* WARNING: sbml model must be SBML Level 2 */ 58 | SBMLResults_t *results = Model_odeSolver(sbml, options); 59 | if ( results != NULL ) 60 | { 61 | timeCourse_t *timecourse = Species_getTimeCourse(species, results); 62 | for ( i=0; i 4 | # $Id: integrate.pl,v 1.1 2007/09/28 13:14:16 raimc Exp $ 5 | 6 | use Getopt::Long; 7 | use Pod::Usage; 8 | 9 | use ODES; 10 | use LibSBML; 11 | use warnings; 12 | use vars qw/$TIME $STEPS $SBMLFILE/; 13 | use strict; 14 | 15 | # defaults for global var(s) 16 | $TIME = 10000; 17 | $STEPS = 100; 18 | $SBMLFILE = undef; 19 | 20 | # process command-line options 21 | pod2usage(-verbose => 0) 22 | unless GetOptions("steps=i" => \$STEPS, 23 | "time=f" => \$TIME, 24 | "man" => sub{pod2usage(-verbose => 2)}, 25 | "help" => sub{pod2usage(-verbose => 1)}); 26 | 27 | # read SBML-filename 28 | $SBMLFILE = shift(); 29 | do { 30 | print STDERR "Error: No SBML filename specified\n"; 31 | pod2usage(-verbose => 0) 32 | } unless defined $SBMLFILE; 33 | 34 | # use LibSBML functions to parse the SBML file 35 | my $rd = new LibSBML::SBMLReader; 36 | my $d = $rd->readSBML($SBMLFILE); 37 | 38 | # set global integration behaviour 39 | my $settings = ODES::CvodeSettings_create(); 40 | $settings->CvodeSettings_setTime($TIME, $STEPS); 41 | 42 | # integrate the model 43 | my $results = ODES::SBML_odeSolver($d, $settings); 44 | 45 | # print timecourse to STDOUT 46 | $results->SBMLResults_dumpSpecies(); 47 | 48 | ################################################## 49 | 50 | =head1 NAME 51 | 52 | integrate.pl - integrate a SBML model 53 | 54 | =head1 SYNOPSIS 55 | 56 | integrate.pl [[-time I] [-steps I]] SBML-filename 57 | 58 | =head1 DESCRIPTION 59 | 60 | The program takes a SBML file as input and dumps the timecourse of the 61 | species to I 62 | 63 | =head1 OPTIONS 64 | 65 | =over 4 66 | 67 | =item B<-time> I 68 | 69 | Set integration endtime to I (default: 10000) 70 | 71 | =item B<-steps> I 72 | 73 | Set output printsteps to I (default: 100) 74 | 75 | =head1 AUTHORS 76 | 77 | Christoph Flamm, Rainer Machne 78 | 79 | =head1 BUGS 80 | 81 | Please send comments and bug reports to {xtof,raim}@tbi.univie.ac.at 82 | 83 | =cut 84 | 85 | __END__ 86 | -------------------------------------------------------------------------------- /tutorial/integrateODES.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | # -*-Perl-*- 3 | # Last changed Time-stamp: <2007-09-26 16:23:22 xtof> 4 | # $Id: integrateODES.pl,v 1.1 2007/09/28 13:14:16 raimc Exp $ 5 | 6 | use ODES; 7 | use LibSBML; 8 | use strict; 9 | 10 | #my $ode0 = 'a-(b+1)*u+v*u^2'; # u' 11 | #my $ode1 = 'b*u-v*u^2'; # v' 12 | #my @x = qw/u v a b/; 13 | #my @x0 = (1.0, 1.5, 1.0, 1.5); 14 | 15 | my $ode0 = '((150.0 * (3.8 - (p * D_cy) - (p * C_cy)) * (1.0 - (p * C_cy))) - (9.0 * C_cy))'; 16 | my $ode1 = '(3.8 - (3.0 * D_cy) - (p * D_cy) - (p * C_cy))'; 17 | 18 | # use LibSBML function to convert the formula into 19 | # an abstract syntax tree (AST) representation 20 | my $astA = LibSBML::parseFormula($ode0); 21 | my $astB = LibSBML::parseFormula($ode1); 22 | my @AST = ($astA, $astB); 23 | my $neq = scalar @AST; 24 | my @x = qw/C_cy D_cy p/; 25 | my @x0 = (0.0, 9.0, 0.2); 26 | 27 | my $om = ODES::ODEModel_createFromODEs(\@AST, 2, 0, 1, \@x, \@x0, undef); 28 | 29 | my $settings = ODES::CvodeSettings_create(); 30 | $settings->CvodeSettings_setTime(0.5, 10); 31 | $settings->CvodeSettings_setSensitivity(1); 32 | 33 | my $ii = ODES::IntegratorInstance_create($om, $settings); 34 | 35 | while( ! $ii->IntegratorInstance_timeCourseCompleted() ) { 36 | if ( ! $ii->IntegratorInstance_integrateOneStep() ) { 37 | ODES::SolverError_dump(); 38 | last; 39 | } 40 | else { 41 | $ii->IntegratorInstance_dumpData(); 42 | } 43 | } 44 | 45 | my $vi = $om->ODEModel_getVariableIndex('C_cy'); 46 | 47 | printf "\nVariable %s has final value of %g at time %g\n\n", 48 | $om->ODEModel_getVariableName($vi), 49 | $ii->IntegratorInstance_getVariableValue($vi), 50 | $ii->IntegratorInstance_getTime(); 51 | 52 | $vi->VariableIndex_free(); 53 | 54 | $vi = $om->ODEModel_getVariableIndex('p'); 55 | 56 | printf "Sensitivies to %s:\n", 57 | $om->ODEModel_getVariableName($vi); 58 | 59 | $ii->IntegratorInstance_dumpPSensitivities($vi); 60 | print "\n"; 61 | 62 | $om->ODEModel_free(); 63 | $settings->CvodeSettings_free(); 64 | $vi->VariableIndex_free(); 65 | 66 | #--- 67 | sub substitute_params { 68 | my ($eq, $params) = @_; 69 | for my $key (keys %$params) { 70 | $eq =~ s/$key/$params->{$key}/g; 71 | } 72 | 73 | return $eq; 74 | } 75 | 76 | __END__ 77 | my $sbmlfile = '../../examples/MAPK.xml'; 78 | 79 | my $rd = new LibSBML::SBMLReader; 80 | my $d = $rd->readSBML($sbmlfile); 81 | 82 | my $settings = ODES::CvodeSettings_create(); 83 | $settings->CvodeSettings_setTime(10000, 100); 84 | 85 | my $results = ODES::SBML_odeSolver($d, $settings); 86 | 87 | $results->SBMLResults_dump(); 88 | 89 | -------------------------------------------------------------------------------- /tutorial/integratorinstance.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | Last changed Time-stamp: <2007-09-28 14:15:50 raim> 4 | $Id: integratorinstance.c,v 1.1 2007/09/28 13:14:16 raimc Exp $ 5 | */ 6 | /* 7 | * 8 | * This library is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation; either version 2.1 of the License, or 11 | * any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 15 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 16 | * documentation provided hereunder is on an "as is" basis, and the 17 | * authors have no obligations to provide maintenance, support, 18 | * updates, enhancements or modifications. In no event shall the 19 | * authors be liable to any party for direct, indirect, special, 20 | * incidental or consequential damages, including lost profits, arising 21 | * out of the use of this software and its documentation, even if the 22 | * authors have been advised of the possibility of such damage. See 23 | * the GNU Lesser General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU Lesser General Public License 26 | * along with this library; if not, write to the Free Software Foundation, 27 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 28 | * 29 | * The original code contained here was initially developed by: 30 | * 31 | * Rainer Machne 32 | * 33 | * Contributor(s): 34 | */ 35 | #ifdef HAVE_CONFIG_H 36 | #include "config.h" 37 | #endif 38 | 39 | #include 40 | #include 41 | 42 | #include 43 | #include 44 | 45 | int main (void) 46 | { 47 | cvodeSettings_t *options = CvodeSettings_createWithTime(10000, 1000); 48 | odeModel_t *odemodel = ODEModel_createFromFile("MAPK.xml"); 49 | variableIndex_t *vi = ODEModel_getVariableIndex(odemodel, "MAPK_PP"); 50 | 51 | integratorInstance_t *ii = IntegratorInstance_create(odemodel, options); 52 | printf("# Time Course for variable %s \n", 53 | ODEModel_getVariableName(odemodel, vi)); 54 | 55 | while( ! IntegratorInstance_timeCourseCompleted(ii) ) 56 | if ( IntegratorInstance_integrateOneStep(ii ) ) 57 | printf("%g %g\n", IntegratorInstance_getTime(ii), 58 | IntegratorInstance_getVariableValue(ii, vi)); 59 | else 60 | break; 61 | SolverError_dump(); 62 | VariableIndex_free(vi); 63 | IntegratorInstance_free(ii); 64 | ODEModel_free(odemodel); 65 | CvodeSettings_free(options); 66 | 67 | return (EXIT_SUCCESS); 68 | } 69 | 70 | 71 | /* End of file */ 72 | -------------------------------------------------------------------------------- /tutorial/odemodel.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | /* 3 | Last changed Time-stamp: <2007-09-29 20:54:18 raim> 4 | $Id: odemodel.c,v 1.3 2007/09/29 18:57:31 raimc Exp $ 5 | */ 6 | /* 7 | * 8 | * This library is free software; you can redistribute it and/or modify it 9 | * under the terms of the GNU Lesser General Public License as published 10 | * by the Free Software Foundation; either version 2.1 of the License, or 11 | * any later version. 12 | * 13 | * This library is distributed in the hope that it will be useful, but 14 | * WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF 15 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. The software and 16 | * documentation provided hereunder is on an "as is" basis, and the 17 | * authors have no obligations to provide maintenance, support, 18 | * updates, enhancements or modifications. In no event shall the 19 | * authors be liable to any party for direct, indirect, special, 20 | * incidental or consequential damages, including lost profits, arising 21 | * out of the use of this software and its documentation, even if the 22 | * authors have been advised of the possibility of such damage. See 23 | * the GNU Lesser General Public License for more details. 24 | * 25 | * You should have received a copy of the GNU Lesser General Public License 26 | * along with this library; if not, write to the Free Software Foundation, 27 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. 28 | * 29 | * The original code contained here was initially developed by: 30 | * 31 | * Rainer Machne 32 | * 33 | * Contributor(s): 34 | */ 35 | #ifdef HAVE_CONFIG_H 36 | #include "config.h" 37 | #endif 38 | 39 | #include 40 | #include 41 | 42 | #include 43 | 44 | int main (void) 45 | { 46 | odeModel_t *odemodel = ODEModel_createFromFile("MAPK.xml"); 47 | variableIndex_t *vi = ODEModel_getVariableIndex(odemodel, "MAPK_PP"); 48 | 49 | const ASTNode_t *ode = ODEModel_getOde(odemodel, vi); 50 | char *equation = SBML_formulaToString(ode); 51 | printf("d(%s)/dt = %s\n", ODEModel_getVariableName(odemodel, vi), equation); 52 | 53 | ODEModel_free(odemodel); 54 | VariableIndex_free(vi); 55 | free(equation); 56 | 57 | return (EXIT_SUCCESS); 58 | } 59 | 60 | 61 | 62 | /* End of file */ 63 | -------------------------------------------------------------------------------- /unittest/Makefile.am: -------------------------------------------------------------------------------- 1 | TESTS = unittest 2 | 3 | noinst_PROGRAMS = unittest 4 | 5 | unittest_CPPFLAGS = -DEXAMPLES=$(srcdir)/../examples \ 6 | -I$(srcdir)/../src \ 7 | @SUNDIALS_CPPFLAGS@ \ 8 | @SBML_CPPFLAGS@ 9 | unittest_CFLAGS = -Wno-unknown-pragmas -Wall -Wextra -ansi -std=iso9899:1990 \ 10 | @CHECK_CFLAGS@ 11 | unittest_LDFLAGS = @GRAPHVIZ_RPATH@ @GRACE_RPATH@ @SBML_RPATH@ \ 12 | @SUNDIALS_LDFLAGS@ \ 13 | @SBML_LDFLAGS@ \ 14 | @GRACE_LDFLAGS@ \ 15 | @GRAPHVIZ_LDFLAGS@ 16 | unittest_LDADD = @CHECK_LIBS@ \ 17 | ../src/libODES.la \ 18 | @SUNDIALS_LIBS@ \ 19 | @SBML_LIBS@ \ 20 | @GRACE_LIBS@ \ 21 | @GRAPHVIZ_LIBS@ 22 | unittest_SOURCES = main.c \ 23 | test_ASTIndexNameNode.c \ 24 | test_charBuffer.c \ 25 | test_cvodeData.c \ 26 | test_cvodeSolver.c \ 27 | test_daeSolver.c \ 28 | test_integratorInstance.c \ 29 | test_integratorSettings.c \ 30 | test_interpol.c \ 31 | test_modelSimplify.c \ 32 | test_nullSolver.c \ 33 | test_odeConstruct.c \ 34 | test_odeModel.c \ 35 | test_odeSolver.c \ 36 | test_processAST.c \ 37 | test_sbml.c \ 38 | test_sbmlResults.c \ 39 | test_sensSolver.c \ 40 | test_solverError.c \ 41 | test_util.c 42 | -------------------------------------------------------------------------------- /unittest/main.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | #include "unittest.h" 3 | 4 | static Suite *create_root_suite(void) 5 | { 6 | return suite_create("root"); 7 | } 8 | 9 | int main(void) 10 | { 11 | SRunner *sr; 12 | int n; 13 | 14 | sr = srunner_create(create_root_suite()); 15 | if (!sr) return EXIT_FAILURE; 16 | 17 | srunner_add_suite(sr, create_suite_ASTIndexNameNode()); 18 | srunner_add_suite(sr, create_suite_charBuffer()); 19 | srunner_add_suite(sr, create_suite_cvodeData()); 20 | srunner_add_suite(sr, create_suite_cvodeSolver()); 21 | srunner_add_suite(sr, create_suite_daeSolver()); 22 | srunner_add_suite(sr, create_suite_integratorInstance()); 23 | srunner_add_suite(sr, create_suite_integratorSettings()); 24 | srunner_add_suite(sr, create_suite_interpol()); 25 | srunner_add_suite(sr, create_suite_modelSimplify()); 26 | srunner_add_suite(sr, create_suite_nullSolver()); 27 | srunner_add_suite(sr, create_suite_odeConstruct()); 28 | srunner_add_suite(sr, create_suite_odeModel()); 29 | srunner_add_suite(sr, create_suite_odeSolver()); 30 | srunner_add_suite(sr, create_suite_processAST()); 31 | srunner_add_suite(sr, create_suite_sbml()); 32 | srunner_add_suite(sr, create_suite_sbmlResults()); 33 | srunner_add_suite(sr, create_suite_sensSolver()); 34 | srunner_add_suite(sr, create_suite_solverError()); 35 | srunner_add_suite(sr, create_suite_util()); 36 | 37 | srunner_run_all(sr, CK_ENV); 38 | n = srunner_ntests_failed(sr); 39 | srunner_free(sr); 40 | return (n == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 41 | } 42 | -------------------------------------------------------------------------------- /unittest/test_ASTIndexNameNode.c: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | #include "unittest.h" 3 | 4 | #include 5 | 6 | /* test cases */ 7 | START_TEST(test_ASTNode_createIndexName) 8 | { 9 | ASTNode_t *node; 10 | 11 | node = ASTNode_createIndexName(); 12 | ck_assert(node != NULL); 13 | ck_assert(ASTNode_isIndexName(node)); 14 | ASTNode_free(node); 15 | } 16 | END_TEST 17 | 18 | START_TEST(test_ASTNode_setIndex) 19 | { 20 | ASTNode_t *node; 21 | unsigned int i; 22 | 23 | node = ASTNode_createIndexName(); 24 | ck_assert(node != NULL); 25 | i = ASTNode_getIndex(node); 26 | ck_assert(i == 0); 27 | ck_assert(!ASTNode_isSetIndex(node)); 28 | ASTNode_setIndex(node, 100); 29 | i = ASTNode_getIndex(node); 30 | ck_assert(i == 100); 31 | ck_assert(ASTNode_isSetIndex(node)); 32 | ASTNode_free(node); 33 | } 34 | END_TEST 35 | 36 | START_TEST(test_ASTNode_setData) 37 | { 38 | ASTNode_t *node; 39 | unsigned int i; 40 | 41 | node = ASTNode_createIndexName(); 42 | ck_assert(node != NULL); 43 | i = ASTNode_isSetData(node); 44 | ck_assert(i == 0); 45 | ASTNode_setData(node); 46 | i = ASTNode_isSetData(node); 47 | ck_assert(i == 1); 48 | ASTNode_free(node); 49 | } 50 | END_TEST 51 | 52 | /* public */ 53 | Suite *create_suite_ASTIndexNameNode(void) 54 | { 55 | Suite *s; 56 | TCase *tc_ASTNode_createIndexName; 57 | TCase *tc_ASTNode_setIndex; 58 | TCase *tc_ASTNode_setData; 59 | 60 | s = suite_create("ASTIndexNameNode"); 61 | 62 | tc_ASTNode_createIndexName = tcase_create("ASTNode_createIndexName"); 63 | tcase_add_test(tc_ASTNode_createIndexName, test_ASTNode_createIndexName); 64 | suite_add_tcase(s, tc_ASTNode_createIndexName); 65 | 66 | tc_ASTNode_setIndex = tcase_create("ASTNode_setIndex"); 67 | tcase_add_test(tc_ASTNode_setIndex, test_ASTNode_setIndex); 68 | suite_add_tcase(s, tc_ASTNode_setIndex); 69 | 70 | tc_ASTNode_setData = tcase_create("ASTNode_setData"); 71 | tcase_add_test(tc_ASTNode_setData, test_ASTNode_setData); 72 | suite_add_tcase(s, tc_ASTNode_setData); 73 | 74 | return s; 75 | } 76 | -------------------------------------------------------------------------------- /unittest/unittest.h: -------------------------------------------------------------------------------- 1 | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | #ifndef UNITTEST_UNITTEST_H_ 3 | #define UNITTEST_UNITTEST_H_ 4 | 5 | #ifdef HAVE_CONFIG_H 6 | #include "config.h" 7 | #endif 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include 18 | 19 | #define EXAMPLES_FILENAME0(dirname, basename) (#dirname "/" basename) 20 | #define EXAMPLES_FILENAME1(dirname, basename) EXAMPLES_FILENAME0(dirname, basename) 21 | #define EXAMPLES_FILENAME(basename) EXAMPLES_FILENAME1(EXAMPLES, basename) 22 | 23 | #define CHECK_PARAMETER(m, i, expected) do { \ 24 | Parameter_t *p = Model_getParameter((m), (i)); \ 25 | ck_assert(p != NULL); \ 26 | ck_assert_str_eq(Parameter_getId(p), (expected)); \ 27 | } while (0) 28 | 29 | #define CHECK_REACTION(m, i, id, formula) do { \ 30 | Reaction_t *r; \ 31 | KineticLaw_t *k; \ 32 | r = Model_getReaction((m), (i)); \ 33 | ck_assert(r != NULL); \ 34 | ck_assert_str_eq(Reaction_getId(r), (id)); \ 35 | k = Reaction_getKineticLaw(r); \ 36 | ck_assert(k != NULL); \ 37 | ck_assert_str_eq(KineticLaw_getFormula(k), (formula)); \ 38 | } while (0) 39 | 40 | #define CHECK_RULE(m, i, expected) do { \ 41 | Rule_t *r = Model_getRule((m), (i)); \ 42 | ck_assert(r != NULL); \ 43 | ck_assert_str_eq(Rule_getFormula(r), (expected)); \ 44 | } while (0) 45 | 46 | #define CHECK_DOUBLE_WITH_TOLERANCE(d, expected) ck_assert(fabs((d) - (expected)) <= DBL_EPSILON) 47 | 48 | #define OPEN_TMPFILE_OR_ABORT(fp) do { \ 49 | (fp) = tmpfile(); \ 50 | if (!(fp)) ck_abort_msg("could not open a temporary file"); \ 51 | } while (0) 52 | 53 | Suite *create_suite_ASTIndexNameNode(void); 54 | Suite *create_suite_charBuffer(void); 55 | Suite *create_suite_cvodeData(void); 56 | Suite *create_suite_cvodeSolver(void); 57 | Suite *create_suite_daeSolver(void); 58 | Suite *create_suite_integratorInstance(void); 59 | Suite *create_suite_integratorSettings(void); 60 | Suite *create_suite_interpol(void); 61 | Suite *create_suite_modelSimplify(void); 62 | Suite *create_suite_nullSolver(void); 63 | Suite *create_suite_odeConstruct(void); 64 | Suite *create_suite_odeModel(void); 65 | Suite *create_suite_odeSolver(void); 66 | Suite *create_suite_processAST(void); 67 | Suite *create_suite_sbml(void); 68 | Suite *create_suite_sbmlResults(void); 69 | Suite *create_suite_sensSolver(void); 70 | Suite *create_suite_solverError(void); 71 | Suite *create_suite_util(void); 72 | 73 | #endif 74 | --------------------------------------------------------------------------------