Changeset 894 in Sophya for trunk/SophyaLib/TArray/basarr.cc


Ignore:
Timestamp:
Apr 12, 2000, 7:42:33 PM (25 years ago)
Author:
ansari
Message:

documentation cmv 12/4/00

File:
1 edited

Legend:

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

    r890 r894  
    99
    1010// Variables statiques globales
    11 char * BaseArray::ck_op_msg_[6] = {"???", "Size(int )", "IsPacked(int )",
    12                        "Stride(int )", "ElemCheckBound()", "operator()" };
     11char * BaseArray::ck_op_msg_[6] =
     12     {"???", "Size(int )", "IsPacked(int )"
     13     ,"Stride(int )", "ElemCheckBound()", "operator()" };
    1314uint_4 BaseArray::max_nprt_ = 50;
    1415uint_4 BaseArray::prt_lev_ = 0;
     
    1920// ------ Methodes statiques globales --------
    2021
    21 //  1/ Gestion des impressions
    2222//! Set maximum number of printed elements and print level
    2323/*!
     
    4141
    4242
     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*/
    4351uint_8 BaseArray::ComputeTotalSize(uint_4 ndim, const uint_4 * siz, uint_4 step, uint_8 offset)
    4452{
     
    4856}
    4957
     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 */
    5091short BaseArray::SetDefaultMemoryMapping(short mm)
    5192{
     
    5495}
    5596
     97//! Set Default Vector Type
     98/*!
     99  \param vt : vector type (ColumnVector,RowVector)
     100  \return default vector type value
     101 */
    56102short BaseArray::SetDefaultVectorType(short vt)
    57103{
     
    60106}
    61107
    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 */
    63115short BaseArray::SelectMemoryMapping(short mm)
    64 // si mm == CMemoryMapping, elements d'une ligne suivant X (consecutif)
    65 // sinon (mm == FortranMemoryMapping)  elements d'une colonne suivant X
    66116{
    67117  if ( (mm == CMemoryMapping) || (mm == FortranMemoryMapping) )  return (mm) ;
    68118  else return (default_memory_mapping);
    69119}
     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 */
    70128short BaseArray::SelectVectorType(short vt)
    71129{
     
    74132}
    75133
     134//! Update Memory Mapping
     135/*!
     136  Update variables marowi_ macoli_ veceli_
     137  \param mm : type of Memory Mapping (CMemoryMapping,FortranMemoryMapping)
     138  \sa SetDefaultMemoryMapping
     139 */
    76140void BaseArray::UpdateMemoryMapping(short mm)
    77141{
     
    94158}
    95159
     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 */
    96167void BaseArray::UpdateMemoryMapping(BaseArray const & a, short mm)
    97168{
     
    119190}
    120191
     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 */
    121199void BaseArray::SetMemoryMapping(short mm)
    122200{
     
    140218}
    141219
     220//! Set Vector Type
     221/*!
     222  Compute values for variable veceli_
     223  \param vt : vector type ()
     224  \sa SetDefaultVectorType
     225 */
    142226void BaseArray::SetVectorType(short vt)
    143227{
     
    184268
    185269
    186 //! Returns true if \b ndim and \b sizes are equal
     270//! Returns true if dimension and sizes are equal
    187271/*!
    188272  \param a : array to be compared
    189   \return true if ndim and sizes are equal, false if not
     273  \return true if ndim and sizes[ndim] are equal, false if not
    190274*/
    191275bool BaseArray::CompareSizes(const BaseArray& a)
     
    201285}
    202286
     287//! Change dimension if some size == 1
    203288void BaseArray::CompactAllDim()
    204289{
     
    223308}
    224309
     310//! Change dimension if some trailed size == 1
    225311void BaseArray::CompactTrailingDim()
    226312{
     
    240326}
    241327
    242 
     328//! return minimum value for step[ndim]
    243329uint_4 BaseArray::MinStepKA() const
    244330{
     
    248334}
    249335
     336//! return maximum value for step[ndim]
    250337uint_4 BaseArray::MaxSizeKA() const
    251338{
     
    262349// Position de l'element 0 du vecteur i selon l'axe ka
    263350// --------------------------------------------------
     351//! return position of first element for vector \b i alond \b ka th axe.
    264352uint_8 BaseArray::Offset(uint_4 ka, uint_8 i) const
    265353{
     
    285373}
    286374
     375//! return position of element \b ip.
    287376uint_8 BaseArray::Offset(uint_8 ip) const
    288377{
     
    317406// ----------------------------------------------------
    318407
     408//! Show infos on stream \b os (\b si to display DvList)
    319409void BaseArray::Show(ostream& os, bool si) const
    320410{
     
    345435}
    346436
     437//! Return BaseArray Type
    347438string BaseArray::InfoString() const
    348439{
     
    352443}
    353444
     445//! Return attached DVList
    354446DVList& BaseArray::Info()
    355447{
     
    358450}
    359451
    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 */
    361461bool BaseArray::UpdateSizes(uint_4 ndim, const uint_4 * siz, uint_4 step, uint_8 offset, string & exmsg)
    362462{
     
    402502}
    403503
     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 */
    404513bool BaseArray::UpdateSizes(uint_4 ndim, const uint_4 * siz, const uint_4 * step, uint_8 offset, string & exmsg)
    405514{
     
    450559}
    451560
     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 */
    452567bool BaseArray::UpdateSizes(const BaseArray& a, string & exmsg)
    453568{
     
    492607
    493608
     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 */
    494618void BaseArray::UpdateSubArraySizes(BaseArray & ra, uint_4 ndim, uint_4 * siz, uint_4 * pos, uint_4 * step) const
    495619{
Note: See TracChangeset for help on using the changeset viewer.