Logo ROOT   6.10/09
Reference Guide
PDEFoamVect.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: S. Jadach, Tancredi Carli, Dominik Dannheim, Alexander Voigt
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Classes: PDEFoamVect *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Auxiliary class PDEFoamVect of n-dimensional vector, with dynamic *
12  * allocation used for the cartesian geometry of the PDEFoam cells *
13  * *
14  * Authors (alphabetical): *
15  * S. Jadach - Institute of Nuclear Physics, Cracow, Poland *
16  * Tancredi Carli - CERN, Switzerland *
17  * Dominik Dannheim - CERN, Switzerland *
18  * Alexander Voigt - TU Dresden, Germany *
19  * *
20  * Copyright (c) 2008: *
21  * CERN, Switzerland *
22  * MPI-K Heidelberg, Germany *
23  * *
24  * Redistribution and use in source and binary forms, with or without *
25  * modification, are permitted according to the terms listed in LICENSE *
26  * (http://tmva.sourceforge.net/LICENSE) *
27  **********************************************************************************/
28 
29 #ifndef ROOT_TMVA_PDEFoamVect
30 #define ROOT_TMVA_PDEFoamVect
31 
32 #include "TObject.h"
33 
34 namespace TMVA {
35 
36  class PDEFoamVect : public TObject {
37 
38  private:
39  Int_t fDim; // Dimension
40  Double_t *fCoords; // [fDim] Coordinates
41 
42  public:
43  // constructor
44  PDEFoamVect(); // Constructor
45  PDEFoamVect(Int_t); // USER Constructor
46  PDEFoamVect(const PDEFoamVect &); // Copy constructor
47  virtual ~PDEFoamVect(); // Destructor
48 
49  //////////////////////////////////////////////////////////////////////////////
50  // Overloading operators //
51  //////////////////////////////////////////////////////////////////////////////
52  PDEFoamVect& operator =( const PDEFoamVect& ); // = operator; Substitution
53  Double_t & operator[]( Int_t ); // [] provides POINTER to coordinate
54  PDEFoamVect& operator =( Double_t [] ); // LOAD IN entire double vector
55  PDEFoamVect& operator =( Double_t ); // LOAD IN double number
56  ////////////////////////// OTHER METHODS //////////////////////////////////
57  PDEFoamVect& operator+=( const PDEFoamVect& ); // +=; add vector u+=v (FAST)
58  PDEFoamVect& operator-=( const PDEFoamVect& ); // +=; add vector u+=v (FAST)
59  PDEFoamVect& operator*=( const Double_t& ); // *=; mult. by scalar v*=x (FAST)
60  PDEFoamVect operator+ ( const PDEFoamVect& ); // +; u=v+s, NEVER USE IT, SLOW!!!
61  PDEFoamVect operator- ( const PDEFoamVect& ); // -; u=v-s, NEVER USE IT, SLOW!!!
62  void Print(Option_t *option) const; // Prints vector
63  Int_t GetDim() const { return fDim; } // Returns dimension
64  Double_t GetCoord(Int_t i) const { return fCoords[i]; } // Returns coordinate
65 
66  ClassDef(PDEFoamVect,2) //n-dimensional vector with dynamical allocation
67  }; // end of PDEFoamVect
68 } // namespace TMVA
69 
70 #endif
Double_t GetCoord(Int_t i) const
Definition: PDEFoamVect.h:64
PDEFoamVect & operator*=(const Double_t &)
unary multiplication operator *=
PDEFoamVect & operator-=(const PDEFoamVect &)
unary subtraction operator -=
PDEFoamVect & operator=(const PDEFoamVect &)
substitution operator
Definition: PDEFoamVect.cxx:99
const char Option_t
Definition: RtypesCore.h:62
void Print(Option_t *option) const
Printout of all vector components.
int Int_t
Definition: RtypesCore.h:41
Int_t GetDim() const
Definition: PDEFoamVect.h:63
virtual ~PDEFoamVect()
Destructor.
Definition: PDEFoamVect.cxx:86
Double_t & operator[](Int_t)
[] is for access to elements as in ordinary matrix like a[j]=bj Range protection is built in...
#define ClassDef(name, id)
Definition: Rtypes.h:297
PDEFoamVect()
Default constructor for streamer.
Definition: PDEFoamVect.cxx:50
Double_t * fCoords
Definition: PDEFoamVect.h:40
PDEFoamVect & operator+=(const PDEFoamVect &)
unary addition operator +=; adding vector c*=x,
PDEFoamVect operator+(const PDEFoamVect &)
addition operator +; sum of 2 vectors: c=a+b, a=a+b, NEVER USE IT, VERY SLOW!!!
double Double_t
Definition: RtypesCore.h:55
Mother of all ROOT objects.
Definition: TObject.h:37
Abstract ClassifierFactory template that handles arbitrary types.
PDEFoamVect operator-(const PDEFoamVect &)
subtraction operator -; difference of 2 vectors; c=a-b, a=a-b, NEVER USE IT, VERY SLOW!!! ...