From 2969064fa3f376c7ef180ecc4893b363ad839e5e Mon Sep 17 00:00:00 2001 From: Rainer Kartmann <rainer.kartmann@kit.edu> Date: Thu, 8 Oct 2020 10:06:19 +0200 Subject: [PATCH] Make names snake case --- SimoxUtility/math/statistics/BoxPlotStats.cpp | 8 ++++---- SimoxUtility/math/statistics/measures.cpp | 10 +++++----- SimoxUtility/math/statistics/measures.h | 8 ++++---- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/SimoxUtility/math/statistics/BoxPlotStats.cpp b/SimoxUtility/math/statistics/BoxPlotStats.cpp index 301e13f4d..794344ea6 100644 --- a/SimoxUtility/math/statistics/BoxPlotStats.cpp +++ b/SimoxUtility/math/statistics/BoxPlotStats.cpp @@ -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; diff --git a/SimoxUtility/math/statistics/measures.cpp b/SimoxUtility/math/statistics/measures.cpp index 26236c5ed..044b4d5a5 100644 --- a/SimoxUtility/math/statistics/measures.cpp +++ b/SimoxUtility/math/statistics/measures.cpp @@ -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; } diff --git a/SimoxUtility/math/statistics/measures.h b/SimoxUtility/math/statistics/measures.h index 67c19c271..fe0d5e446 100644 --- a/SimoxUtility/math/statistics/measures.h +++ b/SimoxUtility/math/statistics/measures.h @@ -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); } -- GitLab