42#include <flint/flint.h>
69static void PrintMulticolumn(
const std::vector<std::string>& lines)
71 const std::size_t n_lines = lines.size();
73 if ( n_lines == 0 )
return;
75 const std::size_t line_len = AC.LineLength > 0 ? AC.LineLength : 79;
76 constexpr std::size_t max_cols = 6;
77 constexpr std::size_t col_spacing = 2;
79 std::vector<std::size_t> col_lens(max_cols);
81 for ( std::size_t n_cols = max_cols; n_cols >= 2; n_cols-- ) {
82 const std::size_t n_rows = (n_lines - 1) / n_cols + 1;
87 std::fill(col_lens.begin(),col_lens.begin()+n_cols,0);
89 std::size_t total_len = 0;
90 for ( std::size_t j = 0; j < n_cols; j++ ) {
91 for ( std::size_t i = 0; i < n_rows; i++ ) {
92 const std::size_t k = i + j * n_rows;
93 if ( k >= n_lines )
break;
94 col_lens[j] = std::max(col_lens[j],lines[k].size());
96 total_len += col_lens[j];
98 total_len += (n_cols - 1) * col_spacing;
100 if ( total_len > line_len )
continue;
105 line.reserve(line_len);
106 for ( std::size_t i = 0; i < n_rows; i++ ) {
108 for ( std::size_t j = 0; j < n_cols; j++ ) {
109 const std::size_t k = i + j * n_rows;
110 if ( k >= n_lines )
break;
112 if ( j < n_cols - 1 ) {
113 line += std::string(col_lens[j]-lines[k].size()+col_spacing,
' ');
116 MesPrint(
"%s",line.c_str());
123 for (
const auto& f : lines ) {
124 MesPrint(
"%s",f.c_str());
133 std::vector<std::string> feature_list = {
135#ifdef ENABLE_BACKTRACE
148 "+flint=" + std::string(flint_version),
160 "+gmp=" + std::string(gmp_version),
166 "+mpfr=" + std::string(mpfr_get_version()),
196 "+zlib=" + std::string(zlibVersion()),
202 "+zstd=" + std::string(ZSTD_versionString()),
209 PrintMulticolumn(feature_list);
void PrintFeatureList(void)