MCPcopy Create free account
hub / github.com/p-ranav/tabulate / make_base_table

Function make_base_table

samples/benchmark.cpp:50–59  ·  view source on GitHub ↗

Builds a plain, unformatted rows x cols table with short placeholder text, used as the common base content for every feature-cost scenario below.

Source from the content-addressed store, hash-verified

48// Builds a plain, unformatted rows x cols table with short placeholder text,
49// used as the common base content for every feature-cost scenario below.
50Table make_base_table(int rows, int cols) {
51 Table table;
52 for (int r = 0; r < rows; ++r) {
53 Row_t row;
54 for (int c = 0; c < cols; ++c)
55 row.push_back("r" + std::to_string(r) + "c" + std::to_string(c));
56 table.add_row(row);
57 }
58 return table;
59}
60
61std::string print_to_string(Table &table) {
62 std::ostringstream out;

Callers 3

benchmark_scalingFunction · 0.85
benchmark_feature_costsFunction · 0.85

Calls 2

to_stringFunction · 0.50
add_rowMethod · 0.45

Tested by

no test coverage detected