6
6
#include < fstream>
7
7
#include < functional>
8
8
#include < iomanip>
9
- #include < ios>
10
9
#include < iostream>
11
10
#include < mutable/catalog/CostModel.hpp>
12
11
#include < mutable/mutable.hpp>
@@ -437,7 +436,7 @@ Immanuel Haffner\
437
436
std::size_t max_len = 0 ;
438
437
for (auto &layout : layouts) max_len = std::max (max_len, strlen (layout.first ));
439
438
for (auto &layout : layouts) {
440
- std::cout << " \n " << std::setw (max_len) << std::left << layout.first ;
439
+ std::cout << " \n " << layout. first << std::setw (max_len - strlen ( layout.first )) << " " ;
441
440
if (layout.second .description ())
442
441
std::cout << " - " << layout.second .description ();
443
442
}
@@ -450,7 +449,7 @@ Immanuel Haffner\
450
449
std::size_t max_len = 0 ;
451
450
for (auto &ce : cardinality_estimators) max_len = std::max (max_len, strlen (ce.first ));
452
451
for (auto &ce : cardinality_estimators) {
453
- std::cout << " \n " << std::setw (max_len) << std::left << ce.first ;
452
+ std::cout << " \n " << ce. first << std::setw (max_len - strlen ( ce.first )) << " " ; ;
454
453
if (ce.second .description ())
455
454
std::cout << " - " << ce.second .description ();
456
455
}
@@ -463,7 +462,7 @@ Immanuel Haffner\
463
462
std::size_t max_len = 0 ;
464
463
for (auto &pe : plan_enumerators) max_len = std::max (max_len, strlen (pe.first ));
465
464
for (auto &pe : plan_enumerators) {
466
- std::cout << " \n " << std::setw (max_len) << std::left << pe.first ;
465
+ std::cout << " \n " << pe. first << std::setw (max_len - strlen ( pe.first )) << " " ; ;
467
466
if (pe.second .description ())
468
467
std::cout << " - " << pe.second .description ();
469
468
}
@@ -476,7 +475,7 @@ Immanuel Haffner\
476
475
range backends (C.backends_cbegin (), C.backends_cend ());
477
476
for (auto &backend : backends) max_len = std::max (max_len, strlen (backend.first ));
478
477
for (auto &backend : backends) {
479
- std::cout << " \n " << std::setw (max_len) << std::left << backend.first ;
478
+ std::cout << " \n " << backend. first << std::setw (max_len - strlen ( backend.first )) << " " ; ;
480
479
if (backend.second .description ())
481
480
std::cout << " - " << backend.second .description ();
482
481
}
@@ -487,11 +486,11 @@ Immanuel Haffner\
487
486
std::cout << " List of available cost functions:" ;
488
487
std::size_t max_len = 0 ;
489
488
range cost_functions (C.cost_functions_cbegin (), C.cost_functions_cend ());
490
- for (auto &cost_function : cost_functions) max_len = std::max (max_len, strlen (cost_function .first ));
491
- for (auto &cost_function : cost_functions) {
492
- std::cout << " \n " << std::setw (max_len) << std::left << cost_function. first ;
493
- if (cost_function .second .description ())
494
- std::cout << " - " << cost_function .second .description ();
489
+ for (auto &cf : cost_functions) max_len = std::max (max_len, strlen (cf .first ));
490
+ for (auto &cf : cost_functions) {
491
+ std::cout << " \n " << cf. first << std::setw (max_len - strlen (cf. first )) << " " ; ;
492
+ if (cf .second .description ())
493
+ std::cout << " - " << cf .second .description ();
495
494
}
496
495
std::cout << " \n (Use --train-cost-models to train a cost function on your specific hardware)" ;
497
496
std::cout << std::endl;
@@ -503,7 +502,7 @@ Immanuel Haffner\
503
502
range schedulers (C.schedulers_cbegin (), C.schedulers_cend ());
504
503
for (auto &scheduler : schedulers) max_len = std::max (max_len, strlen (scheduler.first ));
505
504
for (auto &scheduler : schedulers) {
506
- std::cout << " \n " << std::setw (max_len) << std::left << scheduler.first ;
505
+ std::cout << " \n " << scheduler. first << std::setw (max_len - strlen ( scheduler.first )) << " " ; ;
507
506
if (scheduler.second .description ())
508
507
std::cout << " - " << scheduler.second .description ();
509
508
}
@@ -516,7 +515,7 @@ Immanuel Haffner\
516
515
range table_factories (C.table_properties_cbegin (), C.table_properties_cend ());
517
516
for (auto &table_factory : table_factories) max_len = std::max (max_len, strlen (table_factory.first ));
518
517
for (auto &table_factory : table_factories) {
519
- std::cout << " \n " << std::setw (max_len) << std::left << table_factory.first ;
518
+ std::cout << " \n " << table_factory. first << std::setw (max_len - strlen ( table_factory.first )) << " " ; ;
520
519
if (table_factory.second .description ())
521
520
std::cout << " - " << table_factory.second .description ();
522
521
}
0 commit comments