roadrunner
2.6.0
Fast simulator for SBML models
|
stores the names of all the symbols in the sbml model and thier indexes in the ModelData arrays. More...
#include <LLVMModelDataSymbols.h>
Classes | |
struct | SpeciesReferenceInfo |
info about an entry in the stoich matrix. More... | |
Public Types | |
enum | SpeciesReferenceType { Reactant , Product , Modifier , MultiReactantProduct } |
enum | SymbolIndexType { FLOATING_SPECIES , BOUNDARY_SPECIES , COMPARTMENT , GLOBAL_PARAMETER , REACTION , EVENT , STOICHIOMETRY , INVALID_SYMBOL } |
The model frequently looks for indices to sbml symbols. More... | |
typedef std::map< std::string, uint > | StringUIntMap |
typedef std::map< std::string, std::vector< uint > > | StringUIntVectorMap |
typedef std::pair< std::string, uint > | StringUIntPair |
typedef std::unordered_map< uint, uint > | UIntUIntMap |
Public Member Functions | |
LLVMModelDataSymbols (libsbml::Model const *model, unsigned options) | |
LLVMModelDataSymbols (std::istream &in) | |
const std::string & | getModelName () const |
int | getCompartmentIndex (std::string const &) const |
SymbolIndexType | getSymbolIndex (const std::string &name, int &result) const |
checks to see if we have the given symbol in the sbml. More... | |
int | getFloatingSpeciesIndex (std::string const &id, bool requireIndependent=true) const |
Get the index of a floating species. More... | |
int | getBoundarySpeciesIndex (std::string const &id) const |
Get the index of a boundary species. More... | |
size_t | getIndependentBoundarySpeciesSize () const |
number of boundary species not defined by rules. | |
size_t | getIndependentFloatingSpeciesSize () const |
number of fully indenpendent species, these are species that have thier dynamics fully determined by the reaction rates / stoichiometric matrix – these DO NOT have any rules determining their dynamics. More... | |
int | getGlobalParameterIndex (std::string const &) const |
index of a global param given its name. More... | |
int | getRateRuleIndex (std::string const &) const |
size_t | getRateRuleSize () const |
std::string | getRateRuleId (size_t indx) const |
get the symbolic id of the i'th rate rule | |
size_t | getIndependentGlobalParameterSize () const |
number of global parameters which are not determined by rules. | |
int | getReactionIndex (std::string const &) const |
std::vector< std::string > | getReactionIds () const |
size_t | getReactionSize () const |
int | getStoichiometryIndex (std::string const &) const |
int | getStoichiometryIndex (const std::string &, const std::string &) const |
std::vector< std::string > | getStoichiometryIds () const |
size_t | getStoichiometrySize () const |
std::vector< std::string > | getGlobalParameterIds () const |
bool | isRateRuleGlobalParameter (uint gid) const |
is the global parameter index defined by a rate rule. | |
std::vector< std::string > | getFloatingSpeciesIds () const |
the list that is returned by ExecutableModel, so order must remain constant. | |
std::string | getFloatingSpeciesId (size_t indx) const |
get the symbolic id of the i'th floating species. | |
std::string | getBoundarySpeciesId (size_t indx) const |
get the symbolic id of the i'th boundary species. | |
std::string | getCompartmentId (size_t indx) const |
get the symbolic id of the i'th compartment. | |
std::string | getGlobalParameterId (size_t indx) const |
find the id of the given global parameter index. | |
size_t | getFloatingSpeciesSize () const |
total size of all floating species. | |
size_t | getBoundarySpeciesSize () const |
size_t | getCompartmentsSize () const |
size_t | getGlobalParametersSize () const |
std::vector< std::string > | getCompartmentIds () const |
size_t | getIndependentCompartmentSize () const |
number of compartments which are not determined by rules. | |
std::vector< std::string > | getBoundarySpeciesIds () const |
std::list< SpeciesReferenceInfo > | getStoichiometryList () const |
get a list of all the non-zero entries in the stoichiometry matrix. More... | |
void | print () const |
initialize and allocate the buffers (including the stoich matrix) for an existing ModelData struct. | |
bool | isIndependentElement (const std::string &id) const |
if there are no rules for an element, then they are considered independent. More... | |
bool | hasRateRule (const std::string &id) const |
bool | hasAssignmentRule (const std::string &id) const |
bool | hasInitialAssignmentRule (const std::string &id) const |
bool | isIndependentFloatingSpecies (const std::string &id) const |
bool | isIndependentBoundarySpecies (const std::string &id) const |
bool | isBoundarySpecies (const std::string &id) const |
bool | isIndependentGlobalParameter (const std::string &id) const |
bool | isIndependentCompartment (const std::string &id) const |
bool | isNamedSpeciesReference (const std::string &id) const |
const SpeciesReferenceInfo & | getNamedSpeciesReferenceInfo (const std::string &id) |
bool | isConservedMoietySpecies (const std::string &symbol) const |
checks if the given symbol is a init value for a conserved species. More... | |
bool | isConservedMoietySpecies (uint id, uint &result) const |
checks if the given floating species id corresponds to to a conserved moiety species. More... | |
bool | isConservedMoietyParameter (uint id) const |
check if the global parameter with the given id is a conserved moiety. | |
size_t | getConservedMoietySize () const |
get the number of conserved moieties. | |
int | getDepSpeciesIndexForConservedMoietyId (std::string id) const |
get the dependent species for a given conserved moiety id | |
const std::vector< uint > & | getIndSpeciesIndexForConservedMoietyId (std::string id) const |
get all the independent species for a given conserved moiety id | |
int | getConservedMoietyGlobalParameterIndex (uint cmIndex) const |
get the index of a global parameter given a conserved moiety index. | |
std::string | getConservedMoietyId (size_t indx) const |
find the id of the given conserved moiety index. | |
int | getConservedMoietyIndex (const std::string &name) const |
get the id of a conserved moiety given its name. | |
bool | isConservedMoietyAnalysis () const |
check if the conserved moiety is turned on for this model | |
const std::vector< unsigned char > & | getEventAttributes () const |
size_t | getEventBufferSize (size_t eventId) const |
get the size (in number of doubles) of the buffer that events need to save the event data to. | |
const std::vector< uint > & | getStoichRowIndx () const |
the row indices of non-zero stoichiometry values | |
const std::vector< uint > & | getStoichColIndx () const |
the column indices of non-zero stoichiometry values | |
bool | isIndependentInitFloatingSpecies (const std::string &symbol) const |
checks if the given symbol is an init value for an independent floating species. More... | |
bool | isIndependentInitBoundarySpecies (const std::string &symbol) const |
checks if the given symbol is an init value for an independent boundary species. More... | |
bool | isIndependentInitElement (const std::string &symbol) const |
Is this sbml element an independent initial value. More... | |
bool | isIndependentInitCompartment (const std::string &symbol) const |
bool | isIndependentInitGlobalParameter (const std::string &symbol) const |
has this std::string been found to be an independent init global param– is a global param and not having an assignment or init assignment rule. | |
bool | isIndependentInitGlobalParameter (size_t id) const |
is this global parameter id an independent init param – a global param without an init assignment rule. | |
int | getFloatingSpeciesInitIndex (const std::string &symbol) const |
get the index of a floating species initial value. More... | |
int | getBoundarySpeciesInitIndex (const std::string &symbol) const |
get the index of a boundary species initial value. More... | |
int | getCompartmentInitIndex (const std::string &symbol) const |
get the index of a compartment initial value More... | |
int | getCompartmentIndexForFloatingSpecies (size_t floatIndex) const |
get the index of a compartment for a float species. | |
int | getCompartmentIndexForBoundarySpecies (size_t floatIndex) const |
get the index of a compartment for a boundary species. | |
int | getGlobalParameterInitIndex (const std::string &symbol) const |
get the index of a global parameter initial value More... | |
size_t | getInitCompartmentSize () const |
size_t | getInitFloatingSpeciesSize () const |
size_t | getInitBoundarySpeciesSize () const |
size_t | getInitGlobalParameterSize () const |
std::vector< std::string > | getEventIds () const |
std::vector< std::string > | getAssignmentRuleIds () const |
std::vector< std::string > | getRateRuleIds () const |
std::vector< std::string > | getInitialAssignmentIds () const |
std::string | getEventId (size_t indx) const |
int | getEventIndex (const std::string &id) const |
void | saveState (std::ostream &) const |
void | loadState (std::istream &) |
Static Public Member Functions | |
static const char * | getFieldName (ModelDataFields field) |
get the textual form of the field names. | |
stores the names of all the symbols in the sbml model and thier indexes in the ModelData arrays.
This class essentially maps symbol names into ModelData indexes.
The logic behind splitting up LLVMModelDataSymbols and LLVMModelSymbols is that LLVMModelSymbols contains all the ASTs from the model, and this contains only ModelData indices – once the all the model functions are generated, there is no need to keep AST information around, but we still need to know what symbol is at what index for the various Model accessor functions.
The model frequently looks for indices to sbml symbols.
This is a list of the types of sbml symbols that this class keeps track of.
int rrllvm::LLVMModelDataSymbols::getBoundarySpeciesIndex | ( | std::string const & | id | ) | const |
Get the index of a boundary species.
id | the id of the species to retrieve. |
int rrllvm::LLVMModelDataSymbols::getBoundarySpeciesInitIndex | ( | const std::string & | symbol | ) | const |
get the index of a boundary species initial value.
has the same index as the run time boundary species.
int rrllvm::LLVMModelDataSymbols::getCompartmentInitIndex | ( | const std::string & | symbol | ) | const |
get the index of a compartment initial value
has the same index as the run time compartment.
int rrllvm::LLVMModelDataSymbols::getFloatingSpeciesIndex | ( | std::string const & | id, |
bool | requireIndependent = true |
||
) | const |
Get the index of a floating species.
id | the id of the species to retrieve. |
requireIndependent | if true, the float species must be independent – not defined by a rule. |
int rrllvm::LLVMModelDataSymbols::getFloatingSpeciesInitIndex | ( | const std::string & | symbol | ) | const |
get the index of a floating species initial value.
has the same index as the run time floating species.
int rrllvm::LLVMModelDataSymbols::getGlobalParameterIndex | ( | std::string const & | id | ) | const |
index of a global param given its name.
exception | if invalid name. |
int rrllvm::LLVMModelDataSymbols::getGlobalParameterInitIndex | ( | const std::string & | symbol | ) | const |
get the index of a global parameter initial value
has the same index as the run time global parameter.
size_t rrllvm::LLVMModelDataSymbols::getIndependentFloatingSpeciesSize | ( | ) | const |
number of fully indenpendent species, these are species that have thier dynamics fully determined by the reaction rates / stoichiometric matrix – these DO NOT have any rules determining their dynamics.
This is size of the allocated array in the ModelData struct.
std::list< LLVMModelDataSymbols::SpeciesReferenceInfo > rrllvm::LLVMModelDataSymbols::getStoichiometryList | ( | ) | const |
get a list of all the non-zero entries in the stoichiometry matrix.
in the list of pairs, first is the row (species) index, and second is the column (reaction) index.
LLVMModelDataSymbols::SymbolIndexType rrllvm::LLVMModelDataSymbols::getSymbolIndex | ( | const std::string & | name, |
int & | result | ||
) | const |
checks to see if we have the given symbol in the sbml.
name | the name of the sbml symbol to look up. |
result | if successfull, this is set to the index |
bool rrllvm::LLVMModelDataSymbols::isConservedMoietySpecies | ( | const std::string & | symbol | ) | const |
checks if the given symbol is a init value for a conserved species.
Global parameters or floating species can be conservied moieties,
a global parameter is a CM if it is defined by a inital assignment rules as a linear of one CM species and a set of indepdent floating species.
A floating species may be a CM if it is defined by a rule as a linear combination of independent species.
If a floating species is a CM, then it must by definition be a dependent floating species.
It can however have independent initial conditions defined either by intial values or initial assignment rules.
bool rrllvm::LLVMModelDataSymbols::isConservedMoietySpecies | ( | uint | id, |
uint & | result | ||
) | const |
checks if the given floating species id corresponds to to a conserved moiety species.
id | index of floating species | |
[out] | result | the index of the conserved moiety if this is a conserved moiety species. |
bool rrllvm::LLVMModelDataSymbols::isIndependentElement | ( | const std::string & | id | ) | const |
if there are no rules for an element, then they are considered independent.
These are only for elements, not init values, will return false for all init symbols.
Only valid after class has been constructed.
bool rrllvm::LLVMModelDataSymbols::isIndependentInitBoundarySpecies | ( | const std::string & | symbol | ) | const |
checks if the given symbol is an init value for an independent boundary species.
Conserved Moiety species are considered to have independent initial condtions as in this case, the assignment rule only applies at time t > 0.
bool rrllvm::LLVMModelDataSymbols::isIndependentInitElement | ( | const std::string & | symbol | ) | const |
Is this sbml element an independent initial value.
True if this value does NOT have an assignment or initial assignment rule.
Independent initial values do not have assignment or initial assigment rules, but may have rate rules.
bool rrllvm::LLVMModelDataSymbols::isIndependentInitFloatingSpecies | ( | const std::string & | symbol | ) | const |
checks if the given symbol is an init value for an independent floating species.
Conserved Moiety species are considered to have independent initial condtions as in this case, the assignment rule only applies at time t > 0.