Tellurium Plugin C API  1.0.0
Plugin Framework for Tellurium
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Functions
TelluriumData Manipulation

Functions to manpiulate numerical data using TelluriumData objects. More...

Functions

TELHandle tpGetRoadRunnerDataHandle (TELHandle handle)
 Retrieve a handle to RoadRunners internal data. More...
 
bool tpGetTelluriumDataElement (TELHandle rrData, int r, int c, double *value)
 Retrieves an element at a given row and column from a Tellurium data type variable. More...
 
bool tpSetTelluriumDataElement (TELHandle rrData, int r, int c, double value)
 Set an data element at a given row and column in a Tellurium data type variable. More...
 
bool tpGetTelluriumDataWeight (TELHandle rrData, int r, int c, double *value)
 Retrieves the weight for a data element at a given row and column from a Tellurium data type variable. More...
 
bool tpHasWeights (TELHandle rrData, bool *answer)
 Query if a TelluriumData object have enabled its weights feature. More...
 
bool tpAllocateWeights (TELHandle rrData, bool *success)
 Allocate roadrunner data weights. Initially, all weights are set to '1'. More...
 
bool tpSetTelluriumDataWeight (TELHandle rrData, int r, int c, double value)
 Set the weight for a Tellurium data element at a given row and column in a Tellurium data type variable. More...
 
char * tpGetTelluriumDataColumnHeader (TELHandle data)
 Retrieves a Tellurium data column header. The column header is a string with comma delimited values. Each value is a header for correseponding data column. More...
 
char * tpGetTelluriumDataColumnHeaderByIndex (TELHandle data, int index)
 Retrieves a Tellurium data column name by index. More...
 
bool tpSetTelluriumDataColumnHeader (TELHandle data, char *hdr)
 Assign Tellurium data column header from a string. The header string is composed of comma delimited (with optional spaces) values. Each value is a header for correseponding data column. More...
 
bool tpSetTelluriumDataColumnHeaderByIndex (TELHandle data, int index, char *hdr)
 Assign Tellurium data column header from a string for specifiex index. More...
 
int tpGetTelluriumDataNumRows (TELHandle data)
 Retrieves the number of rows in a Tellurium data object. More...
 
int tpGetTelluriumDataNumCols (TELHandle data)
 Retrieves the number of cols in a Tellurium data object. More...
 
TELHandle tpCreateTelluriumData (int rows, int cols, char *colNames)
 Creates a Tellurium data object, and returns a handle to it. More...
 
TELHandle tpCreateTelluriumDataFromRoadRunnerData (TELHandle rrData)
 Creates a Tellurium data object from a RoadRunner Data object. More...
 
bool tpFreeTelluriumData (TELHandle handle)
 Free the memory allocated by a Tellurium data object. More...
 
bool tpWriteTelluriumDataToFile (TELHandle rrData, const char *fName)
 Write roadrunner data to file a Tellurium data object. More...
 
bool tpReadTelluriumDataFromFile (TELHandle rrData, const char *fName)
 Read roadrunner data from a file, into a Tellurium data object. More...
 

Detailed Description

Functions to manpiulate numerical data using TelluriumData objects.

Function Documentation

bool tpAllocateWeights ( TELHandle  rrData,
bool *  success 
)

Allocate roadrunner data weights. Initially, all weights are set to '1'.

Parameters
rrDataA handle to TelluriumData
successBoolean indicating if allocation was succesful or not
Returns
Returns true or false indicating function success
Note
Related functions hasWeights(), getTelluriumDataWeight(), setTelluriumDataWeight()
TELHandle tpCreateTelluriumData ( int  rows,
int  cols,
char *  colNames 
)

Creates a Tellurium data object, and returns a handle to it.

Parameters
rowsNumber of rows to create.
colsNumber of cols to create.
colNamesColumn header as a string, e.g. "time, S1, S2".
Returns
Returns a handle to a Tellurium data object, NULL if unsuccessfull.
TELHandle tpCreateTelluriumDataFromRoadRunnerData ( TELHandle  rrData)

Creates a Tellurium data object from a RoadRunner Data object.

Parameters
rrDataHandle to a roadrunner data object
Returns
Returns a handle to a Tellurium data object, NULL if unsuccessfull.
bool tpFreeTelluriumData ( TELHandle  handle)

Free the memory allocated by a Tellurium data object.

Parameters
handleA TELHandle handle to an underlying TelluriumData object.
Returns
Returns a boolean indicating success.
TELHandle tpGetRoadRunnerDataHandle ( TELHandle  handle)

Retrieve a handle to RoadRunners internal data.

Parameters
handleHandle to a RoadRunner instance
Returns
Returns an handle to roadrunners internal data object
char* tpGetTelluriumDataColumnHeader ( TELHandle  data)

Retrieves a Tellurium data column header. The column header is a string with comma delimited values. Each value is a header for correseponding data column.

Parameters
dataA handle to a Tellurium data type variable
Returns
Returns a string containing the header as a string, NULL if unsuccesful
char* tpGetTelluriumDataColumnHeaderByIndex ( TELHandle  data,
int  index 
)

Retrieves a Tellurium data column name by index.

Parameters
dataA handle to a Tellurium data type variable
indexIndex of requested column name
Returns
Returns a string containing the col name as a string, NULL if unsuccesful
bool tpGetTelluriumDataElement ( TELHandle  rrData,
int  r,
int  c,
double *  value 
)

Retrieves an element at a given row and column from a Tellurium data type variable.

Tellurium numerical data are indexed from zero

Example:

status = getTelluriumDataElement (rrDataHandle, 2, 4, *value);
Parameters
rrDataA Handle o a Tellurium data type variable
rThe row index to the rrData data
cThe column index to the rrData data
[out]value- The retrieved value from the rrData data
Returns
Returns true if succesful;
int tpGetTelluriumDataNumCols ( TELHandle  data)

Retrieves the number of cols in a Tellurium data object.

Parameters
dataA handle to a Tellurium data type variable
Returns
Returns the number of cols in the underlying data object.
int tpGetTelluriumDataNumRows ( TELHandle  data)

Retrieves the number of rows in a Tellurium data object.

Parameters
dataA handle to a Tellurium data type variable
Returns
Returns the number of rows in the underlying data object.
bool tpGetTelluriumDataWeight ( TELHandle  rrData,
int  r,
int  c,
double *  value 
)

Retrieves the weight for a data element at a given row and column from a Tellurium data type variable.

Tellurium numerical data are indexed from zero

Example:

status = getTelluriumDataWeight (rrDataHandle, 2, 4, *value);
Parameters
rrDataA Handle o a Tellurium data type variable
rThe row index to the rrData data
cThe column index to the rrData data
[out]value- The retrieved weight value from the rrData data
Returns
Returns true if succesful;
Note
In order to use weights with a roadrunner data object, make sure that data weights are allocated, using the function haveWeights(TELHandle), and allocateWeights(rrDataHandle).
bool tpHasWeights ( TELHandle  rrData,
bool *  answer 
)

Query if a TelluriumData object have enabled its weights feature.

Parameters
rrDataA handle to TelluriumData
answerBoolean indicating if the data has weights or not
Returns
Returns true or false indicating function success
Note
Related functions allocateWeights(), getTelluriumDataWeight(), setTelluriumDataWeight()
bool tpReadTelluriumDataFromFile ( TELHandle  rrData,
const char *  fName 
)

Read roadrunner data from a file, into a Tellurium data object.

Parameters
rrDataA handle to Tellurium data.
fNameFile name to read data from.
Returns
Returns a boolean indicating success.
bool tpSetTelluriumDataColumnHeader ( TELHandle  data,
char *  hdr 
)

Assign Tellurium data column header from a string. The header string is composed of comma delimited (with optional spaces) values. Each value is a header for correseponding data column.

Parameters
dataA handle to a Tellurium data type variable
hdrA Cstring containing the column labels
Returns
Returns a boolean indicating if assignement was succesful or not
Note
The number of labels in the string MUST correspond to the number of columns in the data. If not, the assignment is aborted and false is returned
bool tpSetTelluriumDataColumnHeaderByIndex ( TELHandle  data,
int  index,
char *  hdr 
)

Assign Tellurium data column header from a string for specifiex index.

Parameters
dataA handle to a Tellurium data type variable
indexIndex for wanted colName to change
hdrA Cstring containing the column label
Returns
Returns a boolean indicating if assignement was succesful or not
bool tpSetTelluriumDataElement ( TELHandle  rrData,
int  r,
int  c,
double  value 
)

Set an data element at a given row and column in a Tellurium data type variable.

Tellurium numerical data are indexed from zero

Example:

status = setTelluriumDataElement (rrDataHandle, 2, 4, 42);
Parameters
rrDataA Handle o a Tellurium data type variable
rThe row index to the rrData data
cThe column index to the rrData data
[in]value- The new value.
Returns
Returns true if succesful
bool tpSetTelluriumDataWeight ( TELHandle  rrData,
int  r,
int  c,
double  value 
)

Set the weight for a Tellurium data element at a given row and column in a Tellurium data type variable.

Tellurium numerical data are indexed from zero

Example:

status = setTelluriumDataWeight (rrDataHandle, 2, 4, .89);
Parameters
rrDataA Handle o a Tellurium data type variable
rThe row index to the rrData data
cThe column index to the rrData data
[in]value- The new value.
Returns
Returns true if succesful
Note
In order to use weights with a roadrunner data object, make sure that data weights are allocated, using the function haveWeights(TELHandle), and allocateWeights(rrDataHandle).
bool tpWriteTelluriumDataToFile ( TELHandle  rrData,
const char *  fName 
)

Write roadrunner data to file a Tellurium data object.

Parameters
rrDataA handle to Tellurium data.
fNameOutput file name as a string.
Returns
Returns a boolean indicating success.