Guest User

checkfields

a guest
Jul 16th, 2020
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.56 KB | None | 0 0
  1. template <class FieldType,
  2.           class = std::enable_if_t<
  3.               arma::is_Col<typename FieldType::object_type>::value ||
  4.               arma::is_Mat_only<typename FieldType::object_type>::value>>
  5. // Check the values of two field types
  6. inline void CheckFields(const FieldType& a,
  7.                           const FieldType& b)
  8. {
  9.   BOOST_REQUIRE_EQUAL(a.n_rows, b.n_rows);
  10.   BOOST_REQUIRE_EQUAL(a.n_cols, b.n_cols);
  11.  
  12.   for (size_t i = 0; i < a.n_elem; ++i)
  13.     for(size_t j = 0; j < a[i].n_elem; ++j)
  14.       BOOST_REQUIRE_EQUAL(a[i][j], b[i][j]);
  15. }
Add Comment
Please, Sign In to add comment