Mantid
Loading...
Searching...
No Matches
CommutativeBinaryOperation.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 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 +
8
9namespace Mantid::Algorithms {
22 // Don't allow this for EventWorkspaces. See for instance
23 // Multiply::checkSizeCompatability
24 if (std::dynamic_pointer_cast<const DataObjects::EventWorkspace>(lhs) ||
25 std::dynamic_pointer_cast<const DataObjects::EventWorkspace>(rhs)) {
26 // call the base routine
28 }
29
30 // get the largest workspace
33 if (rhs->size() > lhs->size()) {
34 wsLarger = rhs;
35 wsSmaller = lhs;
36 } else {
37 wsLarger = lhs;
38 wsSmaller = rhs;
39 }
40 // call the base routine
41 return BinaryOperation::checkSizeCompatibility(wsLarger, wsSmaller);
42}
43} // namespace Mantid::Algorithms
const std::vector< double > & rhs
virtual std::string checkSizeCompatibility(const API::MatrixWorkspace_const_sptr lhs, const API::MatrixWorkspace_const_sptr rhs) const
Checks the overall size compatibility of two workspaces.
std::string checkSizeCompatibility(const API::MatrixWorkspace_const_sptr lhs, const API::MatrixWorkspace_const_sptr rhs) const override
Checks the overall size compatability of two workspaces.
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)