| 1774 | } |
| 1775 | |
| 1776 | struct absMatch { |
| 1777 | float diff_; |
| 1778 | absMatch(float diff) : diff_(diff) {} |
| 1779 | |
| 1780 | template<typename T> |
| 1781 | bool operator()(const T &lhs, const T &rhs) const { |
| 1782 | if (diff_ > 0) { |
| 1783 | using half_float::abs; |
| 1784 | using std::abs; |
| 1785 | return abs(rhs - lhs) <= diff_; |
| 1786 | } else { |
| 1787 | return boost::math::epsilon_difference(lhs, rhs) < T(1.f); |
| 1788 | } |
| 1789 | } |
| 1790 | }; |
| 1791 | |
| 1792 | template<> |
| 1793 | bool absMatch::operator()<af::af_cfloat>(const af::af_cfloat &lhs, |