// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * 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. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // // $Id: G4InterpolationManager.hh,v 1.13 2007/06/06 12:45:13 ahoward Exp $ // GEANT4 tag $Name: geant4-09-03-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!=0) delete [] start; if(range!=0) delete [] range; if(scheme!=0) delete [] scheme; } G4InterpolationManager & operator= (const G4InterpolationManager & aManager) { if(this != &aManager) { nRanges = aManager.nRanges; nEntries = aManager.nEntries; if(scheme!=0) delete [] scheme; if(start!=0) delete [] start; if(range!=0) 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