Changeset 894 in Sophya for trunk/SophyaLib/TArray/tmatrix.h


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/tmatrix.h

    r813 r894  
    88
    99namespace SOPHYA {
     10
     11//! Class of matrixes
     12/*!
     13  \sa TArray
     14 */
    1015
    1116template <class T>
     
    2328  //  Pour verifiez la compatibilite de dimensions lors de l'affectation
    2429  virtual TArray<T>& Set(const TArray<T>& a);
     30  //! Operator = between matrices
    2531  inline  TMatrix<T>& operator = (const TMatrix<T>& a)
    26                        { Set(a);  return(*this); }
     32                     { Set(a);  return(*this); }
    2733
    2834  // Size - Changing the Size
     35  //! return number of rows
    2936  inline uint_4 NRows() const {return Size(marowi_); }
     37  //! return number of columns
    3038  inline uint_4 NCols() const {return Size(macoli_); }
     39  //! return number of columns
    3140  inline uint_4 NCol()  const {return Size(macoli_); } // back-compat Peida
    3241
     
    3645  // Sub-matrix extraction $CHECK$ Reza 03/2000  Doit-on declarer ces methode const ?
    3746  TMatrix<T> SubMatrix(Range rline, Range rcol) const ;
     47  //! () : Return submatrix define by \b Range \b rline and \b rcol
    3848  inline TMatrix<T> operator () (Range rline, Range rcol) const
    3949                    { return SubMatrix(rline, rcol); }
    4050  // Lignes et colonnes de la matrice
     51  //! Return submatrix define by line \b ir (line vector)
    4152  inline TMatrix<T> Row(uint_4 ir) const
    4253                    { return SubMatrix(Range(ir,ir), Range(0,NCols()-1)); }
     54  //! Return submatrix define by column \b ic (column vector)
    4355  inline TMatrix<T> Column(uint_4 ic) const
    4456                    { return SubMatrix(Range(0,NRows()-1), Range(ic,ic)); }
     
    5870  // A = x (matrice diagonale Identite)
    5971  virtual TMatrix<T>& SetIdentity(IdentityMatrix imx);
     72  // = : fill matrix with an identity matrix \b imx
    6073  inline  TMatrix<T>& operator = (IdentityMatrix imx) { return SetIdentity(imx); }
    6174
     75  // = : fill matrix with a Sequence \b seq
    6276  inline  TMatrix<T>&  operator = (Sequence seq)    { SetSeq(seq); return(*this); }
    6377
    6478  // Operations diverses  avec une constante
     79  //! = : fill matrix with constant value \b x
    6580  inline  TMatrix<T>&  operator = (T x)             { SetT(x); return(*this); }
     81  //! += : add constant value \b x to matrix
    6682  inline  TMatrix<T>&  operator += (T x)            { Add(x); return(*this); }
     83  //! -= : substract constant value \b x to matrix
    6784  inline  TMatrix<T>&  operator -= (T x)            { Sub(x); return(*this); }
     85  //! *= : multiply matrix by constant value \b x
    6886  inline  TMatrix<T>&  operator *= (T x)            { Mul(x); return(*this); }
     87  //! /= : divide matrix by constant value \b x
    6988  inline  TMatrix<T>&  operator /= (T x)            { Div(x); return(*this); }
    7089
    7190  //  operations avec matrices
     91  //! += : add a matrix
    7292  inline  TMatrix<T>&  operator += (const TMatrix<T>& a)  { AddElt(a); return(*this); }
     93  //! -= : substract a matrix
    7394  inline  TMatrix<T>&  operator -= (const TMatrix<T>& a)  { SubElt(a); return(*this); }
    74   // Produit matriciel Multiply : C = (*this)*B
    7595  TMatrix<T>  Multiply(const TMatrix<T>& b, short mm=SameMemoryMapping) const;
     96  //! *= : matrix product : C = (*this)*B
    7697  inline  TMatrix<T>&  operator *= (const TMatrix<T>& b)
    7798          { this->Set(Multiply(b));  return(*this); }
     
    85106
    86107//  ---- inline acces methods ------
     108 //! () : return element for line \b r and column \b c
    87109template <class T>
    88110inline T const& TMatrix<T>::operator()(uint_4 r, uint_4 c) const
     
    96118}
    97119
     120//! () : return element for line \b r and column \b c
    98121template <class T>
    99122inline T & TMatrix<T>::operator()(uint_4 r, uint_4 c)
     
    113136// Doit-on le faire aussi pour les constantes ? - Fin de $CHECK$ Reza 3/4/2000
    114137
     138//! + : add matrixes \b a and \b b
    115139template <class T>
    116140inline TMatrix<T> operator + (const TMatrix<T>& a,const TMatrix<T>& b)
    117141    {TMatrix<T> result(a); result.SetTemp(true); result.AddElt(b); return result;}
    118142
     143//! - : substract matrixes \b a and \b b
    119144template <class T>
    120145inline TMatrix<T> operator - (const TMatrix<T>& a,const TMatrix<T>& b)
     
    122147
    123148// Surcharge d'operateurs C = A * B
    124 
     149//! - : multiply matrixes \b a and \b b
    125150template <class T> inline TMatrix<T> operator * (const TMatrix<T>& a, const TMatrix<T>& b)
    126151{ TMatrix<T> result(a); result.SetTemp(true); return(result.Multiply(b)); }
    127152
     153//! Define Matrix to be TMatrix<r_8>
    128154typedef TMatrix<r_8> Matrix;
    129155
Note: See TracChangeset for help on using the changeset viewer.