Mantid
Loading...
Searching...
No Matches
BinaryOperationMD.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 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 +
7#pragma once
8
15#include "MantidMDAlgorithms/DllConfig.h"
16
17namespace Mantid {
18namespace MDAlgorithms {
19
31class MANTID_MDALGORITHMS_DLL BinaryOperationMD : public API::Algorithm {
32public:
33 const std::string name() const override;
34 int version() const override;
35 const std::string category() const override;
36 const std::string summary() const override {
37 return "Abstract base class for binary operations on IMDWorkspaces, e.g. A "
38 "= B + C or A = B / C.";
39 }
40
41protected:
42 ~BinaryOperationMD() = default;
44 virtual bool commutative() const = 0;
45
47 virtual void checkInputs() = 0;
48
50 virtual void execEvent() = 0;
51
55
59
61 virtual std::string inputPropName1() const { return "LHSWorkspace"; }
63 virtual std::string inputPropName2() const { return "RHSWorkspace"; }
65 virtual std::string outputPropName() const { return "OutputWorkspace"; }
66
67 void init() override;
68 virtual void initExtraProperties();
69 void exec() override;
70
77
85
90
95
98};
99
100} // namespace MDAlgorithms
101} // namespace Mantid
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Abstract base class for binary operations on IMDWorkspaces, e.g.
Mantid::API::IMDEventWorkspace_sptr m_rhs_event
Mantid::DataObjects::WorkspaceSingleValue_sptr m_operand_scalar
Operand WorkspaceSingleValue.
virtual void execHistoHisto(Mantid::DataObjects::MDHistoWorkspace_sptr out, Mantid::DataObjects::MDHistoWorkspace_const_sptr operand)=0
Run the algorithm with a MDHisotWorkspace as output and operand.
virtual std::string outputPropName() const
The name of the output workspace property.
virtual void execHistoScalar(Mantid::DataObjects::MDHistoWorkspace_sptr out, Mantid::DataObjects::WorkspaceSingleValue_const_sptr scalar)=0
Run the algorithm with a MDHisotWorkspace as output, scalar and operand.
virtual std::string inputPropName1() const
The name of the first input workspace property.
const std::string summary() const override
function returns a summary message that will be displayed in the default GUI, and in the help.
Mantid::API::IMDEventWorkspace_sptr m_lhs_event
For checkInputs.
virtual void execEvent()=0
Run the algorithm with an MDEventWorkspace as output.
Mantid::DataObjects::MDHistoWorkspace_sptr m_operand_histo
Operand MDHistoWorkspace.
Mantid::DataObjects::WorkspaceSingleValue_sptr m_rhs_scalar
Mantid::API::IMDEventWorkspace_sptr m_operand_event
Operand MDEventWorkspace.
virtual bool commutative() const =0
Is the operation commutative?
Mantid::API::IMDWorkspace_sptr m_lhs
LHS workspace.
Mantid::DataObjects::MDHistoWorkspace_sptr m_out_histo
Output MDHistoWorkspace.
Mantid::DataObjects::WorkspaceSingleValue_sptr m_lhs_scalar
virtual std::string inputPropName2() const
The name of the second input workspace property.
Mantid::API::IMDWorkspace_sptr m_out
Output workspace.
Mantid::DataObjects::MDHistoWorkspace_sptr m_rhs_histo
virtual void checkInputs()=0
Check the inputs and throw if the algorithm cannot be run.
Mantid::DataObjects::MDHistoWorkspace_sptr m_lhs_histo
Mantid::API::IMDWorkspace_sptr m_rhs
RHS workspace.
Mantid::API::IMDEventWorkspace_sptr m_out_event
Output MDEventWorkspace.
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
std::shared_ptr< IMDWorkspace > IMDWorkspace_sptr
Shared pointer to the IMDWorkspace base class.
Definition: IMDWorkspace.h:146
std::shared_ptr< WorkspaceSingleValue > WorkspaceSingleValue_sptr
shared pointer to the WorkspaceSingleValue class
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.
Helper class which provides the Collimation Length for SANS instruments.