Index: trunk/SophyaLib/TArray/basarr.h
===================================================================
--- trunk/SophyaLib/TArray/basarr.h	(revision 1099)
+++ trunk/SophyaLib/TArray/basarr.h	(revision 1156)
@@ -40,13 +40,13 @@
 
   // threshold for parallel routine call
-  static void	 SetOpenMPSizeThreshold(uint_8 thr=200000);
+  static void	 SetOpenMPSizeThreshold(sa_size_t thr=200000);
   //! Get Size threshold for parallel routine call
-  static inline uint_8 GetOpenMPSizeThreshold() { return openmp_size_threshold; }
-
-  static void    SetMaxPrint(uint_4 nprt=50, uint_4 lev=0);   
+  static inline sa_size_t GetOpenMPSizeThreshold() { return openmp_size_threshold; }
+
+  static void    SetMaxPrint(int_4 nprt=50, int_4 lev=0);   
   //! Get maximum number of printed elements
-  static inline uint_4 GetMaxPrint() { return max_nprt_; }
-  //! Maximum number of printed elements arint level
-  static inline uint_4 GetPrintLevel() { return prt_lev_; }
+  static inline int_4 GetMaxPrint() { return max_nprt_; }
+  //! Get print  level
+  static inline int_4 GetPrintLevel() { return prt_lev_; }
 
   static short   SetDefaultMemoryMapping(short mm=CMemoryMapping);
@@ -70,18 +70,18 @@
   // Array dimensions
   //! Return number of dimensions
-  inline uint_4 NbDimensions() const { return( ndim_ ); }
+  inline int_4 NbDimensions() const { return( ndim_ ); }
 
   //! Return total size of the array
-  inline uint_8 Size() const { return(totsize_); }
+  inline sa_size_t Size() const { return(totsize_); }
   //! Return size along the first dimension
-  inline uint_4 SizeX() const { return(size_[0]); }
+  inline sa_size_t SizeX() const { return(size_[0]); }
   //! Return size along the second dimension
-  inline uint_4 SizeY() const { return(size_[1]); }
+  inline sa_size_t SizeY() const { return(size_[1]); }
   //! Return size along the third dimension
-  inline uint_4 SizeZ() const { return(size_[2]); }
+  inline sa_size_t SizeZ() const { return(size_[2]); }
   //! Return size along the \b ka th dimension
-  inline uint_4 Size(int ka) const { return(size_[CheckDI(ka,1)]); }
-
-  int MaxSizeKA() const ;
+  inline sa_size_t Size(int_4 ka) const { return(size_[CheckDI(ka,1)]); }
+
+  int_4 MaxSizeKA() const ;
 
   //! Get memory organization
@@ -89,9 +89,9 @@
          { return ( (marowi_ == 1) ? CMemoryMapping : FortranMemoryMapping) ; }
   //! line index dimension
-  inline int    RowsKA() const {return marowi_; }
+  inline int_4    RowsKA() const {return marowi_; }
   //! column index dimension
-  inline int    ColsKA() const {return macoli_; }
+  inline int_4    ColsKA() const {return macoli_; }
   //! Index dimension of the elements of a vector
-  inline int    VectKA() const {return veceli_; }
+  inline int_4    VectKA() const {return veceli_; }
   void          SetMemoryMapping(short mm=AutoMemoryMapping);
 
@@ -111,33 +111,33 @@
   inline bool   IsPackedZ() const { return(step_[2] == 1); }
   //! return true if array is packed along the \b ka th dimension
-  inline bool   IsPacked(int ka) const { return(step_[CheckDI(ka,2)] == 1); }
+  inline bool   IsPacked(int_4 ka) const { return(step_[CheckDI(ka,2)] == 1); }
 
   //! return the minimum step value along all the dimensions
-  inline uint_4 MinStep() const  { return(minstep_); }
+  inline sa_size_t MinStep() const  { return(minstep_); }
   //! return the average step value along all the dimensions
-  inline uint_4 AvgStep() const  { return(moystep_); }
+  inline sa_size_t AvgStep() const  { return(moystep_); }
   //! return the step along the first dimension
-  inline uint_4 StepX() const { return(step_[0]); }
+  inline sa_size_t StepX() const { return(step_[0]); }
   //! return the step along the second dimension
-  inline uint_4 StepY() const { return(step_[1]); }
+  inline sa_size_t StepY() const { return(step_[1]); }
   //! return the step along the third dimension
-  inline uint_4 StepZ() const { return(step_[2]); }
+  inline sa_size_t StepZ() const { return(step_[2]); }
   //! return the step along the \b ka th dimension
-  inline uint_4 Step(int ka) const { return(step_[CheckDI(ka,3)]); }
-
-  int MinStepKA() const ;
+  inline sa_size_t Step(int_4 ka) const { return(step_[CheckDI(ka,3)]); }
+
+  int_4 MinStepKA() const ;
 
   // Offset of element ip
-  uint_8 Offset(uint_8 ip=0) const ;
+  sa_size_t Offset(sa_size_t ip=0) const ;
   // Offset of the i'th vector along axe ka 
-  uint_8  Offset(uint_4 ka, uint_8 i) const ;
-  inline uint_8  Offset(uint_4 ix, uint_4 iy, uint_4 iz, uint_4 it=0, uint_4 iu=0) const;  
+  sa_size_t Offset(int_4 ka, sa_size_t i) const ;
+  inline sa_size_t  Offset(sa_size_t ix, sa_size_t iy, sa_size_t iz, sa_size_t it=0, sa_size_t iu=0) const;  
 
   // an abstract element acces methode
-  virtual MuTyV & ValueAtPosition(uint_8 ip) const = 0;
+  virtual MuTyV & ValueAtPosition(sa_size_t ip) const = 0;
 
   // Pour recuperer pas et numero d'axe pour operations sur deux arrays
-  void   GetOpeParams(const BaseArray& a, bool smo, int& ax, int& axa, uint_8& step,
-		      uint_8& stepa, uint_8& gpas, uint_8& naxa);
+  void   GetOpeParams(const BaseArray& a, bool smo, int_4& ax, int_4& axa, sa_size_t& step,
+		      sa_size_t& stepa, sa_size_t& gpas, sa_size_t& naxa);
   // Impression, I/O, ...
   void           Show(ostream& os, bool si=false) const;
@@ -150,11 +150,11 @@
 
 protected:
-  inline int CheckDI(int ka, int msg) const ;
-  inline void CheckBound(uint_4 ix, uint_4 iy, uint_4 iz, uint_4 it, uint_4 iu, int msg) const ;
+  inline int_4 CheckDI(int_4 ka, int msg) const ;
+  inline void CheckBound(sa_size_t ix, sa_size_t iy, sa_size_t iz, sa_size_t it, sa_size_t iu, int msg) const ;
   // Changing Sizes/NDim ... return true if OK
-  bool UpdateSizes(uint_4 ndim, const uint_4 * siz, uint_4 step, uint_8 offset, string & exmsg);
-  bool UpdateSizes(uint_4 ndim, const uint_4 * siz, const uint_4 * step, uint_8 offset, string & exmsg);
+  bool UpdateSizes(sa_size_t ndim, const sa_size_t * siz, sa_size_t step, sa_size_t offset, string & exmsg);
+  bool UpdateSizes(sa_size_t ndim, const sa_size_t * siz, const sa_size_t * step, sa_size_t offset, string & exmsg);
   bool UpdateSizes(const BaseArray& a, string & exmsg);
-  static uint_8 ComputeTotalSize(uint_4 ndim, const uint_4 * siz, uint_4 step, uint_8 offset) ;
+  static sa_size_t ComputeTotalSize(sa_size_t ndim, const sa_size_t * siz, sa_size_t step, sa_size_t offset) ;
   //  Organisation memoire
   static short SelectMemoryMapping(short mm);
@@ -164,14 +164,14 @@
 
   // Pour Extraction de sous-tableau 
-  virtual void UpdateSubArraySizes(BaseArray & ra, uint_4 ndim, uint_4 * siz, uint_4 * pos, uint_4 * step) const;
-
-  uint_4 ndim_; //!< number of dimensions of array
-  uint_4 size_[BASEARRAY_MAXNDIMS]; //!< array of the size in each dimension
-  uint_8 totsize_; //!< Total number of elements
-  uint_8 offset_;  //!< global offset -\> position of elem[0] in DataBlock
+  virtual void UpdateSubArraySizes(BaseArray & ra, sa_size_t ndim, sa_size_t * siz, sa_size_t * pos, sa_size_t * step) const;
+
+  int_4  ndim_; //!< number of dimensions of array
+  sa_size_t size_[BASEARRAY_MAXNDIMS]; //!< array of the size in each dimension
+  sa_size_t totsize_; //!< Total number of elements
+  sa_size_t offset_;  //!< global offset -\> position of elem[0] in DataBlock
   //! two consecutive elements distance in a given dimension 
-  uint_4 step_[BASEARRAY_MAXNDIMS];
-  uint_4 minstep_; //!< minimal step (in any axes)
-  uint_4 moystep_; //!< mean step, if == 0 --\> non regular steps
+  sa_size_t step_[BASEARRAY_MAXNDIMS];
+  sa_size_t minstep_; //!< minimal step (in any axes)
+  sa_size_t moystep_; //!< mean step, if == 0 --\> non regular steps
   int_2  marowi_; //!< For matrices, Row index in dimensions
   int_2  macoli_; //!< For matrices, Column index in dimensions
@@ -181,9 +181,9 @@
 
   static char * ck_op_msg_[6]; //!< Operation messages for CheckDI() CheckBound()
-  static uint_4 max_nprt_; //!< maximum number of printed elements
-  static uint_4 prt_lev_;  //!< Print level
+  static int_4 max_nprt_; //!< maximum number of printed elements
+  static int_4 prt_lev_;  //!< Print level
   static short default_memory_mapping; //!< Default memory mapping
   static short default_vector_type;    //!< Default vector type Row/Column
-  static uint_8 openmp_size_threshold; //!< Size limit for parallel routine calls
+  static sa_size_t openmp_size_threshold; //!< Size limit for parallel routine calls
 };
 
@@ -192,7 +192,7 @@
 // --------------------------------------------------
 //! to verify the compatibility of the dimension index
-inline int BaseArray::CheckDI(int ka, int msg)  const
+inline int_4 BaseArray::CheckDI(int_4 ka, int msg)  const
 {
-  if ( (ka < 0) || ((uint_4) ka >= ndim_) ) {
+  if ( (ka < 0) || (ka >= ndim_) ) {
     string txt = "BaseArray::CheckDimensionIndex/Error ";   txt += ck_op_msg_[msg];
     throw(RangeCheckError(txt));
@@ -202,8 +202,9 @@
 
 //! to verify the compatibility of the indexes in all dimensions
-inline void BaseArray::CheckBound(uint_4 ix, uint_4 iy, uint_4 iz, uint_4 it, uint_4 iu, int msg)  const
+inline void BaseArray::CheckBound(sa_size_t ix, sa_size_t iy, sa_size_t iz, sa_size_t it, sa_size_t iu, int msg)  const
 {
-  if ( (ix >= size_[0]) || (iy >= size_[1]) || (iz > size_[2]) ||
-       (it >= size_[3]) || (iu >= size_[4]) ) {
+  if ( (ix >= size_[0]) || (ix < 0) || (iy >= size_[1]) || (iy < 0) || 
+       (iz >= size_[2]) || (iz < 0) || (it >= size_[3]) || (it < 0) ||
+       (iu >= size_[4]) || (iu < 0) )  {
     string txt = "BaseArray::CheckArrayBound/Error ";   txt += ck_op_msg_[msg];
     throw(RangeCheckError(txt));
@@ -218,5 +219,5 @@
 // --------------------------------------------------
 //! Offset of element (ix,iy,iz,it,iu)
-inline uint_8 BaseArray::Offset(uint_4 ix, uint_4 iy, uint_4 iz, uint_4 it, uint_4 iu) const
+inline sa_size_t BaseArray::Offset(sa_size_t ix, sa_size_t iy, sa_size_t iz, sa_size_t it, sa_size_t iu) const
 {
 #ifdef SO_BOUNDCHECKING
