Changeset 894 in Sophya for trunk/SophyaLib/TArray/basarr.cc
- Timestamp:
- Apr 12, 2000, 7:42:33 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/TArray/basarr.cc
r890 r894 9 9 10 10 // Variables statiques globales 11 char * BaseArray::ck_op_msg_[6] = {"???", "Size(int )", "IsPacked(int )", 12 "Stride(int )", "ElemCheckBound()", "operator()" }; 11 char * BaseArray::ck_op_msg_[6] = 12 {"???", "Size(int )", "IsPacked(int )" 13 ,"Stride(int )", "ElemCheckBound()", "operator()" }; 13 14 uint_4 BaseArray::max_nprt_ = 50; 14 15 uint_4 BaseArray::prt_lev_ = 0; … … 19 20 // ------ Methodes statiques globales -------- 20 21 21 // 1/ Gestion des impressions22 22 //! Set maximum number of printed elements and print level 23 23 /*! … … 41 41 42 42 43 //! Compute totale size 44 /*! 45 \param ndim : number of dimensions 46 \param siz : array of size along the \b ndim dimensions 47 \param step[ndim] : step value 48 \param offset : offset value 49 \return Total size of the array 50 */ 43 51 uint_8 BaseArray::ComputeTotalSize(uint_4 ndim, const uint_4 * siz, uint_4 step, uint_8 offset) 44 52 { … … 48 56 } 49 57 58 //! Set Default Memory Mapping 59 /*! 60 \param mm : Memory Mapping type 61 \verbatim 62 mm == CMemoryMapping : C like memory mapping 63 mm == FortranMemoryMapping : Fortran like memory mapping 64 \endverbatim 65 \verbatim 66 # ===== For Matrices 67 *** MATHEMATICS: m(row,column) with indexes running [1,n]) 68 | 11 12 13 | 69 matrix Math = Mmath= | 21 22 23 | 70 | 31 32 33 | 71 *** IDL, \b FORTRAN: indexes data in \b row-major format: 72 indexes arrays in (column,row) order. 73 index IDL running [0,n[ ; index FORTRAN running [1,n] 74 M in memory: [ 11 12 13 : 21 22 23 : 31 32 33 : ... ] 75 line 1 : line 2 : line 3 : ... 76 ex: Midl(0,2) = Mfor(1,3) = Mmath(3,1) = 31 77 Midl(2,0) = Mfor(3,1) = Mmath(1,3) = 13 78 *** C: indexes data in \b column-major format: 79 indexes arrays in [row][column] order. 80 index C running [0,n[ 81 M in memory: [ 11 21 31 : 12 22 32 : 13 23 33 : ... ] 82 column 1 : column 2 : column 3 : ... 83 ex: Mc[2][0] = Mmath(3,1) = 31 84 Mc[0][2] = Mmath(1,3) = 13 85 *** RESUME diff Idl/Fortan/C/Math: 86 Midl(col-1,row-1) = Mfor(col,row) = Mc[row-1][col-1] = Mmath(row,col) 87 TRANSPOSE(column-major array) --> row-major array 88 \endverbatim 89 \return default memory mapping value 90 */ 50 91 short BaseArray::SetDefaultMemoryMapping(short mm) 51 92 { … … 54 95 } 55 96 97 //! Set Default Vector Type 98 /*! 99 \param vt : vector type (ColumnVector,RowVector) 100 \return default vector type value 101 */ 56 102 short BaseArray::SetDefaultVectorType(short vt) 57 103 { … … 60 106 } 61 107 62 // Memory organisation 108 //! Select Memory Mapping 109 /*! 110 Do essentially nothing. 111 \param mm : type of Memory Mapping (CMemoryMapping,FortranMemoryMapping) 112 \return return \b mm if it makes sense or default memory mapping value 113 \sa SetDefaultMemoryMapping 114 */ 63 115 short BaseArray::SelectMemoryMapping(short mm) 64 // si mm == CMemoryMapping, elements d'une ligne suivant X (consecutif)65 // sinon (mm == FortranMemoryMapping) elements d'une colonne suivant X66 116 { 67 117 if ( (mm == CMemoryMapping) || (mm == FortranMemoryMapping) ) return (mm) ; 68 118 else return (default_memory_mapping); 69 119 } 120 121 //! Select Vector type 122 /*! 123 Do essentially nothing. 124 \param vt : vector type (ColumnVector,RowVector) 125 \return return \b vt if it makes sense or default vector type 126 \sa SetDefaultVectorType 127 */ 70 128 short BaseArray::SelectVectorType(short vt) 71 129 { … … 74 132 } 75 133 134 //! Update Memory Mapping 135 /*! 136 Update variables marowi_ macoli_ veceli_ 137 \param mm : type of Memory Mapping (CMemoryMapping,FortranMemoryMapping) 138 \sa SetDefaultMemoryMapping 139 */ 76 140 void BaseArray::UpdateMemoryMapping(short mm) 77 141 { … … 94 158 } 95 159 160 //! Update Memory Mapping 161 /*! 162 \param a : Array to be compared with 163 \param mm : type of Memory Mapping or memory mapping transfert 164 (SameMemoryMapping,AutoMemoryMapping,CMemoryMapping,FortranMemoryMapping) 165 \sa SetDefaultMemoryMapping 166 */ 96 167 void BaseArray::UpdateMemoryMapping(BaseArray const & a, short mm) 97 168 { … … 119 190 } 120 191 192 //! Set Memory Mapping type 193 /*! 194 Compute values for variables marowi_ macoli_ veceli_ 195 \param mm : Memory Mapping type (SameMemoryMapping,AutoMemoryMapping 196 ,CMemoryMapping,FortranMemoryMapping) 197 \sa SetDefaultMemoryMapping 198 */ 121 199 void BaseArray::SetMemoryMapping(short mm) 122 200 { … … 140 218 } 141 219 220 //! Set Vector Type 221 /*! 222 Compute values for variable veceli_ 223 \param vt : vector type () 224 \sa SetDefaultVectorType 225 */ 142 226 void BaseArray::SetVectorType(short vt) 143 227 { … … 184 268 185 269 186 //! Returns true if \b ndim and \bsizes are equal270 //! Returns true if dimension and sizes are equal 187 271 /*! 188 272 \param a : array to be compared 189 \return true if ndim and sizes are equal, false if not273 \return true if ndim and sizes[ndim] are equal, false if not 190 274 */ 191 275 bool BaseArray::CompareSizes(const BaseArray& a) … … 201 285 } 202 286 287 //! Change dimension if some size == 1 203 288 void BaseArray::CompactAllDim() 204 289 { … … 223 308 } 224 309 310 //! Change dimension if some trailed size == 1 225 311 void BaseArray::CompactTrailingDim() 226 312 { … … 240 326 } 241 327 242 328 //! return minimum value for step[ndim] 243 329 uint_4 BaseArray::MinStepKA() const 244 330 { … … 248 334 } 249 335 336 //! return maximum value for step[ndim] 250 337 uint_4 BaseArray::MaxSizeKA() const 251 338 { … … 262 349 // Position de l'element 0 du vecteur i selon l'axe ka 263 350 // -------------------------------------------------- 351 //! return position of first element for vector \b i alond \b ka th axe. 264 352 uint_8 BaseArray::Offset(uint_4 ka, uint_8 i) const 265 353 { … … 285 373 } 286 374 375 //! return position of element \b ip. 287 376 uint_8 BaseArray::Offset(uint_8 ip) const 288 377 { … … 317 406 // ---------------------------------------------------- 318 407 408 //! Show infos on stream \b os (\b si to display DvList) 319 409 void BaseArray::Show(ostream& os, bool si) const 320 410 { … … 345 435 } 346 436 437 //! Return BaseArray Type 347 438 string BaseArray::InfoString() const 348 439 { … … 352 443 } 353 444 445 //! Return attached DVList 354 446 DVList& BaseArray::Info() 355 447 { … … 358 450 } 359 451 360 452 //! Update sizes and information for array 453 /*! 454 \param ndim : dimension 455 \param siz[ndim] : sizes 456 \param step : step (must be the same on all dimensions) 457 \param offset : offset of the first element 458 \return true if all OK, false if problems appear 459 \return string \b exmsg for explanation in case of problems 460 */ 361 461 bool BaseArray::UpdateSizes(uint_4 ndim, const uint_4 * siz, uint_4 step, uint_8 offset, string & exmsg) 362 462 { … … 402 502 } 403 503 504 //! Update sizes and information for array 505 /*! 506 \param ndim : dimension 507 \param siz[ndim] : sizes 508 \param step[ndim] : steps 509 \param offset : offset of the first element 510 \return true if all OK, false if problems appear 511 \return string \b exmsg for explanation in case of problems 512 */ 404 513 bool BaseArray::UpdateSizes(uint_4 ndim, const uint_4 * siz, const uint_4 * step, uint_8 offset, string & exmsg) 405 514 { … … 450 559 } 451 560 561 //! Update sizes and information relative to array \b a 562 /*! 563 \param a : array to be compare with 564 \return true if all OK, false if problems appear 565 \return string \b exmsg for explanation in case of problems 566 */ 452 567 bool BaseArray::UpdateSizes(const BaseArray& a, string & exmsg) 453 568 { … … 492 607 493 608 609 //! Update sizes and information relative to array \b a 610 /*! 611 \param a : array to be compare with 612 \param ndim : could be change (but should be less than the ndim of the current class) 613 \param siz[ndim],pos[ndim],step[ndim] : could be changed but must be 614 compatible within the memory size with those of the current class. 615 \return true if all OK, false if problems appear 616 \return string \b exmsg for explanation in case of problems 617 */ 494 618 void BaseArray::UpdateSubArraySizes(BaseArray & ra, uint_4 ndim, uint_4 * siz, uint_4 * pos, uint_4 * step) const 495 619 {
Note:
See TracChangeset
for help on using the changeset viewer.