Index: /trunk/SophyaLib/TArray/tarray.cc
===================================================================
--- /trunk/SophyaLib/TArray/tarray.cc	(revision 2751)
+++ /trunk/SophyaLib/TArray/tarray.cc	(revision 2752)
@@ -7,4 +7,6 @@
 #include <stdlib.h>
 #include <math.h>
+#include <iomanip>
+
 #include "pexceptions.h"
 #include "tarray.h"
@@ -1303,6 +1305,23 @@
   if (maxprt < 0)  maxprt = max_nprt_;
   sa_size_t npr = 0;
+  // keep stream's io flags 
+  ios_base::fmtflags ioflg = os.flags();
+  os << right ;
+  
   Show(os, si);
   if (ndim_ < 1) return;
+
+  // Calcul de la largeur d'impression pour chaque element
+  int fprtw = os.precision()+7;
+  int prtw = 5;
+
+  if ( (typeid(T) == typeid( int_4 )) || (typeid(T) == typeid( uint_4 )) ) prtw = 8;
+  else if ( (typeid(T) == typeid( int_8 )) || (typeid(T) == typeid( uint_8 )) ) prtw = 11;
+  else if ( typeid(T) == typeid( r_4 ) ) prtw = fprtw;
+  else if ( typeid(T) == typeid( r_8 ) ) prtw = fprtw;
+  else if ( typeid(T) == typeid(complex<r_4>) ) prtw = fprtw;
+  else if ( typeid(T) == typeid(complex<r_8>) ) prtw = fprtw;
+
+
   sa_size_t k0,k1,k2,k3,k4;
   for(k4=0; k4<size_[4]; k4++) {
@@ -1320,5 +1339,5 @@
 	  for(k0=0; k0<size_[0]; k0++) {
             if(k0 > 0) os << " ";  
-            os << Elem(k0, k1, k2, k3, k4);     npr++;
+            os << setw(prtw) << Elem(k0, k1, k2, k3, k4);     npr++;
 	    if (npr >= (sa_size_t) maxprt) {
 	      if (npr < totsize_)  os << "\n     .... " << endl; return;
@@ -1331,4 +1350,5 @@
   }
   os <<  endl;
+  os.flags(ioflg);  // reset stream io flags
 }
 
Index: /trunk/SophyaLib/TArray/tmatrix.cc
===================================================================
--- /trunk/SophyaLib/TArray/tmatrix.cc	(revision 2751)
+++ /trunk/SophyaLib/TArray/tmatrix.cc	(revision 2752)
@@ -1,6 +1,8 @@
-// $Id: tmatrix.cc,v 1.29 2004-09-10 09:55:07 cmv Exp $
+// $Id: tmatrix.cc,v 1.30 2005-05-23 16:18:17 ansari Exp $
 //                         C.Magneville          04/99
 #include "sopnamsp.h"
 #include "machdefs.h"
+#include <iostream>
+#include <iomanip>
 #include <stdio.h>
 #include <stdlib.h>
@@ -102,27 +104,10 @@
 
 //! Constructor of a matrix from a TArray \b a
-template <class T>
-TMatrix<T>::TMatrix(const TArray<T>& a)
-: TArray<T>(a)
-{
-  if (a.NbDimensions() > 2) 
-    throw SzMismatchError("TMatrix<T>::TMatrix(const TArray<T>& a) a.NbDimensions()>2 ");
-  if (a.NbDimensions() == 1) {
-    size_[1] = 1;
-    step_[1] = size_[0]*step_[0];
-    ndim_ = 2;
-  }
-  arrtype_ = 1;   // Type = Matrix
-  UpdateMemoryMapping(a, SameMemoryMapping);
-}
-
-//! Constructor of a matrix from a TArray \b a
 /*!
   \param a : TArray to be copied or shared
   \param share : if true, share data. If false copy data
-  \param mm : define the memory mapping type
- */
-template <class T>
-TMatrix<T>::TMatrix(const TArray<T>& a, bool share, short mm )
+ */
+template <class T>
+TMatrix<T>::TMatrix(const TArray<T>& a, bool share)
 : TArray<T>(a, share)
 {
@@ -135,5 +120,5 @@
   }
   arrtype_ = 1;   // Type = Matrix
-  UpdateMemoryMapping(a, mm);
+  UpdateMemoryMapping(a, SameMemoryMapping);
 }
 
@@ -264,9 +249,9 @@
 TMatrix<T> TMatrix<T>::SubMatrix(Range rline, Range rcol) const
 {
+  Range rx, ry;
   short mm = GetMemoryMapping();
-  Range rx, ry;
   if (mm == CMemoryMapping)  { rx = rcol;  ry = rline; }
   else { ry = rcol;  rx = rline; }
-  TMatrix sm(SubArray(rx, ry, Range(0), Range(0), Range(0)),true, mm);
+  TMatrix sm(SubArray(rx, ry, Range(0), Range(0), Range(0)),true);
   sm.UpdateMemoryMapping(mm);
   return(sm);
@@ -389,6 +374,22 @@
   if (maxprt < 0)  maxprt = max_nprt_;
   sa_size_t npr = 0;
+
+  // keep stream's io flags 
+  ios_base::fmtflags ioflg = os.flags();
+  os << right ;
+
   Show(os, si);
   if (ndim_ < 1)  return;
+  // Calcul de la largeur d'impression pour chaque element
+  int fprtw = os.precision()+7;
+  int prtw = 5;
+
+  if ( (typeid(T) == typeid( int_4 )) || (typeid(T) == typeid( uint_4 )) ) prtw = 8;
+  else if ( (typeid(T) == typeid( int_8 )) || (typeid(T) == typeid( uint_8 )) ) prtw = 11;
+  else if ( typeid(T) == typeid( r_4 ) ) prtw = fprtw;
+  else if ( typeid(T) == typeid( r_8 ) ) prtw = fprtw;
+  else if ( typeid(T) == typeid(complex<r_4>) ) prtw = fprtw;
+  else if ( typeid(T) == typeid(complex<r_8>) ) prtw = fprtw;
+
   sa_size_t kc,kr;  
   for(kr=0; kr<size_[marowi_]; kr++) {
@@ -396,5 +397,5 @@
     for(kc=0; kc<size_[macoli_]; kc++) {
       if(kc > 0) os << " ";  
-      os << (*this)(kr, kc);   npr++; 
+      os << setw(prtw) << (*this)(kr, kc);   npr++; 
       if (npr >= (sa_size_t) maxprt) {
 	if (npr < totsize_)  os << "\n     .... " << endl; return;
@@ -404,4 +405,5 @@
   }
   os << endl;
+  os.flags(ioflg);  // reset stream io flags
 }
 
Index: /trunk/SophyaLib/TArray/tmatrix.h
===================================================================
--- /trunk/SophyaLib/TArray/tmatrix.h	(revision 2751)
+++ /trunk/SophyaLib/TArray/tmatrix.h	(revision 2752)
@@ -18,6 +18,5 @@
   TMatrix(const TMatrix<T>& a);
   TMatrix(const TMatrix<T>& a, bool share);
-  TMatrix(const TArray<T>& a); 
-  TMatrix(const TArray<T>& a,  bool share, short mm=BaseArray::AutoMemoryMapping);
+  TMatrix(const TArray<T>& a,  bool share=true);
   TMatrix(const BaseArray& a); 
 
Index: /trunk/SophyaLib/TArray/tvector.cc
===================================================================
--- /trunk/SophyaLib/TArray/tvector.cc	(revision 2751)
+++ /trunk/SophyaLib/TArray/tvector.cc	(revision 2752)
@@ -1,3 +1,3 @@
-// $Id: tvector.cc,v 1.18 2005-05-13 16:44:30 cmv Exp $
+// $Id: tvector.cc,v 1.19 2005-05-23 16:18:17 ansari Exp $
 //                         C.Magneville          04/99
 #include "sopnamsp.h"
@@ -91,13 +91,4 @@
 }
 
-//! Constructor from a TArray
-template <class T>
-TVector<T>::TVector(const TArray<T>& a)
-: TMatrix<T>(a)
-{
-  if ( (size_[0] != 1) && (size_[1] != 1) )
-    throw SzMismatchError("TVector<T>::TVector(const TArray<T>& a) NRows()!=1 && NCols()!=1 ");
-  arrtype_ = 2;   // Type = Vector
-}
 
 //! Constructor of a vector from a TArray \b a
@@ -105,11 +96,10 @@
   \param a : TArray to be copied or shared
   \param share : if true, share data. If false copy data
-  \param mm : define the memory mapping type
   \param lcv : line or column vector ?
   \sa SelectVectorType
  */
 template <class T>
-TVector<T>::TVector(const TArray<T>& a, bool share, short lcv, short mm)
-: TMatrix<T>(a, share, mm)
+TVector<T>::TVector(const TArray<T>& a, bool share, short lcv)
+: TMatrix<T>(a, share)
 {
   if ( (size_[0] != 1) && (size_[1] != 1) )
@@ -202,5 +192,5 @@
   else cr = relt;
   TMatrix<T> const & mtx = (*this);
-  TVector sv( mtx(rr, cr) , true, GetVectorType(), GetMemoryMapping() );
+  TVector sv( mtx(rr, cr) , true, GetVectorType() );
   return(sv);  
 }
Index: /trunk/SophyaLib/TArray/tvector.h
===================================================================
--- /trunk/SophyaLib/TArray/tvector.h	(revision 2751)
+++ /trunk/SophyaLib/TArray/tvector.h	(revision 2752)
@@ -17,6 +17,5 @@
   TVector(const TVector<T>& v);
   TVector(const TVector<T>& v, bool share);
-  TVector(const TArray<T>& a);
-  TVector(const TArray<T>& a,  bool share, short lcv=AutoVectorType, short mm=AutoMemoryMapping);
+  TVector(const TArray<T>& a,  bool share=true, short lcv=AutoVectorType);
   TVector(const BaseArray& a);
   TVector(const vector<T>& v, short lcv=AutoVectorType);
Index: /trunk/SophyaLib/TArray/utilarr.cc
===================================================================
--- /trunk/SophyaLib/TArray/utilarr.cc	(revision 2751)
+++ /trunk/SophyaLib/TArray/utilarr.cc	(revision 2752)
@@ -287,5 +287,5 @@
     if (is.good()) {
       if ((line.length() > 0) && (line[0]!=clm)) {
-	nel = Append(line, nbad);
+	nel = Append(line, nbad, sep);
 	if (nel > 0)  { 
 	  nr++;  n += nel;
@@ -298,5 +298,5 @@
   }
   if ((line.length() > 0) && (line[0]!=clm)) {
-    nel = Append(line, nbad);
+    nel = Append(line, nbad, sep);
     //        cout << " Decoding Eline = " << line << " Nel= " << nel << endl;
     if (nel > 0)  { 
