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 {
16 return ids_[iLHS] < ids_[iRHS];
23 std::vector<int> indices(
size(),1);
25 std::partial_sum(indices.begin(),indices.end(),indices.begin());
26 std::sort(indices.begin(), indices.end(), TypeCompare(m_ids));
30 boost::make_permutation_iterator( m_ids.begin(), indices.begin() ),
31 boost::make_permutation_iterator( m_ids.end(), indices.end() ),
40 for(
size_type j=0,
i=0;
i!=indices.size(); ++
i, j+=m_stride)
41 ::memcpy(&
tmp[j], &m_data[indices[
i]*m_stride], s);
std::vector< data_type > DataContainer
std::vector< std::vector< double > > tmp
std::vector< id_type > IdContainer