<commit_before>#ifndef TEST_TEST_H_

#define TEST_TEST_H_

#include <gtest/gtest.h>

#define EXPECT_Vector2f_NEAR(expected, actual, delta)                          \
  EXPECT_NEAR(expected.x(), actual.x(), delta);                                \
  EXPECT_NEAR(expected.y(), actual.y(), delta);

#define EXPECT_Vector3f_NEAR(expected, actual, delta)                          \
  EXPECT_NEAR(expected.x(), actual.x(), delta);                                \
  EXPECT_NEAR(expected.y(), actual.y(), delta);                                \
  EXPECT_NEAR(expected.z(), actual.z(), delta);

#define EXPECT_Vector4f_NEAR(expected, actual, delta)                          \
  EXPECT_NEAR(expected.x(), actual.x(), delta);                                \
  EXPECT_NEAR(expected.y(), actual.y(), delta);                                \
  EXPECT_NEAR(expected.z(), actual.z(), delta);                                \
  EXPECT_NEAR(expected.w(), actual.w(), delta);

#define EXPECT_Matrix4f_NEAR(expected, actual, delta)                          \
  EXPECT_NEAR(expected(0, 0), actual(0, 0), delta);                            \
  EXPECT_NEAR(expected(0, 1), actual(0, 1), delta);                            \
  EXPECT_NEAR(expected(0, 2), actual(0, 2), delta);                            \
  EXPECT_NEAR(expected(0, 3), actual(0, 3), delta);                            \
  EXPECT_NEAR(expected(1, 0), actual(1, 0), delta);                            \
  EXPECT_NEAR(expected(1, 1), actual(1, 1), delta);                            \
  EXPECT_NEAR(expected(1, 2), actual(1, 2), delta);                            \
  EXPECT_NEAR(expected(1, 3), actual(1, 3), delta);                            \
  EXPECT_NEAR(expected(2, 0), actual(2, 0), delta);                            \
  EXPECT_NEAR(expected(2, 1), actual(2, 1), delta);                            \
  EXPECT_NEAR(expected(2, 2), actual(2, 2), delta);                            \
  EXPECT_NEAR(expected(2, 3), actual(2, 3), delta);                            \
  EXPECT_NEAR(expected(3, 0), actual(3, 0), delta);                            \
  EXPECT_NEAR(expected(3, 1), actual(3, 1), delta);                            \
  EXPECT_NEAR(expected(3, 2), actual(3, 2), delta);                            \
  EXPECT_NEAR(expected(3, 3), actual(3, 3), delta);

#endif  // TEST_TEST_H_<commit_msg>Add debug function to print a vector as matrix.<commit_after>#ifndef TEST_TEST_H_

#define TEST_TEST_H_

#include <gtest/gtest.h>

#define EXPECT_Vector2f_NEAR(expected, actual, delta)                          \
  EXPECT_NEAR(expected.x(), actual.x(), delta);                                \
  EXPECT_NEAR(expected.y(), actual.y(), delta);

#define EXPECT_Vector3f_NEAR(expected, actual, delta)                          \
  EXPECT_NEAR(expected.x(), actual.x(), delta);                                \
  EXPECT_NEAR(expected.y(), actual.y(), delta);                                \
  EXPECT_NEAR(expected.z(), actual.z(), delta);

#define EXPECT_Vector4f_NEAR(expected, actual, delta)                          \
  EXPECT_NEAR(expected.x(), actual.x(), delta);                                \
  EXPECT_NEAR(expected.y(), actual.y(), delta);                                \
  EXPECT_NEAR(expected.z(), actual.z(), delta);                                \
  EXPECT_NEAR(expected.w(), actual.w(), delta);

#define EXPECT_Matrix4f_NEAR(expected, actual, delta)                          \
  EXPECT_NEAR(expected(0, 0), actual(0, 0), delta);                            \
  EXPECT_NEAR(expected(0, 1), actual(0, 1), delta);                            \
  EXPECT_NEAR(expected(0, 2), actual(0, 2), delta);                            \
  EXPECT_NEAR(expected(0, 3), actual(0, 3), delta);                            \
  EXPECT_NEAR(expected(1, 0), actual(1, 0), delta);                            \
  EXPECT_NEAR(expected(1, 1), actual(1, 1), delta);                            \
  EXPECT_NEAR(expected(1, 2), actual(1, 2), delta);                            \
  EXPECT_NEAR(expected(1, 3), actual(1, 3), delta);                            \
  EXPECT_NEAR(expected(2, 0), actual(2, 0), delta);                            \
  EXPECT_NEAR(expected(2, 1), actual(2, 1), delta);                            \
  EXPECT_NEAR(expected(2, 2), actual(2, 2), delta);                            \
  EXPECT_NEAR(expected(2, 3), actual(2, 3), delta);                            \
  EXPECT_NEAR(expected(3, 0), actual(3, 0), delta);                            \
  EXPECT_NEAR(expected(3, 1), actual(3, 1), delta);                            \
  EXPECT_NEAR(expected(3, 2), actual(3, 2), delta);                            \
  EXPECT_NEAR(expected(3, 3), actual(3, 3), delta);

template <class T>
void printVectorAsMatrix(T vector, int width, int height)
{
  for (int i = 0; i < height; i++)
  {
    for (int j = 0; j < width; ++j)
      std::cout << vector[i * width + j] << " ";

    std::cout << std::endl;
  }
}

#endif  // TEST_TEST_H_
{'fraction_non_alphanumeric': 0.14366310699173887, 'fraction_numerical': 0.02780576264356236, 'mean_word_length': 1.5058051489146895, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1396240', 'n_tokens_mistral': 1561, 'n_tokens_neox': 1531, 'n_words': 299}