#include <G4InterpolationManager.hh>
Definition at line 38 of file G4InterpolationManager.hh.
◆ G4InterpolationManager()
G4InterpolationManager::G4InterpolationManager |
( |
| ) |
|
|
inline |
Definition at line 44 of file G4InterpolationManager.hh.
45 {
46 nRanges = 1;
48 start[0] = 0;
50 range [0] = 100000;
53 nEntries = 0;
54 }
◆ ~G4InterpolationManager()
G4InterpolationManager::~G4InterpolationManager |
( |
| ) |
|
|
inline |
Definition at line 56 of file G4InterpolationManager.hh.
57 {
58 if(start!=0) delete [] start;
59 if(range!=0) delete [] range;
60 if(scheme!=0) delete [] scheme;
61 }
◆ AppendScheme()
Definition at line 90 of file G4InterpolationManager.cc.
91 {
92 if(aPoint!=nEntries)
93 {
94 G4cout <<
"G4InterpolationManager::AppendScheme - "<<aPoint<<
" "<<nEntries<<
G4endl;
95 throw G4HadronicException(__FILE__, __LINE__,
"Wrong usage of G4InterpolationManager::AppendScheme");
96 }
97 if(nEntries==0)
98 {
99 nEntries = 1;
100 nRanges = 1;
101 start[0] = 0;
102 range [0] = 1;
103 scheme[0] = aScheme;
104 }
105 else if(aScheme==scheme[nRanges-1])
106 {
107 ++range[nRanges-1];
108 nEntries++;
109 }
110 else
111 {
112 nEntries++;
113 nRanges++;
118 for(i=0; i<nRanges-1; i++)
119 {
121 buffer1[i] = range[i];
122 buff2[i] = scheme[i];
123 }
124 delete [] start;
125 delete [] range;
126 delete [] scheme;
128 range = buffer1;
129 scheme = buff2;
130 start[nRanges-1] = start[nRanges-2]+range[nRanges-2];
131 range[nRanges-1] = 1;
132 scheme[nRanges-1] = aScheme;
133 }
134 }
G4DLLIMPORT std::ostream G4cout
Referenced by G4NeutronHPVector::Merge(), and G4NeutronHPVector::SetScheme().
◆ CleanUp()
void G4InterpolationManager::CleanUp |
( |
| ) |
|
|
inline |
◆ GetInverseScheme()
◆ GetScheme()
Definition at line 132 of file G4InterpolationManager.hh.
133 {
135 for(
G4int i=1; i<nRanges; i++)
136 {
137 if(index<start[i]) break;
138 it = i;
139 }
140 return scheme[it];
141 }
Referenced by G4NeutronHPAngularP::GetCosTh(), GetInverseScheme(), G4NeutronHPVector::GetMeanX(), G4NeutronHPVector::GetScheme(), G4NeutronHPVector::GetXsec(), G4NeutronHPPartial::GetY(), G4NeutronHPVector::Integrate(), G4NeutronHPVector::IntegrateAndNormalise(), G4NeutronHPDiscreteTwoBody::Sample(), G4NeutronHPLabAngularEnergy::Sample(), G4NeutronHPContAngularPar::Sample(), G4NeutronHPLegendreStore::Sample(), G4NeutronHPPartial::Sample(), G4NeutronHPLegendreStore::SampleDiscreteTwoBody(), G4NeutronHPLegendreStore::SampleElastic(), and G4NeutronHPLegendreStore::SampleMax().
◆ Init() [1/3]
void G4InterpolationManager::Init |
( |
G4int |
aScheme, |
|
|
G4int |
aRange |
|
) |
| |
|
inline |
Definition at line 85 of file G4InterpolationManager.hh.
86 {
87 nRanges = 1;
88 start[0] = 0;
89 range [0] = aRange;
91 nEntries = aRange;
92 }
G4InterpolationScheme MakeScheme(G4int it)
Referenced by G4NeutronHPAngularP::Init(), G4NeutronHPContEnergyAngular::Init(), G4NeutronHPDiscreteTwoBody::Init(), G4NeutronHPLabAngularEnergy::Init(), G4NeutronHPVector::Init(), G4NeutronHPArbitaryTab::Init(), G4NeutronHPPhotonDist::InitAngular(), G4NeutronHPLegendreStore::InitInterpolation(), G4NeutronHPPartial::InitInterpolation(), G4NeutronHPVector::InitInterpolation(), G4NeutronHPDiscreteTwoBody::Sample(), G4NeutronHPContAngularPar::Sample(), and G4NeutronHPContAngularPar::SetInterpolation().
◆ Init() [2/3]
Definition at line 93 of file G4InterpolationManager.hh.
94 {
95 nRanges = 1;
96 start[0] = 0;
97 range [0] = aRange;
98 scheme[0] = aScheme;
99 nEntries = aRange;
100 }
◆ Init() [3/3]
void G4InterpolationManager::Init |
( |
std::ifstream & |
aDataFile | ) |
|
|
inline |
Definition at line 102 of file G4InterpolationManager.hh.
103 {
104 delete [] start;
105 delete [] range;
106 delete [] scheme;
107 aDataFile >> nRanges;
108 start =
new G4int[nRanges];
109 range =
new G4int[nRanges];
111 start[0] = 0;
113 for(
G4int i=0; i<nRanges; i++)
114 {
115 aDataFile>>range[i];
116
117
118
119
120
121
122 if(i!=0) start[i] = range[i-1];
123
124 aDataFile>>it;
126 }
127 nEntries = start[nRanges-1]+range[nRanges-1];
128 }
◆ MakeScheme()
Definition at line 33 of file G4InterpolationManager.cc.
34 {
36 switch(it)
37 {
38 case 1:
40 break;
41 case 2:
43 break;
44 case 3:
46 break;
47 case 4:
49 break;
50 case 5:
52 break;
53 case 11:
55 break;
56 case 12:
58 break;
59 case 13:
61 break;
62 case 14:
64 break;
65 case 15:
67 break;
68 case 21:
70 break;
71 case 22:
73 break;
74 case 23:
76 break;
77 case 24:
79 break;
80 case 25:
82 break;
83 default:
84 throw G4HadronicException(__FILE__, __LINE__,
"G4InterpolationManager: unknown interpolation scheme");
85 break;
86 }
87 return result;
88 }
Referenced by Init().
◆ operator=()
Definition at line 63 of file G4InterpolationManager.hh.
64 {
65 if(this != &aManager)
66 {
67 nRanges = aManager.nRanges;
68 nEntries = aManager.nEntries;
69 if(scheme!=0) delete [] scheme;
70 if(start!=0) delete [] start;
71 if(range!=0) delete [] range;
73 start =
new G4int[nRanges];
74 range =
new G4int[nRanges];
75 for(
G4int i=0; i<nRanges; i++)
76 {
77 scheme[i]=aManager.scheme[i];
78 start[i]=aManager.start[i];
79 range[i]=aManager.range[i];
80 }
81 }
82 return *this;
83 }
◆ G4InterpolationIterator
The documentation for this class was generated from the following files: