28 const std::vector<double> &hist,
29 const int per_line = 5,
30 const int max_full = 100,
33 std::ostringstream out;
34 out << std::scientific << std::setprecision(3);
36 const int n =
static_cast<int>(hist.size());
37 const bool truncate = (n > max_full);
38 const int head = truncate ? keep : n;
41 auto print_one = [&out, &printed, per_line](
const double value)
43 if (printed % per_line == 0)
55 for (
int i = 0; i < head; ++i)
61 const int omitted = n - 2 * keep;
62 out <<
"\n ... (omitted " << omitted <<
" step(s)) ...";
63 for (
int i = n - keep; i < n; ++i)
std::string format_relax_history(const std::vector< double > &hist, const int per_line=5, const int max_full=100, const int keep=10)
Format a per-step history for the running log.
Definition relax_history.h:27