10 #ifndef _ZOLTAN2_SORT_HPP_
11 #define _ZOLTAN2_SORT_HPP_
13 #include <Teuchos_Array.hpp>
30 template<
class KeyType,
class ValueType>
31 bool SortInc (
const std::pair<KeyType, ValueType>& a,
const std::pair<KeyType, ValueType>& b)
33 return a.second < b.second;
36 template<
class KeyType,
class ValueType>
37 bool SortDec (
const std::pair<KeyType, ValueType>& a,
const std::pair<KeyType, ValueType>& b)
39 return a.second > b.second;
44 template <
typename key_t,
typename value_t>
53 void sort(Teuchos::Array<std::pair<key_t,value_t> > &listofPairs,
bool inc=
true)
57 std::stable_sort (listofPairs.begin(), listofPairs.end(), Details::SortInc<key_t, value_t>);
59 std::stable_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)