sbml2matlab  1.01
SBML to MATLAB translator
 All Classes Files Functions
NOM/NOM.h
Go to the documentation of this file.
00001 
00009 /* C API to libSBML that implements the original NOM API
00010 *
00011 * SBW defined a simplified SBML API. This project provides the same API in the form
00012 * of a DLL than can be used from a variety of programming languages. 
00013 *
00014 * Copyright 2007-2011 SBW Team http://sys-bio.org/
00015 *
00016 * Organization: University of Washington
00017 *
00018 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 
00019 * and associated documentation files (the "Software"), to deal in the Software without restriction, 
00020 * including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 
00021 * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to 
00022 * do so, subject to the following conditions:
00023 * 
00024 * The above copyright notice and this permission notice shall be included in all copies or 
00025 * substantial portions of the Software.
00026 * 
00027 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT 
00028 * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
00029 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 
00030 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
00031 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00032 */
00033 
00034 #ifndef SBML_SUPPORT_H
00035 #define SBML_SUPPORT_H
00036 
00037 #include <stdio.h>
00038 #include <stdlib.h>
00039 #include <cstring>
00040 
00041 #ifdef WIN32
00042 #define DLL_EXPORT __declspec(dllexport)
00043 #else
00044 #define DLL_EXPORT
00045 #endif
00046 
00047 //#define WIN32_LEAN_AND_MEAN
00048 #undef SEVERITY_ERROR
00049 
00050 #include "sbml/SBMLTypes.h"
00051 #include "sbml/math/ASTNode.h"
00052 
00053 #define BUFFER_SIZE 1024
00054 #define FUNCDATAROWS 44
00055 #define FUNCDATACOLS 16
00056 
00057 #define GET_ID_IF_POSSIBLE(x) (x->isSetId() ?  x->getId() :  x->getName() )
00058 
00059 #define GET_NAME_IF_POSSIBLE(x) (x->isSetName() ?  x->getName() :  x->getId() )
00060 
00061 #include <string>
00062 #include <vector>
00063 using namespace std;
00064 
00065 
00066 
00067 extern "C" {
00068 
00073         DLL_EXPORT char *getError ();
00074 
00075 
00081         DLL_EXPORT int loadSBML(char* sbmlStr);
00082 
00083 
00088         DLL_EXPORT int getNumErrors();
00089 
00090 
00101         DLL_EXPORT int getNthError (int index, int *line, int *column, int *errorId, char **errorType, char **errorMsg);
00102 
00103 
00108         DLL_EXPORT int validateSBML(char *cSBML);
00109 
00110 
00118         DLL_EXPORT int hasInitialAmount (char *sId, bool *isInitialAmount);
00119 
00120 
00128         DLL_EXPORT int hasInitialConcentration (char *cId, int *hasInitial);
00129 
00130 
00137         DLL_EXPORT int getValue (char *sId, double *value);
00138 
00139 
00146         DLL_EXPORT int setValue (char *sId, double dValue);
00147 
00148 
00154         DLL_EXPORT int validate(char *sbmlStr);
00155 
00156 
00162         DLL_EXPORT int getModelName (char **name);
00163 
00164 
00170         DLL_EXPORT int getModelId (char **sId);
00171 
00172 
00178         DLL_EXPORT int setModelId (char *cId);
00179 
00180 
00185         DLL_EXPORT int getNumFunctionDefinitions();
00186 
00187 
00192         DLL_EXPORT int getNumCompartments();
00193 
00194 
00199         DLL_EXPORT int getNumReactions();
00200 
00201 
00206         DLL_EXPORT int getNumFloatingSpecies();
00207 
00208 
00213         DLL_EXPORT int getNumBoundarySpecies();
00214 
00215 
00220         DLL_EXPORT int getNumGlobalParameters();
00221 
00222 
00229         DLL_EXPORT int getNthGlobalParameterName (int nIndex, char **name);
00230 
00231 
00238         DLL_EXPORT int getNthGlobalParameterId (int nIndex, char **sId);
00239 
00240 
00250         DLL_EXPORT int getNthFunctionDefinition (int index, char** fnId, int *numArgs, char*** argList, char** body);
00251 
00252 
00253 
00260         DLL_EXPORT int getNthCompartmentName (int nIndex, char **name);
00261 
00262 
00269         DLL_EXPORT int getNthCompartmentId (int nIndex, char **sId);
00270 
00271 
00278         DLL_EXPORT int getCompartmentIdBySpeciesId (char *cId, char **compId);
00279 
00286         DLL_EXPORT int getListOfFloatingSpeciesIds (char*** IdList, int *numFloat);
00287 
00288 
00295         DLL_EXPORT int getNthFloatingSpeciesName (int nIndex, char **name);
00296 
00297 
00304         DLL_EXPORT int getNthFloatingSpeciesId (int nIndex, char**sId);
00305 
00312         DLL_EXPORT int getListOfBoundarySpeciesIds (char*** IdList, int *numBoundary);
00313 
00320         DLL_EXPORT int getNthBoundarySpeciesName (int nIndex, char **name);
00321 
00322 
00329         DLL_EXPORT int getNthBoundarySpeciesId (int nIndex, char **sId);
00330 
00331 
00336         DLL_EXPORT int getNumRules();
00337 
00338 
00346         DLL_EXPORT int getNthRule (int nIndex, char **rule, int *ruleType);
00347 
00348 
00353         DLL_EXPORT int getNumEvents();
00354 
00355 
00362         DLL_EXPORT int getNthReactionName (int nIndex, char **name);
00363 
00364 
00371         DLL_EXPORT int isReactionReversible(int arg, int *isReversible);
00372 
00373 
00380         DLL_EXPORT int getNthReactionId (int nIndex, char **sId);
00381 
00382 
00387         DLL_EXPORT int getNumReactants (int arg);
00388 
00389 
00394         DLL_EXPORT int getNumProducts (int arg);
00395 
00403         DLL_EXPORT int getNthReactantName (int arg1, int arg2, char **name);
00404 
00405 
00413         DLL_EXPORT int getNthProductName (int arg1, int arg2, char **name);
00414 
00415 
00422         DLL_EXPORT int getKineticLaw (int index, char **kineticLaw);
00423 
00424 
00431         DLL_EXPORT int getNthReactantStoichiometry (int arg1, int arg2);
00432 
00439         DLL_EXPORT int getNthProductStoichiometry (int arg1, int arg2);
00440 
00441 
00447         DLL_EXPORT int getNumLocalParameters (int reactionIndex);
00448 
00449 
00457         DLL_EXPORT int getNthLocalParameterName (int reactionIndex, int parameterIndex, char **sId);
00458 
00459 
00467         DLL_EXPORT int getNthLocalParameterId (int reactionIndex, int parameterIndex, char **sId);
00468 
00469 
00477         DLL_EXPORT int getNthLocalParameterValue (int reactionIndex, int parameterIndex, double *value);
00478 
00479 
00486         DLL_EXPORT int getParamPromotedSBML (char *inSBML, char **outSBML);
00487 
00488 
00495         DLL_EXPORT int addMissingModifiers (char *inSBML, char **outSBML);
00496 
00497 
00504         DLL_EXPORT int convertMathMLToString (char *mathMLStr, char **infix);
00505 
00512         DLL_EXPORT int convertStringToMathML (char* infixStr, char **mathMLStr);
00513 
00519         DLL_EXPORT int reorderRules(char **sbml);
00520 
00529         DLL_EXPORT int convertSBML(char *inputModel, char **outputModel, int nLevel, int nVersion);
00530 
00531 }
00532 
00533 #endif
00534