6inline void progbar(
int i,
int max,
int length = 50) {
7 const int len = (length - 2) / 2;
8 const int current = int(len *
double(i) /
double(
max));
10 for (
auto j = 0; j < current; ++j) {
13 for (
auto j = current; j < len; ++j) {
16 std::cout <<
"] \r" << std::flush;
19inline void progbar50(
int i,
int max) {
21 const int prev = int(len *
double(i) /
double(
max) + 1.0e-6);
22 const int current = int(len *
double(i + 1) /
double(
max) + 1.0e-6);
24 for (
int j = prev; j < current; ++j)
25 std::cout <<
"=" << std::flush;
27 std::cout <<
"|\n" << std::flush;
qip library: A collection of useful functions
Definition Array.hpp:9
T max(T first, Args... rest)
Returns maximum of any number of parameters (variadic function)
Definition Maths.hpp:22