00001 00002 /********************************************************************************** 00003 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis * 00004 * Package: TMVA * 00005 * Classes: PDEFoamVect * 00006 * Web : http://tmva.sourceforge.net * 00007 * * 00008 * Description: * 00009 * Auxiliary class PDEFoamVect of n-dimensional vector, with dynamic * 00010 * allocation used for the cartesian geometry of the PDEFoam cells * 00011 * * 00012 * Authors (alphabetical): * 00013 * S. Jadach - Institute of Nuclear Physics, Cracow, Poland * 00014 * Tancredi Carli - CERN, Switzerland * 00015 * Dominik Dannheim - CERN, Switzerland * 00016 * Alexander Voigt - CERN, Switzerland * 00017 * * 00018 * Copyright (c) 2008: * 00019 * CERN, Switzerland * 00020 * MPI-K Heidelberg, Germany * 00021 * * 00022 * Redistribution and use in source and binary forms, with or without * 00023 * modification, are permitted according to the terms listed in LICENSE * 00024 * (http://tmva.sourceforge.net/LICENSE) * 00025 **********************************************************************************/ 00026 00027 #ifndef ROOT_TMVA_PDEFoamVect 00028 #define ROOT_TMVA_PDEFoamVect 00029 00030 #ifndef ROOT_TObject 00031 #include "TObject.h" 00032 #endif 00033 00034 namespace TMVA { 00035 00036 class PDEFoamVect : public TObject { 00037 00038 private: 00039 Int_t fDim; // Dimension 00040 Double_t *fCoords; // [fDim] Coordinates 00041 00042 public: 00043 // constructor 00044 PDEFoamVect(); // Constructor 00045 PDEFoamVect(Int_t); // USER Constructor 00046 PDEFoamVect(const PDEFoamVect &); // Copy constructor 00047 virtual ~PDEFoamVect(); // Destructor 00048 00049 ////////////////////////////////////////////////////////////////////////////// 00050 // Overloading operators // 00051 ////////////////////////////////////////////////////////////////////////////// 00052 PDEFoamVect& operator =( const PDEFoamVect& ); // = operator; Substitution 00053 Double_t & operator[]( Int_t ); // [] provides POINTER to coordinate 00054 PDEFoamVect& operator =( Double_t [] ); // LOAD IN entire double vector 00055 PDEFoamVect& operator =( Double_t ); // LOAD IN double number 00056 ////////////////////////// OTHER METHODS ////////////////////////////////// 00057 PDEFoamVect& operator+=( const PDEFoamVect& ); // +=; add vector u+=v (FAST) 00058 PDEFoamVect& operator-=( const PDEFoamVect& ); // +=; add vector u+=v (FAST) 00059 PDEFoamVect& operator*=( const Double_t& ); // *=; mult. by scalar v*=x (FAST) 00060 PDEFoamVect operator+ ( const PDEFoamVect& ); // +; u=v+s, NEVER USE IT, SLOW!!! 00061 PDEFoamVect operator- ( const PDEFoamVect& ); // -; u=v-s, NEVER USE IT, SLOW!!! 00062 void Print(Option_t *option) const; // Prints vector 00063 Int_t GetDim() const { return fDim; } // Returns dimension 00064 Double_t GetCoord(Int_t i) const { return fCoords[i]; } // Returns coordinate 00065 00066 ClassDef(PDEFoamVect,1) //n-dimensional vector with dynamical allocation 00067 }; // end of PDEFoamVect 00068 } // namespace TMVA 00069 00070 #endif