Logo ROOT  
Reference Guide
TFoamVect.h
Go to the documentation of this file.
1 // @(#)root/foam:$Id$
2 // Author: S. Jadach <mailto:Stanislaw.jadach@ifj.edu.pl>, P.Sawicki <mailto:Pawel.Sawicki@ifj.edu.pl>
3 
4 #ifndef ROOT_TFoamVect
5 #define ROOT_TFoamVect
6 
7 #include "TObject.h"
8 
9 
10 class TFoamVect : public TObject {
11  // constructor
12 private:
13  Int_t fDim; ///< Dimension
14  Double_t *fCoords; ///< [fDim] Coordinates
15 public:
16  TFoamVect(); // Constructor
17  TFoamVect(Int_t); // USER Constructor
18  TFoamVect(const TFoamVect &); // Copy constructor
19  virtual ~TFoamVect(); // Destructor
20 
21  TFoamVect& operator =(const TFoamVect&); // = operator; Substitution
22  Double_t &operator[](Int_t); // [] provides POINTER to coordinate
23  TFoamVect& operator =(Double_t []); // LOAD IN entire double vector
24  TFoamVect& operator =(Double_t); // LOAD IN double number
25 
26  TFoamVect& operator+=(const TFoamVect&); // +=; add vector u+=v (FAST)
27  TFoamVect& operator-=(const TFoamVect&); // +=; add vector u+=v (FAST)
28  TFoamVect& operator*=(const Double_t&); // *=; mult. by scalar v*=x (FAST)
29  TFoamVect operator+( const TFoamVect&); // +; u=v+s, NEVER USE IT, SLOW!!!
30  TFoamVect operator-( const TFoamVect&); // -; u=v-s, NEVER USE IT, SLOW!!!
31  void Print(Option_t *option) const; // Prints vector
32  Int_t GetDim() const { return fDim; } // Returns dimension
33  Double_t GetCoord(Int_t i) const {return fCoords[i];}; // Returns coordinate
34 
35  ClassDef(TFoamVect,1) //n-dimensional vector with dynamical allocation
36 };
37 
38 #endif
39 
TFoamVect::operator-
TFoamVect operator-(const TFoamVect &)
subtraction operator -; difference of 2 vectors; c=a-b, a=a-b, NEVER USE IT, VERY SLOW!...
Definition: TFoamVect.cxx:169
TFoamVect::operator+
TFoamVect operator+(const TFoamVect &)
addition operator +; sum of 2 vectors: c=a+b, a=a+b, NEVER USE IT, VERY SLOW!!!
Definition: TFoamVect.cxx:157
Option_t
const char Option_t
Definition: RtypesCore.h:66
TFoamVect::TFoamVect
TFoamVect()
Default constructor for streamer.
Definition: TFoamVect.cxx:28
TFoamVect::GetCoord
Double_t GetCoord(Int_t i) const
Definition: TFoamVect.h:33
TFoamVect::fDim
Int_t fDim
Dimension.
Definition: TFoamVect.h:13
TFoamVect::operator[]
Double_t & operator[](Int_t)
[] is for access to elements as in ordinary matrix like a[j]=bj Range protection is built in,...
Definition: TFoamVect.cxx:109
TFoamVect::operator+=
TFoamVect & operator+=(const TFoamVect &)
unary addition operator +=; adding vector c*=x,
Definition: TFoamVect.cxx:130
TFoamVect::~TFoamVect
virtual ~TFoamVect()
Destructor.
Definition: TFoamVect.cxx:76
TFoamVect
Auxiliary class TFoamVect of n-dimensional vector, with dynamic allocation used for the cartesian geo...
Definition: TFoamVect.h:10
TFoamVect::operator=
TFoamVect & operator=(const TFoamVect &)
substitution operator
Definition: TFoamVect.cxx:86
TFoamVect::GetDim
Int_t GetDim() const
Definition: TFoamVect.h:32
Double_t
double Double_t
Definition: RtypesCore.h:59
TFoamVect::Print
void Print(Option_t *option) const
Printout of all vector components on "std::cout".
Definition: TFoamVect.cxx:203
TObject.h
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TFoamVect::operator-=
TFoamVect & operator-=(const TFoamVect &)
unary subtraction operator -=
Definition: TFoamVect.cxx:143
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TFoamVect::operator*=
TFoamVect & operator*=(const Double_t &)
unary multiplication operator *=
Definition: TFoamVect.cxx:120
TFoamVect::fCoords
Double_t * fCoords
[fDim] Coordinates
Definition: TFoamVect.h:14
int