Changeset 1412 in Sophya for trunk/SophyaLib


Ignore:
Timestamp:
Feb 20, 2001, 7:29:18 PM (25 years ago)
Author:
ansari
Message:

Modifs sur TMatrix::Transpose() et ajout methode SetSize comme alias de ReSize ds TMatrix et TVector - Reza 20/2/2001

Location:
trunk/SophyaLib/TArray
Files:
4 edited

Legend:

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

    r1156 r1412  
    1 // $Id: tmatrix.cc,v 1.16 2000-08-29 16:10:30 ansari Exp $
     1// $Id: tmatrix.cc,v 1.17 2001-02-20 18:29:17 ansari Exp $
    22//                         C.Magneville          04/99
    33#include "machdefs.h"
     
    244244////////////////////////////////////////////////////////////////
    245245// Transposition
    246 //! Transpose matrix in place
    247 template <class T>
    248 TMatrix<T>& TMatrix<T>::Transpose()
     246//! Transpose matrix in place, by changing the memory mapping
     247template <class T>
     248TMatrix<T>& TMatrix<T>::TransposeSelf()
    249249{
    250250  short vt = (marowi_ == veceli_) ? ColumnVector : RowVector;
     
    257257
    258258
    259 //! Transpose matrix into new matrix
     259//! Returns the transpose of the original matrix.
     260/*!
     261  The data is shared between the two matrices
     262  \return return a new matrix
     263 */
     264template <class T>
     265TMatrix<T> TMatrix<T>::Transpose()
     266{
     267  TMatrix<T> tm(*this);
     268  tm.TransposeSelf();
     269  return tm;
     270}
     271
     272//! Returns a new matrix, corresponding to the transpose of the original matrix
    260273/*!
    261274  \param mm : define the memory mapping type
     
    275288}
    276289
    277 //! Rearrange data in memory memoire according to \b mm
     290//! Rearrange data in memory according to \b mm
    278291/*!
    279292  \param mm : define the memory mapping type
  • trunk/SophyaLib/TArray/tmatrix.h

    r1156 r1412  
    4848  inline sa_size_t NCol()  const {return Size(macoli_); } // back-compat Peida
    4949
    50   void ReSize(sa_size_t r,sa_size_t c, short mm=BaseArray::SameMemoryMapping);  // Reallocation de place
     50  void ReSize(sa_size_t r,sa_size_t c, short mm=BaseArray::SameMemoryMapping);
     51  //! a synonym (alias) for method ReSize(sa_size_t, sa_size_t, short)
     52  inline void SetSize(sa_size_t r,sa_size_t c, short mm=BaseArray::SameMemoryMapping)
     53                 { ReSize(r, c, mm); }
     54  // Reallocation de place
    5155  void Realloc(sa_size_t r,sa_size_t c, short mm=BaseArray::SameMemoryMapping, bool force=false);
    5256
     
    6973
    7074  // Operations matricielles
    71   TMatrix<T>& Transpose();
     75  TMatrix<T>& TransposeSelf();
     76  TMatrix<T>  Transpose();
    7277  //mm = SameMemoryMapping or CMemoryMapping or FortranMemoryMapping
    7378  TMatrix<T>  Transpose(short mm);
  • trunk/SophyaLib/TArray/tvector.h

    r1156 r1412  
    4040  // Gestion taille/Remplissage
    4141  void ReSize(sa_size_t n, short lcv=SameVectorType );
     42  //! a synonym (alias) for method ReSize(sa_size_t, short)
     43  inline void SetSize(sa_size_t n, short lcv=SameVectorType )
     44              { ReSize(n, lcv); }
    4245  void Realloc(sa_size_t n, short lcv=SameVectorType, bool force=false);
    4346
  • trunk/SophyaLib/TArray/utilarr.cc

    r1404 r1412  
    154154/*!
    155155  Define a range of indexes
    156   \param start : start index
    157   \param end : start end
    158   \param size : size
    159   \param step : step
     156  \param start : start index (inclusive)
     157  \param end : end index (inclusive)
     158  \param size : size (number of elements, used if end \<= start)
     159  \param step : step (or stride)
    160160
    161161  \warning If \b end \> \b start, \b size is computed automatically
Note: See TracChangeset for help on using the changeset viewer.