Unit.h File Reference

Detailed Description

Definitions of Unit and ListOfUnits.

Author:
Ben Bornstein
Include dependency graph for Unit.h:
This graph shows which files directly or indirectly include this file:

Functions

int Unit_areEquivalent (Unit_t *unit1, Unit_t *unit2)
int Unit_areIdentical (Unit_t *unit1, Unit_t *unit2)
Unit_t * Unit_clone (const Unit_t *c)
 Creates a deep copy of the given Unit_t structure.
UnitDefinition_t * Unit_convertToSI (Unit_t *unit)
Unit_t * Unit_create (unsigned int level, unsigned int version)
 Creates a new Unit_t structure using the given SBML level and version values.
Unit_t * Unit_createWithNS (SBMLNamespaces_t *sbmlns)
 Creates a new Unit_t structure using the given SBMLNamespaces_t structure.
void Unit_free (Unit_t *u)
 Frees the given Unit_t structure.
int Unit_getExponent (const Unit_t *u)
 Returns the value of the "exponent" attribute of the given Unit_t structure u.
double Unit_getExponentAsDouble (const Unit_t *u)
 Returns the value of the "exponent" attribute of the given Unit_t structure u.
UnitKind_t Unit_getKind (const Unit_t *u)
 Returns the "kind" attribute value of the given unit u.
double Unit_getMultiplier (const Unit_t *u)
 Returns the value of the "multiplier" attribute of the given Unit_t structure u.
const XMLNamespaces_t * Unit_getNamespaces (Unit_t *c)
 Returns a list of XMLNamespaces_t associated with this Unit_t structure.
double Unit_getOffset (const Unit_t *u)
 Returns the value of the "offset" attribute of the given Unit_t structure u.
int Unit_getScale (const Unit_t *u)
 Returns the value of the "scale" attribute of the given Unit_t structure u.
int Unit_hasRequiredAttributes (Unit_t *u)
 Predicate returning true or false depending on whether all the required attributes for this Unit object have been set.
void Unit_initDefaults (Unit_t *u)
 Initializes the attributes of this Unit (except for "kind") to their defaults values.
int Unit_isAmpere (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind ampere.
int Unit_isBecquerel (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind becquerel.
int Unit_isBuiltIn (const char *name, unsigned int level)
 Predicate to test whether a given string is the name of a built-in SBML unit.
int Unit_isCandela (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind candela.
int Unit_isCelsius (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind Celsius.
int Unit_isCoulomb (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind coulomb.
int Unit_isDimensionless (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind dimensionless.
int Unit_isFarad (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind farad.
int Unit_isGram (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind gram.
int Unit_isGray (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind gray.
int Unit_isHenry (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind henry.
int Unit_isHertz (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind hertz.
int Unit_isItem (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind item.
int Unit_isJoule (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind joule.
int Unit_isKatal (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind katal.
int Unit_isKelvin (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind kelvin.
int Unit_isKilogram (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind kilogram.
int Unit_isLitre (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind litre or liter.
int Unit_isLumen (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind lumen.
int Unit_isLux (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind lux.
int Unit_isMetre (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind metre or meter.
int Unit_isMole (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind mole.
int Unit_isNewton (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind newton.
int Unit_isOhm (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind ohm.
int Unit_isPascal (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind pascal.
int Unit_isRadian (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind radian.
int Unit_isSecond (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind second.
int Unit_isSetExponent (const Unit_t *u)
 Predicate to test whether the "exponent" attribute of the given Unit_t structure u is set.
int Unit_isSetKind (const Unit_t *u)
 Predicate to test whether the "kind" attribute of the given Unit_t structure u is set.
int Unit_isSetMultiplier (const Unit_t *u)
 Predicate to test whether the "multiplier" attribute of the given Unit_t structure u is set.
int Unit_isSetScale (const Unit_t *u)
 Predicate to test whether the "scale" attribute of the given Unit_t structure u is set.
int Unit_isSiemens (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind siemens.
int Unit_isSievert (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind sievert.
int Unit_isSteradian (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind steradian.
int Unit_isTesla (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind tesla.
int Unit_isVolt (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind volt.
int Unit_isWatt (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind watt.
int Unit_isWeber (const Unit_t *u)
 Predicate for testing whether the given Unit_t structure represents a unit of the kind weber.
void Unit_merge (Unit_t *unit1, Unit_t *unit2)
int Unit_removeScale (Unit_t *unit)
int Unit_setExponent (Unit_t *u, int value)
 Sets the "exponent" attribute value of the given Unit_t structure u.
int Unit_setExponentAsDouble (Unit_t *u, double value)
 Sets the "exponent" attribute value of the given Unit_t structure u.
int Unit_setKind (Unit_t *u, UnitKind_t kind)
 Sets the kind of the given Unit_t structure u to the given UnitKind_t value.
int Unit_setMultiplier (Unit_t *u, double value)
 Sets the "multiplier" attribute value of the given Unit_t structure u.
int Unit_setOffset (Unit_t *u, double value)
 Sets the "offset" attribute value of the given Unit_t structure u.
int Unit_setScale (Unit_t *u, int value)
 Sets the "scale" attribute value of the given Unit_t structure u.

Function Documentation

int Unit_areEquivalent ( Unit_t *  unit1,
Unit_t *  unit2 
)
int Unit_areIdentical ( Unit_t *  unit1,
Unit_t *  unit2 
)
Unit_t* Unit_clone ( const Unit_t *  u)

Creates a deep copy of the given Unit_t structure.

Parameters:
uthe Unit_t structure to be copied
Returns:
a (deep) copy of the given Unit_t structure.
UnitDefinition_t* Unit_convertToSI ( Unit_t *  unit)
Unit_t* Unit_create ( unsigned int  level,
unsigned int  version 
)

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

Parameters:
levelan unsigned int, the SBML Level to assign to this Unit
versionan unsigned int, the SBML Version to assign to this Unit
Returns:
a pointer to the newly created Unit_t structure.
Note:
Once a Unit has been added to an SBMLDocument, the level and version for the document override those used to create the Unit. 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.
Unit_t* Unit_createWithNS ( SBMLNamespaces_t *  sbmlns)

Creates a new Unit_t structure using the given SBMLNamespaces_t structure.

Parameters:
sbmlnsSBMLNamespaces, a pointer to an SBMLNamespaces structure to assign to this Unit
Returns:
a pointer to the newly created Unit_t structure.
Note:
Once a Unit has been added to an SBMLDocument, the sbmlns namespaces for the document override those used to create the Unit. 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 Unit_free ( Unit_t *  u)

Frees the given Unit_t structure.

Parameters:
uthe Unit_t structure to be freed.
int Unit_getExponent ( const Unit_t *  u)

Returns the value of the "exponent" attribute of the given Unit_t structure u.

Parameters:
ua Unit_t structure
Returns:
the "exponent" value of this Unit_t structure, as an integer.
double Unit_getExponentAsDouble ( const Unit_t *  u)

Returns the value of the "exponent" attribute of the given Unit_t structure u.

Parameters:
ua Unit_t structure
Returns:
the "exponent" value of this Unit_t structure, as an integer.
UnitKind_t Unit_getKind ( const Unit_t *  u)

Returns the "kind" attribute value of the given unit u.

Returns:
the value of the "kind" attribute of this Unit as a value from the UnitKind_t enumeration.
double Unit_getMultiplier ( const Unit_t *  u)

Returns the value of the "multiplier" attribute of the given Unit_t structure u.

Parameters:
ua Unit_t structure
Returns:
the "multiplier" value of this Unit, as a double
const XMLNamespaces_t* Unit_getNamespaces ( Unit_t *  u)

Returns a list of XMLNamespaces_t associated with this Unit_t structure.

Parameters:
uthe Unit_t structure
Returns:
pointer to the XMLNamespaces_t structure associated with this SBML object
double Unit_getOffset ( const Unit_t *  u)

Returns the value of the "offset" attribute of the given Unit_t structure u.

Parameters:
ua Unit_t structure
Returns:
the "offset" value of this Unit, as a double
Warning:
The "offset" attribute is only available in SBML Level 2 Version 1. This attribute is not present in SBML Level 2 Version 2 or above. When producing SBML models using these later specifications, Modelers and software need to account for units with offsets explicitly. The SBML specification document offers a number of suggestions for how to achieve this. LibSBML functions such as this one related to "offset" are retained for compatibility with earlier versions of SBML Level 2, but their use is strongly discouraged.
int Unit_getScale ( const Unit_t *  u)

Returns the value of the "scale" attribute of the given Unit_t structure u.

Parameters:
ua Unit_t structure
Returns:
the "scale" value of this Unit, as an integer.
int Unit_hasRequiredAttributes ( Unit_t *  u)

Predicate returning true or false depending on whether all the required attributes for this Unit object have been set.

Note:
The required attributes for a Unit object are:
  • kind
  • exponent (L3 on)
  • multiplier (L3 on)
  • scale (L3 on)
Returns:
a boolean value indicating whether all the required elements for this object have been defined.
void Unit_initDefaults ( Unit_t *  u)

Initializes the attributes of this Unit (except for "kind") to their defaults values.

The default values are as follows:

  • exponent = 1
  • scale = 0
  • multiplier = 1.0
int Unit_isAmpere ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind ampere.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "ampere", zero (0) otherwise.
int Unit_isBecquerel ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind becquerel.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "becquerel", zero (0) otherwise.
int Unit_isBuiltIn ( const char *  name,
unsigned int  level 
)

Predicate to test whether a given string is the name of a built-in SBML unit.

Parameters:
namea string to be tested against the built-in unit names
Returns:
nonzero (for true) if name is one of the five SBML built-in Unit names ("substance", "volume, @c "area", @c "length" or @c "time"), zero (0) otherwise
Note:
: "length" and "area" were added in Level 2 Version 1
int Unit_isCandela ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind candela.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "candela", zero (0) otherwise.
int Unit_isCelsius ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind Celsius.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "Celsius", zero (0) otherwise.
Warning:
The predefined unit Celsius was removed from the list of predefined units in SBML Level 2 Version 3 at the same time that the "offset" attribute was removed from Unit definitions. LibSBML functions such as this one related to Celsius are retained for compatibility with earlier versions of SBML Level 2, but their use is strongly discouraged.
int Unit_isCoulomb ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind coulomb.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "coulomb", zero (0) otherwise.
int Unit_isDimensionless ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind dimensionless.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "dimensionless", zero (0) otherwise.
int Unit_isFarad ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind farad.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "farad", zero (0) otherwise.
int Unit_isGram ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind gram.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "gram", zero (0) otherwise.
int Unit_isGray ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind gray.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "gray", zero (0) otherwise.
int Unit_isHenry ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind henry.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "henry", zero (0) otherwise.
int Unit_isHertz ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind hertz.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "hertz", zero (0) otherwise.
int Unit_isItem ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind item.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "item", zero (0) otherwise.
int Unit_isJoule ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind joule.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "joule", zero (0) otherwise.
int Unit_isKatal ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind katal.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "katal", zero (0) otherwise.
int Unit_isKelvin ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind kelvin.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "kelvin", zero (0) otherwise.
int Unit_isKilogram ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind kilogram.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "kilogram", zero (0) otherwise.
int Unit_isLitre ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind litre or liter.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "litre" or "liter", zero (0) otherwise.
int Unit_isLumen ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind lumen.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "lumen", zero (0) otherwise.
int Unit_isLux ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind lux.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "lux", zero (0) otherwise.
int Unit_isMetre ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind metre or meter.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "metre" or "meter", zero (0) otherwise.
int Unit_isMole ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind mole.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "mole", zero (0) otherwise.
int Unit_isNewton ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind newton.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "newton", zero (0) otherwise.
int Unit_isOhm ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind ohm.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "ohm", zero (0) otherwise.
int Unit_isPascal ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind pascal.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "pascal", zero (0) otherwise.
int Unit_isRadian ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind radian.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "radian", zero (0) otherwise.
int Unit_isSecond ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind second.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "second", zero (0) otherwise.
int Unit_isSetExponent ( const Unit_t *  u)

Predicate to test whether the "exponent" attribute of the given Unit_t structure u is set.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "exponent" attribute of the given Unit_t structure is set, zero (0) otherwise.
int Unit_isSetKind ( const Unit_t *  u)

Predicate to test whether the "kind" attribute of the given Unit_t structure u is set.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set, zero (0) otherwise.
int Unit_isSetMultiplier ( const Unit_t *  u)

Predicate to test whether the "multiplier" attribute of the given Unit_t structure u is set.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "multiplier" attribute of the given Unit_t structure is set, zero (0) otherwise.
int Unit_isSetScale ( const Unit_t *  u)

Predicate to test whether the "scale" attribute of the given Unit_t structure u is set.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "scale" attribute of the given Unit_t structure is set, zero (0) otherwise.
int Unit_isSiemens ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind siemens.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "siemens", zero (0) otherwise.
int Unit_isSievert ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind sievert.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "sievert", zero (0) otherwise.
int Unit_isSteradian ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind steradian.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "steradian", zero (0) otherwise.
int Unit_isTesla ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind tesla.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "tesla", zero (0) otherwise.
int Unit_isVolt ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind volt.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "volt", zero (0) otherwise.
int Unit_isWatt ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind watt.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "watt", zero (0) otherwise.
int Unit_isWeber ( const Unit_t *  u)

Predicate for testing whether the given Unit_t structure represents a unit of the kind weber.

Parameters:
uthe Unit_t structure to query
Returns:
nonzero (for true) if the "kind" attribute of the given Unit_t structure is set to "weber", zero (0) otherwise.
void Unit_merge ( Unit_t *  unit1,
Unit_t *  unit2 
)
int Unit_removeScale ( Unit_t *  unit)
int Unit_setExponent ( Unit_t *  u,
int  value 
)

Sets the "exponent" attribute value of the given Unit_t structure u.

Parameters:
uthe Unit_t structure whose value is to be set
valuethe integer to which the attribute "exponent" should be set
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
int Unit_setExponentAsDouble ( Unit_t *  u,
double  value 
)

Sets the "exponent" attribute value of the given Unit_t structure u.

Parameters:
uthe Unit_t structure whose value is to be set
valuethe double to which the attribute "exponent" should be set
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
int Unit_setKind ( Unit_t *  u,
UnitKind_t  kind 
)

Sets the kind of the given Unit_t structure u to the given UnitKind_t value.

Parameters:
uthe Unit_t structure whose value is to be set
kinda value from the UnitKind_t enumeration
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
int Unit_setMultiplier ( Unit_t *  u,
double  value 
)

Sets the "multiplier" attribute value of the given Unit_t structure u.

Parameters:
uthe Unit_t structure whose value is to be set
valuethe integer to which the attribute "multiplier" should be set
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_UNEXPECTED_ATTRIBUTE
int Unit_setOffset ( Unit_t *  u,
double  value 
)

Sets the "offset" attribute value of the given Unit_t structure u.

Parameters:
uthe Unit_t structure whose value is to be set
valuethe integer to which the attribute "offset" should be set
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_UNEXPECTED_ATTRIBUTE
Warning:
The "offset" attribute is only available in SBML Level 2 Version 1. This attribute is not present in SBML Level 2 Version 2 or above. When producing SBML models using these later specifications, Modelers and software need to account for units with offsets explicitly. The SBML specification document offers a number of suggestions for how to achieve this. LibSBML functions such as this one related to "offset" are retained for compatibility with earlier versions of SBML Level 2, but their use is strongly discouraged.
int Unit_setScale ( Unit_t *  u,
int  value 
)

Sets the "scale" attribute value of the given Unit_t structure u.

Parameters:
uthe Unit_t structure whose value is to be set
valuethe integer to which the attribute "scale" should be set
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
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines