Tests/testDSL.cpp
/**
 * Calculate max abs difference for arrays
 */
Calculate max abs difference for arrays
Calculate max abs difference for arrays
float max_abs_value(std::vector<float> const &a, float const *b) {
  REQUIRE(b != nullptr);
  float ret = -1.0f;
  for (int i = 0; i < (int) a.size(); ++i) {
    float diff = abs(a[i] - b[i]);
    if (ret == -1.0f || ret < diff) {
      ret = diff;
    }
  }
  return ret;
}
float max_abs_value ( std :: vector < float > const & a , float const * b ) { REQUIRE ( b != nullptr ) ; float ret = -1.0f ; for ( int i = 0 ; i < ( int ) a . size ( ) ; ++ i ) { float diff = abs ( a [ i ] - b [ i ] ) ; if ( ret == -1.0f || ret < diff ) { ret = diff ; } } return ret ; }
Calculate max abs difference for arrays
Calculate max abs difference for arrays