|
|
@ -1,8 +1,12 @@
|
|
|
|
#include "histogram.h"
|
|
|
|
#include "histogram.h"
|
|
|
|
|
|
|
|
#include "histogram_internal.h"
|
|
|
|
|
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
using namespace std;
|
|
|
|
|
|
|
|
|
|
|
|
void find_minmax(const vector<double>& numbers, double& min, double& max) {
|
|
|
|
bool find_minmax(const vector<double>& numbers, double& min, double& max) {
|
|
|
|
|
|
|
|
if (numbers.size() == 0) {
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
}
|
|
|
|
min = numbers[0];
|
|
|
|
min = numbers[0];
|
|
|
|
max = numbers[0];
|
|
|
|
max = numbers[0];
|
|
|
|
for (double x : numbers) {
|
|
|
|
for (double x : numbers) {
|
|
|
@ -13,6 +17,7 @@ void find_minmax(const vector<double>& numbers, double& min, double& max) {
|
|
|
|
max = x;
|
|
|
|
max = x;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
vector<size_t> make_histogram(const vector<double> &numbers, size_t bin_count) {
|
|
|
|
vector<size_t> make_histogram(const vector<double> &numbers, size_t bin_count) {
|
|
|
|
vector<size_t> bins(bin_count);
|
|
|
|
vector<size_t> bins(bin_count);
|
|
|
|