TinkeCell API  1.0.0
C/Python/Octave/Ruby API
Functions
Basic operations

basic functions for getting and setting matrices, arrays, tables, etc. More...

Functions

TCAPIEXPORT tc_matrix tc_createMatrix (int rows, int cols)
 Create a matrix with the given rows and columns.
TCAPIEXPORT tc_table tc_createTable (int rows, int cols)
 Create a strings table with the given rows and columns.
TCAPIEXPORT tc_strings tc_createStringsArray (int len)
 Create an array of strings.
TCAPIEXPORT tc_items tc_createItemsArray (int len)
 Create an array of items.
TCAPIEXPORT double tc_getMatrixValue (tc_matrix M, int i, int j)
 get i,jth value from a tc_matrix
TCAPIEXPORT void tc_setMatrixValue (tc_matrix M, int i, int j, double d)
 set i,jth value of a tc_matrix
TCAPIEXPORT const char * tc_getRowName (tc_matrix M, int i)
 get ith row name from a tc_matrix
TCAPIEXPORT void tc_setRowName (tc_matrix M, int i, const char *s)
 set ith row name for a tc_matrix
TCAPIEXPORT const char * tc_getColumnName (tc_matrix M, int j)
 get jth column name of a tc_matrix
TCAPIEXPORT void tc_setColumnName (tc_matrix M, int j, const char *s)
 set jth column name of a tc_matrix
TCAPIEXPORT const char * tc_getTableValue (tc_table S, int i, int j)
 get i,j-th string in a table
TCAPIEXPORT void tc_setTableValue (tc_table S, int i, int j, const char *s)
 set i,jth string in a table
TCAPIEXPORT const char * tc_getString (tc_strings S, int i)
 get ith string in array of strings
TCAPIEXPORT void tc_setString (tc_strings S, int i, const char *c)
 set ith string in array of strings
TCAPIEXPORT long tc_getItem (tc_items A, int i)
 get ith long item in array of items
TCAPIEXPORT void tc_setItem (tc_items A, int i, long o)
 set ith long item in array of items
TCAPIEXPORT int tc_getStringIndex (tc_strings A, const char *s)
 get the index of a string in the array
TCAPIEXPORT int tc_getRowIndex (tc_matrix, const char *s)
 get the row number of a row name
TCAPIEXPORT int tc_getColumnIndex (tc_matrix, const char *s)
 get the column number of a column name
TCAPIEXPORT void tc_deleteMatrix (tc_matrix M)
 delete a matrix
TCAPIEXPORT void tc_deleteTable (tc_table M)
 delete a strings table
TCAPIEXPORT void tc_deleteItemsArray (tc_items A)
 delete an array of items
TCAPIEXPORT void tc_deleteStringsArray (tc_strings C)
 delete an array of strings
TCAPIEXPORT tc_matrix tc_appendColumns (tc_matrix A, tc_matrix B)
 combine two matrices by appending their columns. row size must be equal for both matrices
TCAPIEXPORT tc_matrix tc_appendRows (tc_matrix A, tc_matrix B)
 combine two matrices by appending their row. column sizes must be equal for both matrices
TCAPIEXPORT tc_matrix tc_transpose (tc_matrix A)
 transpose a matrix
TCAPIEXPORT void tc_printMatrixToFile (const char *file, tc_matrix M)
 print a matrix to file
TCAPIEXPORT void tc_printOutMatrix (tc_matrix M)
 print a matrix to stdout
TCAPIEXPORT void tc_printTableToFile (const char *file, tc_table M)
 print a table to file
TCAPIEXPORT void tc_printOutTable (tc_table M)
 print a table to stdout

Detailed Description

basic functions for getting and setting matrices, arrays, tables, etc.


Function Documentation

TCAPIEXPORT tc_matrix tc_appendColumns ( tc_matrix  A,
tc_matrix  B 
)

combine two matrices by appending their columns. row size must be equal for both matrices

Parameters:
tc_matrixfirst matrix
tc_matrixfsecond matrix
Returns:
tc_matrix new combined matrix
TCAPIEXPORT tc_matrix tc_appendRows ( tc_matrix  A,
tc_matrix  B 
)

combine two matrices by appending their row. column sizes must be equal for both matrices

Parameters:
tc_matrixfirst matrix
tc_matrixfsecond matrix
Returns:
tc_matrix new combined matrix
TCAPIEXPORT tc_items tc_createItemsArray ( int  len)

Create an array of items.

Parameters:
intnumber of items
Returns:
tc_items
TCAPIEXPORT tc_matrix tc_createMatrix ( int  rows,
int  cols 
)

Create a matrix with the given rows and columns.

Parameters:
intnumber of rows
intnumber of columns
Returns:
tc_matrix
TCAPIEXPORT tc_strings tc_createStringsArray ( int  len)

Create an array of strings.

Parameters:
intlength
Returns:
tc_strings
TCAPIEXPORT tc_table tc_createTable ( int  rows,
int  cols 
)

Create a strings table with the given rows and columns.

Parameters:
intnumber of rows
intnumber of columns
Returns:
tc_table
TCAPIEXPORT void tc_deleteItemsArray ( tc_items  A)

delete an array of items

Parameters:
&tc_itemspointer to array
TCAPIEXPORT void tc_deleteMatrix ( tc_matrix  M)

delete a matrix

Parameters:
&tc_matrixpointer to matrix
TCAPIEXPORT void tc_deleteStringsArray ( tc_strings  C)

delete an array of strings

Parameters:
&tc_stringspointer to array
TCAPIEXPORT void tc_deleteTable ( tc_table  M)

delete a strings table

Parameters:
&tc_tablepointer to table
TCAPIEXPORT int tc_getColumnIndex ( tc_matrix  ,
const char *  s 
)

get the column number of a column name

Parameters:
tc_matrixmatrix
char*a string in the matrix
Returns:
int index of that string
TCAPIEXPORT const char* tc_getColumnName ( tc_matrix  M,
int  j 
)

get jth column name of a tc_matrix

Parameters:
tc_matrixmatrix
intcolumn
Returns:
string column name
TCAPIEXPORT long tc_getItem ( tc_items  A,
int  i 
)

get ith long item in array of items

Parameters:
tc_itemsarray
intindex
Returns:
long value
TCAPIEXPORT double tc_getMatrixValue ( tc_matrix  M,
int  i,
int  j 
)

get i,jth value from a tc_matrix

Parameters:
tc_matrixmatrix
introw
intcolumn
Returns:
double value at the given row, column
TCAPIEXPORT int tc_getRowIndex ( tc_matrix  ,
const char *  s 
)

get the row number of a row name

Parameters:
tc_matrixmatrix
char*a string in the matrix
Returns:
int index of that string
TCAPIEXPORT const char* tc_getRowName ( tc_matrix  M,
int  i 
)

get ith row name from a tc_matrix

Parameters:
tc_matrixmatrix
introw
Returns:
string row name
TCAPIEXPORT const char* tc_getString ( tc_strings  S,
int  i 
)

get ith string in array of strings

Parameters:
tc_stringsarray
intindex
Returns:
string value
TCAPIEXPORT int tc_getStringIndex ( tc_strings  A,
const char *  s 
)

get the index of a string in the array

Parameters:
tc_stringsarray
char*a string in the array
Returns:
int index of that string
TCAPIEXPORT const char* tc_getTableValue ( tc_table  S,
int  i,
int  j 
)

get i,j-th string in a table

Parameters:
tc_tabletable
introw
intcolumn
Returns:
string value at row,column
TCAPIEXPORT void tc_printMatrixToFile ( const char *  file,
tc_matrix  M 
)

print a matrix to file

Parameters:
char*file name
tc_matrix
TCAPIEXPORT void tc_printOutMatrix ( tc_matrix  M)

print a matrix to stdout

Parameters:
char*file name
tc_matrix
TCAPIEXPORT void tc_printOutTable ( tc_table  M)

print a table to stdout

Parameters:
tc_table
TCAPIEXPORT void tc_printTableToFile ( const char *  file,
tc_table  M 
)

print a table to file

Parameters:
char*file name
tc_table
TCAPIEXPORT void tc_setColumnName ( tc_matrix  M,
int  j,
const char *  s 
)

set jth column name of a tc_matrix

Parameters:
tc_matrixmatrix
intcolumn
stringcolumn name
TCAPIEXPORT void tc_setItem ( tc_items  A,
int  i,
long  o 
)

set ith long item in array of items

Parameters:
tc_itemsarray
intindex
longvalue
TCAPIEXPORT void tc_setMatrixValue ( tc_matrix  M,
int  i,
int  j,
double  d 
)

set i,jth value of a tc_matrix

Parameters:
tc_matrixmatrix
introw
intcolumn
doublevalue at the given row, column
TCAPIEXPORT void tc_setRowName ( tc_matrix  M,
int  i,
const char *  s 
)

set ith row name for a tc_matrix

Parameters:
tc_matrixmatrix
introw
stringrow name
TCAPIEXPORT void tc_setString ( tc_strings  S,
int  i,
const char *  c 
)

set ith string in array of strings

Parameters:
tc_stringsarray
intindex
stringvalue
TCAPIEXPORT void tc_setTableValue ( tc_table  S,
int  i,
int  j,
const char *  s 
)

set i,jth string in a table

Parameters:
tc_tabletable
introw
intcolumn
stringvalue at row,column
TCAPIEXPORT tc_matrix tc_transpose ( tc_matrix  A)

transpose a matrix

Parameters:
tc_matrixtarget matrix
Returns:
tc_matrix new transposed matrix
 All Data Structures