// @(#)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" ClassImp(TFoamVect); //_____________________________________________________________________________ TFoamVect::TFoamVect() { // Default constructor for streamer fDim =0; fCoords =0; fNext =0; fPrev =0; } //______________________________________________________________________________ TFoamVect::TFoamVect(Int_t n) { // User constructor creating n-dimensional vector // and allocating dynamically array of components Int_t i; fNext=0; fPrev=0; 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; i0) 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]; } //______________________________________________________________________ TFoamVect& TFoamVect::operator*=(const Double_t &x) { // unary multiplication operator *= for(Int_t i=0;ifNext; i++; } } /////////////////////////////////////////////////////////////////////////////// // End of Class TFoamVect // ///////////////////////////////////////////////////////////////////////////////