From 0ab23ddbfee6b612ba715703ed5f3d6205534cde Mon Sep 17 00:00:00 2001 From: Dan Nixon Date: Mon, 2 Mar 2015 09:25:27 +0000 Subject: [PATCH] Fix RefAxis comparison in CheckWorkspacesMatch Refs #11179 --- Code/Mantid/Framework/API/inc/MantidAPI/RefAxis.h | 2 ++ Code/Mantid/Framework/API/src/RefAxis.cpp | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/Code/Mantid/Framework/API/inc/MantidAPI/RefAxis.h b/Code/Mantid/Framework/API/inc/MantidAPI/RefAxis.h index aeb0787d8171..a9b08b94cb5a 100644 --- a/Code/Mantid/Framework/API/inc/MantidAPI/RefAxis.h +++ b/Code/Mantid/Framework/API/inc/MantidAPI/RefAxis.h @@ -54,6 +54,8 @@ class MANTID_API_DLL RefAxis : public NumericAxis { const std::size_t &verticalIndex) const; virtual void setValue(const std::size_t &index, const double &value); virtual bool operator==(const Axis &) const; + bool equalWithinTolerance(const Axis &axis2, + const double tolerance = 0.0) const; virtual double getMin() const; virtual double getMax() const; diff --git a/Code/Mantid/Framework/API/src/RefAxis.cpp b/Code/Mantid/Framework/API/src/RefAxis.cpp index 923d158ecb76..cd68d0027518 100644 --- a/Code/Mantid/Framework/API/src/RefAxis.cpp +++ b/Code/Mantid/Framework/API/src/RefAxis.cpp @@ -90,6 +90,17 @@ bool RefAxis::operator==(const Axis &axis2) const { return true; } +/** Check if two numeric axis are equivalent to a given tolerance + * @param axis2 :: Reference to the axis to compare to + * @param tolerance :: Tolerance to compare to + * @return true if self and second axis are equal + */ +bool RefAxis::equalWithinTolerance(const Axis &axis2, + const double tolerance) const { + UNUSED_ARG(tolerance); + return this->operator==(axis2); +} + double RefAxis::getMin() const { throw std::runtime_error("RefAxis cannot determine minimum value. Use readX " "on the workspace instead");