Added underflow bin (energy) to indices that are
drawn from
This commit is contained in:
@@ -18,6 +18,7 @@ std::mt19937* RandomNumbers::engine() {
|
||||
}
|
||||
|
||||
// does NOT shuffle the indices!
|
||||
// num bins for the energy binning should include the underflow bin!
|
||||
RandomIndex::RandomIndex(blitz::TinyVector<int, 5> num_bins) :
|
||||
num_bins_(num_bins){
|
||||
|
||||
@@ -44,6 +45,8 @@ bool RandomIndex::visited_all() {
|
||||
|
||||
// return the next index in the shuffled index vector. Returns the last
|
||||
// index if all bins have been visited. Reshuffling resets this.
|
||||
// Note that the underflow bin for the energy is included, i.e. min index for E
|
||||
// is -1 not 0
|
||||
blitz::TinyVector<int, 5> RandomIndex::index() {
|
||||
size_t tmp_one_dimensional_idx = one_dimensional_indices_[current_index_in_vector_];
|
||||
|
||||
@@ -63,6 +66,8 @@ blitz::TinyVector<int, 5> RandomIndex::index() {
|
||||
tmp_one_dimensional_idx -= tmp * current_prod;
|
||||
}
|
||||
|
||||
return_index(4) -= 1;
|
||||
|
||||
if(!visited_all())
|
||||
current_index_in_vector_++;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user