Data Structures UFC  1.0.0
Essential Data Structures for C language
Typedefs | Functions
matrix.h File Reference

Go to the source code of this file.

Typedefs

typedef struct matrix Matrix
 

Functions

Matrixmatrix_create (int m, int n)
 Create a new matrix. More...
 
void matrix_free (Matrix *matrix)
 Free memory of the matrix. More...
 
float matrix_get (Matrix *matrix, int i, int j)
 
void matrix_set (Matrix *matrix, int i, int j, float v)
 Set a value on position(i,j) of the matrix. More...
 
int matrix_lines (Matrix *matrix)
 Get the number of lines of the matrix. More...
 
int matrix_columns (Matrix *matrix)
 Get the number of columns of the matrix. More...
 

Typedef Documentation

typedef struct matrix Matrix

Function Documentation

int matrix_columns ( Matrix matrix)

Get the number of columns of the matrix.

Parameters
matrixthe matrix pointer
Returns
the number of columns
Matrix* matrix_create ( int  m,
int  n 
)

Create a new matrix.

Parameters
mmeans number of lines
nmeans number of columns
Returns
the address of the created matrix
void matrix_free ( Matrix matrix)

Free memory of the matrix.

Parameters
matrixthe matrix pointer itself
float matrix_get ( Matrix matrix,
int  i,
int  j 
)

Get a value on position (i,j) of the matrix

Parameters
thematrix pointer
ithe line index
jthe column index
Returns
the value on (i,j) as float
int matrix_lines ( Matrix matrix)

Get the number of lines of the matrix.

Parameters
matrixthe matrix pointer
Returns
the number of lines
void matrix_set ( Matrix matrix,
int  i,
int  j,
float  v 
)

Set a value on position(i,j) of the matrix.

Parameters
matrixthe matrix pointer
ithe line index
jthe column index
vthe value the set on (i,j)