<commit_before>#include <cassert>

namespace Arcv {

template <typename T>
Vec<T>::Vec(const std::initializer_list<T>& list)
  : data(list.size()) {
  auto element = list.begin();

  for (std::size_t i = 0; i < list.size(); ++i, ++element)
    data[i] = *element;
}

template <typename T>
const T Vec<T>::dot(const Vec& vec) const {
  assert(("Error: Vectors aren't the same size", data.size() == vec.getData().size()));

  float res = 0.f;
  for (std::size_t i = 0; i < data.size(); ++i)
    res += data[i] * vec.getData()[i];
  return res;
}

template <typename T>
Vec<T> Vec<T>::operator+(Vec vec) {
  assert(("Error: Vectors aren't the same size", data.size() == vec.getData().size()));

  vec += *this;
  return vec;
}

template <typename T>
Vec<T> Vec<T>::operator+(float val) {
  Vec<T> res = *this;
  res += val;
  return res;
}

template <typename T>
Vec<T> Vec<T>::operator-(Vec vec) {
  assert(("Error: Vectors aren't the same size", data.size() == vec.getData().size()));

  vec -= *this;
  return vec;
}

template <typename T>
Vec<T> Vec<T>::operator-(float val) {
  Vec<T> res = *this;
  res -= val;
  return res;
}

template <typename T>
Vec<T> Vec<T>::operator*(Vec vec) {
  assert(("Error: Vectors aren't the same size", data.size() == vec.getData().size()));

  vec *= *this;
  return vec;
}

template <typename T>
Vec<T> Vec<T>::operator*(float val) {
  Vec<T> res = *this;
  res *= val;
  return res;
}

template <typename T>
Vec<T> Vec<T>::operator/(Vec vec) {
  assert(("Error: Vectors aren't the same size", data.size() == vec.getData().size()));

  vec /= *this;
  return vec;
}

template <typename T>
Vec<T> Vec<T>::operator/(float val) {
  Vec<T> res = *this;
  res /= val;
  return res;
}

template <typename T>
Vec<T>& Vec<T>::operator+=(const Vec& vec) {
  assert(("Error: Vectors aren't the same size", data.size() == vec.getData().size()));

  for (std::size_t i = 0; i < data.size(); ++i)
    data[i] += vec.getData()[i];
  return *this;
}

template <typename T>
Vec<T>& Vec<T>::operator+=(float val) {
  for (std::size_t i = 0; i < data.size(); ++i)
    data[i] += val;
  return *this;
}

template <typename T>
Vec<T>& Vec<T>::operator-=(const Vec& vec) {
  assert(("Error: Vectors aren't the same size", data.size() == vec.getData().size()));

  for (std::size_t i = 0; i < data.size(); ++i)
    data[i] -= vec.getData()[i];
  return *this;
}

template <typename T>
Vec<T>& Vec<T>::operator-=(float val) {
  for (std::size_t i = 0; i < data.size(); ++i)
    data[i] -= val;
  return *this;
}

template <typename T>
Vec<T>& Vec<T>::operator*=(const Vec& vec) {
  assert(("Error: Vectors aren't the same size", data.size() == vec.getData().size()));

  for (std::size_t i = 0; i < data.size(); ++i)
    data[i] *= vec.getData()[i];
  return *this;
}

template <typename T>
Vec<T>& Vec<T>::operator*=(float val) {
  for (std::size_t i = 0; i < data.size(); ++i)
    data[i] *= val;
  return *this;
}

template <typename T>
Vec<T>& Vec<T>::operator/=(const Vec& vec) {
  assert(("Error: Vectors aren't the same size", data.size() == vec.getData().size()));

  for (std::size_t i = 0; i < data.size(); ++i)
    data[i] /= vec.getData()[i];
  return *this;
}

template <typename T>
Vec<T>& Vec<T>::operator/=(float val) {
  for (std::size_t i = 0; i < data.size(); ++i)
    data[i] /= val;
  return *this;
}

} // namespace Arcv<commit_msg>[Update] Operators' loops changed to foreach in vectors<commit_after>#include <cassert>

