24 :
UnaryOperation(), m_NaNValue(0.), m_NaNError(0.), m_InfiniteValue(0.), m_InfiniteError(0.), m_bigThreshold(0.),
25 m_bigValue(0.), m_bigError(0.), m_performNaNCheck(false), m_performInfiniteCheck(false), m_performBigCheck(false),
26 m_checkErrors(false) {}
31 "The value used to replace occurrences of NaN "
32 "(default: do not check).");
33 declareProperty(
"NaNError", 0.0,
"The error value used when replacing a value of NaN ");
36 "The value used to replace occurrences of positive or negative infinity "
37 "(default: do not check).");
38 declareProperty(
"InfinityError", 0.0,
"The error value used when replacing a value of infinity ");
41 "The threshold above which a number (positive or negative) "
42 "should be replaced. "
43 "(default: do not check)");
44 declareProperty(
"BigNumberValue", 0.0,
"The value with which to replace occurrences of 'big' numbers.");
45 declareProperty(
"BigNumberError", 0.0,
"The error value used when replacing a 'big' number");
48 "The threshold below which a number (positive or negative) "
49 "should be replaced. (default: do not check)");
50 declareProperty(
"SmallNumberValue", 0.0,
"The value with which to replace occurrences of 'small' numbers.");
51 declareProperty(
"SmallNumberError", 0.0,
"The error value used when replacing a 'small' number");
52 declareProperty(
"CheckErrorAxis",
false,
"Whether or not to also check the error axis values.");
53 declareProperty(
"UseAbsolute",
true,
"Whether large and small comparisons should be done on absolute values.");
77 if (!replacement_set) {
78 throw std::invalid_argument(
"No value was defined for NaN, infinity, "
79 "BigValueThreshold or SmallValueThreshold");
#define DECLARE_ALGORITHM(classname)
double value
The value of the point.
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
Replaces instances of NaN and infinity in the workspace with user defined numbers.
void defineProperties() override
A virtual function in which additional properties of an algorithm should be declared.
double m_bigValue
considered 'big'
double m_smallError
The replacement error value for small numbers.
bool m_performBigCheck
be performed
double m_bigError
The replacement error value for big numbers.
void retrieveProperties() override
A virtual function in which additional properties should be retrieved into member variables.
bool m_performInfiniteCheck
performed
double m_InfiniteError
The replacement error value for infinity.
bool checkIfNan(const double value) const
returns true if the value is NaN
bool m_performNaNCheck
Flag to indicate if the NaN check is to be.
bool checkIfInfinite(const double value) const
returns true if the value if + or - infinity
bool m_checkErrors
to be performed
double m_NaNError
The replacement error value for NaN.
void performUnaryOperation(const double XIn, const double YIn, const double EIn, double &YOut, double &EOut) override
Carries out the Unary operation on the current 'cell'.
bool m_performSmallCheck
be performed
double m_smallThreshold
The threshold value below which a value is 'small'.
double m_InfiniteValue
The replacement value for infinity.
bool m_useAbsolute
Flag to indicate if the algorithm should use the absolute value when comparing big and small checks.
double m_NaNValue
The replacement value for NaN.
bool checkifPropertyEmpty(const double value) const
returns true if the value has been set
double m_bigThreshold
The threshold value above which a value is.
double m_smallValue
The replacement value for small numbers.
bool checkIfBig(const double value) const
Returns true if the absolute value is larger than the 'big' threshold.
bool checkIfSmall(const double value) const
Returns true is the absolute value is smaller than the 'small' threshold.
UnaryOperation supports the implementation of a Unary operation on an input workspace.
constexpr double EMPTY_DBL() noexcept
Returns what we consider an "empty" double within a property.