#ifndef MATRICE_H #define MATRICE_H /* types */ typedef struct matrice *matrice; typedef struct anneau *anneau; typedef unsigned int indice; typedef void *(*constante) (); typedef void *(*unaire) (void *); typedef void *(*binaire) (void *, void *); typedef void (*free_function) (void *); /* constructeurs / destructeurs */ extern anneau anneau_creer (constante element_nul, constante element_unite, binaire somme, binaire produit, unaire dupliquer, free_function liberer); extern matrice mat_creer_matrice_nulle (indice dim1, indice dim2, anneau a); extern void mat_liberer (matrice m); matrice mat_creer_copie (matrice source); /* manipulations elementaires */ /* NB les indices sont compris entre 0 et dim-1 */ /* mat_valeur_element (mat_affecter_element) ne copie pas */ /* la valeur retournée (passée en parametre): */ /* la zone de mémoire associé à cet objet "appartient au */ /* module peut etre libéré par celui-ci */ extern void mat_affecter_element (matrice m, indice i, indice j, void *valeur); extern void *mat_valeur_element (matrice m, indice i, indice j); /* calcul matriciel */ extern matrice mat_somme (matrice a, matrice b); extern matrice mat_produit (matrice a, matrice b); extern matrice mat_transposee (matrice m); #endif /* MATRICE_H */