Tellurium Plugin C API
1.0.0
Plugin Framework for Tellurium
|
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... | |
Functions to manpiulate numerical data using TelluriumData objects.
bool tpAllocateWeights | ( | TELHandle | rrData, |
bool * | success | ||
) |
Allocate roadrunner data weights. Initially, all weights are set to '1'.
rrData | A handle to TelluriumData |
success | Boolean indicating if allocation was succesful or not |
TELHandle tpCreateTelluriumData | ( | int | rows, |
int | cols, | ||
char * | colNames | ||
) |
Creates a Tellurium data object, and returns a handle to it.
rows | Number of rows to create. |
cols | Number of cols to create. |
colNames | Column header as a string, e.g. "time, S1, S2". |
Creates a Tellurium data object from a RoadRunner Data object.
rrData | Handle to a roadrunner data object |
bool tpFreeTelluriumData | ( | TELHandle | handle) |
Free the memory allocated by a Tellurium data object.
handle | A TELHandle handle to an underlying TelluriumData object. |
Retrieve a handle to RoadRunners internal data.
handle | Handle to a RoadRunner instance |
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.
data | A handle to a Tellurium data type variable |
char* tpGetTelluriumDataColumnHeaderByIndex | ( | TELHandle | data, |
int | index | ||
) |
Retrieves a Tellurium data column name by index.
data | A handle to a Tellurium data type variable |
index | Index of requested column name |
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:
rrData | A Handle o a Tellurium data type variable | |
r | The row index to the rrData data | |
c | The column index to the rrData data | |
[out] | value | - The retrieved value from the rrData data |
int tpGetTelluriumDataNumCols | ( | TELHandle | data) |
Retrieves the number of cols in a Tellurium data object.
data | A handle to a Tellurium data type variable |
int tpGetTelluriumDataNumRows | ( | TELHandle | data) |
Retrieves the number of rows in a Tellurium data object.
data | A handle to a Tellurium data type variable |
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:
rrData | A Handle o a Tellurium data type variable | |
r | The row index to the rrData data | |
c | The column index to the rrData data | |
[out] | value | - The retrieved weight value from the rrData data |
bool tpHasWeights | ( | TELHandle | rrData, |
bool * | answer | ||
) |
Query if a TelluriumData object have enabled its weights feature.
rrData | A handle to TelluriumData |
answer | Boolean indicating if the data has weights or not |
bool tpReadTelluriumDataFromFile | ( | TELHandle | rrData, |
const char * | fName | ||
) |
Read roadrunner data from a file, into a Tellurium data object.
rrData | A handle to Tellurium data. |
fName | File name to read data from. |
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.
data | A handle to a Tellurium data type variable |
hdr | A Cstring containing the column labels |
bool tpSetTelluriumDataColumnHeaderByIndex | ( | TELHandle | data, |
int | index, | ||
char * | hdr | ||
) |
Assign Tellurium data column header from a string for specifiex index.
data | A handle to a Tellurium data type variable |
index | Index for wanted colName to change |
hdr | A Cstring containing the column label |
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:
rrData | A Handle o a Tellurium data type variable | |
r | The row index to the rrData data | |
c | The column index to the rrData data | |
[in] | value | - The new value. |
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:
rrData | A Handle o a Tellurium data type variable | |
r | The row index to the rrData data | |
c | The column index to the rrData data | |
[in] | value | - The new value. |
bool tpWriteTelluriumDataToFile | ( | TELHandle | rrData, |
const char * | fName | ||
) |
Write roadrunner data to file a Tellurium data object.
rrData | A handle to Tellurium data. |
fName | Output file name as a string. |