13 #include <boost/math/special_functions.hpp>
56 template <
typename t_Scalar,
typename = std::enable_if_t<std::is_
floating_po
int_v<t_Scalar>>>
59 if constexpr (std::is_same_v<t_Scalar, double>)
63 if constexpr (std::is_same_v<t_Scalar, float>)
70 template <
class t_Complex>
73 return (getTolerance<typename t_Complex::value_type>());
90 template <
class t_Left,
class t_Right>
91 bool visit(
const t_Left &left,
const t_Right &right,
const std::string &name,
const Parameters ¶m)
103 catch (std::exception &e)
112 template <
typename t_Scalar>
115 if (boost::math::isnan(left))
117 if (boost::math::isnan(right))
127 if (boost::math::isinf(left))
129 if (boost::math::isinf(right))
131 if (((left > 0) && (right > 0)) || ((left < 0) && (right < 0)))
138 return (std::abs(left - right)
139 <= ((std::abs(left) < std::abs(right) ? std::abs(right) : std::abs(left))
144 template <
class t_Left,
class t_Right>
147 const t_Right &right,
148 const std::string &name,
156 const bool equal_check = this->
equal_;
158 if (not this->equal_ and equal_check != this->equal_)
171 #define ARILES2_NAMED_ENTRY_compare(v, entry, name) visitor.visitMapEntry(entry, other.entry, #name, parameters);
172 #define ARILES2_PARENT_compare(v, entry) entry::arilesVisit(visitor, other, parameters);
174 #define ARILES2_VISIT_compare \
175 template <class t_Other> \
177 ariles2::compare::Visitor &visitor, \
178 const t_Other &other, \
179 const typename ariles2::compare::Visitor::Parameters ¶meters) const \
181 CPPUT_UNUSED_ARG(visitor); \
182 CPPUT_UNUSED_ARG(other); \
183 CPPUT_UNUSED_ARG(parameters); \
184 CPPUT_TRACE_FUNCTION; \
185 ARILES2_ENTRIES(compare) \
188 #define ARILES2_METHODS_compare \
189 const ariles2::compare::Visitor::Parameters &arilesGetParameters(const ariles2::compare::Visitor &visitor) const \
191 CPPUT_TRACE_FUNCTION; \
192 return (visitor.getDefaultParameters()); \
194 #define ARILES2_BASE_METHODS_compare
t_Complex::value_type getTolerance() const
Parameters(const bool override_parameters=true)
bool compare_number_of_entries_
t_Scalar getTolerance() const
static bool compareFloats(const t_Scalar left, const t_Scalar right, const Parameters ¶m)
bool visit(const t_Left &left, const t_Right &right, const std::string &name, const Parameters ¶m)
void visitMapEntry(const t_Left &left, const t_Right &right, const std::string &name, const Parameters ¶m)
std::vector< std::string > backtrace_
void apply_compare(t_Visitor &visitor, const t_Left &left, const t_Right &right, const typename t_Visitor::Parameters ¶m)
visitor::Parameters Parameters
#define CPPUT_TRACE_FUNCTION
#define CPPUT_TRACE_TYPE(type)
#define CPPUT_TRACE_VALUE(value)