23 { std::sort(items.begin(), items.end()); }
33 int size = items.size();
39 T newVal = items[0].value;
42 for (
int i = 1; i < size; ++i) {
43 newVal = items[i].value;
45 if (newVal > oldVal + epsilon) {
63 template void sort<double>(std::vector< Item<double> >& );
64 template void sort<float>(std::vector< Item<float> >& );
67 void findBunches<double>(std::vector< Item<double> >
const &,
71 void findBunches<float>(std::vector< Item<float> >
const &,
An automatically growable array, analogous to a std::vector.
void clear()
Reset to empty state.
void append(Data const &data)
Append an element to the end of the sequence.
File containing preprocessor macros for error handling.
#define UTIL_CHECK(condition)
Assertion macro suitable for serial or parallel production code.
void findBunches(std::vector< Item< T > > const &items, GArray< Bunch > &bunches, T epsilon)
Identify "bunches" of equal values within a sorted vector.
void sort(std::vector< Item< T > > &items)
Sort a std::vector< Item<T> > by ascending item value.
PSCF package top-level namespace.
Struct with value and index, to keep track of permutation.