// // ******************************************************************** // * DISCLAIMER * // * * // * The following disclaimer summarizes all the specific disclaimers * // * of contributors to this software. The specific disclaimers,which * // * govern, are listed with their locations in: * // * http://cern.ch/geant4/license * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. * // * * // * This code implementation is the intellectual property of the * // * GEANT4 collaboration. * // * By copying, distributing or modifying the Program (or any work * // * based on the Program) you indicate your acceptance of this * // * statement, and all its terms. * // ******************************************************************** // // // $Id: G4InterpolationManager.hh,v 1.10 2003/11/03 17:54:36 hpw Exp $ // GEANT4 tag $Name: geant4-07-00-cand-01 $ // #ifndef G4InterpolationManager_h #define G4InterpolationManager_h 1 #include "globals.hh" #include "G4InterpolationScheme.hh" #include "G4ios.hh" #include #include "G4HadronicException.hh" class G4InterpolationManager { public: friend class G4InterpolationIterator; G4InterpolationManager() { nRanges = 1; start = new G4int[1]; start[0] = 0; range = new G4int[1]; range [0] = 100000; scheme = new G4InterpolationScheme[1]; scheme[0] = LINLIN; nEntries = 0; } ~G4InterpolationManager() { if(start!=NULL) delete [] start; if(range!=NULL) delete [] range; if(scheme!=NULL) delete [] scheme; } G4InterpolationManager & operator= (const G4InterpolationManager & aManager) { if(this != &aManager) { nRanges = aManager.nRanges; nEntries = aManager.nEntries; if(scheme!=NULL) delete [] scheme; if(start!=NULL) delete [] start; if(range!=NULL) delete [] range; scheme = new G4InterpolationScheme[nRanges]; start = new G4int[nRanges]; range = new G4int[nRanges]; for(G4int i=0; i> nRanges; start = new G4int[nRanges]; range = new G4int[nRanges]; scheme = new G4InterpolationScheme[nRanges]; start[0] = 0; G4int it; for(G4int i=0; i>range[i]; if(i!=0) start[i] = start[i-1]+range[i-1]; aDataFile>>it; scheme[i] = MakeScheme(it); } nEntries = start[nRanges-1]+range[nRanges-1]; } G4InterpolationScheme MakeScheme(G4int it); inline G4InterpolationScheme GetScheme(G4int index) const { G4int it = 0; for(G4int i=1; i