13 #include <boost/math/special_functions.hpp>
47 double_tolerance_ = 1e-12;
48 float_tolerance_ = 1e-8;
49 compare_number_of_entries_ =
false;
56 template <
typename t_Scalar>
59 template <
class t_Complex>
62 return (getTolerance<typename t_Complex::value_type>());
81 template <
class t_Ariles>
84 return (ariles_class.arilesGetParameters(*
this));
88 template <
class t_Left,
class t_Right>
89 bool visit(
const t_Left &left,
const t_Right &right,
const std::string &name,
const Parameters ¶m)
91 ARILES2_TRACE_FUNCTION;
95 this->visitMapEntry(left, right, name, param);
98 backtrace_.push_back(name);
101 catch (std::exception &e)
103 backtrace_.push_back(e.what());
110 template <
typename t_Scalar>
113 if (boost::math::isnan(left))
115 if (boost::math::isnan(right))
125 if (boost::math::isinf(left))
127 if (boost::math::isinf(right))
129 if (((left > 0) && (right > 0)) || ((left < 0) && (right < 0)))
136 return (std::abs(left - right)
137 <= ((std::abs(left) < std::abs(right) ? std::abs(right) : std::abs(left))
142 template <
class t_Left,
class t_Right>
145 const t_Right &right,
146 const std::string &name,
149 ARILES2_TRACE_FUNCTION;
150 ARILES2_TRACE_VALUE(name);
151 ARILES2_TRACE_TYPE(left);
152 ARILES2_TRACE_TYPE(right);
154 const bool equal_check = this->equal_;
156 if (
false == this->equal_ and equal_check != this->equal_)
158 backtrace_.push_back(name);
165 inline double Visitor::Parameters::getTolerance<double>(
183 #define ARILES2_NAMED_ENTRY_compare(v, entry, name) visitor.visitMapEntry(entry, other.entry, #name, parameters);
184 #define ARILES2_PARENT_compare(v, entry) entry::arilesVisit(visitor, other, parameters);
186 #define ARILES2_VISIT_compare \
187 template <class t_Other> \
189 ariles2::compare::Visitor &visitor, \
190 const t_Other &other, \
191 const typename ariles2::compare::Visitor::Parameters ¶meters) const \
193 ARILES2_UNUSED_ARG(visitor); \
194 ARILES2_UNUSED_ARG(other); \
195 ARILES2_UNUSED_ARG(parameters); \
196 ARILES2_TRACE_FUNCTION; \
197 ARILES2_ENTRIES(compare) \
200 #define ARILES2_METHODS_compare \
201 const ariles2::compare::Visitor::Parameters &arilesGetParameters(const ariles2::compare::Visitor &visitor) const \
203 ARILES2_TRACE_FUNCTION; \
204 return (visitor.getDefaultParameters()); \
206 #define ARILES2_BASE_METHODS_compare