Index: trunk/SophyaLib/NTools/fftmserver.cc
===================================================================
--- trunk/SophyaLib/NTools/fftmserver.cc	(revision 1401)
+++ trunk/SophyaLib/NTools/fftmserver.cc	(revision 1402)
@@ -246,5 +246,6 @@
 
 /* --Methode-- */
-void FFTMayerServer::FFTBackward(TArray< complex<r_4> > const & ina, TArray< r_4 > & outa)
+void FFTMayerServer::FFTBackward(TArray< complex<r_4> > const & ina, TArray< r_4 > & outa,
+				 bool usoutsz)
 {
  ckR4.CheckResize(ina, outa);
@@ -338,5 +339,6 @@
 
 /* --Methode-- */
-void FFTMayerServer::FFTBackward(TArray< complex<r_8> > const & ina, TArray< r_8 > & outa)
+void FFTMayerServer::FFTBackward(TArray< complex<r_8> > const & ina, TArray< r_8 > & outa,
+				 bool usoutsz)
 {
  ckR8.CheckResize(ina, outa);
Index: trunk/SophyaLib/NTools/fftmserver.h
===================================================================
--- trunk/SophyaLib/NTools/fftmserver.h	(revision 1401)
+++ trunk/SophyaLib/NTools/fftmserver.h	(revision 1402)
@@ -21,5 +21,6 @@
   virtual void FFTBackward(TArray< complex<r_8> > const & in, TArray< complex<r_8> > & out);
   virtual void FFTForward(TArray< r_8 > const & in, TArray< complex<r_8> > & out);
-  virtual void FFTBackward(TArray< complex<r_8> > const & in, TArray< r_8 > & out);
+  virtual void FFTBackward(TArray< complex<r_8> > const & in, TArray< r_8 > & out,
+			   bool usoutsz=false);
 
 
@@ -28,5 +29,6 @@
   virtual void FFTBackward(TArray< complex<r_4> > const & in, TArray< complex<r_4> > & out);
   virtual void FFTForward(TArray< r_4 > const & in, TArray< complex<r_4> > & out);
-  virtual void FFTBackward(TArray< complex<r_4> > const & in, TArray< r_4 > & out);
+  virtual void FFTBackward(TArray< complex<r_4> > const & in, TArray< r_4 > & out,
+			   bool usoutsz=false);
 
 
Index: trunk/SophyaLib/NTools/fftpserver.cc
===================================================================
--- trunk/SophyaLib/NTools/fftpserver.cc	(revision 1401)
+++ trunk/SophyaLib/NTools/fftpserver.cc	(revision 1402)
@@ -97,7 +97,8 @@
 }
 
-void FFTPackServer::FFTBackward(TArray< complex<r_4> > const & in, TArray< r_4 > & out)
-{
-  ckR4.CheckResize(in, out);    
+void FFTPackServer::FFTBackward(TArray< complex<r_4> > const & in, TArray< r_4 > & out,
+				bool usoutsz)
+{
+  ckR4.CheckResize(in, out, usoutsz);    
   ReShapetoReal(in, out);
   fftb(out.Size(), out.Data());
@@ -114,7 +115,8 @@
 }
 
-void FFTPackServer::FFTBackward(TArray< complex<r_8> > const & in, TArray< r_8 > & out)
-{
-  ckR8.CheckResize(in, out);  
+void FFTPackServer::FFTBackward(TArray< complex<r_8> > const & in, TArray< r_8 > & out,
+				bool usoutsz)
+{
+  ckR8.CheckResize(in, out, usoutsz);  
   ReShapetoReal(in, out);
   fftb(out.Size(), out.Data());
Index: trunk/SophyaLib/NTools/fftpserver.h
===================================================================
--- trunk/SophyaLib/NTools/fftpserver.h	(revision 1401)
+++ trunk/SophyaLib/NTools/fftpserver.h	(revision 1402)
@@ -26,5 +26,6 @@
   virtual void FFTBackward(TArray< complex<r_8> > const & in, TArray< complex<r_8> > & out);
   virtual void FFTForward(TArray< r_8 > const & in, TArray< complex<r_8> > & out);
-  virtual void FFTBackward(TArray< complex<r_8> > const & in, TArray< r_8 > & out);
+  virtual void FFTBackward(TArray< complex<r_8> > const & in, TArray< r_8 > & out, 
+			   bool usoutsz=false);
 
   // Transforme unidimensionnel sur des float
@@ -32,5 +33,6 @@
   virtual void FFTBackward(TArray< complex<r_4> > const & in, TArray< complex<r_4> > & out);
   virtual void FFTForward(TArray< r_4 > const & in, TArray< complex<r_4> > & out);
-  virtual void FFTBackward(TArray< complex<r_4> > const & in, TArray< r_4 > & out);
+  virtual void FFTBackward(TArray< complex<r_4> > const & in, TArray< r_4 > & out,
+			   bool usoutsz=false);
 
 // Methodes statiques pour reordonner les donnees
Index: trunk/SophyaLib/NTools/fftservintf.cc
===================================================================
--- trunk/SophyaLib/NTools/fftservintf.cc	(revision 1401)
+++ trunk/SophyaLib/NTools/fftservintf.cc	(revision 1402)
@@ -41,5 +41,5 @@
 
 /* --Methode-- */
-void FFTServerInterface::FFTBackward(TArray< complex<r_8> > const &, TArray< r_8 > &)
+void FFTServerInterface::FFTBackward(TArray< complex<r_8> > const &, TArray< r_8 > &, bool)
 {
   throw NotAvailableOperation("FFTServer::FFTBackward(TArray...) Unsupported operation !");
@@ -68,5 +68,5 @@
 
 /* --Methode-- */
-void FFTServerInterface::FFTBackward(TArray< complex<r_4> > const &, TArray< r_4 > &)
+void FFTServerInterface::FFTBackward(TArray< complex<r_4> > const &, TArray< r_4 > &, bool)
 {
   throw NotAvailableOperation("FFTServer::FFTBackward(TArray r_4 ... ) Unsupported operation !");
@@ -183,5 +183,6 @@
 /* --Methode-- */
 template <class T>
-int FFTArrayChecker<T>::CheckResize(TArray< complex<T> > const & in, TArray< T > & out)
+int FFTArrayChecker<T>::CheckResize(TArray< complex<T> > const & in, TArray< T > & out, 
+				    bool usoutsz)
 {
   int k;
@@ -204,21 +205,35 @@
       throw(SzMismatchError(msg));
     }
-  sa_size_t sz[BASEARRAY_MAXNDIMS];
-  if (ndg1 > 1) {
-    sz[0] = 2*in.Size(0)-1;
-    for(k=1; k<in.NbDimensions(); k++) 
-      sz[k] = in.Size(k);
+  if (usoutsz) { // We have to use output array size 
+    bool fgerr = false;
+    if (ndg1 > 1) {
+      if (in.Size(0) != out.Size(0)/2+1) fgerr = true;
+    }      
+    else {
+      if (in.Size(in.MaxSizeKA()) != out.Size(in.MaxSizeKA())/2+1) fgerr = true;
+    }
+    if (fgerr) {
+	msg = _msg + "CheckResize(complex in, real out) - Incompatible in-out sizes !";
+	throw(SzMismatchError(msg));
+    }
+  }
+  else {  // We have to resize the output array 
+    sa_size_t sz[BASEARRAY_MAXNDIMS];
+    if (ndg1 > 1) {
+      sz[0] = 2*in.Size(0)-1;
+      for(k=1; k<in.NbDimensions(); k++) 
+	sz[k] = in.Size(k);
     //      sz[k] = in.Size(k)*2-1;
-  }
-  else {
-    for(k=0; k<BASEARRAY_MAXNDIMS; k++)  sz[k] = 1; 
-    T thr = ZeroThreshold();
-    sa_size_t n = in.Size(in.MaxSizeKA());
-    sa_size_t ncs = ( (in[n-1].imag() < -thr) || (in[n-1].imag() > thr) ) ?
-                    ncs = 2*n-1 : ncs = 2*n-2;
-    sz[in.MaxSizeKA()] = ncs;
-  }
-
+    }
+    else {
+      for(k=0; k<BASEARRAY_MAXNDIMS; k++)  sz[k] = 1; 
+      T thr = ZeroThreshold();
+      sa_size_t n = in.Size(in.MaxSizeKA());
+      sa_size_t ncs = ( (in[n-1].imag() < -thr) || (in[n-1].imag() > thr) ) ?
+	ncs = 2*n-1 : ncs = 2*n-2;
+      sz[in.MaxSizeKA()] = ncs;
+    }
   out.ReSize(in.NbDimensions(), sz);
+  }
 
   return(ndg1);
@@ -226,36 +241,4 @@
 }
 
-/* --Methode-- 
-template <class T>
-void FFTArrayChecker<T>::ReShapetoReal( TArray< complex<T> > const & in, TArray< T >  & out)
-{
-  sa_size_t n = in.Size();
-  //  int ncs = (fabs(in(n-1).imag()) > 1.e-12) ? ncs = 2*n-1 : ncs = n*2-2;
-  sa_size_t ncs = 2*n-1;
-  sa_size_t k;
-  out[0] = in[0].real();
-  for(k=1;k<n-1;k++) {
-    out[2*k-1] = in[k].real();
-    out[2*k] = in[k].imag();
-  }
-  //  if (ncs == n*2-2)  out[ncs-1] = in[n-1].real();
-  //  else { out[ncs-2] = in[n-1].real();  out[ncs-1] = in[n-1].imag(); }
-  out[ncs-2] = in[n-1].real();  out[ncs-1] = in[n-1].imag(); 
-}
-*/
-
-/* --Methode-- 
-template <class T>
-void FFTArrayChecker<T>::ReShapetoCompl(TArray< T > const & in, TArray< complex<T> > & out)
-{
-  sa_size_t n =  in.Size();
-  sa_size_t ncs = n/2+1;
-  sa_size_t nc = (n%2 != 0) ? n/2+1 : n/2;
-  out[0] = complex<T> (in[0],0.);
-  for(int k=1;k<nc;k++) 
-    out[k] =  complex<T> (in[2*k-1], in[2*k]);
-  if (n%2 == 0) out[ncs-1] = complex<r_8>(in[n-1], 0.);
-}
-*/
 
 #ifdef __CXX_PRAGMA_TEMPLATES__
Index: trunk/SophyaLib/NTools/fftservintf.h
===================================================================
--- trunk/SophyaLib/NTools/fftservintf.h	(revision 1401)
+++ trunk/SophyaLib/NTools/fftservintf.h	(revision 1402)
@@ -35,6 +35,7 @@
   virtual void FFTForward(TArray< complex<r_8> > const & in, TArray< complex<r_8> > & out);
   virtual void FFTBackward(TArray< complex<r_8> > const & in, TArray< complex<r_8> > & out);
-  virtual void FFTForward(TArray< r_8 > const & in, TArray< complex<r_8> > & out);
-  virtual void FFTBackward(TArray< complex<r_8> > const & in, TArray< r_8 > & out);
+  virtual void FFTForward(TArray< r_8 > const & in, TArray< complex<r_8> > & out); 
+  virtual void FFTBackward(TArray< complex<r_8> > const & in, TArray< r_8 > & out, 
+			   bool usoutsz=false);
 
   // Transforme N-dim sur des float
@@ -42,9 +43,12 @@
   virtual void FFTBackward(TArray< complex<r_4> > const & in, TArray< complex<r_4> > & out);
   virtual void FFTForward(TArray< r_4 > const & in, TArray< complex<r_4> > & out);
-  virtual void FFTBackward(TArray< complex<r_4> > const & in, TArray< r_4 > & out);
+  virtual void FFTBackward(TArray< complex<r_4> > const & in, TArray< r_4 > & out,
+			   bool usoutsz=false);
 
  protected:
+
   bool _fgnorm;
   string _info;
+  
 };
 
@@ -58,9 +62,13 @@
   virtual	~FFTArrayChecker();
   static T	ZeroThreshold();
+  
+  inline void	SetMsg(string const & msg) { _msg = msg; }
+  inline void	CheckPackedArray(bool ck=true) { _checkpack = ck; }
+  inline void	Accept1DOnly(bool ac1d=false) { _onedonly = ac1d; }
+
   virtual int	CheckResize(TArray< complex<T> > const & in, TArray< complex<T> > & out);
   virtual int	CheckResize(TArray< T > const & in, TArray< complex<T> > & out);
-  virtual int	CheckResize(TArray< complex<T> > const & in, TArray< T > & out);
-  //  virtual void  ReShapetoReal(TArray< complex<T> > const & in, TArray< T >  & out);
-  //  virtual void  ReShapetoCompl(TArray< T > const & in, TArray< complex<T> > & out); 
+  virtual int	CheckResize(TArray< complex<T> > const & in, TArray< T > & out, 
+			    bool usoutsz=false);
 
 protected:
@@ -68,4 +76,5 @@
   bool _checkpack;
   bool _onedonly;
+
 };
 
