Mantid
Loading...
Searching...
No Matches
UnaryOperation.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2009 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
10#include "MantidAlgorithms/DllConfig.h"
11
12namespace Mantid {
13namespace Algorithms {
33class MANTID_ALGORITHMS_DLL UnaryOperation : public API::DistributedAlgorithm {
34public:
36 const std::string category() const override { return "Arithmetic"; }
38 const std::string summary() const override {
39 return "Supports the implementation of a Unary operation on an input "
40 "workspace.";
41 }
42
43protected:
44 // Overridden Algorithm methods
45 void init() override;
46 void exec() override;
47 virtual void execEvent();
48 template <class T> void unaryOperationEventHelper(std::vector<T> &wevector);
50 virtual const std::string inputPropName() const { return "InputWorkspace"; }
52 virtual const std::string outputPropName() const { return "OutputWorkspace"; }
53
56 virtual void defineProperties() { /*Empty in base class*/
57 }
60 virtual void retrieveProperties() { /*Empty in base class*/
61 }
62
71 virtual void performUnaryOperation(const double XIn, const double YIn, const double EIn, double &YOut,
72 double &EOut) = 0;
73
76 bool useHistogram{false};
77};
78
79} // namespace Algorithms
80} // namespace Mantid
Base class for algorithms that treat all spectra independently, i.e., we can trivially parallelize ov...
UnaryOperation supports the implementation of a Unary operation on an input workspace.
virtual void defineProperties()
A virtual function in which additional properties of an algorithm should be declared.
virtual const std::string outputPropName() const
The name of the output workspace property.
const std::string summary() const override
Summary of algorithms purpose.
virtual void performUnaryOperation(const double XIn, const double YIn, const double EIn, double &YOut, double &EOut)=0
Carries out the Unary operation on the current 'cell'.
virtual const std::string inputPropName() const
The name of the input workspace property.
const std::string category() const override
Algorithm's category for identification.
virtual void retrieveProperties()
A virtual function in which additional properties should be retrieved into member variables.
Helper class which provides the Collimation Length for SANS instruments.