diff --git a/histogram.cpp b/histogram.cpp index f62a31d..319e9d5 100644 --- a/histogram.cpp +++ b/histogram.cpp @@ -20,12 +20,12 @@ void find_minmax(const std::vector &numbers, double &min, double &max, } } -std::vector make_histogram( std::vector &numbers, size_t &bin_count) { +std::vector make_histogram( const std::vector &numbers, std::size_t bin_count) { double min, max; bool res = false; find_minmax(numbers, min, max, res); double bin_size = ( max - min ) / bin_count; - std::vector bins ( bin_count ); + std::vector bins ( bin_count ); for (std::size_t i=0; i < numbers.size(); i++ ){ bool found = false; for (std::size_t j = 0; ( j < bin_count - 1 ) && !found; j++ ){ diff --git a/histogram.h b/histogram.h index 69a04c7..7eddad5 100644 --- a/histogram.h +++ b/histogram.h @@ -3,7 +3,6 @@ #include -std::vector -make_histogram(const std::vector &numbers, std::size_t &bin_count); +std::vector make_histogram(const std::vector &numbers, std::size_t bin_count); #endif // HISTOGRAM_H_INCLUDED diff --git a/svg.cpp b/svg.cpp index abc0a77..6c8689b 100644 --- a/svg.cpp +++ b/svg.cpp @@ -27,7 +27,7 @@ void svg_rect(double x, double y, double width, double height){ } void -show_histogram_svg(const std::vector bins) { +show_histogram_svg(const std::vector &bins) { const auto IMAGE_WIDTH = 400; const auto IMAGE_HEIGHT = 300; diff --git a/svg.h b/svg.h index a09d6d2..c159f7d 100644 --- a/svg.h +++ b/svg.h @@ -3,7 +3,6 @@ #include -void -show_histogram_svg(const std::vector &bins); +void show_histogram_svg(const std::vector &bins); #endif // SVG_H_INCLUDED