58 {
59
60
61
62
63
64
65 uint32_t *hist = hist_.data();
66 uint32_t *hist_smoothed = hist_buffer_.data();
68 Smooth(hist, nr_bins, hist_smoothed);
69#if 0
70 SaveHist("input_hist", hist, nr_bins);
71 SaveHist("smoothed_hist", hist_smoothed, nr_bins);
72#endif
73 int max_index = 0;
74 uint32_t mass = 0;
75 GetPeakIndexAndMass(hist_smoothed, nr_bins, &max_index, &mass);
77 AERROR <<
"Fail: lack enough samples.";
78 return false;
79 }
80
81 if (!IsGoodShape(hist, nr_bins, max_index)) {
82 AERROR <<
"Fail: distribution is not good.";
83 return false;
84 }
85
86 val_estimation_ = GetValFromIndex(max_index);
87 Decay(hist, nr_bins);
88
89 return true;
90}
uint32_t histogram_mass_limit