9 #ifndef _fei_CommMap_hpp_
10 #define _fei_CommMap_hpp_
12 #include <fei_macros.hpp>
13 #include <fei_ArrayUtils.hpp>
22 typedef std::map<int,std::vector<T> > Type;
34 bool keep_sorted_and_unique =
true)
37 if (iter == comm_map.end()) {
38 iter = comm_map.insert(std::make_pair(proc,std::vector<T>())).first;
41 std::vector<T>& comm_items = iter->second;
43 if (keep_sorted_and_unique) {
44 for(
size_t i=0; i<numItems; ++i) {
49 for(
size_t i=0; i<numItems; ++i) {
50 comm_items.push_back(items[i]);
57 #endif // _fei_CommMap_hpp_
void addItemsToCommMap(int proc, size_t numItems, const T *items, typename CommMap< T >::Type &comm_map, bool keep_sorted_and_unique=true)
int sortedListInsert(const T &item, std::vector< T > &list)