19 #ifndef LIBMESH_PARALLEL_HISTOGRAM_H 20 #define LIBMESH_PARALLEL_HISTOGRAM_H 50 template <
typename KeyType,
typename IdxType=
unsigned int>
54 typedef typename std::vector<KeyType>::const_iterator
IterType;
63 const std::vector<KeyType> & d);
115 const std::vector<KeyType> &
data;
123 template <
typename KeyType,
typename IdxType>
132 template <
typename KeyType,
typename IdxType>
136 if (bin_iters.empty())
139 return cast_int<IdxType>(bin_iters.size()-1);
144 template <
typename KeyType,
typename IdxType>
148 libmesh_assert_less ((bin+1), bin_iters.size());
151 return cast_int<IdxType>
152 (std::distance (bin_iters[bin], bin_iters[bin+1]));
157 template <
typename KeyType,
typename IdxType>
161 libmesh_assert_less (bin, hist.size());
169 template <
typename KeyType,
typename IdxType>
173 libmesh_assert_less ((bin+1), bin_bounds.size());
175 return bin_bounds[bin];
180 template <
typename KeyType,
typename IdxType>
184 libmesh_assert_less ((bin+1), bin_bounds.size());
186 return bin_bounds[bin+1];
193 #endif // LIBMESH_PARALLEL_HISTOGRAM_H
const Parallel::Communicator & comm() const
std::vector< IdxType > hist
std::vector< IterType > bin_iters
long double max(long double a, double b)
double upper_bound(const IdxType bin) const
IdxType local_bin_size(const IdxType bin) const
const std::vector< KeyType > & data
Histogram(const Parallel::Communicator &comm, const std::vector< KeyType > &d)
IdxType global_bin_size(const IdxType bin) const
void make_histogram(const IdxType nbins, KeyType max, KeyType min)
An object whose state is distributed along a set of processors.
std::vector< KeyType >::const_iterator IterType
double lower_bound(const IdxType bin) const
Used in conjunction with a BinSorter for parallel sorting.
std::vector< double > bin_bounds
long double min(long double a, double b)
const std::vector< IdxType > & get_histogram() const