Skip to content
Snippets Groups Projects
Commit 2969064f authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Make names snake case

parent 301859f5
No related branches found
No related tags found
No related merge requests found
......@@ -18,16 +18,16 @@ BoxPlotStats::BoxPlotStats(const std::vector<float>& values, bool isSorted, floa
void BoxPlotStats::set(const std::vector<float>& _values, bool isSorted)
{
const std::vector<float>& values = isSorted ? _values : sorted(_values);
const std::vector<float>& values = isSorted ? _values : math::sorted(_values);
this->minimum = math::min(values, true);
this->maximum = math::max(values, true);
this->lowerQuartile = math::lowerQuartile(values, true);
this->lowerQuartile = math::lower_quartile(values, true);
this->median = math::median(values, true);
this->upperQuartile = math::upperQuartile(values, true);
this->upperQuartile = math::upper_quartile(values, true);
const float iqr = interquartileRange(lowerQuartile, upperQuartile);
const float iqr = math::interquartile_range(lowerQuartile, upperQuartile);
this->minWhisker = lowerQuartile - whisk * iqr;
this->maxWhisker = upperQuartile + whisk * iqr;
......
......@@ -90,7 +90,7 @@ float simox::math::quantile(const std::vector<float>& _values, float p, bool isS
}
}
float simox::math::lowerQuartile(const std::vector<float>& values, bool isSorted)
float simox::math::lower_quartile(const std::vector<float>& values, bool isSorted)
{
return quantile(values, .25, isSorted);
}
......@@ -100,20 +100,20 @@ float simox::math::median(const std::vector<float>& values, bool isSorted)
return quantile(values, .5, isSorted);
}
float simox::math::upperQuartile(const std::vector<float>& values, bool isSorted)
float simox::math::upper_quartile(const std::vector<float>& values, bool isSorted)
{
return quantile(values, .75, isSorted);
}
float simox::math::interquartileRange(const std::vector<float>& _values, bool isSorted)
float simox::math::interquartile_range(const std::vector<float>& _values, bool isSorted)
{
checkNotEmpty(_values);
const std::vector<float>& values = isSorted ? _values : sorted(_values);
return interquartileRange(lowerQuartile(values, true), upperQuartile(values, true));
return interquartile_range(lower_quartile(values, true), upper_quartile(values, true));
}
float simox::math::interquartileRange(float lowerQuartile, float upperQuartile)
float simox::math::interquartile_range(float lowerQuartile, float upperQuartile)
{
return upperQuartile - lowerQuartile;
}
......
......@@ -19,11 +19,11 @@ namespace simox::math
float quantile(const std::vector<float>& values, float p, bool isSorted=false);
float lowerQuartile(const std::vector<float>& values, bool isSorted=false);
float lower_quartile(const std::vector<float>& values, bool isSorted=false);
float median(const std::vector<float>& values, bool isSorted=false);
float upperQuartile(const std::vector<float>& values, bool isSorted=false);
float upper_quartile(const std::vector<float>& values, bool isSorted=false);
float interquartileRange(const std::vector<float>& values, bool isSorted=false);
float interquartileRange(float lowerQuartile, float upperQuartile);
float interquartile_range(const std::vector<float>& values, bool isSorted=false);
float interquartile_range(float lower_quartile, float upper_quartile);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment