// @(#)root/foam:$Id$ // Author: S. Jadach , P.Sawicki //_____________________________________________________________________________ // // // Auxiliary class TFoamVect of n-dimensional vector, with dynamic allocation // // used for the cartesian geometry of the TFoam cells // // // //_____________________________________________________________________________ #include "Riostream.h" #include "TSystem.h" #include "TFoamVect.h" /** \class TFoamVect Auxiliary class TFoamVect of n-dimensional vector, with dynamic allocation used for the cartesian geometry of the TFoam cells */ ClassImp(TFoamVect); //////////////////////////////////////////////////////////////////////////////// /// Default constructor for streamer TFoamVect::TFoamVect() { fDim =0; fCoords =0; } //////////////////////////////////////////////////////////////////////////////// /// User constructor creating n-dimensional vector /// and allocating dynamically array of components TFoamVect::TFoamVect(Int_t n) { Int_t i; fDim=n; fCoords = 0; if (n>0) { fCoords = new Double_t[fDim]; if(gDebug) { if(fCoords == 0) Error("TFoamVect", "Constructor failed to allocate\n"); } for (i=0; i 0) fCoords = new Double_t[fDim]; if(gDebug) { if(fCoords == 0) { Error("TFoamVect", "Constructor failed to allocate fCoords\n"); } } for(Int_t i=0; i=fDim)) { Error( "TFoamVect","operator[], out of range \n"); } return fCoords[n]; } //////////////////////////////////////////////////////////////////////////////// /// unary multiplication operator *= TFoamVect& TFoamVect::operator*=(const Double_t &x) { for(Int_t i=0;i