/* param 1 = size of the matrices at the beginning param 2 = incrementation param 3 = size of the matrices at the end param 4 = number of iteration with gcc -O3 -o cmult mult.c */ #include #include #include typedef struct Complexe {double re; double img;} complexe; complexe zero; __inline__ complexe complexe_add(complexe a, complexe b) { return (complexe){a.re+b.re, a.img+b.img}; } __inline__ complexe complexe_mult(complexe x, complexe y) { return (complexe) {x.re*y.re-x.img*y.img, x.re*y.img+x.img*y.re}; } complexe random_complexe(void) { complexe c = {c.re=(double)(rand()%1000), c.img=(double)(rand()%1000)}; return c; } void multiply_complex(int n, complexe *a, complexe *b, complexe *c) { register int i,j,k; complexe tmp; for (i=0; i