27 const ArrayView<
const std::pair<size_type, size_type>> &inputs)
31 boost::container::small_vector<std::pair<size_type, size_type>, 128> entries(
32 inputs.begin(), inputs.end());
33 std::sort(entries.begin(), entries.end());
34 boost::container::small_vector<size_type, 128> columns;
36 auto entry = entries.begin();
37 while (entry != entries.end())
39 const auto row = entry->first;
41 while (row_end != entries.end() && row_end->first == row)
45 columns.reserve(row_end - entry);
47 columns.push_back(entry->second);
49 while (entry != row_end)
51 if (columns.back() != entry->second)
52 columns.push_back(entry->second);