45 #ifndef _ZOLTAN2_SORT_HPP_
46 #define _ZOLTAN2_SORT_HPP_
48 #include <Teuchos_Array.hpp>
65 template<
class KeyType,
class ValueType>
66 bool SortInc (
const std::pair<KeyType, ValueType>& a,
const std::pair<KeyType, ValueType>& b)
68 return a.second < b.second;
71 template<
class KeyType,
class ValueType>
72 bool SortDec (
const std::pair<KeyType, ValueType>& a,
const std::pair<KeyType, ValueType>& b)
74 return a.second > b.second;
79 template <
typename key_t,
typename value_t>
88 void sort(Teuchos::Array<std::pair<key_t,value_t> > &listofPairs,
bool inc=
true)
92 std::sort (listofPairs.begin(), listofPairs.end(), Details::SortInc<key_t, value_t>);
94 std::sort (listofPairs.begin(), listofPairs.end(), Details::SortDec<key_t, value_t>);
bool SortDec(const std::pair< KeyType, ValueType > &a, const std::pair< KeyType, ValueType > &b)
void sort(Teuchos::Array< std::pair< key_t, value_t > > &listofPairs, bool inc=true)
bool SortInc(const std::pair< KeyType, ValueType > &a, const std::pair< KeyType, ValueType > &b)