Index: /trunk/SophyaLib/TArray/basarr.cc
===================================================================
--- /trunk/SophyaLib/TArray/basarr.cc	(revision 4034)
+++ /trunk/SophyaLib/TArray/basarr.cc	(revision 4035)
@@ -118,4 +118,5 @@
      mm == FortranMemoryMapping : Fortran like memory mapping
   \endverbatim
+  \return default memory mapping value
   \verbatim
   # ===== For Matrices
@@ -138,9 +139,8 @@
      ex: Mc[2][0] = Mmath(3,1) = 31
          Mc[0][2] = Mmath(1,3) = 13
-  *** RESUME diff Idl/Fortan/C/Math:
+  *** SUMMARY difference Idl/Fortan/C/Math:
     Midl(col-1,row-1) = Mfor(col,row) = Mc[row-1][col-1] = Mmath(row,col)
     TRANSPOSE(column-major array) --> row-major array
   \endverbatim
-  \return default memory mapping value
  */
 short BaseArray::SetDefaultMemoryMapping(short mm)
@@ -565,5 +565,5 @@
 }
 
-//! Return attached DVList
+//! Return the attached DVList info object 
 DVList& BaseArray::Info()
 {
@@ -571,4 +571,6 @@
 return(*mInfo);
 }
+
+
 
 //! Update sizes and information for array
Index: /trunk/SophyaLib/TArray/basarr.h
===================================================================
--- /trunk/SophyaLib/TArray/basarr.h	(revision 4034)
+++ /trunk/SophyaLib/TArray/basarr.h	(revision 4035)
@@ -160,6 +160,11 @@
   virtual void   WriteASCII(ostream& os) const = 0;
 
-  // DVList info Object
+  // Access to the DVList info Object
   DVList& Info();
+  //! return true if the  DVList info Object has been created (not empty)
+  inline bool HasInfoObject() const { return ((mInfo!=NULL)?true:false); }  
+
+//! Return the attached DVList object pointer (for special uses only TArray ... ) 
+  inline DVList* getInfoPointer() const { return mInfo; }
 
 protected:
Index: /trunk/SophyaLib/TArray/tarray.cc
===================================================================
--- /trunk/SophyaLib/TArray/tarray.cc	(revision 4034)
+++ /trunk/SophyaLib/TArray/tarray.cc	(revision 4035)
@@ -197,4 +197,5 @@
   : BaseArray() , mNDBlock(a.mNDBlock) 
 {
+  if (a.NbDimensions() == 0)  return;    // Reza-Nov 2011: we allow copy contrsuctor on non allocated arrays  
   string exmsg = "TArray<T>::TArray(const TArray<T>&)";
   if (!UpdateSizes(a, exmsg))  throw( ParmError(exmsg) );
@@ -210,5 +211,5 @@
   : BaseArray() , mNDBlock(a.mNDBlock, share) 
 {
-  if (a.NbDimensions() == 0)  return;  
+  if (a.NbDimensions() == 0)  return;  // Reza-Nov 2011: we allow copy contrsuctor on non allocated arrays  
   string exmsg = "TArray<T>::TArray(const TArray<T>&, bool)";
   if (!UpdateSizes(a, exmsg))  throw( ParmError(exmsg) );
@@ -216,15 +217,19 @@
 }
 
-//! Constructor with size and contents copied (after conversion) from a different type TArray
-template <class T>
-TArray<T>::TArray(const BaseArray& a)
+//! Constructor with size and contents copied (after conversion) from an array with different data type.
+/*!
+  The array size and memory layout are copied from the array \b a, or a packed array is created if \b pack==true.
+  \param a : original array, to copy sizes and data from
+  \param pack : if \b true , create a packed array, else same memory layout as \b a. 
+*/
+template <class T>
+TArray<T>::TArray(const BaseArray& a, bool pack)
   : BaseArray() , mNDBlock() 
 {
   if (a.NbDimensions() == 0)  return;  
-  string exmsg = "TArray<T>::TArray(const BaseArray&)";
-  if (!UpdateSizes(a, exmsg))  throw( ParmError(exmsg) );
-  mNDBlock.ReSize(totsize_);    
-  //  if (a.mInfo) mInfo = new DVList(*(a.mInfo));  - pb protected !
+  string exmsg = "TArray<T>::TArray(const BaseArray&,bool)";
+  ReSize(a,pack,false);
   ConvertAndCopyElt(a);
+  if (a.HasInfoObject()) mInfo = new DVList(*(a.getInfoPointer()));     
 }
 
@@ -1626,6 +1631,7 @@
   }
   SetSeq(es);
-  cout << "TArray<T>::ReadASCII()/Info: " << n << " elements read from stream " 
-       << " (Row,Col= " << nr << "," << nc << ")" << endl;
+  if (BaseArray::GetPrintLevel()>0) 
+    cout << "TArray<T>::ReadASCII()/Info: " << n << " elements read from stream " 
+	 << " (Row,Col= " << nr << "," << nc << ")" << endl;
   return(n);
 }
Index: /trunk/SophyaLib/TArray/tarray.h
===================================================================
--- /trunk/SophyaLib/TArray/tarray.h	(revision 4034)
+++ /trunk/SophyaLib/TArray/tarray.h	(revision 4035)
@@ -35,5 +35,5 @@
   TArray(const TArray<T>& a);
   TArray(const TArray<T>& a, bool share);
-  TArray(const BaseArray& a);
+  TArray(const BaseArray& a, bool pack=true);
 
   virtual ~TArray();
Index: /trunk/SophyaLib/TArray/tmatrix.cc
===================================================================
--- /trunk/SophyaLib/TArray/tmatrix.cc	(revision 4034)
+++ /trunk/SophyaLib/TArray/tmatrix.cc	(revision 4035)
@@ -1,3 +1,3 @@
-// $Id: tmatrix.cc,v 1.40 2010-08-05 12:16:19 ansari Exp $
+// $Id: tmatrix.cc,v 1.41 2011-11-14 16:28:25 ansari Exp $
 //                         C.Magneville          04/99
 #include "sopnamsp.h"
@@ -127,4 +127,9 @@
 : TArray<T>(a, share)
 {
+  arrtype_ = 1;   // Type = Matrix
+  if (a.NbDimensions() == 0)  {   // Reza-Nov 2011: we allow copy contrsuctor on non allocated arrays  
+    UpdateMemoryMapping(a, SameMemoryMapping);
+    return;
+  }
   if (a.NbDimensions() > 2) 
     throw SzMismatchError("TMatrix<T>::TMatrix(const TArray<T>& a, ...) a.NbDimensions()>2");
@@ -134,16 +139,29 @@
     ndim_ = 2;
   }
+  UpdateMemoryMapping(a, SameMemoryMapping);
+}
+
+//! Constructor of a matrix from a TArray \b a , with different data type
+/*!
+  Matrix size and memory layout are copied from the array \b a, or a packed matrix is created if \b pack==true.
+  \param a : original array, to copy sizes and data from
+  \param pack : if \b true , create a packed matrix, else same memory layout as \b a. 
+*/
+template <class T>
+TMatrix<T>::TMatrix(const BaseArray& a, bool pack)
+  : TArray<T>()
+{
+  // On ne peut pas passer par TArray<T>(const BaseArray&), car il faut initialiser  arrtype_ d'abord !
   arrtype_ = 1;   // Type = Matrix
+  if (a.NbDimensions() == 0)  {   // Reza-Nov 2011: we allow copy contrsuctor on non allocated arrays  
+    UpdateMemoryMapping(a, SameMemoryMapping);
+    return;
+  }
+  if (a.NbDimensions() > 2) 
+    throw SzMismatchError("TMatrix<T>::TMatrix((const BaseArray& a, bool) a.NbDimensions()>2");
+  string exmsg = "TMatrix<T>::TMatrix(const BaseArray&,bool)";
+  TArray<T>::ReSize(a,pack,false);
   UpdateMemoryMapping(a, SameMemoryMapping);
-}
-
-//! Constructor of a matrix from a TArray \b a , with a different data type
-template <class T>
-TMatrix<T>::TMatrix(const BaseArray& a)
-: TArray<T>()
-{
-  arrtype_ = 1;   // Type = Matrix
-  UpdateMemoryMapping(a, SameMemoryMapping);
-  SetBA(a);
+  TArray<T>::ConvertAndCopyElt(a);
 }
 
Index: /trunk/SophyaLib/TArray/tmatrix.h
===================================================================
--- /trunk/SophyaLib/TArray/tmatrix.h	(revision 4034)
+++ /trunk/SophyaLib/TArray/tmatrix.h	(revision 4035)
@@ -21,6 +21,6 @@
   TMatrix(const TMatrix<T>& a);
   TMatrix(const TMatrix<T>& a, bool share);
-  TMatrix(const TArray<T>& a,  bool share=true);
-  TMatrix(const BaseArray& a); 
+  TMatrix(const TArray<T>& a, bool share=true);
+  TMatrix(const BaseArray& a, bool pack=true); 
 
   virtual ~TMatrix();
Index: /trunk/SophyaLib/TArray/tvector.cc
===================================================================
--- /trunk/SophyaLib/TArray/tvector.cc	(revision 4034)
+++ /trunk/SophyaLib/TArray/tvector.cc	(revision 4035)
@@ -1,3 +1,3 @@
-// $Id: tvector.cc,v 1.28 2010-08-12 15:01:47 ansari Exp $
+// $Id: tvector.cc,v 1.29 2011-11-14 16:28:25 ansari Exp $
 //                         C.Magneville          04/99
 #include "sopnamsp.h"
@@ -56,5 +56,5 @@
 /*!
   \param n : number of elements
-  \param lcv : line or column vector ?
+  \param lcv : line or column vector (BaseArray::AutoVectorType / SameVectorType / ColumnVector / RowVector)
   \param mm : memory mapping type
   \param fzero : if \b true , set vector elements to zero 
@@ -108,7 +108,8 @@
 : TMatrix<T>(a, share)
 {
+  arrtype_ = 2;   // Type = Vector
+  if (a.NbDimensions() == 0)  return;    // Reza-Nov 2011: we allow copy contrsuctor on non allocated arrays  
   if ( (size_[0] != 1) && (size_[1] != 1) )
     throw SzMismatchError("TVector<T>::TVector(const TArray<T>& a) NRows()!=1 && NCols()!=1 ");
-  arrtype_ = 2;   // Type = Vector
   if ( (size_[0] == 1) && (size_[1] == 1) ) {
     if (lcv == SameVectorType) lcv = a.GetVectorType();
@@ -119,11 +120,17 @@
 
 //! Constructor of a vector from a TArray \b a , with a different data type
-template <class T>
-TVector<T>::TVector(const BaseArray& a)
-: TMatrix<T>(a)
-{
+/*!
+  vector size and memory layout are copied from the array \b a, or a packed vector is created if \b pack==true.
+  \param a : original array, to copy sizes and data from
+  \param pack : if \b true , create a packed vector, else same memory layout as \b a. 
+*/
+template <class T>
+TVector<T>::TVector(const BaseArray& a, bool pack)
+  : TMatrix<T>(a,pack)
+{
+  arrtype_ = 2;   // Type = Vector
+  if (a.NbDimensions() == 0)  return;    // Reza-Nov 2011: we allow copy contrsuctor on non allocated arrays  
   if ( (size_[0] != 1) && (size_[1] != 1) )
-    throw SzMismatchError("TVector<T>::TVector(const BaseArray& a) NRows()!=1 && NCols()!=1 ");
-  arrtype_ = 2;   // Type = Vector
+    throw SzMismatchError("TVector<T>::TVector(const BaseArray& a,bool) NRows()!=1 && NCols()!=1 ");
 }
 
Index: /trunk/SophyaLib/TArray/tvector.h
===================================================================
--- /trunk/SophyaLib/TArray/tvector.h	(revision 4034)
+++ /trunk/SophyaLib/TArray/tvector.h	(revision 4035)
@@ -20,6 +20,6 @@
   TVector(const TVector<T>& v);
   TVector(const TVector<T>& v, bool share);
-  TVector(const TArray<T>& a,  bool share=true, short lcv=BaseArray::AutoVectorType);
-  TVector(const BaseArray& a);
+  TVector(const TArray<T>& a, bool share=true, short lcv=BaseArray::AutoVectorType);
+  TVector(const BaseArray& a, bool pack=true);
   TVector(const vector<T>& v, short lcv=BaseArray::AutoVectorType);
 
