Index: trunk/SophyaLib/NTools/NTools.o.list
===================================================================
--- trunk/SophyaLib/NTools/NTools.o.list	(revision 709)
+++ trunk/SophyaLib/NTools/NTools.o.list	(revision 710)
@@ -12,5 +12,7 @@
 fct2dfit.o
 fftpackc.o
+fftpserver.o
 fftserver.o
+fftservintf.o
 generaldata.o
 generalfit.o
Index: trunk/SophyaLib/NTools/cspline.cc
===================================================================
--- trunk/SophyaLib/NTools/cspline.cc	(revision 709)
+++ trunk/SophyaLib/NTools/cspline.cc	(revision 710)
@@ -4,4 +4,6 @@
 #include <stdio.h>
 #include <math.h>
+#include <iostream.h>
+
 #ifdef __MWERKS__
    #include <iostream>
Index: trunk/SophyaLib/NTools/fftpackc.c
===================================================================
--- trunk/SophyaLib/NTools/fftpackc.c	(revision 709)
+++ trunk/SophyaLib/NTools/fftpackc.c	(revision 710)
@@ -11,7 +11,7 @@
 
 /*  ------ File cfftb.f ------ */
-/* Subroutine */ int cfftb_(integer *n, real *c__, real *wsave)
-{
-    extern /* Subroutine */ int cfftb1_(integer *, real *, real *, real *, 
+/* Subroutine */ int cfftb_(integer *n, float *c__, float *wsave)
+{
+    extern /* Subroutine */ int cfftb1_(integer *, float *, float *, float *, 
 	    integer *);
     static integer iw1, iw2;
@@ -32,5 +32,5 @@
 
 /*  ------ File cfftb1.f ------ */
-/* Subroutine */ int cfftb1_(integer *n, real *c__, real *ch, real *wa, 
+/* Subroutine */ int cfftb1_(integer *n, float *c__, float *ch, float *wa, 
 	integer *ifac)
 {
@@ -41,12 +41,12 @@
     static integer idot, i__;
     extern /* Subroutine */ int passb_(integer *, integer *, integer *, 
-	    integer *, integer *, real *, real *, real *, real *, real *, 
-	    real *);
+	    integer *, integer *, float *, float *, float *, float *, float *, 
+	    float *);
     static integer k1, l1, l2, n2;
-    extern /* Subroutine */ int passb2_(integer *, integer *, real *, real *, 
-	    real *), passb3_(integer *, integer *, real *, real *, real *, 
-	    real *), passb4_(integer *, integer *, real *, real *, real *, 
-	    real *, real *), passb5_(integer *, integer *, real *, real *, 
-	    real *, real *, real *, real *);
+    extern /* Subroutine */ int passb2_(integer *, integer *, float *, float *, 
+	    float *), passb3_(integer *, integer *, float *, float *, float *, 
+	    float *), passb4_(integer *, integer *, float *, float *, float *, 
+	    float *, float *), passb5_(integer *, integer *, float *, float *, 
+	    float *, float *, float *, float *);
     static integer na, nf, ip, iw, ix2, ix3, ix4, nac, ido, idl1;
 
@@ -164,7 +164,7 @@
 
 /*  ------ File cfftf.f ------ */
-/* Subroutine */ int cfftf_(integer *n, real *c__, real *wsave)
-{
-    extern /* Subroutine */ int cfftf1_(integer *, real *, real *, real *, 
+/* Subroutine */ int cfftf_(integer *n, float *c__, float *wsave)
+{
+    extern /* Subroutine */ int cfftf1_(integer *, float *, float *, float *, 
 	    integer *);
     static integer iw1, iw2;
@@ -185,5 +185,5 @@
 
 /*  ------ File cfftf1.f ------ */
-/* Subroutine */ int cfftf1_(integer *n, real *c__, real *ch, real *wa, 
+/* Subroutine */ int cfftf1_(integer *n, float *c__, float *ch, float *wa, 
 	integer *ifac)
 {
@@ -194,12 +194,12 @@
     static integer idot, i__;
     extern /* Subroutine */ int passf_(integer *, integer *, integer *, 
-	    integer *, integer *, real *, real *, real *, real *, real *, 
-	    real *);
+	    integer *, integer *, float *, float *, float *, float *, float *, 
+	    float *);
     static integer k1, l1, l2, n2;
-    extern /* Subroutine */ int passf2_(integer *, integer *, real *, real *, 
-	    real *), passf3_(integer *, integer *, real *, real *, real *, 
-	    real *), passf4_(integer *, integer *, real *, real *, real *, 
-	    real *, real *), passf5_(integer *, integer *, real *, real *, 
-	    real *, real *, real *, real *);
+    extern /* Subroutine */ int passf2_(integer *, integer *, float *, float *, 
+	    float *), passf3_(integer *, integer *, float *, float *, float *, 
+	    float *), passf4_(integer *, integer *, float *, float *, float *, 
+	    float *, float *), passf5_(integer *, integer *, float *, float *, 
+	    float *, float *, float *, float *);
     static integer na, nf, ip, iw, ix2, ix3, ix4, nac, ido, idl1;
 
@@ -317,7 +317,7 @@
 
 /*  ------ File cffti.f ------ */
-/* Subroutine */ int cffti_(integer *n, real *wsave)
-{
-    extern /* Subroutine */ int cffti1_(integer *, real *, integer *);
+/* Subroutine */ int cffti_(integer *n, float *wsave)
+{
+    extern /* Subroutine */ int cffti1_(integer *, float *, integer *);
     static integer iw1, iw2;
 
@@ -336,5 +336,5 @@
 
 /*  ------ File cffti1.f ------ */
-/* Subroutine */ int cffti1_(integer *n, real *wa, integer *ifac)
+/* Subroutine */ int cffti1_(integer *n, float *wa, integer *ifac)
 {
     /* Initialized data */
@@ -346,16 +346,16 @@
 
     /* Builtin functions */ 
-/*    double cos(doublereal), sin(doublereal);   commente, remplace par math.h - Reza  29/11/99 */
+/*    double cos(doubletruc), sin(doubletruc);   commente, remplace par math.h - Reza  29/11/99 */
 
     /* Local variables */
-    static real argh;
+    static float argh;
     static integer idot, ntry, i__, j;
-    static real argld;
+    static float argld;
     static integer i1, k1, l1, l2, ib;
-    static real fi;
+    static float fi;
     static integer ld, ii, nf, ip, nl, nq, nr;
-    static real arg;
+    static float arg;
     static integer ido, ipm;
-    static real tpi;
+    static float tpi;
 
     /* Parameter adjustments */
@@ -411,5 +411,5 @@
     ifac[2] = nf;
     tpi = 6.28318530717959f;
-    argh = tpi / (real) (*n);
+    argh = tpi / (float) (*n);
     i__ = 2;
     l1 = 1;
@@ -429,5 +429,5 @@
 	    ld += l1;
 	    fi = 0.f;
-	    argld = (real) ld * argh;
+	    argld = (float) ld * argh;
 	    i__3 = idot;
 	    for (ii = 4; ii <= i__3; ii += 2) {
@@ -454,9 +454,9 @@
 
 /*  ------ File cosqb.f ------ */
-/* Subroutine */ int cosqb_(integer *n, real *x, real *wsave)
+/* Subroutine */ int cosqb_(integer *n, float *x, float *wsave)
 {
     /* Initialized data */
 
-    static real tsqrt2 = 2.82842712474619f;
+    static float tsqrt2 = 2.82842712474619f;
 
     /* System generated locals */
@@ -464,6 +464,6 @@
 
     /* Local variables */
-    static real x1;
-    extern /* Subroutine */ int cosqb1_(integer *, real *, real *, real *);
+    static float x1;
+    extern /* Subroutine */ int cosqb1_(integer *, float *, float *, float *);
 
     /* Parameter adjustments */
@@ -493,5 +493,5 @@
 
 /*  ------ File cosqb1.f ------ */
-/* Subroutine */ int cosqb1_(integer *n, real *x, real *w, real *xh)
+/* Subroutine */ int cosqb1_(integer *n, float *x, float *w, float *xh)
 {
     /* System generated locals */
@@ -500,7 +500,7 @@
     /* Local variables */
     static integer modn, i__, k;
-    extern /* Subroutine */ int rfftb_(integer *, real *, real *);
+    extern /* Subroutine */ int rfftb_(integer *, float *, float *);
     static integer kc, np2, ns2;
-    static real xim1;
+    static float xim1;
 
     /* Parameter adjustments */
@@ -547,9 +547,9 @@
 
 /*  ------ File cosqf.f ------ */
-/* Subroutine */ int cosqf_(integer *n, real *x, real *wsave)
+/* Subroutine */ int cosqf_(integer *n, float *x, float *wsave)
 {
     /* Initialized data */
 
-    static real sqrt2 = 1.4142135623731f;
+    static float sqrt2 = 1.4142135623731f;
 
     /* System generated locals */
@@ -557,6 +557,6 @@
 
     /* Local variables */
-    static real tsqx;
-    extern /* Subroutine */ int cosqf1_(integer *, real *, real *, real *);
+    static float tsqx;
+    extern /* Subroutine */ int cosqf1_(integer *, float *, float *, float *);
 
     /* Parameter adjustments */
@@ -584,5 +584,5 @@
 
 /*  ------ File cosqf1.f ------ */
-/* Subroutine */ int cosqf1_(integer *n, real *x, real *w, real *xh)
+/* Subroutine */ int cosqf1_(integer *n, float *x, float *w, float *xh)
 {
     /* System generated locals */
@@ -591,7 +591,7 @@
     /* Local variables */
     static integer modn, i__, k;
-    extern /* Subroutine */ int rfftf_(integer *, real *, real *);
+    extern /* Subroutine */ int rfftf_(integer *, float *, float *);
     static integer kc, np2, ns2;
-    static real xim1;
+    static float xim1;
 
     /* Parameter adjustments */
@@ -636,9 +636,9 @@
 
 /*  ------ File cosqi.f ------ */
-/* Subroutine */ int cosqi_(integer *n, real *wsave)
+/* Subroutine */ int cosqi_(integer *n, float *wsave)
 {
     /* Initialized data */
 
-    static real pih = 1.57079632679491f;
+    static float pih = 1.57079632679491f;
 
     /* System generated locals */
@@ -646,10 +646,10 @@
 
     /* Builtin functions */
-/*    double cos(doublereal);    commente - Remplace par math.h  Reza 29/11/99 */
+/*    double cos(doubletruc);    commente - Remplace par math.h  Reza 29/11/99 */
 
     /* Local variables */
     static integer k;
-    extern /* Subroutine */ int rffti_(integer *, real *);
-    static real fk, dt;
+    extern /* Subroutine */ int rffti_(integer *, float *);
+    static float fk, dt;
 
     /* Parameter adjustments */
@@ -657,5 +657,5 @@
 
     /* Function Body */
-    dt = pih / (real) (*n);
+    dt = pih / (float) (*n);
     fk = 0.f;
     i__1 = *n;
@@ -670,5 +670,5 @@
 
 /*  ------ File cost.f ------ */
-/* Subroutine */ int cost_(integer *n, real *x, real *wsave)
+/* Subroutine */ int cost_(integer *n, float *x, float *wsave)
 {
     /* System generated locals */
@@ -677,12 +677,12 @@
     /* Local variables */
     static integer modn, i__, k;
-    extern /* Subroutine */ int rfftf_(integer *, real *, real *);
-    static real c1, t1, t2;
+    extern /* Subroutine */ int rfftf_(integer *, float *, float *);
+    static float c1, t1, t2;
     static integer kc;
-    static real xi;
+    static float xi;
     static integer nm1, np1;
-    static real x1h;
+    static float x1h;
     static integer ns2;
-    static real tx2, x1p3, xim2;
+    static float tx2, x1p3, xim2;
 
     /* Parameter adjustments */
@@ -753,9 +753,9 @@
 
 /*  ------ File costi.f ------ */
-/* Subroutine */ int costi_(integer *n, real *wsave)
+/* Subroutine */ int costi_(integer *n, float *wsave)
 {
     /* Initialized data */
 
-    static real pi = 3.14159265358979f;
+    static float pi = 3.14159265358979f;
 
     /* System generated locals */
@@ -763,11 +763,11 @@
 
     /* Builtin functions */
-/*    double sin(doublereal), cos(doublereal);  commente - Remplace par math.h  Reza 29/11/99 */
+/*    double sin(doubletruc), cos(doubletruc);  commente - Remplace par math.h  Reza 29/11/99 */
 
     /* Local variables */
     static integer k;
-    extern /* Subroutine */ int rffti_(integer *, real *);
+    extern /* Subroutine */ int rffti_(integer *, float *);
     static integer kc;
-    static real fk, dt;
+    static float fk, dt;
     static integer nm1, np1, ns2;
 
@@ -782,5 +782,5 @@
     np1 = *n + 1;
     ns2 = *n / 2;
-    dt = pi / (real) nm1;
+    dt = pi / (float) nm1;
     fk = 0.f;
     i__1 = ns2;
@@ -797,10 +797,10 @@
 
 /*  ------ File ezfft1.f ------ */
-/* Subroutine */ int ezfft1_(integer *n, real *wa, integer *ifac)
+/* Subroutine */ int ezfft1_(integer *n, float *wa, integer *ifac)
 {
     /* Initialized data */
 
     static integer ntryh[4] = { 4,2,3,5 };
-    static real tpi = 6.28318530717959f;
+    static float tpi = 6.28318530717959f;
 
     /* System generated locals */
@@ -808,12 +808,12 @@
 
     /* Builtin functions */
-/*    double cos(doublereal), sin(doublereal);  commente - Remplace par math.h  Reza 29/11/99 */
+/*    double cos(doubletruc), sin(doubletruc);  commente - Remplace par math.h  Reza 29/11/99 */
 
     /* Local variables */
-    static real argh;
+    static float argh;
     static integer ntry, i__, j, k1, l1, l2, ib, ii, nf, ip, nl, is, nq, nr;
-    static real ch1, sh1;
+    static float ch1, sh1;
     static integer ido, ipm;
-    static real dch1, ch1h, arg1, dsh1;
+    static float dch1, ch1h, arg1, dsh1;
     static integer nfm1;
 
@@ -869,5 +869,5 @@
     ifac[1] = *n;
     ifac[2] = nf;
-    argh = tpi / (real) (*n);
+    argh = tpi / (float) (*n);
     is = 0;
     nfm1 = nf - 1;
@@ -882,5 +882,5 @@
 	ido = *n / l2;
 	ipm = ip - 1;
-	arg1 = (real) l1 * argh;
+	arg1 = (float) l1 * argh;
 	ch1 = 1.f;
 	sh1 = 0.f;
@@ -916,6 +916,6 @@
 
 /*  ------ File ezfftb.f ------ */
-/* Subroutine */ int ezfftb_(integer *n, real *r__, real *azero, real *a, 
-	real *b, real *wsave)
+/* Subroutine */ int ezfftb_(integer *n, float *r__, float *azero, float *a, 
+	float *b, float *wsave)
 {
     /* System generated locals */
@@ -924,5 +924,5 @@
     /* Local variables */
     static integer i__;
-    extern /* Subroutine */ int rfftb_(integer *, real *, real *);
+    extern /* Subroutine */ int rfftb_(integer *, float *, float *);
     static integer ns2;
 
@@ -965,6 +965,6 @@
 
 /*  ------ File ezfftf.f ------ */
-/* Subroutine */ int ezfftf_(integer *n, real *r__, real *azero, real *a, 
-	real *b, real *wsave)
+/* Subroutine */ int ezfftf_(integer *n, float *r__, float *azero, float *a, 
+	float *b, float *wsave)
 {
     /* System generated locals */
@@ -973,8 +973,8 @@
     /* Local variables */
     static integer i__;
-    extern /* Subroutine */ int rfftf_(integer *, real *, real *);
-    static real cf;
+    extern /* Subroutine */ int rfftf_(integer *, float *, float *);
+    static float cf;
     static integer ns2;
-    static real cfm;
+    static float cfm;
     static integer ns2m;
 
@@ -1010,5 +1010,5 @@
     }
     rfftf_(n, &wsave[1], &wsave[*n + 1]);
-    cf = 2.f / (real) (*n);
+    cf = 2.f / (float) (*n);
     cfm = -cf;
     *azero = cf * .5f * wsave[1];
@@ -1030,7 +1030,7 @@
 
 /*  ------ File ezffti.f ------ */
-/* Subroutine */ int ezffti_(integer *n, real *wsave)
-{
-    extern /* Subroutine */ int ezfft1_(integer *, real *, integer *);
+/* Subroutine */ int ezffti_(integer *n, float *wsave)
+{
+    extern /* Subroutine */ int ezfft1_(integer *, float *, integer *);
 
     /* Parameter adjustments */
@@ -1047,6 +1047,6 @@
 /*  ------ File passb.f ------ */
 /* Subroutine */ int passb_(integer *nac, integer *ido, integer *ip, integer *
-	l1, integer *idl1, real *cc, real *c1, real *c2, real *ch, real *ch2, 
-	real *wa)
+	l1, integer *idl1, float *cc, float *c1, float *c2, float *ch, float *ch2, 
+	float *wa)
 {
     /* System generated locals */
@@ -1058,5 +1058,5 @@
     static integer idij, idlj, idot, ipph, i__, j, k, l, jc, lc, ik, nt, idj, 
 	    idl, inc, idp;
-    static real wai, war;
+    static float wai, war;
     static integer ipp2;
 
@@ -1287,6 +1287,6 @@
 
 /*  ------ File passb2.f ------ */
-/* Subroutine */ int passb2_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1)
+/* Subroutine */ int passb2_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1)
 {
     /* System generated locals */
@@ -1295,5 +1295,5 @@
     /* Local variables */
     static integer i__, k;
-    static real ti2, tr2;
+    static float ti2, tr2;
 
     /* Parameter adjustments */
@@ -1349,11 +1349,11 @@
 
 /*  ------ File passb3.f ------ */
-/* Subroutine */ int passb3_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1, real *wa2)
+/* Subroutine */ int passb3_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1, float *wa2)
 {
     /* Initialized data */
 
-    static real taur = -.5f;
-    static real taui = .866025403784439f;
+    static float taur = -.5f;
+    static float taui = .866025403784439f;
 
     /* System generated locals */
@@ -1362,5 +1362,5 @@
     /* Local variables */
     static integer i__, k;
-    static real ci2, ci3, di2, di3, cr2, cr3, dr2, dr3, ti2, tr2;
+    static float ci2, ci3, di2, di3, cr2, cr3, dr2, dr3, ti2, tr2;
 
     /* Parameter adjustments */
@@ -1437,6 +1437,6 @@
 
 /*  ------ File passb4.f ------ */
-/* Subroutine */ int passb4_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1, real *wa2, real *wa3)
+/* Subroutine */ int passb4_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1, float *wa2, float *wa3)
 {
     /* System generated locals */
@@ -1445,5 +1445,5 @@
     /* Local variables */
     static integer i__, k;
-    static real ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, 
+    static float ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, 
 	    tr3, tr4;
 
@@ -1542,13 +1542,13 @@
 
 /*  ------ File passb5.f ------ */
-/* Subroutine */ int passb5_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1, real *wa2, real *wa3, real *wa4)
+/* Subroutine */ int passb5_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1, float *wa2, float *wa3, float *wa4)
 {
     /* Initialized data */
 
-    static real tr11 = .309016994374947f;
-    static real ti11 = .951056516295154f;
-    static real tr12 = -.809016994374947f;
-    static real ti12 = .587785252292473f;
+    static float tr11 = .309016994374947f;
+    static float ti11 = .951056516295154f;
+    static float tr12 = -.809016994374947f;
+    static float ti12 = .587785252292473f;
 
     /* System generated locals */
@@ -1557,5 +1557,5 @@
     /* Local variables */
     static integer i__, k;
-    static real ci2, ci3, ci4, ci5, di3, di4, di5, di2, cr2, cr3, cr5, cr4, 
+    static float ci2, ci3, ci4, ci5, di3, di4, di5, di2, cr2, cr3, cr5, cr4, 
 	    ti2, ti3, ti4, ti5, dr3, dr4, dr5, dr2, tr2, tr3, tr4, tr5;
 
@@ -1678,6 +1678,6 @@
 /*  ------ File passf.f ------ */
 /* Subroutine */ int passf_(integer *nac, integer *ido, integer *ip, integer *
-	l1, integer *idl1, real *cc, real *c1, real *c2, real *ch, real *ch2, 
-	real *wa)
+	l1, integer *idl1, float *cc, float *c1, float *c2, float *ch, float *ch2, 
+	float *wa)
 {
     /* System generated locals */
@@ -1689,5 +1689,5 @@
     static integer idij, idlj, idot, ipph, i__, j, k, l, jc, lc, ik, nt, idj, 
 	    idl, inc, idp;
-    static real wai, war;
+    static float wai, war;
     static integer ipp2;
 
@@ -1918,6 +1918,6 @@
 
 /*  ------ File passf2.f ------ */
-/* Subroutine */ int passf2_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1)
+/* Subroutine */ int passf2_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1)
 {
     /* System generated locals */
@@ -1926,5 +1926,5 @@
     /* Local variables */
     static integer i__, k;
-    static real ti2, tr2;
+    static float ti2, tr2;
 
     /* Parameter adjustments */
@@ -1980,11 +1980,11 @@
 
 /*  ------ File passf3.f ------ */
-/* Subroutine */ int passf3_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1, real *wa2)
+/* Subroutine */ int passf3_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1, float *wa2)
 {
     /* Initialized data */
 
-    static real taur = -.5f;
-    static real taui = -.866025403784439f;
+    static float taur = -.5f;
+    static float taui = -.866025403784439f;
 
     /* System generated locals */
@@ -1993,5 +1993,5 @@
     /* Local variables */
     static integer i__, k;
-    static real ci2, ci3, di2, di3, cr2, cr3, dr2, dr3, ti2, tr2;
+    static float ci2, ci3, di2, di3, cr2, cr3, dr2, dr3, ti2, tr2;
 
     /* Parameter adjustments */
@@ -2068,6 +2068,6 @@
 
 /*  ------ File passf4.f ------ */
-/* Subroutine */ int passf4_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1, real *wa2, real *wa3)
+/* Subroutine */ int passf4_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1, float *wa2, float *wa3)
 {
     /* System generated locals */
@@ -2076,5 +2076,5 @@
     /* Local variables */
     static integer i__, k;
-    static real ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, 
+    static float ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, 
 	    tr3, tr4;
 
@@ -2173,13 +2173,13 @@
 
 /*  ------ File passf5.f ------ */
-/* Subroutine */ int passf5_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1, real *wa2, real *wa3, real *wa4)
+/* Subroutine */ int passf5_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1, float *wa2, float *wa3, float *wa4)
 {
     /* Initialized data */
 
-    static real tr11 = .309016994374947f;
-    static real ti11 = -.951056516295154f;
-    static real tr12 = -.809016994374947f;
-    static real ti12 = -.587785252292473f;
+    static float tr11 = .309016994374947f;
+    static float ti11 = -.951056516295154f;
+    static float tr12 = -.809016994374947f;
+    static float ti12 = -.587785252292473f;
 
     /* System generated locals */
@@ -2188,5 +2188,5 @@
     /* Local variables */
     static integer i__, k;
-    static real ci2, ci3, ci4, ci5, di3, di4, di5, di2, cr2, cr3, cr5, cr4, 
+    static float ci2, ci3, ci4, ci5, di3, di4, di5, di2, cr2, cr3, cr5, cr4, 
 	    ti2, ti3, ti4, ti5, dr3, dr4, dr5, dr2, tr2, tr3, tr4, tr5;
 
@@ -2308,6 +2308,6 @@
 
 /*  ------ File radb2.f ------ */
-/* Subroutine */ int radb2_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1)
+/* Subroutine */ int radb2_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1)
 {
     /* System generated locals */
@@ -2316,5 +2316,5 @@
     /* Local variables */
     static integer i__, k, ic;
-    static real ti2, tr2;
+    static float ti2, tr2;
     static integer idp2;
 
@@ -2385,11 +2385,11 @@
 
 /*  ------ File radb3.f ------ */
-/* Subroutine */ int radb3_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1, real *wa2)
+/* Subroutine */ int radb3_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1, float *wa2)
 {
     /* Initialized data */
 
-    static real taur = -.5f;
-    static real taui = .866025403784439f;
+    static float taur = -.5f;
+    static float taui = .866025403784439f;
 
     /* System generated locals */
@@ -2398,5 +2398,5 @@
     /* Local variables */
     static integer i__, k, ic;
-    static real ci2, ci3, di2, di3, cr2, cr3, dr2, dr3, ti2, tr2;
+    static float ci2, ci3, di2, di3, cr2, cr3, dr2, dr3, ti2, tr2;
     static integer idp2;
 
@@ -2468,10 +2468,10 @@
 
 /*  ------ File radb4.f ------ */
-/* Subroutine */ int radb4_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1, real *wa2, real *wa3)
+/* Subroutine */ int radb4_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1, float *wa2, float *wa3)
 {
     /* Initialized data */
 
-    static real sqrt2 = 1.414213562373095f;
+    static float sqrt2 = 1.414213562373095f;
 
     /* System generated locals */
@@ -2480,5 +2480,5 @@
     /* Local variables */
     static integer i__, k, ic;
-    static real ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, 
+    static float ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, 
 	    tr3, tr4;
     static integer idp2;
@@ -2592,13 +2592,13 @@
 
 /*  ------ File radb5.f ------ */
-/* Subroutine */ int radb5_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1, real *wa2, real *wa3, real *wa4)
+/* Subroutine */ int radb5_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1, float *wa2, float *wa3, float *wa4)
 {
     /* Initialized data */
 
-    static real tr11 = .309016994374947f;
-    static real ti11 = .951056516295154f;
-    static real tr12 = -.809016994374947f;
-    static real ti12 = .587785252292473f;
+    static float tr11 = .309016994374947f;
+    static float ti11 = .951056516295154f;
+    static float tr12 = -.809016994374947f;
+    static float ti12 = .587785252292473f;
 
     /* System generated locals */
@@ -2607,5 +2607,5 @@
     /* Local variables */
     static integer i__, k, ic;
-    static real ci2, ci3, ci4, ci5, di3, di4, di5, di2, cr2, cr3, cr5, cr4, 
+    static float ci2, ci3, ci4, ci5, di3, di4, di5, di2, cr2, cr3, cr5, cr4, 
 	    ti2, ti3, ti4, ti5, dr3, dr4, dr5, dr2, tr2, tr3, tr4, tr5;
     static integer idp2;
@@ -2717,9 +2717,9 @@
 /*  ------ File radbg.f ------ */
 /* Subroutine */ int radbg_(integer *ido, integer *ip, integer *l1, integer *
-	idl1, real *cc, real *c1, real *c2, real *ch, real *ch2, real *wa)
+	idl1, float *cc, float *c1, float *c2, float *ch, float *ch2, float *wa)
 {
     /* Initialized data */
 
-    static real tpi = 6.28318530717959f;
+    static float tpi = 6.28318530717959f;
 
     /* System generated locals */
@@ -2729,11 +2729,11 @@
 
     /* Builtin functions */
-/*    double cos(doublereal), sin(doublereal);  commente - Remplace par math.h  Reza 29/11/99 */
+/*    double cos(doubletruc), sin(doubletruc);  commente - Remplace par math.h  Reza 29/11/99 */
 
     /* Local variables */
     static integer idij, ipph, i__, j, k, l, j2, ic, jc, lc, ik, is;
-    static real dc2, ai1, ai2, ar1, ar2, ds2;
+    static float dc2, ai1, ai2, ar1, ar2, ds2;
     static integer nbd;
-    static real dcp, arg, dsp, ar1h, ar2h;
+    static float dcp, arg, dsp, ar1h, ar2h;
     static integer idp2, ipp2;
 
@@ -2760,5 +2760,5 @@
 
     /* Function Body */
-    arg = tpi / (real) (*ip);
+    arg = tpi / (float) (*ip);
     dcp = cos(arg);
     dsp = sin(arg);
@@ -3057,6 +3057,6 @@
 
 /*  ------ File radf2.f ------ */
-/* Subroutine */ int radf2_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1)
+/* Subroutine */ int radf2_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1)
 {
     /* System generated locals */
@@ -3065,5 +3065,5 @@
     /* Local variables */
     static integer i__, k, ic;
-    static real ti2, tr2;
+    static float ti2, tr2;
     static integer idp2;
 
@@ -3135,11 +3135,11 @@
 
 /*  ------ File radf3.f ------ */
-/* Subroutine */ int radf3_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1, real *wa2)
+/* Subroutine */ int radf3_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1, float *wa2)
 {
     /* Initialized data */
 
-    static real taur = -.5f;
-    static real taui = .866025403784439f;
+    static float taur = -.5f;
+    static float taui = .866025403784439f;
 
     /* System generated locals */
@@ -3148,5 +3148,5 @@
     /* Local variables */
     static integer i__, k, ic;
-    static real ci2, di2, di3, cr2, dr2, dr3, ti2, ti3, tr2, tr3;
+    static float ci2, di2, di3, cr2, dr2, dr3, ti2, ti3, tr2, tr3;
     static integer idp2;
 
@@ -3214,10 +3214,10 @@
 
 /*  ------ File radf4.f ------ */
-/* Subroutine */ int radf4_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1, real *wa2, real *wa3)
+/* Subroutine */ int radf4_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1, float *wa2, float *wa3)
 {
     /* Initialized data */
 
-    static real hsqt2 = .7071067811865475f;
+    static float hsqt2 = .7071067811865475f;
 
     /* System generated locals */
@@ -3226,5 +3226,5 @@
     /* Local variables */
     static integer i__, k, ic;
-    static real ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, 
+    static float ci2, ci3, ci4, cr2, cr3, cr4, ti1, ti2, ti3, ti4, tr1, tr2, 
 	    tr3, tr4;
     static integer idp2;
@@ -3330,13 +3330,13 @@
 
 /*  ------ File radf5.f ------ */
-/* Subroutine */ int radf5_(integer *ido, integer *l1, real *cc, real *ch, 
-	real *wa1, real *wa2, real *wa3, real *wa4)
+/* Subroutine */ int radf5_(integer *ido, integer *l1, float *cc, float *ch, 
+	float *wa1, float *wa2, float *wa3, float *wa4)
 {
     /* Initialized data */
 
-    static real tr11 = .309016994374947f;
-    static real ti11 = .951056516295154f;
-    static real tr12 = -.809016994374947f;
-    static real ti12 = .587785252292473f;
+    static float tr11 = .309016994374947f;
+    static float ti11 = .951056516295154f;
+    static float tr12 = -.809016994374947f;
+    static float ti12 = .587785252292473f;
 
     /* System generated locals */
@@ -3345,5 +3345,5 @@
     /* Local variables */
     static integer i__, k, ic;
-    static real ci2, di2, ci4, ci5, di3, di4, di5, ci3, cr2, cr3, dr2, dr3, 
+    static float ci2, di2, ci4, ci5, di3, di4, di5, ci3, cr2, cr3, dr2, dr3, 
 	    dr4, dr5, cr5, cr4, ti2, ti3, ti5, ti4, tr2, tr3, tr4, tr5;
     static integer idp2;
@@ -3449,9 +3449,9 @@
 /*  ------ File radfg.f ------ */
 /* Subroutine */ int radfg_(integer *ido, integer *ip, integer *l1, integer *
-	idl1, real *cc, real *c1, real *c2, real *ch, real *ch2, real *wa)
+	idl1, float *cc, float *c1, float *c2, float *ch, float *ch2, float *wa)
 {
     /* Initialized data */
 
-    static real tpi = 6.28318530717959f;
+    static float tpi = 6.28318530717959f;
 
     /* System generated locals */
@@ -3461,11 +3461,11 @@
 
     /* Builtin functions */
-/*    double cos(doublereal), sin(doublereal);    */
+/*    double cos(doubletruc), sin(doubletruc);    */
 
     /* Local variables */
     static integer idij, ipph, i__, j, k, l, j2, ic, jc, lc, ik, is;
-    static real dc2, ai1, ai2, ar1, ar2, ds2;
+    static float dc2, ai1, ai2, ar1, ar2, ds2;
     static integer nbd;
-    static real dcp, arg, dsp, ar1h, ar2h;
+    static float dcp, arg, dsp, ar1h, ar2h;
     static integer idp2, ipp2;
 
@@ -3492,5 +3492,5 @@
 
     /* Function Body */
-    arg = tpi / (real) (*ip);
+    arg = tpi / (float) (*ip);
     dcp = cos(arg);
     dsp = sin(arg);
@@ -3795,7 +3795,7 @@
 
 /*  ------ File rfftb.f ------ */
-/* Subroutine */ int rfftb_(integer *n, real *r__, real *wsave)
-{
-    extern /* Subroutine */ int rfftb1_(integer *, real *, real *, real *, 
+/* Subroutine */ int rfftb_(integer *n, float *r__, float *wsave)
+{
+    extern /* Subroutine */ int rfftb1_(integer *, float *, float *, float *, 
 	    integer *);
 
@@ -3813,5 +3813,5 @@
 
 /*  ------ File rfftb1.f ------ */
-/* Subroutine */ int rfftb1_(integer *n, real *c__, real *ch, real *wa, 
+/* Subroutine */ int rfftb1_(integer *n, float *c__, float *ch, float *wa, 
 	integer *ifac)
 {
@@ -3820,12 +3820,12 @@
 
     /* Local variables */
-    extern /* Subroutine */ int radb2_(integer *, integer *, real *, real *, 
-	    real *), radb3_(integer *, integer *, real *, real *, real *, 
-	    real *), radb4_(integer *, integer *, real *, real *, real *, 
-	    real *, real *), radb5_(integer *, integer *, real *, real *, 
-	    real *, real *, real *, real *);
+    extern /* Subroutine */ int radb2_(integer *, integer *, float *, float *, 
+	    float *), radb3_(integer *, integer *, float *, float *, float *, 
+	    float *), radb4_(integer *, integer *, float *, float *, float *, 
+	    float *, float *), radb5_(integer *, integer *, float *, float *, 
+	    float *, float *, float *, float *);
     static integer i__;
     extern /* Subroutine */ int radbg_(integer *, integer *, integer *, 
-	    integer *, real *, real *, real *, real *, real *, real *);
+	    integer *, float *, float *, float *, float *, float *, float *);
     static integer k1, l1, l2, na, nf, ip, iw, ix2, ix3, ix4, ido, idl1;
 
@@ -3941,7 +3941,7 @@
 
 /*  ------ File rfftf.f ------ */
-/* Subroutine */ int rfftf_(integer *n, real *r__, real *wsave)
-{
-    extern /* Subroutine */ int rfftf1_(integer *, real *, real *, real *, 
+/* Subroutine */ int rfftf_(integer *n, float *r__, float *wsave)
+{
+    extern /* Subroutine */ int rfftf1_(integer *, float *, float *, float *, 
 	    integer *);
 
@@ -3959,5 +3959,5 @@
 
 /*  ------ File rfftf1.f ------ */
-/* Subroutine */ int rfftf1_(integer *n, real *c__, real *ch, real *wa, 
+/* Subroutine */ int rfftf1_(integer *n, float *c__, float *ch, float *wa, 
 	integer *ifac)
 {
@@ -3966,12 +3966,12 @@
 
     /* Local variables */
-    extern /* Subroutine */ int radf2_(integer *, integer *, real *, real *, 
-	    real *), radf3_(integer *, integer *, real *, real *, real *, 
-	    real *), radf4_(integer *, integer *, real *, real *, real *, 
-	    real *, real *), radf5_(integer *, integer *, real *, real *, 
-	    real *, real *, real *, real *);
+    extern /* Subroutine */ int radf2_(integer *, integer *, float *, float *, 
+	    float *), radf3_(integer *, integer *, float *, float *, float *, 
+	    float *), radf4_(integer *, integer *, float *, float *, float *, 
+	    float *, float *), radf5_(integer *, integer *, float *, float *, 
+	    float *, float *, float *, float *);
     static integer i__;
     extern /* Subroutine */ int radfg_(integer *, integer *, integer *, 
-	    integer *, real *, real *, real *, real *, real *, real *);
+	    integer *, float *, float *, float *, float *, float *, float *);
     static integer k1, l1, l2, na, kh, nf, ip, iw, ix2, ix3, ix4, ido, idl1;
 
@@ -4082,7 +4082,7 @@
 
 /*  ------ File rffti.f ------ */
-/* Subroutine */ int rffti_(integer *n, real *wsave)
-{
-    extern /* Subroutine */ int rffti1_(integer *, real *, integer *);
+/* Subroutine */ int rffti_(integer *n, float *wsave)
+{
+    extern /* Subroutine */ int rffti1_(integer *, float *, integer *);
 
     /* Parameter adjustments */
@@ -4098,5 +4098,5 @@
 
 /*  ------ File rffti1.f ------ */
-/* Subroutine */ int rffti1_(integer *n, real *wa, integer *ifac)
+/* Subroutine */ int rffti1_(integer *n, float *wa, integer *ifac)
 {
     /* Initialized data */
@@ -4108,16 +4108,16 @@
 
     /* Builtin functions */
-/*   double cos(doublereal), sin(doublereal);  Remplace par math.h , Reza 29/11/99 */
+/*   double cos(doubletruc), sin(doubletruc);  Remplace par math.h , Reza 29/11/99 */
 
     /* Local variables */
-    static real argh;
+    static float argh;
     static integer ntry, i__, j;
-    static real argld;
+    static float argld;
     static integer k1, l1, l2, ib;
-    static real fi;
+    static float fi;
     static integer ld, ii, nf, ip, nl, is, nq, nr;
-    static real arg;
+    static float arg;
     static integer ido, ipm;
-    static real tpi;
+    static float tpi;
     static integer nfm1;
 
@@ -4174,5 +4174,5 @@
     ifac[2] = nf;
     tpi = 6.28318530717959f;
-    argh = tpi / (real) (*n);
+    argh = tpi / (float) (*n);
     is = 0;
     nfm1 = nf - 1;
@@ -4192,5 +4192,5 @@
 	    ld += l1;
 	    i__ = is;
-	    argld = (real) ld * argh;
+	    argld = (float) ld * argh;
 	    fi = 0.f;
 	    i__3 = ido;
@@ -4213,5 +4213,5 @@
 
 /*  ------ File sinqb.f ------ */
-/* Subroutine */ int sinqb_(integer *n, real *x, real *wsave)
+/* Subroutine */ int sinqb_(integer *n, float *x, float *wsave)
 {
     /* System generated locals */
@@ -4220,6 +4220,6 @@
     /* Local variables */
     static integer k;
-    extern /* Subroutine */ int cosqb_(integer *, real *, real *);
-    static real xhold;
+    extern /* Subroutine */ int cosqb_(integer *, float *, float *);
+    static float xhold;
     static integer kc, ns2;
 
@@ -4254,5 +4254,5 @@
 
 /*  ------ File sinqf.f ------ */
-/* Subroutine */ int sinqf_(integer *n, real *x, real *wsave)
+/* Subroutine */ int sinqf_(integer *n, float *x, float *wsave)
 {
     /* System generated locals */
@@ -4261,6 +4261,6 @@
     /* Local variables */
     static integer k;
-    extern /* Subroutine */ int cosqf_(integer *, real *, real *);
-    static real xhold;
+    extern /* Subroutine */ int cosqf_(integer *, float *, float *);
+    static float xhold;
     static integer kc, ns2;
 
@@ -4292,7 +4292,7 @@
 
 /*  ------ File sinqi.f ------ */
-/* Subroutine */ int sinqi_(integer *n, real *wsave)
-{
-    extern /* Subroutine */ int cosqi_(integer *, real *);
+/* Subroutine */ int sinqi_(integer *n, float *wsave)
+{
+    extern /* Subroutine */ int cosqi_(integer *, float *);
 
     /* Parameter adjustments */
@@ -4305,8 +4305,8 @@
 
 /*  ------ File sint.f ------ */
-/* Subroutine */ int sint_(integer *n, real *x, real *wsave)
-{
-    extern /* Subroutine */ int sint1_(integer *, real *, real *, real *, 
-	    real *, integer *);
+/* Subroutine */ int sint_(integer *n, float *x, float *wsave)
+{
+    extern /* Subroutine */ int sint1_(integer *, float *, float *, float *, 
+	    float *, integer *);
     static integer np1, iw1, iw2, iw3;
 
@@ -4325,10 +4325,10 @@
 
 /*  ------ File sint1.f ------ */
-/* Subroutine */ int sint1_(integer *n, real *war, real *was, real *xh, real *
+/* Subroutine */ int sint1_(integer *n, float *war, float *was, float *xh, float *
 	x, integer *ifac)
 {
     /* Initialized data */
 
-    static real sqrt3 = 1.73205080756888f;
+    static float sqrt3 = 1.73205080756888f;
 
     /* System generated locals */
@@ -4337,6 +4337,6 @@
     /* Local variables */
     static integer modn, i__, k;
-    static real xhold, t1, t2;
-    extern /* Subroutine */ int rfftf1_(integer *, real *, real *, real *, 
+    static float xhold, t1, t2;
+    extern /* Subroutine */ int rfftf1_(integer *, float *, float *, float *, 
 	    integer *);
     static integer kc, np1, ns2;
@@ -4411,9 +4411,9 @@
 
 /*  ------ File sinti.f ------ */
-/* Subroutine */ int sinti_(integer *n, real *wsave)
+/* Subroutine */ int sinti_(integer *n, float *wsave)
 {
     /* Initialized data */
 
-    static real pi = 3.14159265358979f;
+    static float pi = 3.14159265358979f;
 
     /* System generated locals */
@@ -4421,10 +4421,10 @@
 
     /* Builtin functions */
-/*    double sin(doublereal);  remplace par math.h , Reza 29/11/99 */
+/*    double sin(doubletruc);  remplace par math.h , Reza 29/11/99 */
 
     /* Local variables */
     static integer k;
-    extern /* Subroutine */ int rffti_(integer *, real *);
-    static real dt;
+    extern /* Subroutine */ int rffti_(integer *, float *);
+    static float dt;
     static integer np1, ns2;
 
@@ -4438,5 +4438,5 @@
     ns2 = *n / 2;
     np1 = *n + 1;
-    dt = pi / (real) np1;
+    dt = pi / (float) np1;
     i__1 = ns2;
     for (k = 1; k <= i__1; ++k) {
@@ -4785,5 +4785,5 @@
 
     /* Builtin functions */
-/*    double cos(doublereal), sin(doublereal);  remplace par math.h  Reza 29/11/99 */
+/*    double cos(doubletruc), sin(doubletruc);  remplace par math.h  Reza 29/11/99 */
 
     /* Local variables */
@@ -5085,5 +5085,5 @@
 
     /* Builtin functions */
-/*    double cos(doublereal); remplace par math.h  Reza 29/11/99 */
+/*    double cos(doubletruc); remplace par math.h  Reza 29/11/99 */
 
     /* Local variables */
@@ -5202,5 +5202,5 @@
 
     /* Builtin functions */
-/*    double sin(doublereal), cos(doublereal);  remplace par math.h  Reza 29/11/99 */
+/*    double sin(doubletruc), cos(doubletruc);  remplace par math.h  Reza 29/11/99 */
 
     /* Local variables */
@@ -5247,5 +5247,5 @@
 
     /* Builtin functions */
-/*    double cos(doublereal), sin(doublereal);  remplace par math.h  Reza 29/11/99  */
+/*    double cos(doubletruc), sin(doubletruc);  remplace par math.h  Reza 29/11/99  */
 
     /* Local variables */
@@ -7168,5 +7168,5 @@
 
     /* Builtin functions */
-/*    double cos(doublereal), sin(doublereal);  remplace par math.h  Reza 29/11/99 */
+/*    double cos(doubletruc), sin(doubletruc);  remplace par math.h  Reza 29/11/99 */
 
     /* Local variables */
@@ -7900,5 +7900,5 @@
 
     /* Builtin functions */
-/*    double cos(doublereal), sin(doublereal);   */
+/*    double cos(doubletruc), sin(doubletruc);   */
 
     /* Local variables */
@@ -8547,5 +8547,5 @@
 
     /* Builtin functions */
-/*    double cos(doublereal), sin(doublereal); remplace par math.h  Reza 29/11/99 */
+/*    double cos(doubletruc), sin(doubletruc); remplace par math.h  Reza 29/11/99 */
 
     /* Local variables */
@@ -8860,5 +8860,5 @@
 
     /* Builtin functions */
-/*    double sin(doublereal);  remplace par math.h  Reza 29/11/99 */
+/*    double sin(doubletruc);  remplace par math.h  Reza 29/11/99 */
 
     /* Local variables */
Index: trunk/SophyaLib/NTools/fftpackc.h
===================================================================
--- trunk/SophyaLib/NTools/fftpackc.h	(revision 709)
+++ trunk/SophyaLib/NTools/fftpackc.h	(revision 710)
@@ -4,4 +4,7 @@
 #include "machdefs.h"
 /* #include "f2c.h" -- Remplace par ce qui suit */
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 typedef int integer;
@@ -9,8 +12,8 @@
 typedef char *address;
 typedef short int shortint;
-typedef float real;
-typedef double doublereal;
-typedef struct { float r, i; } complex;
-typedef struct { double r, i; } doublecomplex;
+  // typedef float real;
+  // typedef double doublereal;
+  //typedef struct { float r, i; } complex;
+  //typedef struct { double r, i; } doublecomplex;
 
 /* typedef int_4 logical;
@@ -21,53 +24,53 @@
 /* ---------------------- */
 
-extern int cfftb_(integer *n, real *c__, real *wsave);
-extern int cfftb1_(integer *n, real *c__, real *ch, real *wa, integer *ifac);
-extern int cfftf_(integer *n, real *c__, real *wsave);
-extern int cfftf1_(integer *n, real *c__, real *ch, real *wa, integer *ifac);
-extern int cffti_(integer *n, real *wsave);
-extern int cffti1_(integer *n, real *wa, integer *ifac);
-extern int cosqb_(integer *n, real *x, real *wsave);
-extern int cosqb1_(integer *n, real *x, real *w, real *xh);
-extern int cosqf_(integer *n, real *x, real *wsave);
-extern int cosqf1_(integer *n, real *x, real *w, real *xh);
-extern int cosqi_(integer *n, real *wsave);
-extern int cost_(integer *n, real *x, real *wsave);
-extern int costi_(integer *n, real *wsave);
-extern int ezfft1_(integer *n, real *wa, integer *ifac);
-extern int ezfftb_(integer *n, real *r__, real *azero, real *a, real *b, real *wsave);
-extern int ezfftf_(integer *n, real *r__, real *azero, real *a, real *b, real *wsave);
-extern int ezffti_(integer *n, real *wsave);
-extern int passb_(integer *nac, integer *ido, integer *ip, integer *l1, integer *idl1, real *cc, real *c1, real *c2, real *ch, real *ch2, real *wa);
-extern int passb2_(integer *ido, integer *l1, real *cc, real *ch, real *wa1);
-extern int passb3_(integer *ido, integer *l1, real *cc, real *ch, real *wa1, real *wa2);
-extern int passb4_(integer *ido, integer *l1, real *cc, real *ch, real *wa1, real *wa2, real *wa3);
-extern int passb5_(integer *ido, integer *l1, real *cc, real *ch, real *wa1, real *wa2, real *wa3, real *wa4);
-extern int passf_(integer *nac, integer *ido, integer *ip, integer *l1, integer *idl1, real *cc, real *c1, real *c2, real *ch, real *ch2, real *wa);
-extern int passf2_(integer *ido, integer *l1, real *cc, real *ch, real *wa1);
-extern int passf3_(integer *ido, integer *l1, real *cc, real *ch, real *wa1, real *wa2);
-extern int passf4_(integer *ido, integer *l1, real *cc, real *ch, real *wa1, real *wa2, real *wa3);
-extern int passf5_(integer *ido, integer *l1, real *cc, real *ch, real *wa1, real *wa2, real *wa3, real *wa4);
-extern int radb2_(integer *ido, integer *l1, real *cc, real *ch, real *wa1);
-extern int radb3_(integer *ido, integer *l1, real *cc, real *ch, real *wa1, real *wa2);
-extern int radb4_(integer *ido, integer *l1, real *cc, real *ch, real *wa1, real *wa2, real *wa3);
-extern int radb5_(integer *ido, integer *l1, real *cc, real *ch, real *wa1, real *wa2, real *wa3, real *wa4);
-extern int radbg_(integer *ido, integer *ip, integer *l1, integer *idl1, real *cc, real *c1, real *c2, real *ch, real *ch2, real *wa);
-extern int radf2_(integer *ido, integer *l1, real *cc, real *ch, real *wa1);
-extern int radf3_(integer *ido, integer *l1, real *cc, real *ch, real *wa1, real *wa2);
-extern int radf4_(integer *ido, integer *l1, real *cc, real *ch, real *wa1, real *wa2, real *wa3);
-extern int radf5_(integer *ido, integer *l1, real *cc, real *ch, real *wa1, real *wa2, real *wa3, real *wa4);
-extern int radfg_(integer *ido, integer *ip, integer *l1, integer *idl1, real *cc, real *c1, real *c2, real *ch, real *ch2, real *wa);
-extern int rfftb_(integer *n, real *r__, real *wsave);
-extern int rfftb1_(integer *n, real *c__, real *ch, real *wa, integer *ifac);
-extern int rfftf_(integer *n, real *r__, real *wsave);
-extern int rfftf1_(integer *n, real *c__, real *ch, real *wa, integer *ifac);
-extern int rffti_(integer *n, real *wsave);
-extern int rffti1_(integer *n, real *wa, integer *ifac);
-extern int sinqb_(integer *n, real *x, real *wsave);
-extern int sinqf_(integer *n, real *x, real *wsave);
-extern int sinqi_(integer *n, real *wsave);
-extern int sint_(integer *n, real *x, real *wsave);
-extern int sint1_(integer *n, real *war, real *was, real *xh, real *x, integer *ifac);
-extern int sinti_(integer *n, real *wsave);
+extern int cfftb_(integer *n, float *c__, float *wsave);
+extern int cfftb1_(integer *n, float *c__, float *ch, float *wa, integer *ifac);
+extern int cfftf_(integer *n, float *c__, float *wsave);
+extern int cfftf1_(integer *n, float *c__, float *ch, float *wa, integer *ifac);
+extern int cffti_(integer *n, float *wsave);
+extern int cffti1_(integer *n, float *wa, integer *ifac);
+extern int cosqb_(integer *n, float *x, float *wsave);
+extern int cosqb1_(integer *n, float *x, float *w, float *xh);
+extern int cosqf_(integer *n, float *x, float *wsave);
+extern int cosqf1_(integer *n, float *x, float *w, float *xh);
+extern int cosqi_(integer *n, float *wsave);
+extern int cost_(integer *n, float *x, float *wsave);
+extern int costi_(integer *n, float *wsave);
+extern int ezfft1_(integer *n, float *wa, integer *ifac);
+extern int ezfftb_(integer *n, float *r__, float *azero, float *a, float *b, float *wsave);
+extern int ezfftf_(integer *n, float *r__, float *azero, float *a, float *b, float *wsave);
+extern int ezffti_(integer *n, float *wsave);
+extern int passb_(integer *nac, integer *ido, integer *ip, integer *l1, integer *idl1, float *cc, float *c1, float *c2, float *ch, float *ch2, float *wa);
+extern int passb2_(integer *ido, integer *l1, float *cc, float *ch, float *wa1);
+extern int passb3_(integer *ido, integer *l1, float *cc, float *ch, float *wa1, float *wa2);
+extern int passb4_(integer *ido, integer *l1, float *cc, float *ch, float *wa1, float *wa2, float *wa3);
+extern int passb5_(integer *ido, integer *l1, float *cc, float *ch, float *wa1, float *wa2, float *wa3, float *wa4);
+extern int passf_(integer *nac, integer *ido, integer *ip, integer *l1, integer *idl1, float *cc, float *c1, float *c2, float *ch, float *ch2, float *wa);
+extern int passf2_(integer *ido, integer *l1, float *cc, float *ch, float *wa1);
+extern int passf3_(integer *ido, integer *l1, float *cc, float *ch, float *wa1, float *wa2);
+extern int passf4_(integer *ido, integer *l1, float *cc, float *ch, float *wa1, float *wa2, float *wa3);
+extern int passf5_(integer *ido, integer *l1, float *cc, float *ch, float *wa1, float *wa2, float *wa3, float *wa4);
+extern int radb2_(integer *ido, integer *l1, float *cc, float *ch, float *wa1);
+extern int radb3_(integer *ido, integer *l1, float *cc, float *ch, float *wa1, float *wa2);
+extern int radb4_(integer *ido, integer *l1, float *cc, float *ch, float *wa1, float *wa2, float *wa3);
+extern int radb5_(integer *ido, integer *l1, float *cc, float *ch, float *wa1, float *wa2, float *wa3, float *wa4);
+extern int radbg_(integer *ido, integer *ip, integer *l1, integer *idl1, float *cc, float *c1, float *c2, float *ch, float *ch2, float *wa);
+extern int radf2_(integer *ido, integer *l1, float *cc, float *ch, float *wa1);
+extern int radf3_(integer *ido, integer *l1, float *cc, float *ch, float *wa1, float *wa2);
+extern int radf4_(integer *ido, integer *l1, float *cc, float *ch, float *wa1, float *wa2, float *wa3);
+extern int radf5_(integer *ido, integer *l1, float *cc, float *ch, float *wa1, float *wa2, float *wa3, float *wa4);
+extern int radfg_(integer *ido, integer *ip, integer *l1, integer *idl1, float *cc, float *c1, float *c2, float *ch, float *ch2, float *wa);
+extern int rfftb_(integer *n, float *r__, float *wsave);
+extern int rfftb1_(integer *n, float *c__, float *ch, float *wa, integer *ifac);
+extern int rfftf_(integer *n, float *r__, float *wsave);
+extern int rfftf1_(integer *n, float *c__, float *ch, float *wa, integer *ifac);
+extern int rffti_(integer *n, float *wsave);
+extern int rffti1_(integer *n, float *wa, integer *ifac);
+extern int sinqb_(integer *n, float *x, float *wsave);
+extern int sinqf_(integer *n, float *x, float *wsave);
+extern int sinqi_(integer *n, float *wsave);
+extern int sint_(integer *n, float *x, float *wsave);
+extern int sint1_(integer *n, float *war, float *was, float *xh, float *x, integer *ifac);
+extern int sinti_(integer *n, float *wsave);
 
 /* ---------------------- */
@@ -124,4 +127,7 @@
 
 /* Rerunning f2c -P may change prototypes or declarations. */
+#ifdef __cplusplus
+}
+#endif
 
 #endif /*  FFTPACK_H_SEEN */
Index: trunk/SophyaLib/NTools/fftpserver.cc
===================================================================
--- trunk/SophyaLib/NTools/fftpserver.cc	(revision 710)
+++ trunk/SophyaLib/NTools/fftpserver.cc	(revision 710)
@@ -0,0 +1,286 @@
+#include "fftpserver.h"
+#include "fftpackc.h"
+
+#include <iostream.h>
+
+
+/*! \class FFTPackServer
+ \brief An FFT server based on fftpack
+
+A class that calculates Fourier transforms forwards and backwards.
+
+The class calls the c library ``fftpack'', which is accessible and documented
+at http://www.netlib.org/fftpack/.  However, the class functions do not
+necessarily correspond with the equivalent fftpack function.  For example,
+fftpack "forward" transformations are in fact inverse fourier transformations.
+Otherwise, the output is in the fftpack format.
+
+Complex input must be entered using the <complex> template.  Otherwise,
+all input is assumed to be real.
+
+Due to the way that fftpack manages
+its work arrays, an object can run faster if the length of the input arrays
+does not change.  For example, if you need to do a series of FFT's
+of differing length, it may be more efficient to create an fftserver object
+for each length.
+*/
+
+/*! \fn virtual void FFTServer::fftf(int l, float* inout)
+  \param l length of array
+  \param inout input array /output forward FFT (original array destroyed)
+*/
+/*! \fn virtual void FFTServer::fftb(int l, float* inout)
+  \param l length of array
+  \param inout input array /output backward FFT (original array destroyed)
+*/
+/*! \fn virtual void FFTServer::fftf(int l, double* inout)
+  \param l length of array
+  \param inout input array /output forward FFT (original array destroyed)
+  \param inout input/output array (original array destroyed)
+*/
+/*! \fn virtual void FFTServer::fftb(int l, double* inout)
+  \param l length of array
+  \param inout input array /output backward FFT(original array destroyed)
+*/
+/*!\fn  virtual void FFTServer::fftf(int l, complex<float>* inout)
+  \param l length of array
+  \param inout input array /output forward FFT (original array destroyed)
+*/
+/*! \fn virtual void FFTServer::fftb(int l, complex<float>* inout)
+  \param l length of array
+  \param inout input array /output backward FFT (original array destroyed)
+*/
+/*! \fn virtual void FFTServer::fftf(int l, complex<double>* inout)
+  \param l length of array
+  \param inout input array /output forward FFT (original array destroyed)
+*/
+/*! \fn virtual void FFTServer::fftb(int l, complex<double>* inout)
+  \param l length of array
+  \param inout input array /output backward FFT(original array destroyed)
+*/
+/*!\fn  virtual void FFTServer::fftf(Vector& in, Vector& out)
+  \param in input array
+  \param out forward FFT
+*/
+/*! \fn virtual void FFTServer::fftb(Vector& in, Vector& out)
+  \param in input array
+  \param out backward FFT
+*/
+
+FFTPackServer::FFTPackServer()
+   : FFTServerInterface("FFTServer using FFTPack (C-version) package")
+
+{
+  sz_rfft = 0;     //the working array and its size for the different
+  ws_rfft = NULL;  //possible numerical types
+  sz_cfft = 0;
+  ws_cfft = NULL;
+  sz_cdfft = 0;
+  ws_cdfft = NULL;
+}
+
+FFTPackServer::~FFTPackServer()
+{
+if (ws_rfft) delete[] ws_rfft;
+if (ws_cfft) delete[] ws_cfft;
+if (ws_cdfft) delete[] ws_cdfft;
+}
+
+FFTServerInterface * FFTPackServer::Clone()
+{
+  return (new FFTPackServer);
+}
+
+void FFTPackServer::FFTForward(TVector< complex<r_8> > const & in, TVector< complex<r_8> > & out)
+{
+  out = in;
+  fftf(out.NElts(), out.Data());
+}
+
+void FFTPackServer::FFTBackward(TVector< complex<r_8> > const & in, TVector< complex<r_8> > & out)
+{
+  out = in;
+  fftb(out.NElts(), out.Data());
+}
+
+void FFTPackServer::FFTForward(TVector< complex<r_4> > const & in, TVector< complex<r_4> > & out)
+{
+  out = in;
+  fftf(out.NElts(), out.Data());
+}
+
+void FFTPackServer::FFTBackward(TVector< complex<r_4> > const & in, TVector< complex<r_4> > & out)
+{
+  out = in;
+  fftb(out.NElts(), out.Data());
+}
+
+void FFTPackServer::FFTForward(TVector< r_4 > const & in, TVector< complex<r_4> > & out)
+{
+  TVector< r_4 > inout(in);
+  fftf(inout.NElts(), inout.Data());
+  ReShapetoCompl(inout, out);
+}
+
+void FFTPackServer::FFTBackward(TVector< complex<r_4> > const & in, TVector< r_4 > & out)
+{
+  ReShapetoReal(in, out);
+  fftb(out.NElts(), out.Data());
+}
+
+void FFTPackServer::FFTForward(TVector< r_8 > const & in, TVector< complex<r_8> > & out)
+{
+  TVector< r_8 > inout(in);
+  fftf(inout.NElts(), inout.Data());
+  ReShapetoCompl(inout, out);
+}
+
+void FFTPackServer::FFTBackward(TVector< complex<r_8> > const & in, TVector< r_8 > & out)
+{
+  ReShapetoReal(in, out);
+  fftb(out.NElts(), out.Data());
+}
+
+
+void FFTPackServer::checkint_rfft(int l)
+{
+  if (sz_rfft == l) return;       //checkint functions check and reallocate
+                                  //memory for the work arrays when performing
+  if (ws_rfft) delete[] ws_rfft;  //a transform
+  sz_rfft = l;
+  ws_rfft = new float[2*l+15];
+  rffti_(&l, ws_rfft);
+}
+
+void FFTPackServer::checkint_cfft(int l)
+{
+  if (sz_cfft == l) return;
+
+  if (ws_cfft) delete[] ws_cfft;
+  sz_cfft = l;
+  ws_cfft = new float[4*l+15];
+  cffti_(&l, ws_cfft);
+}
+
+void FFTPackServer::checkint_dfft(int l)
+{
+  if (sz_dfft == l) return;
+
+  if (ws_dfft) delete[] ws_dfft;
+  sz_dfft = l;
+  ws_dfft = new double[2*l+15];
+  dffti_(&l, ws_dfft);
+}
+
+void FFTPackServer::checkint_cdfft(int l)
+{
+  if (sz_cdfft == l) return;
+
+  if (ws_cdfft) delete[] ws_cdfft;
+  sz_cdfft = l;
+  ws_cdfft = new double[4*l+15];
+  cdffti_(&l, ws_cdfft);
+}
+
+/* In general forward transformations are resorted since fftpack functions
+   return inverse transformations */
+
+void FFTPackServer::fftf(int l, float* inout)
+{
+  checkint_rfft(l);
+  rfftf_(&l, inout, ws_rfft);
+  for (int k= 2;k<=(l+1)/2;k++) inout[2*k-2]=-inout[2*k-2];
+}
+
+void FFTPackServer::fftf(int l, double* inout)
+{
+  checkint_dfft(l);
+  dfftf_(&l, inout, ws_dfft);
+  for (int k= 2;k<=(l+1)/2;k++) inout[2*k-2]=-inout[2*k-2];
+}
+
+void FFTPackServer::fftf(int l, complex<float>* inout)
+{
+  checkint_cfft(l);
+  cfftf_(&l, (float *)(inout), ws_cfft);
+
+  /*
+  float* foo = new float[2*l];
+  int i;
+  for (i=0;i<l;i++){
+    foo[2*i]=inout[i].real();
+    foo[2*i+1]=inout[i].imag();
+  }
+  cfftf_(&l, foo, ws_cfft);
+  inout[0]=complex<float> (foo[0],foo[1]);
+  for (i=1;i<l;i++) inout[l-i]= complex<float> (foo[2*i], foo[2*i+1]);
+  delete[] foo;
+  */
+}
+
+void FFTPackServer::fftf(int l, complex<double>* inout)
+{
+  checkint_cdfft(l);
+  cdfftf_(&l, (double*)(inout), ws_cdfft);
+  /*
+  double* foo=new double[2*l];
+  int i;
+  for (i=0;i<l;i++){
+    foo[2*i]=inout[i].real();
+    foo[2*i+1]=inout[i].imag();
+  }
+  cdfftf_(&l, foo, ws_cdfft);
+  inout[0]=complex<double> (foo[0],foo[1]);
+  for (i=1;i<l;i++) {
+    inout[l-i]= complex<double> (foo[2*i],foo[2*i+1]);
+  }
+  delete[] foo;
+  */
+}
+
+void FFTPackServer::fftb(int l, float* inout)
+{
+  checkint_rfft(l);
+  rfftf_(&l, inout, ws_rfft);
+}
+
+void FFTPackServer::fftb(int l, double* inout)
+{
+  checkint_dfft(l);
+  dfftf_(&l, inout, ws_dfft);
+}
+
+void FFTPackServer::fftb(int l, complex<float>* inout)
+{
+  checkint_cfft(l);
+  cfftb_(&l, (float *)(inout), ws_cfft);
+  /*
+  float* foo = new float[2*l];
+  int i;
+  for (i=0;i<l;i++){
+    foo[2*i]=inout[i].real();
+    foo[2*i+1]=inout[i].imag();
+  }
+  cfftf_(&l, foo, ws_cfft);
+  for (i=0;i<l;i++) inout[i]=complex<float> (foo[2*i],foo[2*i+1]);
+  delete[] foo;
+  */
+}
+
+void FFTPackServer::fftb(int l, complex<double>* inout)
+{
+  checkint_cdfft(l);
+  cfftb_(&l, (float *)(inout), ws_cfft);
+  /*
+  double* foo = new double[2*l];
+  int i;
+  for (i=0;i<l;i++){
+    foo[2*i]=inout[i].real();
+    foo[2*i+1]=inout[i].imag();
+  }
+  cdfftf_(&l, foo, ws_cdfft);
+  for (i=0;i<l;i++) inout[i]=complex<double> (foo[2*i],foo[2*i+1]);
+  delete[] foo;
+  */
+}
+
Index: trunk/SophyaLib/NTools/fftpserver.h
===================================================================
--- trunk/SophyaLib/NTools/fftpserver.h	(revision 710)
+++ trunk/SophyaLib/NTools/fftpserver.h	(revision 710)
@@ -0,0 +1,63 @@
+#ifndef  FFTPServer_H_SEEN
+#define  FFTPServer_H_SEEN
+
+#include "fftservintf.h"
+
+// implementation de FFTServerInterface en utilisant FFTPack 
+
+namespace SOPHYA {
+
+class FFTPackServer : public FFTServerInterface {
+ public:
+  FFTPackServer();
+  virtual ~FFTPackServer();
+
+  // Implementation de l'interface FFTServerInterface
+
+  virtual FFTServerInterface * Clone();
+
+  virtual void FFTForward(TVector< complex<r_8> > const & in, TVector< complex<r_8> > & out);
+  virtual void FFTBackward(TVector< complex<r_8> > const & in, TVector< complex<r_8> > & out);
+  virtual void FFTForward(TVector< r_8 > const & in, TVector< complex<r_8> > & out);
+  virtual void FFTBackward(TVector< complex<r_8> > const & in, TVector< r_8 > & out);
+
+  virtual void FFTForward(TVector< complex<r_4> > const & in, TVector< complex<r_4> > & out);
+  virtual void FFTBackward(TVector< complex<r_4> > const & in, TVector< complex<r_4> > & out);
+  virtual void FFTForward(TVector< r_4 > const & in, TVector< complex<r_4> > & out);
+  virtual void FFTBackward(TVector< complex<r_4> > const & in, TVector< r_4 > & out);
+
+  //  Methodes propres a cette classe
+  virtual void fftf(int l, float* inout);
+  virtual void fftb(int l, float* inout);
+  virtual void fftf(int l, double* inout);
+  virtual void fftb(int l, double* inout);
+  virtual void fftf(int l, complex<float>* inout);
+  virtual void fftb(int l, complex<float>* inout);
+  virtual void fftf(int l, complex<double>* inout);
+  virtual void fftb(int l, complex<double>* inout);
+
+ protected:
+  virtual void checkint_rfft(int l);
+  virtual void checkint_dfft(int l);
+  virtual void checkint_cfft(int l);
+  virtual void checkint_cdfft(int l);
+
+  int sz_rfft;
+  float* ws_rfft;
+
+  int sz_cfft;
+  float* ws_cfft;
+
+  int sz_dfft;
+  double* ws_dfft;
+
+  int sz_cdfft;
+  double* ws_cdfft;
+};
+
+} // Fin du namespace
+
+
+
+
+#endif
Index: trunk/SophyaLib/NTools/fftservintf.cc
===================================================================
--- trunk/SophyaLib/NTools/fftservintf.cc	(revision 710)
+++ trunk/SophyaLib/NTools/fftservintf.cc	(revision 710)
@@ -0,0 +1,204 @@
+#include "fftservintf.h"
+
+
+
+/* --Methode-- */
+FFTServerInterface::FFTServerInterface(string info)
+{
+  _info = info;
+  _fgnorm = false;
+}
+
+/* --Methode-- */
+FFTServerInterface::~FFTServerInterface()
+{
+}
+
+/* --Methode-- */
+void FFTServerInterface::FFTForward(TVector< complex<r_8> > const &, TVector< complex<r_8> > &)
+{
+  throw ForbiddenError("FFTServer::FFTForward(TVector...) Unsupported operation !");
+}
+
+/* --Methode-- */
+void FFTServerInterface::FFTBackward(TVector< complex<r_8> > const &, TVector< complex<r_8> > &)
+{
+  throw ForbiddenError("FFTServer::FFTBackward(TVector...) Unsupported operation !");
+}
+
+/* --Methode-- */
+void FFTServerInterface::FFTForward(TVector< r_8 > const &, TVector< complex<r_8> > &)
+{
+  throw ForbiddenError("FFTServer::FFTForward(TVector...) Unsupported operation !");
+}
+
+/* --Methode-- */
+void FFTServerInterface::FFTBackward(TVector< complex<r_8> > const &, TVector< r_8 > &)
+{
+  throw ForbiddenError("FFTServer::FFTBackward(TVector...) Unsupported operation !");
+}
+
+/* --Methode-- */
+void FFTServerInterface::FFTForward(TMatrix< complex<r_8> > const &, TMatrix< complex<r_8> > &)
+{
+  throw ForbiddenError("FFTServer::FFTForward(TMatrix...) Unsupported operation !");
+}
+
+/* --Methode-- */
+void FFTServerInterface::FFTBackward(TMatrix< complex<r_8> > const &, TMatrix< complex<r_8> > &)
+{
+  throw ForbiddenError("FFTServer::FFTBackward(TMatrix...) Unsupported operation !");
+}
+
+/* --Methode-- */
+void FFTServerInterface::FFTForward(TMatrix< r_8 > const &, TMatrix< complex<r_8> > &)
+{
+  throw ForbiddenError("FFTServer::FFTForward(TMatrix...) Unsupported operation !");
+}
+
+/* --Methode-- */
+void FFTServerInterface::FFTBackward(TMatrix< complex<r_8> > const &, TMatrix< r_8 > &)
+{
+  throw ForbiddenError("FFTServer::FFTBackward(TMatrix...) Unsupported operation !");
+}
+
+
+// ----------------- Transforme pour les float -------------------
+
+/* --Methode-- */
+void FFTServerInterface::FFTForward(TVector< complex<r_4> > const &, TVector< complex<r_4> > &)
+{
+  throw ForbiddenError("FFTServer::FFTForward(TVector r_4 ... ) Unsupported operation !");
+}
+
+/* --Methode-- */
+void FFTServerInterface::FFTBackward(TVector< complex<r_4> > const &, TVector< complex<r_4> > &)
+{
+  throw ForbiddenError("FFTServer::FFTBackward(TVector r_4 ... ) Unsupported operation !");
+}
+
+/* --Methode-- */
+void FFTServerInterface::FFTForward(TVector< r_4 > const &, TVector< complex<r_4> > &)
+{
+  throw ForbiddenError("FFTServer::FFTForward(TVector r_4 ... ) Unsupported operation !");
+}
+
+/* --Methode-- */
+void FFTServerInterface::FFTBackward(TVector< complex<r_4> > const &, TVector< r_4 > &)
+{
+  throw ForbiddenError("FFTServer::FFTBackward(TVector r_4 ... ) Unsupported operation !");
+}
+
+/* --Methode-- */
+void FFTServerInterface::FFTForward(TMatrix< complex<r_4> > const &, TMatrix< complex<r_4> > &)
+{
+  throw ForbiddenError("FFTServer::FFTForward(TMatrix r_4 ... ) Unsupported operation !");
+}
+
+/* --Methode-- */
+void FFTServerInterface::FFTBackward(TMatrix< complex<r_4> > const &, TMatrix< complex<r_4> > &)
+{
+  throw ForbiddenError("FFTServer::FFTBackward(TMatrix r_4 ... ) Unsupported operation !");
+}
+
+/* --Methode-- */
+void FFTServerInterface::FFTForward(TMatrix< r_4 > const &, TMatrix< complex<r_4> > &)
+{
+  throw ForbiddenError("FFTServer::FFTForward(TMatrix r_4 ... ) Unsupported operation !");
+}
+
+/* --Methode-- */
+void FFTServerInterface::FFTBackward(TMatrix< complex<r_4> > const &, TMatrix< r_4 > &)
+{
+  throw ForbiddenError("FFTServer::FFTBackward(TMatrix r_4 ... ) Unsupported operation !");
+}
+
+
+// Methodes pour reordonner les donnees 
+
+/* --Methode-- */
+void FFTServerInterface::ReShapetoReal( TVector< complex<r_8> > const & in, TVector< r_8 >  & out)
+{
+  int N = in.NElts();
+  out.ReSize(in.NElts()*2);
+  out(0) = in(0).real();
+  if (in(in.NElts()-1).imag() == 0)  {
+    for(int i=1; i<in.NElts(); i++)
+      out(i) = in(i).real();
+
+    for(int i=1; i<in.NElts(); i++)
+      out(i+in.NElts()-1) = in(in.NElts()-i-1).imag();
+
+  }
+  else    {
+    for(int i=1; i<in.NElts(); i++)
+      out(i) = in(i).real();
+    for(int i=1; i<in.NElts(); i++)
+      out(i+in.NElts()-1) = in(in.NElts()-i).imag();
+  }
+}
+/* --Methode-- */
+void FFTServerInterface::ReShapetoReal( TVector< complex<r_4> > const & in, TVector< r_4 >  & out)
+{
+  int N = in.NElts();
+  out.ReSize(in.NElts()*2);
+  out(0) = in(0).real();
+  if (in(in.NElts()-1).imag() == 0)  {
+    for(int i=1; i<in.NElts(); i++)
+      out(i) = in(i).real();
+
+    for(int i=1; i<in.NElts(); i++)
+      out(i+in.NElts()-1) = in(in.NElts()-i-1).imag();
+
+  }
+  else    {
+    for(int i=1; i<in.NElts(); i++)
+      out(i) = in(i).real();
+    for(int i=1; i<in.NElts(); i++)
+      out(i+in.NElts()-1) = in(in.NElts()-i).imag();
+  }
+}
+
+
+/* --Methode-- */
+void FFTServerInterface::ReShapetoCompl(TVector< r_8 > const & in, TVector< complex<r_8> > & out)
+{
+  int N = in.NElts();
+  out.ReSize(N/2+1);
+  out(0) = complex<r_8> (in(0),0.);
+
+  if(in.NElts()%2 !=0) {
+    for(int k=1;k<=N/2+1;k++) {
+      out(k) =  complex<r_8> (in(k),in(N-k));
+    }
+  }
+  else  {
+    for(int k=1;k<N/2;k++)  {
+      out(k) =  complex<r_8> (in(k),in(N-k));
+    }
+    out(N/2) = complex<r_8> (in(N/2),0.);
+  }
+
+}
+
+/* --Methode-- */
+void FFTServerInterface::ReShapetoCompl(TVector< r_4 > const & in, TVector< complex<r_4> > & out)
+{
+  int N = in.NElts();
+  out.ReSize(N/2+1);
+  out(0) = complex<r_4> (in(0),0.);
+
+  if(in.NElts()%2 !=0) {
+    for(int k=1;k<=N/2+1;k++) {
+      out(k) =  complex<r_4> (in(k),in(N-k));
+    }
+  }
+  else  {
+    for(int k=1;k<N/2;k++)  {
+      out(k) =  complex<r_4> (in(k),in(N-k));
+    }
+    out(N/2) = complex<r_4> (in(N/2),0.);
+  }
+
+}
+
Index: trunk/SophyaLib/NTools/fftservintf.h
===================================================================
--- trunk/SophyaLib/NTools/fftservintf.h	(revision 710)
+++ trunk/SophyaLib/NTools/fftservintf.h	(revision 710)
@@ -0,0 +1,70 @@
+#ifndef  FFTServerIntf_H_SEEN
+#define  FFTServerIntf_H_SEEN
+
+#include "machdefs.h"
+#include "pexceptions.h"
+#include <complex>
+#include "tmatrix.h"
+#include "tvector.h"
+
+// Classe definissant l'interface pour les transformees de Fourier 
+// L'implementation par defaut est vide et lance une exception 
+
+namespace SOPHYA {
+
+class FFTServerInterface {
+ public:
+
+// Methodes de la classe 
+  FFTServerInterface(string info);
+  virtual ~FFTServerInterface();
+
+  
+  virtual FFTServerInterface * Clone() = 0;
+
+  inline void setNormalize(bool fg=false) { _fgnorm = fg; }
+  inline bool getNormalize() const { return(_fgnorm); } 
+  inline string getInfo() const { return _info; }
+
+  // Transforme unidimensionnel sur des doubles
+  virtual void FFTForward(TVector< complex<r_8> > const & in, TVector< complex<r_8> > & out);
+  virtual void FFTBackward(TVector< complex<r_8> > const & in, TVector< complex<r_8> > & out);
+  virtual void FFTForward(TVector< r_8 > const & in, TVector< complex<r_8> > & out);
+  virtual void FFTBackward(TVector< complex<r_8> > const & in, TVector< r_8 > & out);
+
+  // Transforme unidimensionnel sur des float
+  virtual void FFTForward(TVector< complex<r_4> > const & in, TVector< complex<r_4> > & out);
+  virtual void FFTBackward(TVector< complex<r_4> > const & in, TVector< complex<r_4> > & out);
+  virtual void FFTForward(TVector< r_4 > const & in, TVector< complex<r_4> > & out);
+  virtual void FFTBackward(TVector< complex<r_4> > const & in, TVector< r_4 > & out);
+
+
+  //---------------------------------------------------
+  // Transforme 2D sur des doubles
+  virtual void FFTForward(TMatrix< complex<r_8> > const & in, TMatrix< complex<r_8> > & out);
+  virtual void FFTBackward(TMatrix< complex<r_8> > const & in, TMatrix< complex<r_8> > & out);
+  virtual void FFTForward(TMatrix< r_8 > const & in, TMatrix< complex<r_8> > & out);
+  virtual void FFTBackward(TMatrix< complex<r_8> > const & in, TMatrix< r_8 > & out);
+
+  // Transforme 2D sur des float
+  virtual void FFTForward(TMatrix< complex<r_4> > const & in, TMatrix< complex<r_4> > & out);
+  virtual void FFTBackward(TMatrix< complex<r_4> > const & in, TMatrix< complex<r_4> > & out);
+  virtual void FFTForward(TMatrix< r_4 > const & in, TMatrix< complex<r_4> > & out);
+  virtual void FFTBackward(TMatrix< complex<r_4> > const & in, TMatrix< r_4 > & out);
+
+// Methodes statiques pour reordonner les donnees 
+  virtual  void ReShapetoReal( TVector< complex<r_8> > const & in, TVector< r_8 >  & out);
+  virtual  void ReShapetoReal( TVector< complex<r_4> > const & in, TVector< r_4 >  & out);
+
+  virtual void ReShapetoCompl(TVector< r_8 > const & in, TVector< complex<r_8> > & out);
+  virtual void ReShapetoCompl(TVector< r_4 > const & in, TVector< complex<r_4> > & out);
+
+
+ protected:
+  bool _fgnorm;
+  string _info;
+};
+
+} // Fin du namespace
+
+#endif
