From 3e7613dc17b6c1d4dafae834f60be144ad314059 Mon Sep 17 00:00:00 2001 From: VolodinDV Date: Tue, 7 May 2024 12:58:48 +0300 Subject: [PATCH] =?UTF-8?q?code:=20=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D1=8F=20=D0=B1=D0=B0=D0=B7=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- histogram.cpp | 4 ++-- histogram.h | 3 +-- svg.cpp | 2 +- svg.h | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) 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