Index: trunk/SophyaLib/TArray/sopemtx.h
===================================================================
--- trunk/SophyaLib/TArray/sopemtx.h	(revision 850)
+++ trunk/SophyaLib/TArray/sopemtx.h	(revision 926)
@@ -7,19 +7,42 @@
 #include "tvector.h"
 
+// doivent imperativement reste avant le namespace SOPHYA !
+/*!
+  \class SOPHYA::SimpleMatrixOperation
+  \ingroup TArray
+  Class for simple operation on TMatrix
+  \sa TMatrix TArray
+  */
+/*!
+  \class SOPHYA::LinFitter
+  \ingroup TArray
+  Class for linear fitting
+  \sa TMatrix TArray
+  */
+
 namespace SOPHYA {
 
-
-
 ////////////////////////////////////////////////////////////////
+//! Class for simple operation on TMatrix
 template <class T>
 class SimpleMatrixOperation {
 public:
-  // Pivot de Gauss : diagonalise la matrice A, en effectuant les memes
-  // operations sur la matrice B
   static TMatrix<T> Inverse(TMatrix<T> const & A);
   static T GausPiv(TMatrix<T>& A, TMatrix<T>& B);
 };
 
+////////////////////////////////////////////////////////////////
 // Resolution du systeme A*C = B
+//! Solve A*C = B for C in place and return determinant
+/*! \ingroup TArray \fn LinSolveInPlace */
+inline r_4 LinSolveInPlace(TMatrix<r_4>& a, TVector<r_4>& b)
+{
+if(a.NCols() != b.NRows() || a.NCols() != a.NRows())
+  throw(SzMismatchError("LinSolveInPlace(TMatrix<r_4>,TVector<r_4>) size mismatch"));
+return SimpleMatrixOperation<r_4>::GausPiv(a,b);
+}
+
+//! Solve A*X = B in place and return determinant
+/*! \ingroup TArray \fn LinSolveInPlace */
 inline r_8 LinSolveInPlace(TMatrix<r_8>& a, TVector<r_8>& b)
 {
@@ -29,34 +52,78 @@
 }
 
-// Resolution du systeme A*C = B, avec C retourne dans B
-inline r_8 LinSolve(const TMatrix<r_8>& a, const TVector<r_8>& b, TVector<r_8>& c)
-{ 
+//! Solve A*X = B in place and return determinant
+/*! \ingroup TArray \fn LinSolveInPlace */
+inline complex<r_4> LinSolveInPlace(TMatrix< complex<r_4> >& a, TVector< complex<r_4> >& b)
+{
 if(a.NCols() != b.NRows() || a.NCols() != a.NRows())
-  throw(SzMismatchError("LinSolve(TMatrix<r_8>,TVector<r_8>) size mismatch"));
-c = b;
-TMatrix<r_8> a1(a);
-return SimpleMatrixOperation<r_8>::GausPiv(a1,c);
+  throw(SzMismatchError("LinSolveInPlace(TMatrix< complex<r_4> >,TVector< complex<r_4> >) size mismatch"));
+return SimpleMatrixOperation< complex<r_4> >::GausPiv(a,b);
 }
 
-inline r_4 LinSolve(const TMatrix<r_4>& a, const TVector<r_4>& b, TVector<r_4>& c)
-{ 
+//! Solve A*X = B in place and return determinant
+/*! \ingroup TArray \fn LinSolveInPlace */
+inline complex<r_8> LinSolveInPlace(TMatrix< complex<r_8> >& a, TVector< complex<r_8> >& b)
+{
 if(a.NCols() != b.NRows() || a.NCols() != a.NRows())
-  throw(SzMismatchError("LinSolve(TMatrix<r_4>,TVector<r_4>) size mismatch"));
-c = b;
-TMatrix<r_4> a1(a);
-return SimpleMatrixOperation<r_4>::GausPiv(a1,c);
+  throw(SzMismatchError("LinSolveInPlace(TMatrix< complex<r_8> >,TVector< complex<r_8> >) size mismatch"));
+return SimpleMatrixOperation< complex<r_8> >::GausPiv(a,b);
 }
 
-// Inverse d'une matrice 
-inline TMatrix<r_8> Inverse(TMatrix<r_8> const & A)
-{
-  return SimpleMatrixOperation<r_8>::Inverse(A);
+////////////////////////////////////////////////////////////////
+// Resolution du systeme A*C = B, avec C retourne dans B
+//! Solve A*C = B and return C and determinant
+/*! \ingroup TArray \fn LinSolve */
+inline r_4 LinSolve(const TMatrix<r_4>& a, const TVector<r_4>& b, TVector<r_4>& c) {
+  if(a.NCols()!=b.NRows() || a.NCols()!=a.NRows())
+    throw(SzMismatchError("LinSolve(TMatrix<r_4>,TVector<r_4>) size mismatch"));
+    c = b; TMatrix<r_4> a1(a);
+  return SimpleMatrixOperation<r_4>::GausPiv(a1,c);
 }
 
-inline TMatrix<r_4> Inverse(TMatrix<r_4> const & A)
-{
-  return SimpleMatrixOperation<r_4>::Inverse(A);
+//! Solve A*C = B and return C and determinant
+/*! \ingroup TArray \fn LinSolve */
+inline r_8 LinSolve(const TMatrix<r_8>& a, const TVector<r_8>& b, TVector<r_8>& c) {
+  if(a.NCols()!=b.NRows() || a.NCols()!=a.NRows())
+    throw(SzMismatchError("LinSolve(TMatrix<r_8>,TVector<r_8>) size mismatch"));
+    c = b; TMatrix<r_8> a1(a);
+  return SimpleMatrixOperation<r_8>::GausPiv(a1,c);
 }
 
+//! Solve A*C = B and return C and determinant
+/*! \ingroup TArray \fn LinSolve */
+inline complex<r_4> LinSolve(const TMatrix< complex<r_4> >& a, const TVector< complex<r_4> >& b, TVector< complex<r_4> >& c) {
+  if(a.NCols()!=b.NRows() || a.NCols()!=a.NRows())
+    throw(SzMismatchError("LinSolve(TMatrix< complex<r_4> >,TVector< complex<r_4> >) size mismatch"));
+    c = b; TMatrix< complex<r_4> > a1(a);
+  return SimpleMatrixOperation< complex<r_4> >::GausPiv(a1,c);
+}
+
+//! Solve A*C = B and return C and determinant
+/*! \ingroup TArray \fn LinSolve */
+inline complex<r_8> LinSolve(const TMatrix< complex<r_8> >& a, const TVector< complex<r_8> >& b, TVector< complex<r_8> >& c) {
+  if(a.NCols()!=b.NRows() || a.NCols()!=a.NRows())
+    throw(SzMismatchError("LinSolve(TMatrix< complex<r_8> >,TVector< complex<r_8> >) size mismatch"));
+    c = b; TMatrix< complex<r_8> > a1(a);
+  return SimpleMatrixOperation< complex<r_8> >::GausPiv(a1,c);
+}
+
+////////////////////////////////////////////////////////////////
+// Inverse d'une matrice
+//! To inverse a TMatrix
+/*! \ingroup TArray \fn Inverse */
+inline TMatrix<r_4> Inverse(TMatrix<r_4> const & A)
+  {return SimpleMatrixOperation<r_4>::Inverse(A);}
+//! To inverse a TMatrix
+/*! \ingroup TArray \fn Inverse */
+inline TMatrix<r_8> Inverse(TMatrix<r_8> const & A)
+  {return SimpleMatrixOperation<r_8>::Inverse(A);}
+//! To inverse a TMatrix
+/*! \ingroup TArray \fn Inverse */
+inline TMatrix< complex<r_4> > Inverse(TMatrix< complex<r_4> > const & A)
+  {return SimpleMatrixOperation< complex<r_4> >::Inverse(A);}
+//! To inverse a TMatrix
+/*! \ingroup TArray \fn Inverse */
+inline TMatrix< complex<r_8> > Inverse(TMatrix< complex<r_8> > const & A)
+  {return SimpleMatrixOperation< complex<r_8> >::Inverse(A);}
 
 //--------------------------------------
@@ -64,4 +131,5 @@
 //--------------------------------------
 
+//!  Class for linear fitting
 class LinFitter {
 public :
