diff --git a/ProgUit Lab1/histogram.cpp b/ProgUit Lab1/histogram.cpp index ddd0192..ae6b7f0 100644 --- a/ProgUit Lab1/histogram.cpp +++ b/ProgUit Lab1/histogram.cpp @@ -2,17 +2,13 @@ #include <vector> #include "histogram.h" +#include "histogram_internal.h" -using namespace std; +using namespace std; -void find_minmax(const vector<double>& numbers, double& min_in_numbers, double& max_in_numbers) { - min_in_numbers = numbers[0]; - max_in_numbers = *(max_element(begin(numbers), end(numbers))); - min_in_numbers = *(min_element(begin(numbers), end(numbers))); -} vector <size_t> make_histogram(const vector<double>& numbers, const size_t bin_count) { diff --git a/ProgUit Lab1/histogram_internal.cpp b/ProgUit Lab1/histogram_internal.cpp new file mode 100644 index 0000000..6fdbaed --- /dev/null +++ b/ProgUit Lab1/histogram_internal.cpp @@ -0,0 +1,13 @@ +#include <iostream> +#include <vector> + +#include "histogram_internal.h" +using namespace std; + + +void find_minmax(const vector<double>& numbers, double& min_in_numbers, double& max_in_numbers) { + min_in_numbers = numbers[0]; + max_in_numbers = *(max_element(begin(numbers), end(numbers))); + min_in_numbers = *(min_element(begin(numbers), end(numbers))); + +} diff --git a/ProgUit Lab1/histogram_internal.h b/ProgUit Lab1/histogram_internal.h new file mode 100644 index 0000000..a29a456 --- /dev/null +++ b/ProgUit Lab1/histogram_internal.h @@ -0,0 +1,8 @@ +#ifndef INTERNAL_H_INCLUDED +#define INTERNAL_H_INCLUDED + +#include <vector> + +void find_minmax(const std::vector<double>& numbers, double& min_in_numbers, double& max_in_numbers); + +#endif //INTERNAL_H_INCLUDED diff --git a/ProgUit Lab1/text.cpp b/ProgUit Lab1/text.cpp index dba81a0..9de464b 100644 --- a/ProgUit Lab1/text.cpp +++ b/ProgUit Lab1/text.cpp @@ -2,6 +2,9 @@ #include <vector> #include "text.h" +#include "histogram.h" +#include "histogram_internal.h" + using namespace std;