3 #include <boost/iterator/permutation_iterator.hpp>
13 std::vector<id_type>
const& ids_;
14 TypeCompare(std::vector<id_type>
const& iType) : ids_(iType) {}
15 bool operator()(id_type
const& iLHS, id_type
const& iRHS)
const {
return ids_[iLHS] < ids_[iRHS]; }
24 std::partial_sum(indices.begin(), indices.end(), indices.begin());
25 std::sort(indices.begin(), indices.end(), TypeCompare(
m_ids));
28 std::copy(boost::make_permutation_iterator(
m_ids.begin(), indices.begin()),
29 boost::make_permutation_iterator(
m_ids.end(), indices.end()),
std::vector< data_type > DataContainer
std::vector< id_type > IdContainer