Changes to Interaction Processor, making possible to add infinite Interactions for all kind of Particles
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user