19 #include <boost/container/small_vector.hpp>
29 const ArrayView<
const std::pair<size_type, size_type>> &inputs)
33 boost::container::small_vector<std::pair<size_type, size_type>, 128> entries(
34 inputs.begin(), inputs.end());
35 std::sort(entries.begin(), entries.end());
36 boost::container::small_vector<size_type, 128> columns;
38 auto entry = entries.begin();
39 while (entry != entries.end())
41 const auto row = entry->first;
43 while (row_end != entries.end() && row_end->first == row)
47 columns.reserve(row_end - entry);
49 columns.push_back(entry->second);
51 while (entry != row_end)
53 if (columns.back() != entry->second)
54 columns.push_back(entry->second);
ArrayView< typename std::remove_reference< typename std::iterator_traits< Iterator >::reference >::type, MemorySpaceType > make_array_view(const Iterator begin, const Iterator end)
virtual void add_entries(const ArrayView< const std::pair< size_type, size_type >> &entries)
virtual void add_row_entries(const size_type &row, const ArrayView< const size_type > &columns, const bool indices_are_sorted=false)=0
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
#define DEAL_II_NAMESPACE_CLOSE
#define DEAL_II_ENABLE_EXTRA_DIAGNOSTICS