#include <G4NeutronHPHash.hh>
Public Member Functions | |
G4NeutronHPHash () | |
~G4NeutronHPHash () | |
G4NeutronHPHash (const G4NeutronHPHash &aHash) | |
G4NeutronHPHash & | operator= (const G4NeutronHPHash &aHash) |
void | Clear () |
G4bool | Prepared () const |
void | SetData (G4int index, G4double x, G4double y) |
G4int | GetMinIndex (G4double e) const |
Definition at line 32 of file G4NeutronHPHash.hh.
G4NeutronHPHash::G4NeutronHPHash | ( | ) | [inline] |
Definition at line 35 of file G4NeutronHPHash.hh.
Referenced by G4NeutronHPHash(), operator=(), and SetData().
G4NeutronHPHash::~G4NeutronHPHash | ( | ) | [inline] |
G4NeutronHPHash::G4NeutronHPHash | ( | const G4NeutronHPHash & | aHash | ) | [inline] |
Definition at line 46 of file G4NeutronHPHash.hh.
References G4NeutronHPHash(), theData, theIndex, and theUpper.
00047 { 00048 theIndex = aHash.theIndex; 00049 theData = aHash.theData; 00050 if(aHash.theUpper != 0) 00051 { 00052 theUpper = new G4NeutronHPHash(*(aHash.theUpper)); 00053 } 00054 else 00055 { 00056 theUpper = 0; 00057 } 00058 }
void G4NeutronHPHash::Clear | ( | ) | [inline] |
Definition at line 78 of file G4NeutronHPHash.hh.
Referenced by G4NeutronHPVector::CleanUp(), and G4NeutronHPVector::ReHash().
00079 { 00080 if(theUpper) 00081 { 00082 delete theUpper; 00083 theUpper = 0; 00084 } 00085 theIndex.clear(); 00086 theData.clear(); 00087 prepared = false; 00088 }
Definition at line 105 of file G4NeutronHPHash.hh.
References GetMinIndex().
Referenced by GetMinIndex(), and G4NeutronHPVector::GetXsec().
00106 { 00107 G4int result=-1; 00108 if(theData.size() == 0) return 0; 00109 if(theData[0].GetX()>e) return 0; 00110 00111 G4int lower=0; 00112 if(theUpper != 0) 00113 { 00114 lower = theUpper->GetMinIndex(e); 00115 } 00116 unsigned int i; 00117 for(i=lower; i<theData.size(); i++) 00118 { 00119 if(theData[i].GetX()>e) 00120 { 00121 result = theIndex[i-1]; 00122 break; 00123 } 00124 } 00125 if(result == -1) result = theIndex[theIndex.size()-1]; 00126 return result; 00127 }
G4NeutronHPHash& G4NeutronHPHash::operator= | ( | const G4NeutronHPHash & | aHash | ) | [inline] |
Definition at line 60 of file G4NeutronHPHash.hh.
References G4NeutronHPHash(), theData, theIndex, and theUpper.
00061 { 00062 if(&aHash != this) 00063 { 00064 theIndex = aHash.theIndex; 00065 theData = aHash.theData; 00066 if(aHash.theUpper != 0) 00067 { 00068 theUpper = new G4NeutronHPHash(*(aHash.theUpper)); 00069 } 00070 else 00071 { 00072 theUpper = 0; 00073 } 00074 } 00075 return *this; 00076 }
G4bool G4NeutronHPHash::Prepared | ( | ) | const [inline] |
Definition at line 90 of file G4NeutronHPHash.hh.
Referenced by G4NeutronHPVector::GetXsec(), G4NeutronHPVector::Merge(), and G4NeutronHPVector::ThinOut().
Definition at line 91 of file G4NeutronHPHash.hh.
References G4NeutronHPHash(), SetData(), and G4NeutronHPDataPoint::SetData().
Referenced by G4NeutronHPVector::Hash(), G4NeutronHPVector::Init(), and SetData().
00092 { 00093 prepared = true; 00094 G4NeutronHPDataPoint aPoint; 00095 aPoint.SetData(x, y); 00096 theData.push_back(aPoint); 00097 theIndex.push_back(index); 00098 if(0 == theData.size()%10 && 0!=theData.size()) 00099 { 00100 if(0 == theUpper) theUpper = new G4NeutronHPHash(); 00101 theUpper->SetData(theData.size()-1, x, y); 00102 } 00103 }