InitialAssignment.cpp File Reference

Detailed Description

Implementation of InitialAssignment and ListOfInitialAssignments.

Author:
Ben Bornstein
Include dependency graph for InitialAssignment.cpp:

Functions

InitialAssignment_t * InitialAssignment_clone (const InitialAssignment_t *ia)
 Copy constructor; creates a copy of this InitialAssignment.
int InitialAssignment_containsUndeclaredUnits (InitialAssignment_t *ia)
 Predicate returning true or false depending on whether the math expression of this InitialAssignment_t contains parameters/numbers with undeclared units.
InitialAssignment_t * InitialAssignment_create (unsigned int level, unsigned int version)
 Creates a new InitialAssignment_t structure using the given SBML level and version values.
InitialAssignment_t * InitialAssignment_createWithNS (SBMLNamespaces_t *sbmlns)
 Creates a new InitialAssignment_t structure using the given SBMLNamespaces_t structure.
void InitialAssignment_free (InitialAssignment_t *ia)
 Frees the given InitialAssignment_t structure.
UnitDefinition_t * InitialAssignment_getDerivedUnitDefinition (InitialAssignment_t *ia)
 Calculates and returns a UnitDefinition_t that expresses the units returned by the math expression of this InitialAssignment_t.
const ASTNode_t * InitialAssignment_getMath (const InitialAssignment_t *ia)
 Get the mathematical formula of this InitialAssignment.
const XMLNamespaces_t * InitialAssignment_getNamespaces (InitialAssignment_t *ia)
 Returns a list of XMLNamespaces_t associated with this InitialAssignment_t structure.
const char * InitialAssignment_getSymbol (const InitialAssignment_t *ia)
 Get the value of the "symbol" attribute of this InitialAssignment.
int InitialAssignment_isSetMath (const InitialAssignment_t *ia)
 Predicate returning true or false depending on whether this InitialAssignment's "math" subelement contains a value.
int InitialAssignment_isSetSymbol (const InitialAssignment_t *ia)
 Predicate returning true or false depending on whether this InitialAssignment's "symbol" attribute is set.
int InitialAssignment_setMath (InitialAssignment_t *ia, const ASTNode_t *math)
 Sets the "math" subelement of this InitialAssignment.
int InitialAssignment_setSymbol (InitialAssignment_t *ia, const char *sid)
 Sets the "symbol" attribute value of this InitialAssignment.
InitialAssignment_t * ListOfInitialAssignments_getById (ListOf_t *lo, const char *sid)
InitialAssignment_t * ListOfInitialAssignments_removeById (ListOf_t *lo, const char *sid)
 Removes item in this ListOf items with the given id or NULL if no such item exists.

Function Documentation

InitialAssignment_t* InitialAssignment_clone ( const InitialAssignment_t *  ia)

Copy constructor; creates a copy of this InitialAssignment.

Parameters:
iathe InitialAssignment_t structure
Returns:
a (deep) copy of the given InitialAssignment_t structure.
int InitialAssignment_containsUndeclaredUnits ( InitialAssignment_t *  ia)

Predicate returning true or false depending on whether the math expression of this InitialAssignment_t contains parameters/numbers with undeclared units.

Returns:
true if the math expression of this InitialAssignment_t includes parameters/numbers with undeclared units, false otherwise.
Note:
a return value of true indicates that the UnitDefinition_t returned by the getDerivedUnitDefinition function may not accurately represent the units of the expression.
See also:
InitialAssignment_getDerivedUnitDefinition()
InitialAssignment_t* InitialAssignment_create ( unsigned int  level,
unsigned int  version 
)

Creates a new InitialAssignment_t structure using the given SBML level and version values.

Parameters:
levelan unsigned int, the SBML Level to assign to this InitialAssignment
versionan unsigned int, the SBML Version to assign to this InitialAssignment
Returns:
a pointer to the newly created InitialAssignment_t structure.
Note:
Once a InitialAssignment has been added to an SBMLDocument, the level and version for the document override those used to create the InitialAssignment. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intended SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument.
InitialAssignment_t* InitialAssignment_createWithNS ( SBMLNamespaces_t *  sbmlns)

Creates a new InitialAssignment_t structure using the given SBMLNamespaces_t structure.

Parameters:
sbmlnsSBMLNamespaces, a pointer to an SBMLNamespaces structure to assign to this InitialAssignment
Returns:
a pointer to the newly created InitialAssignment_t structure.
Note:
Once a InitialAssignment has been added to an SBMLDocument, the sbmlns namespaces for the document override those used to create the InitialAssignment. Despite this, the ability to supply the values at creation time is an important aid to creating valid SBML. Knowledge of the intended SBML Level and Version determine whether it is valid to assign a particular value to an attribute, or whether it is valid to add an object to an existing SBMLDocument.
void InitialAssignment_free ( InitialAssignment_t *  ia)

Frees the given InitialAssignment_t structure.

Parameters:
iathe InitialAssignment_t structure to free.
UnitDefinition_t* InitialAssignment_getDerivedUnitDefinition ( InitialAssignment_t *  ia)

Calculates and returns a UnitDefinition_t that expresses the units returned by the math expression of this InitialAssignment_t.

Returns:
a UnitDefinition_t that expresses the units of the math expression of this InitialAssignment_t.

Note that the functionality that facilitates unit analysis depends on the model as a whole. Thus, in cases where the object has not been added to a model or the model itself is incomplete, unit analysis is not possible and this method will return NULL.

Note:
The units are calculated by applying the mathematics from the expression to the units of the <ci> elements used within the expression. Where there are parameters/numbers with undeclared units the UnitDefinition_t returned by this function may not accurately represent the units of the expression.
See also:
InitialAssignment_containsUndeclaredUnits()
const ASTNode_t* InitialAssignment_getMath ( const InitialAssignment_t *  ia)

Get the mathematical formula of this InitialAssignment.

Parameters:
iathe InitialAssignment_t structure
Returns:
an ASTNode, the value of the "math" subelement of this InitialAssignment
const XMLNamespaces_t* InitialAssignment_getNamespaces ( InitialAssignment_t *  ia)

Returns a list of XMLNamespaces_t associated with this InitialAssignment_t structure.

Parameters:
iathe InitialAssignment_t structure
Returns:
pointer to the XMLNamespaces_t structure associated with this SBML object
const char* InitialAssignment_getSymbol ( const InitialAssignment_t *  ia)

Get the value of the "symbol" attribute of this InitialAssignment.

Parameters:
iathe InitialAssignment_t structure
Returns:
the identifier string stored as the "symbol" attribute value in this InitialAssignment.
int InitialAssignment_isSetMath ( const InitialAssignment_t *  ia)

Predicate returning true or false depending on whether this InitialAssignment's "math" subelement contains a value.

Parameters:
iathe InitialAssignment_t structure
Returns:
nonzero if the "math" for this InitialAssignment is set, zero (0) otherwise.
int InitialAssignment_isSetSymbol ( const InitialAssignment_t *  ia)

Predicate returning true or false depending on whether this InitialAssignment's "symbol" attribute is set.

Parameters:
iathe InitialAssignment_t structure
Returns:
nonzero if the "symbol" attribute of this InitialAssignment is set, zero (0) otherwise.
int InitialAssignment_setMath ( InitialAssignment_t *  ia,
const ASTNode_t *  math 
)

Sets the "math" subelement of this InitialAssignment.

The ASTNode tree passed in math is copied.

Parameters:
iathe InitialAssignment_t structure
mathan ASTNode tree containing the mathematical expression to be used as the formula for this InitialAssignment.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_OBJECT
int InitialAssignment_setSymbol ( InitialAssignment_t *  ia,
const char *  sid 
)

Sets the "symbol" attribute value of this InitialAssignment.

Parameters:
iathe InitialAssignment_t structure
sid,theidentifier of a Species, Compartment or Parameter object defined elsewhere in this Model.
Returns:
integer value indicating success/failure of the function. The value is drawn from the enumeration #OperationReturnValues_t.The possible values returned by this function are:
  • LIBSBML_OPERATION_SUCCESS
  • LIBSBML_INVALID_ATTRIBUTE_VALUE
Note:
Using this function with an id of NULL is equivalent to unsetting the "symbol" attribute.
InitialAssignment_t* ListOfInitialAssignments_getById ( ListOf_t *  lo,
const char *  sid 
)
Returns:
item in this ListOfInitialAssignment with the given id or NULL if no such item exists.
InitialAssignment_t* ListOfInitialAssignments_removeById ( ListOf_t *  lo,
const char *  sid 
)

Removes item in this ListOf items with the given id or NULL if no such item exists.

The caller owns the returned item and is responsible for deleting it.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines