Changeset 804 in Sophya for trunk/SophyaLib/TArray/basarr.h


Ignore:
Timestamp:
Apr 3, 2000, 7:36:01 PM (25 years ago)
Author:
ansari
Message:

Amelioation / debugging de la classe TArray<T> - TVector et TMatrix

heritent maintenant de TArray<T> - Classe RCMatrix rendu prive au fichier
sopemtx.cc - linfit.cc integre a sopemtx.cc

Reza 03/04/2000

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/TArray/basarr.h

    r787 r804  
    2121class BaseArray : public AnyDataObj {
    2222public:
     23  //  To define Array / Matrix memory mapping
     24  enum { AutoMemoryMapping = -1, SameMemoryMapping = 0,
     25         CMemoryMapping = 1, FortranMemoryMapping = 2 };
     26
     27  //    Max Nb of printed elements
     28  static void    SetMaxPrint(uint_4 nprt=50);   
     29  //   Memory organisation (for matrices)
     30  static short   SetDefaultMemoryMapping(short mm=CMemoryMapping);
     31  static inline short GetDefaultMemoryMapping() { return default_memory_mapping; }
     32 
    2333  // Creation / destruction
    2434  BaseArray();
     
    4454
    4555  // memory organisation - packing information
     56  inline short  GetMemoryMapping() const
     57                {return ( (marowi_ == 1) ? CMemoryMapping : FortranMemoryMapping) ; }
     58
     59  inline uint_4 RowsKA() const {return marowi_; }    // Dimension correspondant aux lignes
     60  inline uint_4 ColsKA() const {return macoli_; }    // Dimension correspondant aux colonnes
     61  inline uint_4 VectKA() const {return veceli_; }    // Dimension corr. aux elts d'un vecteur
     62
    4663  inline bool   IsPacked() const { return(moystep_ == 1); }
    4764  inline bool   IsPackedX() const { return(step_[0] == 1); }
     
    6683
    6784// Impression, I/O, ...
    68   static void   SetMaxPrint(uint_4 nprt=50);   
    69   void          Show(ostream& os, bool si=false) const;
    70   inline void   Show() const { Show(cout); }
     85  void           Show(ostream& os, bool si=false) const;
     86  inline void    Show() const { Show(cout); }
    7187  virtual string DataType() const = 0;
    7288
     
    8399  bool UpdateSizes(uint_4 ndim, const uint_4 * siz, const uint_4 * step, uint_8 offset, string & exmsg);
    84100  bool UpdateSizes(const BaseArray& a, string & exmsg);
    85   static uint_8 ComputeTotalSize(uint_4 ndim, uint_4 * siz, uint_4 step, uint_8 offset) ;
    86   // Pour Extraction de sous-tableau
    87   virtual void SubArray(BaseArray & ra, uint_4 ndim, uint_4 * siz, uint_4 * pos, uint_4 * step);
     101  static uint_8 ComputeTotalSize(uint_4 ndim, const uint_4 * siz, uint_4 step, uint_8 offset) ;
     102  //  Organisation memoire
     103  static short SelectMemoryMapping(short mm);
     104  void UpdateMemoryMapping(short mm, uint_4 & nx, uint_4 & ny);
     105  void UpdateMemoryMapping(BaseArray const & a, short mm);
     106
     107  // Pour Extraction de sous-tableau
     108  virtual void UpdateSubArraySizes(BaseArray & ra, uint_4 ndim, uint_4 * siz, uint_4 * pos, uint_4 * step) const;
    88109
    89110  uint_4 ndim_;                   // nb of dimensions
     
    95116  uint_8 offset_;              // global offset -> position of elem[0] in DataBlock
    96117  uint_4 marowi_, macoli_;     // For matrices, Row index and column index in dimensions
     118  uint_4 veceli_;              // For vectors,  dimension index = marowi_/macoli_ (Row/Col vectors)
    97119
    98120  DVList* mInfo;               // Infos (variables) attachees au tableau
     
    100122  static char * ck_op_msg_[6];  // Operation messages for CheckDI() CheckBound()
    101123  static uint_4 max_nprt_;      // Nb maxi d'elements imprimes
     124  static short default_memory_mapping;  // Default memory mapping
    102125};
    103126
Note: See TracChangeset for help on using the changeset viewer.