19 template <
typename ScalarType>
31 template <
typename FadType1,
typename FadType2>
34 if (a.size() != b.size())
return false;
35 if (a.hasFastAccess() != b.hasFastAccess())
return false;
36 if (!
cmp(a.val(), b.val()))
return false;
37 for (
int i=0;
i<a.size(); ++
i) {
38 if (!
cmp(a.dx(
i), b.dx(
i)))
return false;
39 if (!
cmp(a.fastAccessDx(
i), b.fastAccessDx(
i)))
return false;
44 template <
typename FadType1,
typename FadType2>
45 ::testing::AssertionResult
operator() (
const char* a_expr,
const char* b_expr,
46 const FadType1&
a,
const FadType2& b)
48 bool success = (*this)(
a,b);
51 <<
"Fad's do not match!" << std::endl
52 << a_expr <<
" = " << a << std::endl
53 << b_expr <<
" = " << b << std::endl;
63 template <
typename FadType1,
typename FadType2>
66 if (a.size() != b.size())
return false;
67 if (a.hasFastAccess() != b.hasFastAccess())
return false;
68 if (!
cmp(a.val(), b.val()))
return false;
69 for (
int i=0;
i<a.size(); ++
i) {
70 if (!
cmp(a.dx(
i), b.dx(
i)))
return false;
71 if (!
cmp(a.fastAccessDx(
i), b.fastAccessDx(
i)))
return false;
76 template <
typename FadType1,
typename FadType2>
77 ::testing::AssertionResult
operator() (
const char* a_expr,
const char* b_expr,
78 const FadType1&
a,
const FadType2& b)
80 bool success = (*this)(
a,b);
83 <<
"Fad's do not match!" << std::endl
84 << a_expr <<
" = " << a << std::endl
85 << b_expr <<
" = " << b << std::endl;
89 #define COMPARE_VALUES(a, b) \
90 ASSERT_PRED2(CompareFloats(this->tol_a, this->tol_r), a, b);
92 #define COMPARE_FADS(a, b) \
93 ASSERT_PRED_FORMAT2(CompareFads(this->tol_a, this->tol_r), a, b);
95 #define COMPARE_NESTED_FADS(a, b) \
96 ASSERT_PRED_FORMAT2(CompareNestedFads(this->tol_a, this->tol_r), a, b);
bool operator()(const FadType1 &a, const FadType2 &b)
AssertionResult AssertionFailure()
bool operator()(const ScalarType &a, const ScalarType &b)
bool operator()(const FadType1 &a, const FadType2 &b)
AssertionResult AssertionSuccess()
CompareFads(double tol_a, double tol_r)
CompareNestedFads(double tol_a, double tol_r)
CompareFloats(double tol_a_, double tol_r_)