- Écrire un fichier 2.1.cc correspondant au fichier 2.1.h suivant:
// Computes the trace (sum of elements of the diagonal) of a square NxN matrix,
// flattened in memory.
double trace(double* matrix, int N);
RENDU: 2.1.cc
- De même avec 2.2.h:
// Computes the matrix product of two matrices A and B of respective sizes NxM and MxP,
// and returns a newly allocated NxP matrix. All matrices are flattened.
double* matrix_prod(int n, int m, int p, double* a, double *b);
RENDU: 2.2.cc
- De même avec 2.3.h:
// Computes the transpose of a NxM matrix (see wikipedia), in-place. Stores
// the result in the source matrix.
void transpose(int n, int m, double* matrix);
RENDU: 2.3.cc
- (****) Améliorer votre 2.3.cc pour qu'il n'utilise aucune mémoire supplémentaire (et qu'il marche meme sur des matrices non carrées).
RENDU: 2.3.cc, amelioré.