ROOT logo
// @(#)root/foam:$Id: TFoamVect.h 20882 2007-11-19 11:31:26Z rdm $
// Author: S. Jadach <mailto:Stanislaw.jadach@ifj.edu.pl>, P.Sawicki <mailto:Pawel.Sawicki@ifj.edu.pl>

#ifndef ROOT_TFoamVect
#define ROOT_TFoamVect

////////////////////////////////////////////////////////////////////////////////
//                                                                            //
// Auxiliary class TFoamVect of n-dimensional vector, with dynamic allocation //
// used for the cartesian geometry of the TFoam cells                         //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////

#ifndef ROOT_TObject
#include "TObject.h"
#endif


///////////////////////////////////////////////////////////////////////////////
class TFoamVect : public TObject {
   // constructor
private:
   Int_t       fDim;                     // Dimension
   Double_t   *fCoords;                  // [fDim] Coordinates
   TFoamVect  *fNext;                    // pointer for tree construction
   TFoamVect  *fPrev;                    // pointer for tree construction
public:
   TFoamVect();                          // Constructor
   TFoamVect(Int_t);                     // USER Constructor
   TFoamVect(const TFoamVect &);         // Copy constructor
   virtual ~TFoamVect();                 // Destructor
//////////////////////////////////////////////////////////////////////////////
//                     Overloading operators                                //
//////////////////////////////////////////////////////////////////////////////
   TFoamVect& operator =(const TFoamVect&);  // = operator; Substitution
   Double_t &operator[](Int_t);              // [] provides POINTER to coordinate
   TFoamVect& operator =(Double_t []);       // LOAD IN entire double vector
   TFoamVect& operator =(Double_t);          // LOAD IN double number
//////////////////////////   OTHER METHODS    //////////////////////////////////
   TFoamVect& operator+=(const  TFoamVect&); // +=; add vector u+=v  (FAST)
   TFoamVect& operator-=(const  TFoamVect&); // +=; add vector u+=v  (FAST)
   TFoamVect& operator*=(const Double_t&);   // *=; mult. by scalar v*=x (FAST)
   TFoamVect  operator+( const  TFoamVect&); // +;  u=v+s, NEVER USE IT, SLOW!!!
   TFoamVect  operator-( const  TFoamVect&); // -;  u=v-s, NEVER USE IT, SLOW!!!
   void Print(Option_t *option) const;   // Prints vector
   void PrintList();                         // Prints vector and the following linked list
   Int_t    GetDim() const { return fDim; }  // Returns dimension
   Double_t GetCoord(Int_t i) const {return fCoords[i];};   // Returns coordinate

   ClassDef(TFoamVect,1) //n-dimensional vector with dynamical allocation
};

#endif

 TFoamVect.h:1
 TFoamVect.h:2
 TFoamVect.h:3
 TFoamVect.h:4
 TFoamVect.h:5
 TFoamVect.h:6
 TFoamVect.h:7
 TFoamVect.h:8
 TFoamVect.h:9
 TFoamVect.h:10
 TFoamVect.h:11
 TFoamVect.h:12
 TFoamVect.h:13
 TFoamVect.h:14
 TFoamVect.h:15
 TFoamVect.h:16
 TFoamVect.h:17
 TFoamVect.h:18
 TFoamVect.h:19
 TFoamVect.h:20
 TFoamVect.h:21
 TFoamVect.h:22
 TFoamVect.h:23
 TFoamVect.h:24
 TFoamVect.h:25
 TFoamVect.h:26
 TFoamVect.h:27
 TFoamVect.h:28
 TFoamVect.h:29
 TFoamVect.h:30
 TFoamVect.h:31
 TFoamVect.h:32
 TFoamVect.h:33
 TFoamVect.h:34
 TFoamVect.h:35
 TFoamVect.h:36
 TFoamVect.h:37
 TFoamVect.h:38
 TFoamVect.h:39
 TFoamVect.h:40
 TFoamVect.h:41
 TFoamVect.h:42
 TFoamVect.h:43
 TFoamVect.h:44
 TFoamVect.h:45
 TFoamVect.h:46
 TFoamVect.h:47
 TFoamVect.h:48
 TFoamVect.h:49
 TFoamVect.h:50
 TFoamVect.h:51
 TFoamVect.h:52
 TFoamVect.h:53
 TFoamVect.h:54