Skip to content
Snippets Groups Projects
Commit a336cd41 authored by Sam's avatar Sam Committed by Samuel Jones
Browse files

Re #22515 ClangFormat

Re #22515
parent aa602c15
No related branches found
No related tags found
No related merge requests found
......@@ -71,7 +71,7 @@ private:
Mantid::API::MatrixWorkspace_const_sptr inputWorkspace,
Mantid::API::MatrixWorkspace_sptr outputWorkspace,
const size_t sizeOfX, const size_t sizeOfY,
unsigned int specNum);
unsigned int specNum);
};
} // namespace Algorithms
......
......@@ -69,14 +69,13 @@ std::vector<std::size_t> SortXAxis::createIndexes(const size_t sizeOfX) {
template <typename Comparator>
void sortByXValue(std::vector<std::size_t> &workspaceIndicies,
MatrixWorkspace_const_sptr inputWorkspace,
unsigned int specNum,
Comparator const& compare) {
std::sort(workspaceIndicies.begin(), workspaceIndicies.end(),
[&](std::size_t lhs, std::size_t rhs) -> bool {
return compare(inputWorkspace->x(specNum)[lhs],
inputWorkspace->x(specNum)[rhs]);
});
MatrixWorkspace_const_sptr inputWorkspace,
unsigned int specNum, Comparator const &compare) {
std::sort(workspaceIndicies.begin(), workspaceIndicies.end(),
[&](std::size_t lhs, std::size_t rhs) -> bool {
return compare(inputWorkspace->x(specNum)[lhs],
inputWorkspace->x(specNum)[rhs]);
});
}
void SortXAxis::sortIndicesByX(std::vector<std::size_t> &workspaceIndicies,
......@@ -84,9 +83,11 @@ void SortXAxis::sortIndicesByX(std::vector<std::size_t> &workspaceIndicies,
MatrixWorkspace_const_sptr inputWorkspace,
unsigned int specNum) {
if (order == "Ascending") {
sortByXValue(workspaceIndicies, inputWorkspace, specNum, std::less<double>());
sortByXValue(workspaceIndicies, inputWorkspace, specNum,
std::less<double>());
} else if (order == "Descending") {
sortByXValue(workspaceIndicies, inputWorkspace, specNum, std::greater<double>());
sortByXValue(workspaceIndicies, inputWorkspace, specNum,
std::greater<double>());
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment