mat class
[FTS Data Classes]


Detailed Description

The mat class.

Two-dimensional matrix of arbitrary values.


Typedefs

typedef struct mat mat_t
 The mat data type.

Functions

FTS_API fts_schema_tmat_get_schema (mat_t *self, int dim)
 Get row or column schema of mat.
FTS_API void mat_set_schema (mat_t *self, int dim, fts_schema_t *schema)
 Set row or column schema of mat.
FTS_API int mat_set_size_nogrow (mat_t *mat, int m, int n)
 Set dimensions (number of row and columns) of a mat.
FTS_API int mat_insert_rows_nogrow (mat_t *mat, int pos, int num)
 Insert rows at given position of a mat.
FTS_API int mat_insert_columns_nogrow (mat_t *mat, int pos, int num)
 Insert columns at given position of a mat.
FTS_API int mat_delete_rows (mat_t *mat, int pos, int num)
 Delete given number of rows starting from given position.
FTS_API int mat_delete_columns (mat_t *mat, int pos, int num)
 Delete given number of columns starting from given position.
float * mat_lock (mat_t *mat)
 Get a thread-safe shared pointer to the raw float data vector of an mat.
void mat_unlock (mat_t *mat)
 Unlock an mat after a previous lock.
int mat_get_m (mat_t *mat)
 Get number of rows of an mat.
int mat_get_n (mat_t *mat)
 Get number of columns of an mat.
FTS_API void mat_set_element (mat_t *mat, int i, int j, const fts_atom_t *atom)
 Set mat value at given index (row and column).
fts_atom_t * mat_get_element (mat_t *mat, int i, int j)
 Get mat value at given index (row and column).
fts_atom_t * mat_get_row (mat_t *mat, int i)
 Get pointer to values corresponing to a given row of a mat.
FTS_API void mat_set_const (mat_t *mat, const fts_atom_t *atom)
 Set all mat values to a given constant.
FTS_API void mat_copy_locked (mat_t *orig, mat_t *copy)
 Copy values (and dimensions) of one mat to another.
FTS_API void mat_set_from_atoms (mat_t *mat, int onset, int step, int ac, const fts_atom_t *at)
 Set mat values at a given index from a list of values.

Variables

FTS_API fts_class_tmat_class
 The mat class identifier (pointer to class instance).


Function Documentation

FTS_API void mat_copy_locked ( mat_t orig,
mat_t copy 
)

Copy values (and dimensions) of one mat to another.

Parameters:
orig original mat
copy copy mat

FTS_API int mat_delete_columns ( mat_t mat,
int  pos,
int  num 
)

Delete given number of columns starting from given position.

Parameters:
mat the mat
pos start position
num number of columns to be deleted
Returns:
actual number of columns deletes

FTS_API int mat_delete_rows ( mat_t mat,
int  pos,
int  num 
)

Delete given number of rows starting from given position.

Parameters:
mat the mat
pos start position
num number of rows to be deleted
Returns:
actual number of rows deleted

fts_atom_t* mat_get_element ( mat_t mat,
int  i,
int  j 
)

Get mat value at given index (row and column).

Parameters:
mat the mat
i row index
j column index
Returns:
value at given indexs

int mat_get_m ( mat_t mat  ) 

Get number of rows of an mat.

Parameters:
mat the mat
Returns:
number of rows

int mat_get_n ( mat_t mat  ) 

Get number of columns of an mat.

Parameters:
mat the mat
Returns:
number of columns

fts_atom_t* mat_get_row ( mat_t mat,
int  i 
)

Get pointer to values corresponing to a given row of a mat.

Parameters:
mat the mat
i row index
Returns:
values of given row

FTS_API fts_schema_t* mat_get_schema ( mat_t self,
int  dim 
)

Get row or column schema of mat.

Parameters:
dim get row schema if dim == 1, column schema if dim == 2
Returns:
pointer to schema

FTS_API int mat_insert_columns_nogrow ( mat_t mat,
int  pos,
int  num 
)

Insert columns at given position of a mat.

Parameters:
mat the mat
pos insert position
num number fs columns to insert
Returns:
actual number of columns inserted

FTS_API int mat_insert_rows_nogrow ( mat_t mat,
int  pos,
int  num 
)

Insert rows at given position of a mat.

Parameters:
mat the mat
pos insert position
num number of rows to insert
Returns:
actual number of rows inserted

float* mat_lock ( mat_t mat  ) 

Get a thread-safe shared pointer to the raw float data vector of an mat.

This function puts a shared lock (read lock) on the mat. The mat has be unlocked by a call to mat_unlock().

Parameters:
mat the mat
Returns:
pointer to raw float data vector

FTS_API void mat_set_const ( mat_t mat,
const fts_atom_t *  atom 
)

Set all mat values to a given constant.

Parameters:
mat the mat
atom the const value

FTS_API void mat_set_element ( mat_t mat,
int  i,
int  j,
const fts_atom_t *  atom 
)

Set mat value at given index (row and column).

Parameters:
mat the mat
i row index
j column index
atom new value

FTS_API void mat_set_from_atoms ( mat_t mat,
int  onset,
int  step,
int  ac,
const fts_atom_t *  at 
)

Set mat values at a given index from a list of values.

Parameters:
mat the mat
onset the onset
step stride
ac arguments count
at arguments

FTS_API void mat_set_schema ( mat_t self,
int  dim,
fts_schema_t schema 
)

Set row or column schema of mat.

Parameters:
schema pointer to schema
dim set row schema if dim == 1, column schema if dim == 2

FTS_API int mat_set_size_nogrow ( mat_t mat,
int  m,
int  n 
)

Set dimensions (number of row and columns) of a mat.

Parameters:
mat the mat
m new rows count
n new columns count
Returns:
actual number of rows obtained

void mat_unlock ( mat_t mat  ) 

Unlock an mat after a previous lock.

This function has to be calles after a call to mat_lock().

Parameters:
mat the mat


Generated on Wed Aug 24 18:28:43 2011 for FTM API by  doxygen 1.5.6