Changeset 2575 in Sophya for trunk/SophyaLib/TArray/tvector.h


Ignore:
Timestamp:
Jul 29, 2004, 2:31:16 PM (21 years ago)
Author:
ansari
Message:

1/ Remplacement des methodes Add/Sub/Mul/DivElt(a) par

Add/Sub/Mul/DivElt(TArray a, TArray res)

2/ Operateurs += -= A+B A-B TArray et TMatrix/TVecteur modifies en consequence
3/ Ajout methode TArray::ScalarProduct()
4/ Methode TArray::SetT renomme en SetCst() SetT garde en alias
5/ Ajout parametre bool fzero (mise a zero) ajoute ds constructeur et

ReSize() de TMatrix et TVecteur.

Reza 29/07/2004

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/SophyaLib/TArray/tvector.h

    r2564 r2575  
    1414  // Creation / destruction
    1515  TVector();
    16   TVector(sa_size_t n, short lcv=AutoVectorType, short mm=AutoMemoryMapping);
     16  TVector(sa_size_t n, short lcv=AutoVectorType, short mm=AutoMemoryMapping, bool fzero=true);
    1717  TVector(const TVector<T>& v);
    1818  TVector(const TVector<T>& v, bool share);
     
    3939   
    4040  // Gestion taille/Remplissage
    41   void ReSize(sa_size_t n, short lcv=SameVectorType );
     41  void ReSize(sa_size_t n, short lcv=SameVectorType, bool fzero=true);
    4242  //! 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); }
     43  inline void SetSize(sa_size_t n, short lcv=SameVectorType, bool fzero=true)
     44              { ReSize(n, lcv, fzero); }
    4545  void Realloc(sa_size_t n, short lcv=SameVectorType, bool force=false);
    4646
     
    7777  //  operations avec matrices
    7878  //! += : add a vector in place
    79   inline  TVector<T>&  operator += (const TVector<T>& a)  { AddElt(a); return(*this); }
     79  inline  TVector<T>&  operator += (const TVector<T>& a)  { AddElt(a,*this); return(*this); }
    8080  //! += : substract a vector in place
    81   inline  TVector<T>&  operator -= (const TVector<T>& a)  { SubElt(a); return(*this); }
    82 
    83   // Norme(^2)
    84   T Norm2() const ;
     81  inline  TVector<T>&  operator -= (const TVector<T>& a)  { SubElt(a,*this); return(*this); }
    8582
    8683  virtual string InfoString() const;
Note: See TracChangeset for help on using the changeset viewer.