namespace Arcv {

template <typename T>
Vec<T>::Vec(const std::initializer_list<T>& list)
  : data(list.size()) {
  auto element = list.begin();

  for (std::size_t i = 0; i < list.size(); ++i, ++element)
    data[i] = *element;
}

template <typename T>
const T Vec<T>::dot(const Vec& vec) const {
  assert(("Error: Vectors aren't the same size", data.size() == vec.getData().size()));

  float res = 0.f;
  for (std::size_t i = 0; i < data.size(); ++i)
    res += data[i] * vec.getData()[i];
  return res;
}

template <typename T>
Vec<T> Vec<T>::operator+(Vec vec) {
  vec += *this;
  return vec;
}

template <typename T>
Vec<T> Vec<T>::operator+(float val) {
  Vec<T> res = *this;
  res += val;
  return res;
}

template <typename T>
Vec<T> Vec<T>::operator-(Vec vec) {
  vec -= *this;
  return vec;
}

template <typename T>
Vec<T> Vec<T>::operator-(float val) {
  Vec<T> res = *this;
  res -= val;
  return res;
}

template <typename T>
Vec<T> Vec<T>::operator*(Vec vec) {
  vec *= *this;
  return vec;
}

template <typename T>
Vec<T> Vec<T>::operator*(float val) {
  Vec<T> res = *this;
  res *= val;
  return res;
}

template <typename T>
Vec<T> Vec<T>::operator/(Vec vec) {
  assert(("Error: Vectors aren't the same size", data.size() == vec.getData().size()));

  vec /= *this;
  return vec;
}

template <typename T>
Vec<T> Vec<T>::operator/(float val) {
  Vec<T> res = *this;
  res /= val;
  return res;
}

template <typename T>
Vec<T>& Vec<T>::operator+=(const Vec& vec) {
  assert(("Error: Vectors aren't the same size", data.size() == vec.getData().size()));

  for (std::size_t i = 0; i < data.size(); ++i)
    data[i] += vec.getData()[i];
  return *this;
}

template <typename T>
Vec<T>& Vec<T>::operator+=(float val) {
  for (T& it : data)
    it += val;
  return *this;
}

template <typename T>
Vec<T>& Vec<T>::operator-=(const Vec& vec) {
  assert(("Error: Vectors aren't the same size", data.size() == vec.getData().size()));

  for (std::size_t i = 0; i < data.size(); ++i)
    data[i] -= vec.getData()[i];
  return *this;
}

template <typename T>
Vec<T>& Vec<T>::operator-=(float val) {
  for (T& it : data)
    it -= val;
  return *this;
}

template <typename T>
Vec<T>& Vec<T>::operator*=(const Vec& vec) {
  assert(("Error: Vectors aren't the same size", data.size() == vec.getData().size()));

  for (std::size_t i = 0; i < data.size(); ++i)
    data[i] *= vec.getData()[i];
  return *this;
}

template <typename T>
Vec<T>& Vec<T>::operator*=(float val) {
  for (T& it : data)
    it *= val;
  return *this;
}

template <typename T>
Vec<T>& Vec<T>::operator/=(const Vec& vec) {
  assert(("Error: Vectors aren't the same size", data.size() == vec.getData().size()));

  for (std::size_t i = 0; i < data.size(); ++i)
    data[i] /= vec.getData()[i];
  return *this;
}

template <typename T>
Vec<T>& Vec<T>::operator/=(float val) {
  for (T& it : data)
    it /= val;
  return *this;
}

} // namespace Arcv
{'fraction_non_alphanumeric': 0.21839260535798213, 'fraction_numerical': 0.0028199906000313333, 'mean_word_length': 3.8844682478959447, 'pattern_counts': {'":': 0, '<': 135, '<?xml version=': 0, '>': 119, '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': '1042376', 'n_tokens_mistral': 2481, 'n_tokens_neox': 2454, 'n_words': 678}