Skip to content

Commit

Permalink
Fix RefAxis comparison in CheckWorkspacesMatch
Browse files Browse the repository at this point in the history
Refs #11179
  • Loading branch information
DanNixon committed Mar 2, 2015
1 parent 3573429 commit 0ab23dd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Code/Mantid/Framework/API/inc/MantidAPI/RefAxis.h
Expand Up @@ -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;

Expand Down
11 changes: 11 additions & 0 deletions Code/Mantid/Framework/API/src/RefAxis.cpp
Expand Up @@ -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");
Expand Down

0 comments on commit 0ab23dd

Please sign in to comment.