Changes to Interaction Processor, making possible to add infinite Interactions for all kind of Particles

This commit is contained in:
Christian
2019-04-29 13:09:58 +02:00
parent c44bdacb2c
commit e07c03c888
42 changed files with 1599 additions and 1174 deletions
+5 -5
View File
@@ -50,8 +50,8 @@ inline void Base_FuncContainer::stackedMap_from_averageMap (dim1Map *stackedMap,
}
}
inline double Base_FuncContainer::sampleValue_from_stackedMap (dim1Map *stackedMap, ranlib::Uniform<double> *rngUni) {
return (stackedMap->lower_bound(rngUni->random())->second);
inline double Base_FuncContainer::sampleValue_from_stackedMap (const dim1Map &stackedMap, ranlib::Uniform<double> *rngUni) const {
return (stackedMap.lower_bound(rngUni->random())->second);
}
// Base1D_Container
@@ -180,10 +180,10 @@ void Stacked2D_FuncContainer::set_Map(Average2D_FuncContainer &averageContainer)
set_Map(averageMap);
}
double Stacked2D_FuncContainer::sample_Value(double x, ranlib::Uniform<double> *rngUni) {
double Stacked2D_FuncContainer::sample_Value(double x, ranlib::Uniform<double> *rngUni) const {
if (Map.rbegin()->first < x) {
return (sampleValue_from_stackedMap (&Map.rbegin()->second, rngUni));
return (sampleValue_from_stackedMap (Map.rbegin()->second, rngUni));
} else {
return (sampleValue_from_stackedMap (&Map.lower_bound(x)->second, rngUni));
return (sampleValue_from_stackedMap (Map.lower_bound(x)->second, rngUni));
}
}