Mantid
Loading...
Searching...
No Matches
Multiply.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2007 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
11namespace Mantid {
12namespace Algorithms {
29class MANTID_ALGORITHMS_DLL Multiply : public CommutativeBinaryOperation {
30public:
32 const std::string name() const override { return "Multiply"; }
34 const std::string summary() const override {
35 return "The Multiply algorithm will multiply the data values and calculate "
36 "the corresponding error values of two compatible workspaces. ";
37 }
38
40 int version() const override { return 1; }
41 const std::vector<std::string> seeAlso() const override { return {"Plus", "Minus", "Divide"}; }
42
43private:
44 // Overridden BinaryOperation methods
45 void performBinaryOperation(const HistogramData::Histogram &lhs, const HistogramData::Histogram &rhs,
46 HistogramData::HistogramY &YOut, HistogramData::HistogramE &EOut) override;
47 void performBinaryOperation(const HistogramData::Histogram &lhs, const double rhsY, const double rhsE,
48 HistogramData::HistogramY &YOut, HistogramData::HistogramE &EOut) override;
49
50 void setOutputUnits(const API::MatrixWorkspace_const_sptr lhs, const API::MatrixWorkspace_const_sptr rhs,
51 API::MatrixWorkspace_sptr out) override;
52
53 void performEventBinaryOperation(DataObjects::EventList &lhs, const DataObjects::EventList &rhs) override;
54
55 void performEventBinaryOperation(DataObjects::EventList &lhs, const MantidVec &rhsX, const MantidVec &rhsY,
56 const MantidVec &rhsE) override;
57
58 void performEventBinaryOperation(DataObjects::EventList &lhs, const double &rhsY, const double &rhsE) override;
59
60 void checkRequirements() override;
61 std::string checkSizeCompatibility(const API::MatrixWorkspace_const_sptr lhs,
62 const API::MatrixWorkspace_const_sptr rhs) const override;
63};
64
65} // namespace Algorithms
66} // namespace Mantid
const std::vector< double > & rhs
CommutativeBinaryOperation supports commutative binary operations on two input workspaces.
Multiply performs the product of two input workspaces.
Definition: Multiply.h:29
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
Definition: Multiply.h:32
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
Definition: Multiply.h:41
const std::string summary() const override
Summary of algorithms purpose.
Definition: Multiply.h:34
int version() const override
Algorithm's version for identification overriding a virtual method.
Definition: Multiply.h:40
A class for holding :
Definition: EventList.h:56
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
Helper class which provides the Collimation Length for SANS instruments.