lab34 (VasinaEY) 3 недель назад
Родитель d0c5bba80e
Сommit 2e7e252bff

@ -1,6 +1,6 @@
#include "histogram.h" #include "histogram.h"
void find_minmax(std::vector<double> vec, double& min, double& max) { void find_minmax(vector<double> vec, double& min, double& max) {
min = vec[0]; min = vec[0];

@ -1,6 +1,6 @@
#ifndef HISTOGRAM_INTERNAL_H_INCLUDED #ifndef HISTOGRAM_INTERNAL_H_INCLUDED
#define HISTOGRAM_INTERNAL_H_INCLUDED #define HISTOGRAM_INTERNAL_H_INCLUDED
using namespace std;
void find_minmax(std::vector<double> vec, double& min, double& max); void find_minmax(vector<double> vec, double& min, double& max);
#endif // HISTOGRAM_INTERNAL_H_INCLUDED #endif // HISTOGRAM_INTERNAL_H_INCLUDED

@ -32,7 +32,13 @@
<Add option="-Wall" /> <Add option="-Wall" />
<Add option="-fexceptions" /> <Add option="-fexceptions" />
</Compiler> </Compiler>
<Unit filename="histogram.cpp" />
<Unit filename="histogram.h" />
<Unit filename="main.cpp" /> <Unit filename="main.cpp" />
<Unit filename="svg.cpp" />
<Unit filename="svg.h" />
<Unit filename="text.cpp" />
<Unit filename="text.h" />
<Extensions> <Extensions>
<lib_finder disable_auto="1" /> <lib_finder disable_auto="1" />
</Extensions> </Extensions>

@ -2,9 +2,9 @@
#include <vector> #include <vector>
#include "histogram.h" #include "histogram.h"
#include "text.h" #include "text.h"
#include "svg.h"
struct Input { struct Input {
std::vector<double> numbers; vector<double> numbers;
size_t bin_count{}; size_t bin_count{};
}; };
@ -12,18 +12,18 @@ Input input_data() {
Input in; Input in;
size_t number_count; size_t number_count;
std::cerr << "Enter the number of elements: "; cerr << "Enter the number of elements: ";
std::cin >> number_count; cin >> number_count;
in.numbers.resize(number_count); in.numbers.resize(number_count);
std::cerr << "\nEnter " << number_count << " elements:" << std::endl; cerr << "\nEnter " << number_count << " elements:" << endl;
for (size_t i = 0; i < number_count; i++) { for (size_t i = 0; i < number_count; i++) {
std::cin >> in.numbers[i]; cin >> in.numbers[i];
} }
std::cerr << "Enter the number of bins: "; cerr << "Enter the number of bins: ";
std::cin >> in.bin_count; cin >> in.bin_count;
return in; return in;
} }
@ -31,6 +31,6 @@ Input input_data() {
int main() { int main() {
auto in = input_data(); auto in = input_data();
auto bins = make_histogram(in.bin_count, in.numbers); auto bins = make_histogram(in.bin_count, in.numbers);
show_histogram(bins); show_histogram_svg(bins);
return 0; return 0;
} }

@ -1,7 +1,7 @@
#include "text.h" #include "text.h"
#include <iostream> #include <iostream>
void show_histogram(const vector<size_t>& bins) { void show_histogram(const std::vector<size_t>& bins) {
bool gigant = false; bool gigant = false;

@ -2,7 +2,7 @@
#define TEXT_H_INCLUDED #define TEXT_H_INCLUDED
#include <vector> #include <vector>
using namespace std;
void show_histogram(const vector<size_t>& bins); void show_histogram(const std::vector<size_t>& bins);
#endif // TEXT_H_INCLUDED #endif // TEXT_H_INCLUDED

Двоичные данные
unittest/bin/Debug/unittest.exe

Двоичный файл не отображается.

Двоичные данные
unittest/obj/Debug/histogram.o

Двоичный файл не отображается.

Двоичные данные
unittest/obj/Debug/unittest.o

Двоичный файл не отображается.

@ -31,6 +31,19 @@
<Compiler> <Compiler>
<Add option="-Wall" /> <Add option="-Wall" />
</Compiler> </Compiler>
<Unit filename="../doctest.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="../histogram.cpp" />
<Unit filename="../histogram.h" />
<Unit filename="../marks.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="../svg.cpp" />
<Unit filename="../svg.h">
<Option target="&lt;{~None~}&gt;" />
</Unit>
<Unit filename="../unittest.cpp" />
<Extensions> <Extensions>
<lib_finder disable_auto="1" /> <lib_finder disable_auto="1" />
</Extensions> </Extensions>

@ -1,12 +1,12 @@
# depslib dependency file v1.0 # depslib dependency file v1.0
1748213255 source:c:\users\home\desktop\lab34\laba01\histogram.cpp 1748243702 source:c:\users\home\desktop\lab34\laba01\histogram.cpp
"histogram.h" "histogram.h"
1748213210 c:\users\home\desktop\lab34\laba01\histogram.h 1748243652 c:\users\home\desktop\lab34\laba01\histogram.h
<vector> <vector>
<iostream> <iostream>
1748213127 source:c:\users\home\desktop\lab34\laba01\unittest.cpp 1748213519 source:c:\users\home\desktop\lab34\laba01\unittest.cpp
"doctest.h" "doctest.h"
"histogram_internal.h" "histogram_internal.h"
@ -55,5 +55,81 @@
<sys/time.h> <sys/time.h>
<unistd.h> <unistd.h>
1748213259 c:\users\home\desktop\lab34\laba01\histogram_internal.h 1748243717 c:\users\home\desktop\lab34\laba01\histogram_internal.h
1748242437 source:c:\users\home\desktop\lab34\laba01\svg.cpp
"svg.h"
1748242437 c:\users\home\desktop\lab34\laba01\svg.h
<iostream>
<vector>
<string>
<math.h>
1748243704 source:c:\users\u111-15\desktop\lab34\laba01\histogram.cpp
"histogram.h"
1748243654 c:\users\u111-15\desktop\lab34\laba01\histogram.h
<vector>
<iostream>
1748386434 source:c:\users\u111-15\desktop\lab34\laba01\svg.cpp
"svg.h"
1748242438 c:\users\u111-15\desktop\lab34\laba01\svg.h
<iostream>
<vector>
<string>
<math.h>
1748213520 source:c:\users\u111-15\desktop\lab34\laba01\unittest.cpp
"doctest.h"
"histogram_internal.h"
1748430259 c:\users\u111-15\desktop\lab34\laba01\doctest.h
<signal.h>
<ciso646>
<cstddef>
<ostream>
<istream>
<type_traits>
"doctest_fwd.h"
<ctime>
<cmath>
<climits>
<math.h>
<new>
<cstdio>
<cstdlib>
<cstring>
<limits>
<utility>
<fstream>
<sstream>
<iostream>
<algorithm>
<iomanip>
<vector>
<atomic>
<mutex>
<set>
<map>
<unordered_set>
<exception>
<stdexcept>
<csignal>
<cfloat>
<cctype>
<cstdint>
<string>
<sys/types.h>
<unistd.h>
<sys/sysctl.h>
<AfxWin.h>
<windows.h>
<io.h>
<sys/time.h>
<unistd.h>
1748243718 c:\users\u111-15\desktop\lab34\laba01\histogram_internal.h

Загрузка…
Отмена
Сохранить