copasi API  0.1
copasi/copasi_api.h
Go to the documentation of this file.
00001 #ifndef COPASI_SIMPLE_C_API
00002 #define COPASI_SIMPLE_C_API
00003 
00004 /*
00005 This is a C API for the COPASI C++ library. Rate equations in COPASI require the "complete name",   
00006 e.g. instead of X, the rate must specify <model.compartment.X>. In this C API, those complete names
00007 are stored in a hash table. The API replaces the simple strings, i.e. "C", with the complete names by
00008 using the hash-table. This is mainly for speed; otherwise, every cSetReactionRate would be searching
00009 through the entire model for each of its variables. The hash-table idea is used for functions such
00010 as cSetValue, which can set the value of a parameter or that of a molecular species. Again, it uses the
00011 hash table to identify what a variable is. 
00012 
00013 The C API hides the C++ classes by casting some of the main classes into void pointers inside
00014 C structs. 
00015 
00016 QtCore is used for providing the hash-table feature and regular expression (QHash and QRegExp). This
00017 should be replaced with the boost library at some point. 
00018 */
00019 
00020 #include "TC_structs.h"
00021 
00023 typedef struct  
00024 { 
00025         void * CopasiModelPtr;
00026         void * CopasiDataModelPtr;
00027         void * qHash;
00028         char * errorMessage; 
00029 } copasi_model;
00030 
00032 typedef struct  
00033 {
00034         void * CopasiReactionPtr;
00035         void * CopasiModelPtr;
00036         void * qHash; 
00037 } copasi_reaction;
00038 
00040 typedef struct  
00041 {
00042         void * CopasiCompartmentPtr;
00043         void * CopasiModelPtr; 
00044         void * qHash; 
00045 } copasi_compartment;
00046 
00047 BEGIN_C_DECLS
00048 
00053 //TCAPIEXPORT void copasi_init();
00058 TCAPIEXPORT void copasi_end();
00065 TCAPIEXPORT copasi_model cCreateModel(const char * name);
00070 TCAPIEXPORT void cRemoveModel(copasi_model);
00075 //TCAPIEXPORT void clearCopasiModel(copasi_model);
00082 TCAPIEXPORT void cCompileModel(copasi_model model, int substitute_nested_assignments);
00089 TCAPIEXPORT copasi_model cReadAntimonyFile(const char * filename);
00096 TCAPIEXPORT copasi_model cReadSBMLFile(const char * filename);
00103 TCAPIEXPORT copasi_model cReadSBMLString(const char * sbml);
00110 TCAPIEXPORT void cWriteSBMLFile(copasi_model model, const char * filename);
00119 TCAPIEXPORT tc_matrix cGetScaledFluxControlCoeffs(copasi_model model);
00127 TCAPIEXPORT copasi_compartment cCreateCompartment(copasi_model model, const char* name, double volume);
00135 TCAPIEXPORT void cSetVolume(copasi_model, const char * compartment, double volume);
00146 TCAPIEXPORT int cSetValue(copasi_model, const char * name, double value);
00147 
00155 TCAPIEXPORT void cCreateSpecies(copasi_compartment compartment, const char* name, double initialValue);
00156 
00164 TCAPIEXPORT void cSetBoundarySpecies(copasi_model model, const char * species, int isBoundary);
00172 TCAPIEXPORT void cSetConcentration(copasi_model, const char * species, double value);
00181 TCAPIEXPORT int cSetAssignmentRule(copasi_model model, const char * species, const char * formula);
00182 
00191 TCAPIEXPORT int cSetGlobalParameter(copasi_model model, const char * name, double value);
00192 
00201 TCAPIEXPORT int cCreateVariable(copasi_model model, const char * name, const char * formula);
00202 
00213 TCAPIEXPORT int cCreateEvent(copasi_model model, const char * name, const char * trigger, const char * variable, const char * formula);
00214 
00222 TCAPIEXPORT copasi_reaction cCreateReaction(copasi_model model, const char* name);
00230 TCAPIEXPORT void cAddReactant(copasi_reaction reaction, const char * species, double stoichiometry);
00238 TCAPIEXPORT void cAddProduct(copasi_reaction reaction, const char * species, double stoichiometry);
00246 TCAPIEXPORT int cSetReactionRate(copasi_reaction reaction, const char * formula);
00247 
00257 TCAPIEXPORT tc_matrix cSimulateDeterministic(copasi_model model, double startTime, double endTime, int numSteps);
00267 TCAPIEXPORT tc_matrix cSimulateStochastic(copasi_model model, double startTime, double endTime, int numSteps);
00277 TCAPIEXPORT tc_matrix cSimulateHybrid(copasi_model model, double startTime, double endTime, int numSteps);
00287 TCAPIEXPORT tc_matrix cSimulateTauLeap(copasi_model model, double startTime, double endTime, int numSteps);
00288 
00295 TCAPIEXPORT tc_matrix cGetSteadyState(copasi_model model);
00303 TCAPIEXPORT tc_matrix cGetSteadyState2(copasi_model model, int iter);
00304 
00311 TCAPIEXPORT tc_matrix cGetJacobian(copasi_model model);
00318 TCAPIEXPORT tc_matrix cGetEigenvalues(copasi_model model);
00319 
00326 TCAPIEXPORT tc_matrix cGetUnscaledElasticities(copasi_model model);
00327 
00334 TCAPIEXPORT tc_matrix cGetUnscaledConcentrationControlCoeffs(copasi_model model);
00335 
00342 TCAPIEXPORT tc_matrix cGetUnscaledFluxControlCoeffs(copasi_model model);
00343 
00350 TCAPIEXPORT tc_matrix cGetScaledElasticities(copasi_model model);
00351 
00358 TCAPIEXPORT tc_matrix cGetScaledConcentrationConcentrationCoeffs(copasi_model model);
00359 
00366 TCAPIEXPORT tc_matrix cGetScaledFluxControlCoeffs(copasi_model model);
00367 
00374 TCAPIEXPORT tc_matrix cGetFullStoichiometryMatrix(copasi_model model);
00375 
00382 TCAPIEXPORT tc_matrix cGetReducedStoichiometryMatrix(copasi_model model);
00383 
00390 TCAPIEXPORT tc_matrix cGetElementaryFluxModes(copasi_model model);
00391 
00398 TCAPIEXPORT tc_matrix cGetGammaMatrix(copasi_model model);
00399 
00406 TCAPIEXPORT tc_matrix cGetKMatrix(copasi_model model);
00407 
00414 TCAPIEXPORT tc_matrix cGetK0Matrix(copasi_model model);
00415 
00422 TCAPIEXPORT tc_matrix cGetLinkMatrix(copasi_model model);
00423 
00430 TCAPIEXPORT tc_matrix cGetL0Matrix(copasi_model model);
00431 
00432 
00441 //TCAPIEXPORT void cFitModelToData(copasi_model model, const char * filename, tc_matrix params, const char * method);
00442 
00450 TCAPIEXPORT tc_matrix cOptimize(copasi_model model, const char * objective, tc_matrix input);
00451 
00452 TCAPIEXPORT void cSetOptimizerIterations(int);
00453 
00454 TCAPIEXPORT void cSetOptimizerSize(int);
00455 
00456 TCAPIEXPORT void cSetOptimizerMutationRate(double);
00457 
00458 TCAPIEXPORT void cSetOptimizerCrossoverRate(double);
00459 
00460 END_C_DECLS
00461 #endif
00462 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines