• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // given an array of values of a particular type
2 template<typename T, unsigned int N>
check_symmetry(const T (& value)[N])3 constexpr bool check_symmetry(const T (&value)[N]) {
4     using namespace boost::safe_numerics;
5     // for each pair of values p1, p2 (100)
6     for(unsigned int i = 0; i < N; i++)
7     for(unsigned int j = 0; j < N; j++)
8         assert(value[i][j] == value[j][i]);
9     return true;
10 }
11