From 5ef135713b197b04da59995ab1852503bb565bee Mon Sep 17 00:00:00 2001 From: couturie Date: Sat, 30 Apr 2016 09:46:22 +0200 Subject: [PATCH] ajout du code du kernel --- code.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ maj.tex | 12 ++++++-- 2 files changed, 106 insertions(+), 2 deletions(-) create mode 100644 code.c 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