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"}; }
37
38private:
39 // Overridden BinaryOperation methods
40 void performBinaryOperation(const HistogramData::Histogram &lhs, const HistogramData::Histogram &rhs,
41 HistogramData::HistogramY &YOut, HistogramData::HistogramE &EOut) override;
42 void performBinaryOperation(const HistogramData::Histogram &lhs, const double rhsY, const double rhsE,
43 HistogramData::HistogramY &YOut, HistogramData::HistogramE &EOut) override;
44 bool checkCompatibility(const API::MatrixWorkspace_const_sptr lhs,
45 const API::MatrixWorkspace_const_sptr rhs) const override;
46 std::string checkSizeCompatibility(const API::MatrixWorkspace_const_sptr lhs,
47 const API::MatrixWorkspace_const_sptr rhs) const override;
48
50 std::string inputPropName1() const override { return "InputWorkspace1"; }
52 std::string inputPropName2() const override { return "InputWorkspace2"; }
53};
54
55} // namespace Algorithms
56} // 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.
int version() const override
function to return a version of the algorithm, must be overridden in all algorithms
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso algorithms related to this algorithm.
const std::string summary() const override
Summary of algorithms purpose.
const std::string name() const override
function to return a name of the algorithm, must be overridden in all algorithms
std::string inputPropName1() const override
The name of the first input workspace property for BinaryOperation.
std::string inputPropName2() const override
The name of the second input workspace property for BinaryOperation.
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.