template<typename KeyType > bool Parallel::Utils::is_sorted (const std::vector< KeyType > &v) [inline]Utility function that returns true if the vector v is sorted, false otherwise. O(N), the length of the vector. This is implemented solely because the std::is_sorted appears to be an STL extension.
Definition at line 47 of file parallel_conversion_utils.h.
Referenced by Parallel::BinSorter< KeyType >::BinSorter(), and Parallel::Histogram< KeyType >::Histogram().
{
if (v.empty())
return true;
for (unsigned int i=1; i<v.size(); i++)
if (v[i] < v[i-1])
return false;
return true;
}
template<typename KeyType > double Parallel::Utils::to_double (const KeyType &k) [inline]A utility function which converts whatever KeyType is to a double for the histogram bounds
Definition at line 65 of file parallel_conversion_utils.h.
Referenced by Parallel::BinSorter< KeyType >::binsort(), and Parallel::Histogram< KeyType >::make_histogram().
Definition at line 87 of file parallel_conversion_utils.h.
{
return static_cast<double>(bvt.rack2);
}
template<typename KeyType > KeyType Parallel::Utils::to_key_type (const doublef) [inline]A utility to convert a double to some sort of KeyType, for interpreting how histogram bounds relate to KeyType positions.
Definition at line 78 of file parallel_conversion_utils.h.