From: couturie Date: Sat, 30 Apr 2016 07:46:22 +0000 (+0200) Subject: ajout du code du kernel X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/kahina_paper2.git/commitdiff_plain/5ef135713b197b04da59995ab1852503bb565bee?ds=inline;hp=5cbb1a82bc5d2f08ea4fe3f80e991e7d08584630 ajout du code du kernel --- diff --git a/code.c b/code.c new file mode 100644 index 0000000..d681fa0 --- /dev/null +++ b/code.c @@ -0,0 +1,96 @@ + + + + +//Normal version of the Ehrlich-Aberth method +cuDoubleComplex FirstH_EA(int i, cuDoubleComplex *Z) { + + cuDoubleComplex result; + cuDoubleComplex C,F,Fp; + int j; + cuDoubleComplex sum; + cuDoubleComplex un; + + //evaluate the polynomial + F = Fonction(Z[i]); + //evaluate the derivative of the poly. + Fp=FonctionD(Z[i]); + + double mod=Cmodule(F); + sum.x=0;sum.y=0; + un.x=1;un.y=0; + C=Cdiv(F,Fp); //P(z)/P'(z) + + //for all roots, compute the sum + //for the Ehrlich-Aberth iteration + for ( j=0 ; j