ROOT  6.06/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 #ifndef ROOT_TObject
33 #include "TObject.h"
34 #endif
35 
36 namespace TMVA {
37 
38  class PDEFoamVect : public TObject {
39 
40  private:
41  Int_t fDim; // Dimension
42  Double_t *fCoords; // [fDim] Coordinates
43 
44  public:
45  // constructor
46  PDEFoamVect(); // Constructor
47  PDEFoamVect(Int_t); // USER Constructor
48  PDEFoamVect(const PDEFoamVect &); // Copy constructor
49  virtual ~PDEFoamVect(); // Destructor
50 
51  //////////////////////////////////////////////////////////////////////////////
52  // Overloading operators //
53  //////////////////////////////////////////////////////////////////////////////
54  PDEFoamVect& operator =( const PDEFoamVect& ); // = operator; Substitution
55  Double_t & operator[]( Int_t ); // [] provides POINTER to coordinate
56  PDEFoamVect& operator =( Double_t [] ); // LOAD IN entire double vector
57  PDEFoamVect& operator =( Double_t ); // LOAD IN double number
58  ////////////////////////// OTHER METHODS //////////////////////////////////
59  PDEFoamVect& operator+=( const PDEFoamVect& ); // +=; add vector u+=v (FAST)
60  PDEFoamVect& operator-=( const PDEFoamVect& ); // +=; add vector u+=v (FAST)
61  PDEFoamVect& operator*=( const Double_t& ); // *=; mult. by scalar v*=x (FAST)
62  PDEFoamVect operator+ ( const PDEFoamVect& ); // +; u=v+s, NEVER USE IT, SLOW!!!
63  PDEFoamVect operator- ( const PDEFoamVect& ); // -; u=v-s, NEVER USE IT, SLOW!!!
64  void Print(Option_t *option) const; // Prints vector
65  Int_t GetDim() const { return fDim; } // Returns dimension
66  Double_t GetCoord(Int_t i) const { return fCoords[i]; } // Returns coordinate
67 
68  ClassDef(PDEFoamVect,2) //n-dimensional vector with dynamical allocation
69  }; // end of PDEFoamVect
70 } // namespace TMVA
71 
72 #endif
Double_t GetCoord(Int_t i) const
Definition: PDEFoamVect.h:66
PDEFoamVect & operator*=(const Double_t &)
unary multiplication operator *=
PDEFoamVect & operator-=(const PDEFoamVect &)
unary subtraction operator -=
PDEFoamVect & operator=(const PDEFoamVect &)
substitution operator
Definition: PDEFoamVect.cxx:94
const char Option_t
Definition: RtypesCore.h:62
int Int_t
Definition: RtypesCore.h:41
virtual ~PDEFoamVect()
Destructor.
Definition: PDEFoamVect.cxx:81
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:254
Double_t * fCoords
Definition: PDEFoamVect.h:42
void Print(Option_t *option) const
Printout of all vector components.
Int_t GetDim() const
Definition: PDEFoamVect.h:65
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:58
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!!! ...