Mantid
Loading...
Searching...
No Matches
EqualToMD.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
9
10using namespace Mantid::Kernel;
11using namespace Mantid::API;
12
13namespace Mantid::MDAlgorithms {
14
15// Register the algorithm into the AlgorithmFactory
16DECLARE_ALGORITHM(EqualToMD)
17
18//----------------------------------------------------------------------------------------------
20const std::string EqualToMD::name() const { return "EqualToMD"; }
21
23int EqualToMD::version() const { return 1; }
24
25//----------------------------------------------------------------------------------------------
28 declareProperty("Tolerance", 1e-5, "Tolerance when performing the == comparison. Default 10^-5.");
29}
30
31//----------------------------------------------------------------------------------------------
35 double tolerance = getProperty("Tolerance");
36 out->equalTo(*operand, tolerance);
37}
38
39//----------------------------------------------------------------------------------------------
43 double tolerance = getProperty("Tolerance");
44 out->equalTo(scalar->y(0)[0], tolerance);
45}
46
47} // namespace Mantid::MDAlgorithms
#define DECLARE_ALGORITHM(classname)
Definition: Algorithm.h:576
double tolerance
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
Definition: Algorithm.cpp:1913
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
Definition: Algorithm.cpp:2076
EqualToMD : boolean operation on MDHistoWorkspaces.
Definition: EqualToMD.h:19
int version() const override
Algorithm's version for identification.
Definition: EqualToMD.cpp:23
void execHistoHisto(Mantid::DataObjects::MDHistoWorkspace_sptr out, Mantid::DataObjects::MDHistoWorkspace_const_sptr operand) override
Run the algorithm with a MDHisotWorkspace as output and operand.
Definition: EqualToMD.cpp:33
void initExtraProperties() override
Extra properties.
Definition: EqualToMD.cpp:27
void execHistoScalar(Mantid::DataObjects::MDHistoWorkspace_sptr out, Mantid::DataObjects::WorkspaceSingleValue_const_sptr scalar) override
Run the algorithm with a MDHisotWorkspace as output and a scalar on the RHS.
Definition: EqualToMD.cpp:41
std::shared_ptr< const WorkspaceSingleValue > WorkspaceSingleValue_const_sptr
std::shared_ptr< MDHistoWorkspace > MDHistoWorkspace_sptr
A shared pointer to a MDHistoWorkspace.
std::shared_ptr< const MDHistoWorkspace > MDHistoWorkspace_const_sptr
A shared pointer to a const MDHistoWorkspace.
STL namespace.