15 namespace illumina {
namespace interop {
namespace logic {
namespace plot {
28 const float eps = 1e-7f;
29 const float NaN = std::numeric_limits<float>::quiet_NaN();
32 std::stable_sort(beg, end);
33 const float p25 = util::percentile_sorted<float>(beg, end, 25);
34 const float p50 = util::percentile_sorted<float>(beg, end, 50);
35 const float p75 = util::percentile_sorted<float>(beg, end, 75);
38 const float tukey_constant = 1.5f;
39 const float iqr = p75-p25;
40 const float lower = p25 - tukey_constant * iqr;
41 const float upper = p75 + tukey_constant * iqr;
42 if(outliers.capacity()>0)
47 const size_t count =
static_cast<size_t>(std::distance(beg,end));
49 I upper_it = std::lower_bound(beg, end, upper);
50 I lower_it = std::lower_bound(beg, end, lower-(eps*lower));
54 const float max_val = (upper_it != beg) ?
55 ((upper_it == end || *upper_it > upper) ? *(upper_it-1) : *upper_it)
57 ((upper_it != end) ? *upper_it : NaN);
59 const float min_val = (lower_it != end) ? *lower_it : NaN;
Definition: enum_description.h:15
void outliers_upper(I beg, I end, const F bound, O out)
Definition: statistics.h:334
void outliers_lower(I beg, I end, const F bound, O out)
Definition: statistics.h:313
Definition: candle_stick_point.h:19
#define INTEROP_ASSERT(TST)
Definition: assert.h:21
void plot_candle_stick(model::plot::candle_stick_point &point, I beg, I end, const float x, std::vector< float > &outliers)
Definition: plot_point.h:26