Changeset 813 in Sophya for trunk/SophyaLib/TArray/basarr.h
- Timestamp:
- Apr 5, 2000, 5:44:19 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/TArray/basarr.h
r804 r813 22 22 public: 23 23 // To define Array / Matrix memory mapping 24 enum { AutoMemoryMapping = -1, SameMemoryMapping = 0,24 enum MemoryMapping { AutoMemoryMapping = -1, SameMemoryMapping = 0, 25 25 CMemoryMapping = 1, FortranMemoryMapping = 2 }; 26 // Vector type 27 enum VectorType {AutoVectorType = -1, SameVectorType = 0, 28 ColumnVector = 1, RowVector = 2}; 26 29 27 // Max Nb of printed elements 28 static void SetMaxPrint(uint_4 nprt=50); 29 // Memory organisation (for matrices) 30 // Size threshold for parallel routine call 31 static void SetOpenMPSizeThreshold(uint_8 thr=200000); 32 static inline uint_8 GetOpenMPSizeThreshold() { return openmp_size_threshold; } 33 // Max Nb of printed elements and print level 34 static void SetMaxPrint(uint_4 nprt=50, uint_4 lev=0); 35 static inline uint_4 GetMaxPrint() { return max_nprt_; } 36 static inline uint_4 GetPrintLevel() { return prt_lev_; } 37 38 // Memory organisation (for matrices) and vector type 30 39 static short SetDefaultMemoryMapping(short mm=CMemoryMapping); 31 40 static inline short GetDefaultMemoryMapping() { return default_memory_mapping; } 41 static short SetDefaultVectorType(short vt=ColumnVector); 42 static inline short GetDefaultVectorType() { return default_vector_type; } 32 43 33 44 // Creation / destruction … … 53 64 uint_4 MaxSizeKA() const ; 54 65 55 // memory organisation - packing information66 // memory organisation 56 67 inline short GetMemoryMapping() const 57 { return ( (marowi_ == 1) ? CMemoryMapping : FortranMemoryMapping) ; }68 { return ( (marowi_ == 1) ? CMemoryMapping : FortranMemoryMapping) ; } 58 69 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 70 inline uint_4 RowsKA() const {return marowi_; } // Dimension des index de lignes 71 inline uint_4 ColsKA() const {return macoli_; } // Dimension des index de colonnes 72 inline uint_4 VectKA() const {return veceli_; } // Dimension des index des elts d'un vecteur 73 void SetMemoryMapping(short mm=AutoMemoryMapping); 62 74 75 // Vector type Line or Column vector 76 inline short GetVectorType() const 77 { return((marowi_ == veceli_) ? ColumnVector : RowVector); } 78 void SetVectorType(short vt=AutoVectorType); 79 80 // memory organisation - packing information 63 81 inline bool IsPacked() const { return(moystep_ == 1); } 64 82 inline bool IsPackedX() const { return(step_[0] == 1); } … … 76 94 uint_4 MinStepKA() const ; 77 95 96 // Offset of element ip 78 97 uint_8 Offset(uint_8 ip=0) const ; 98 // Offset of the i'th vector along axe ka 99 uint_8 Offset(uint_4 ka, uint_8 i) const ; 79 100 inline uint_8 Offset(uint_4 ix, uint_4 iy, uint_4 iz, uint_4 it=0, uint_4 iu=0) const; 80 101 … … 85 106 void Show(ostream& os, bool si=false) const; 86 107 inline void Show() const { Show(cout); } 87 virtual string DataType() const = 0;108 virtual string InfoString() const; 88 109 89 110 // Objet DVList info … … 102 123 // Organisation memoire 103 124 static short SelectMemoryMapping(short mm); 104 void UpdateMemoryMapping(short mm, uint_4 & nx, uint_4 & ny); 125 static short SelectVectorType(short vt); 126 void UpdateMemoryMapping(short mm); 105 127 void UpdateMemoryMapping(BaseArray const & a, short mm); 106 128 … … 113 135 uint_4 step_[BASEARRAY_MAXNDIMS]; // two consecutive elements distance in a given dimension 114 136 uint_4 minstep_; // minimal step (in any axes) 115 uint_4 moystep_; // mean step 0non regular steps137 uint_4 moystep_; // mean step if == 0 --> non regular steps 116 138 uint_8 offset_; // global offset -> position of elem[0] in DataBlock 117 139 uint_4 marowi_, macoli_; // For matrices, Row index and column index in dimensions 118 140 uint_4 veceli_; // For vectors, dimension index = marowi_/macoli_ (Row/Col vectors) 119 141 bool ck_memo_vt_; // if true, check MemoryOrg./VectorType for CompareSize 120 142 DVList* mInfo; // Infos (variables) attachees au tableau 121 143 122 144 static char * ck_op_msg_[6]; // Operation messages for CheckDI() CheckBound() 123 145 static uint_4 max_nprt_; // Nb maxi d'elements imprimes 146 static uint_4 prt_lev_; // Niveau de print 0 ou 1 124 147 static short default_memory_mapping; // Default memory mapping 148 static short default_vector_type; // Default vector type Row/Column 149 static uint_8 openmp_size_threshold; // Size limit for parallel routine calls 125 150 }; 126 151 … … 132 157 if ( (ka < 0) || (ka >= ndim_) ) { 133 158 string txt = "BaseArray::CheckDimensionIndex/Error "; txt += ck_op_msg_[msg]; 134 throw( ParmError(txt));159 throw(RangeCheckError(txt)); 135 160 } 136 161 return(ka); … … 142 167 (it >= size_[3]) || (iu >= size_[4]) ) { 143 168 string txt = "BaseArray::CheckArrayBound/Error "; txt += ck_op_msg_[msg]; 144 throw( ParmError(txt));169 throw(RangeCheckError(txt)); 145 170 } 146 171 return; 147 172 } 173 148 174 149 175
Note:
See TracChangeset
for help on using the changeset viewer.