Data Structures Lerax 1.0.0
Essential Data Structures for C language
Loading...
Searching...
No Matches
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.
void matrix_free (Matrix *matrix)
 Free memory of the matrix.
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.
int matrix_lines (Matrix *matrix)
 Get the number of lines of the matrix.
int matrix_columns (Matrix *matrix)
 Get the number of columns of the matrix.

Typedef Documentation

◆ Matrix

typedef struct matrix Matrix

Function Documentation

◆ matrix_columns()

int matrix_columns ( Matrix * matrix)

Get the number of columns of the matrix.

Parameters
matrixthe matrix pointer
Returns
the number of columns

◆ matrix_create()

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

◆ matrix_free()

void matrix_free ( Matrix * matrix)

Free memory of the matrix.

Parameters
matrixthe matrix pointer itself

◆ matrix_get()

float matrix_get ( Matrix * matrix,
int i,
int j )

@brieaf 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

◆ matrix_lines()

int matrix_lines ( Matrix * matrix)

Get the number of lines of the matrix.

Parameters
matrixthe matrix pointer
Returns
the number of lines

◆ matrix_set()

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)