diff --git a/Framework/Algorithms/src/SortXAxis2.cpp b/Framework/Algorithms/src/SortXAxis2.cpp index 642d386edcf7702457f7c7554d317b7a356bf4a8..f528bfc5cb9d2aa6c72336751a9ccc0384aa29e1 100644 --- a/Framework/Algorithms/src/SortXAxis2.cpp +++ b/Framework/Algorithms/src/SortXAxis2.cpp @@ -197,6 +197,30 @@ void SortXAxis::copyToOutputWorkspace( sizeOfY, specNum, isAProperHistogram); } +/** + * @brief determines whether or not a given spectrum is sorted based on a passed + * comparator + * + * @tparam Comparator + * @param compare std::less<double> for descending, and std::greater<double> for + * ascending. + * @param inputWorkspace the unsorted input workspace + * @param specNum the spectrum number currently being compared + * @return true if it is sorted + * @return false if it is not sorted + */ +template <typename Comparator> +bool isItSorted(Comparator const &compare, + MatrixWorkspace_const_sptr inputWorkspace, + unsigned int specNum) { + return std::is_sorted(inputWorkspace->x(specNum).begin(), + inputWorkspace->x(specNum).end(), + [&](std::size_t lhs, std::size_t rhs) -> bool { + return compare(inputWorkspace->x(specNum)[lhs], + inputWorkspace->x(specNum)[rhs]); + }); +} + /** * @brief Determines whether it is a valid histogram or not. * @@ -235,29 +259,5 @@ bool SortXAxis::determineIfHistogramIsValid( return false; } -/** - * @brief determines whether or not a given spectrum is sorted based on a passed - * comparator - * - * @tparam Comparator - * @param compare std::less<double> for descending, and std::greater<double> for - * ascending. - * @param inputWorkspace the unsorted input workspace - * @param specNum the spectrum number currently being compared - * @return true if it is sorted - * @return false if it is not sorted - */ -template <typename Comparator> -bool isItSorted(Comparator const &compare, - MatrixWorkspace_const_sptr inputWorkspace, - unsigned int specNum) { - return std::is_sorted(inputWorkspace->x(specNum).begin(), - inputWorkspace->x(specNum).end(), - [&](std::size_t lhs, std::size_t rhs) -> bool { - return compare(inputWorkspace->x(specNum)[lhs], - inputWorkspace->x(specNum)[rhs]); - }); -} - } // namespace Algorithms } // namespace Mantid \ No newline at end of file