19#ifndef LIBMESH_PARALLEL_BIN_SORTER_H
20#define LIBMESH_PARALLEL_BIN_SORTER_H
27#include "libmesh/libmesh_common.h"
28#include "libmesh/parallel_object.h"
48template <
typename KeyType,
typename IdxType=
unsigned int>
52 typedef typename std::vector<KeyType>::const_iterator
IterType;
59 const std::vector<KeyType> & d);
66 void binsort (
const IdxType nbins,
78 const std::vector<KeyType> &
data;
86template <
typename KeyType,
typename IdxType>
90 libmesh_assert_less ((bin+1), bin_iters.size());
94 return cast_int<IdxType>
95 (std::distance (bin_iters[bin], bin_iters[bin+1]));
An object whose state is distributed along a set of processors.
const Parallel::Communicator & comm() const
Perform a parallel sort using a bin-sort method.
void binsort(const IdxType nbins, KeyType max, KeyType min)
The actual function which sorts the data into nbins.
const std::vector< KeyType > & data
std::vector< IterType > bin_iters
IdxType sizeof_bin(const IdxType bin) const
std::vector< KeyType >::const_iterator IterType
The libMesh namespace provides an interface to certain functionality in the library.