Mantid
Loading...
Searching...
No Matches
WeightedMean.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2010 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 "MantidHistogramData/Histogram.h"
11
12namespace Mantid {
13namespace Algorithms {
27class MANTID_ALGORITHMS_DLL WeightedMean : public CommutativeBinaryOperation {
28public:
29 const std::string name() const override { return "WeightedMean"; }
31 const std::string summary() const override {
32 return "An algorithm to calculate the weighted mean of two workspaces.";
33 }
34
35 int version() const override { return (1); }
36 const std::vector<std::string> seeAlso() const override { return {"Mean"}; }
38 const std::string category() const override { return "Arithmetic"; }
39
40private:
41 // Overridden BinaryOperation methods
42 void performBinaryOperation(const HistogramData::Histogram &lhs, const HistogramData::Histogram &rhs,
43 HistogramData::HistogramY &YOut, HistogramData::HistogramE &EOut) override;
44 void performBinaryOperation(const HistogramData::Histogram &lhs, const double rhsY, const double rhsE,
45 HistogramData::HistogramY &YOut, HistogramData::HistogramE &EOut) override;
46 bool checkCompatibility(const API::MatrixWorkspace_const_sptr lhs,
47 const API::MatrixWorkspace_const_sptr rhs) const override;
48 std::string checkSizeCompatibility(const API::MatrixWorkspace_const_sptr lhs,
49 const API::MatrixWorkspace_const_sptr rhs) const override;
50
52 std::string inputPropName1() const override { return "InputWorkspace1"; }
54 std::string inputPropName2() const override { return "InputWorkspace2"; }
55};
56
57} // namespace Algorithms
58} // namespace Mantid
const std::vector< double > & rhs
CommutativeBinaryOperation supports commutative binary operations on two input workspaces.
An algorithm to calculate the weighted mean of two workspaces.
Definition: WeightedMean.h:27
int version() const override
function to return a version of the algorithm, must be overridden in all algorithms
Definition: WeightedMean.h:35
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
Definition: WeightedMean.h:36
const std::string summary() const override
Summary of algorithms purpose.
Definition: WeightedMean.h:31
const std::string name() const override
function to return a name of the algorithm, must be overridden in all algorithms
Definition: WeightedMean.h:29
std::string inputPropName1() const override
The name of the first input workspace property for BinaryOperation.
Definition: WeightedMean.h:52
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
Definition: WeightedMean.h:38
std::string inputPropName2() const override
The name of the second input workspace property for BinaryOperation.
Definition: WeightedMean.h:54
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
Helper class which provides the Collimation Length for SANS instruments.