EvdochenkoNV 3 недель назад
Родитель ca853cef18
Сommit 5f4d64fd36

@ -18,6 +18,13 @@ bool find_minmax(vector<double> vec, double& min, double& max) {
}
return true;
}
bool width(size_t block_width){
if (block_width > 3 && block_width<30 ) {
return true;
}
}
vector<size_t> make_histogram(size_t number, vector<double> vec) {
vector<size_t> bins(number);
double mn, mx;

@ -4,3 +4,4 @@
using namespace std;
vector<size_t> make_histogram(size_t number, vector<double> vec);
bool width(size_t block_width);

@ -1 +1,2 @@
bool find_minmax(std::vector<double> vec, double& min, double& max);
bool width(size_t block_width);

@ -37,6 +37,7 @@ Input input_data() {
return in;
}
int main() {
auto in = input_data();
auto bins = make_histogram(in.korz, in.vec);

@ -1,6 +1,6 @@
#include "svg.h"
using namespace std;
void svg_begin(double width, double height) {
cout << "<?xml version='1.0' encoding='UTF-8'?>\n";

@ -21,6 +21,9 @@ TEST_CASE("empty vector"){
CHECK(!result);
}
TEST_CASE("single vector"){
double min = 0;
double max = 0;
@ -47,3 +50,17 @@ TEST_CASE("same vector"){
CHECK(min == 1);
CHECK(max == 1);
}
TEST_CASE("block"){
size_t block_width = 15;
bool result = width( block_width);
CHECK(result);
}
TEST_CASE("block"){
size_t block_width = 0;
bool result = width( block_width);
CHECK(!result);
}

@ -1,12 +1,12 @@
# depslib dependency file v1.0
1746274971 source:c:\users\natasha\desktop\Ïðîãè Ñ2\cs-lab34\histogram.cpp
1746447381 source:c:\users\natasha\desktop\Ïðîãè Ñ2\cs-lab34\histogram.cpp
"histogram.h"
1746274971 c:\users\natasha\desktop\Ïðîãè Ñ2\cs-lab34\histogram.h
1746446253 c:\users\natasha\desktop\Ïðîãè Ñ2\cs-lab34\histogram.h
<vector>
<iostream>
1746276122 source:c:\users\natasha\desktop\Ïðîãè Ñ2\cs-lab34\unittest.cpp
1746447498 source:c:\users\natasha\desktop\Ïðîãè Ñ2\cs-lab34\unittest.cpp
"doctest.h"
"histogram_internal.h"
@ -55,5 +55,5 @@
<sys/time.h>
<unistd.h>
1746276025 c:\users\natasha\desktop\Ïðîãè Ñ2\cs-lab34\histogram_internal.h
1746447065 c:\users\natasha\desktop\Ïðîãè Ñ2\cs-lab34\histogram_internal.h

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