Skip to content
Snippets Groups Projects
Commit 6c56cef9 authored by thibaud's avatar thibaud
Browse files

écriture des fonctions matricielles terminées

parent aad4daca
No related branches found
No related tags found
No related merge requests found
#ifndef _MY_MATRIX_
#define _MY_MATRIX_
#include <cstdint>
#include <stdbool.h>
typedef enum _error_code {
OK, ERR
} error_code;
struct _matrix
{
int32_t m, n;
int32_t ** data;
} matrix;
error_code matrix_alloc(_matrix *mat, int32_t m, int32_t n);
error_code matrix_init(_matrix *mat, int32_t m, int32_t n, int32_t val);
error_code matrix_destroy(_matrix *mat);
error_code matrix_init_from_array(_matrix *mat, int32_t m , int32_t n, int32_t data[], int32_t s);
error_code matrix_clone(_matrix *cloned, _matrix mat);
error_code matrix_transpose(_matrix *transposed, _matrix mat);
error_code matrix_print(_matrix mat);
bool matrix_is_equal(_matrix mat1, _matrix mat2);
error_code matrix_get(int32_t *elem, _matrix mat, int32_t ix, int32_t iy);
error_code matrix_set(_matrix mat, int32_t ix, int32_t iy, int32_t elem);
#endif
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment