Changeset 804 in Sophya for trunk/SophyaLib/TArray/basarr.h
- Timestamp:
- Apr 3, 2000, 7:36:01 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/TArray/basarr.h
r787 r804 21 21 class BaseArray : public AnyDataObj { 22 22 public: 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 23 33 // Creation / destruction 24 34 BaseArray(); … … 44 54 45 55 // 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 46 63 inline bool IsPacked() const { return(moystep_ == 1); } 47 64 inline bool IsPackedX() const { return(step_[0] == 1); } … … 66 83 67 84 // 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); } 71 87 virtual string DataType() const = 0; 72 88 … … 83 99 bool UpdateSizes(uint_4 ndim, const uint_4 * siz, const uint_4 * step, uint_8 offset, string & exmsg); 84 100 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; 88 109 89 110 uint_4 ndim_; // nb of dimensions … … 95 116 uint_8 offset_; // global offset -> position of elem[0] in DataBlock 96 117 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) 97 119 98 120 DVList* mInfo; // Infos (variables) attachees au tableau … … 100 122 static char * ck_op_msg_[6]; // Operation messages for CheckDI() CheckBound() 101 123 static uint_4 max_nprt_; // Nb maxi d'elements imprimes 124 static short default_memory_mapping; // Default memory mapping 102 125 }; 103 126
Note:
See TracChangeset
for help on using the changeset viewer.