-
Notifications
You must be signed in to change notification settings - Fork 122
/
GreaterThanMD.cpp
43 lines (35 loc) · 1.68 KB
/
GreaterThanMD.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source,
// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
// SPDX - License - Identifier: GPL - 3.0 +
#include "MantidMDAlgorithms/GreaterThanMD.h"
#include "MantidKernel/System.h"
using namespace Mantid::Kernel;
using namespace Mantid::API;
namespace Mantid {
namespace MDAlgorithms {
// Register the algorithm into the AlgorithmFactory
DECLARE_ALGORITHM(GreaterThanMD)
//----------------------------------------------------------------------------------------------
/// Algorithm's name for identification. @see Algorithm::name
const std::string GreaterThanMD::name() const { return "GreaterThanMD"; }
/// Algorithm's version for identification. @see Algorithm::version
int GreaterThanMD::version() const { return 1; }
//----------------------------------------------------------------------------------------------
/// Run the algorithm with a MDHisotWorkspace as output and operand
void GreaterThanMD::execHistoHisto(
Mantid::DataObjects::MDHistoWorkspace_sptr out,
Mantid::DataObjects::MDHistoWorkspace_const_sptr operand) {
out->greaterThan(*operand);
}
//----------------------------------------------------------------------------------------------
/// Run the algorithm with a MDHisotWorkspace as output and a scalar on the RHS
void GreaterThanMD::execHistoScalar(
Mantid::DataObjects::MDHistoWorkspace_sptr out,
Mantid::DataObjects::WorkspaceSingleValue_const_sptr scalar) {
out->greaterThan(scalar->y(0)[0]);
}
} // namespace MDAlgorithms
} // namespace Mantid