First version with advanced algorithm

This commit is contained in:
2018-04-25 23:57:18 +03:00
parent 23f18e9e15
commit 6d07558df8
3 changed files with 233 additions and 99 deletions

19
al_utility.cpp Normal file
View File

@@ -0,0 +1,19 @@
#include "al_utility.hpp"
bool print_progress(long current, long total, double print_every) {
long integer_part = total * print_every;
if ( current % integer_part != 0 )
return false;
// сделаем потокобезопасным
std::stringstream ss;
ss << "Progress " << current << " of " << total
<< " " << std::fixed << std::setw(5) << std::setprecision(2)
<< 100. * current / total << "%" << std::endl;
std::cout << ss.str();
return true;
}
int get_math_coeff(int k) {
return static_cast<int>(pow(1.4, k + 2));
}