MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / absMatch

Class absMatch

test/arrayfire_test.cpp:1776–1790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1774}
1775
1776struct 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
1792template<>
1793bool absMatch::operator()<af::af_cfloat>(const af::af_cfloat &lhs,

Callers 1

elemWiseEqFunction · 0.85

Calls

no outgoing calls

Tested by 1

elemWiseEqFunction · 0.68