MCPcopy Create free account
hub / github.com/BoevaLab/FREEC / get_quartiles

Function get_quartiles

src/myFunc.cpp:2727–2742  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2725
2726
2727 std::vector<float> get_quartiles(vector<float> vect)
2728{
2729 float q1 = 0, q2 = 0, q3 = 0;
2730 if (vect.size() > 10)
2731 {
2732 std::sort(vect.begin(), vect.end());
2733 q2 = get_median(vect, 0, vect.size());
2734 q1 = get_median(vect, 0, round(vect.size()/2));
2735 q3 = get_median(vect, round(vect.size()/2), vect.size());
2736 }
2737 vector<float> quartiles;
2738 quartiles.push_back(q1);
2739 quartiles.push_back(q2);
2740 quartiles.push_back(q3);
2741 return quartiles;
2742}
2743

Callers

nothing calls this directly

Calls 1

get_medianFunction · 0.85

Tested by

no test coverage detected