34 template <
typename KeyType,
typename IdxType>
36 const std::vector<KeyType> & d) :
45 template <
typename KeyType,
typename IdxType>
50 libmesh_assert_less (
min,
max);
67 bin_bounds.resize (nbins+1);
68 bin_iters.resize (nbins+1,
data.begin());
71 bin_iters[0] =
data.begin();
75 for (IdxType b=1; b<nbins; ++b)
80 std::lower_bound (bin_iters[b-1],
data.end(),
84 bin_iters[nbins] =
data.end();
90 template <
typename KeyType,
typename IdxType>
94 std::vector<IdxType> local_hist (this->n_bins());
96 for (IdxType b=0; b<this->n_bins(); b++)
97 local_hist[b] = this->local_bin_size(b);
101 this->comm().sum(hist);
112 #ifdef LIBMESH_HAVE_LIBHILBERT
long double max(long double a, double b)
bool is_sorted(const std::vector< KeyType > &v)
const std::vector< KeyType > & data
Histogram(const Parallel::Communicator &comm, const std::vector< KeyType > &d)
void make_histogram(const IdxType nbins, KeyType max, KeyType min)
An object whose state is distributed along a set of processors.
static KeyType to_key_type(const double f)
Used in conjunction with a BinSorter for parallel sorting.
long double min(long double a, double b)
double to_double(const KeyType &k)