<commit_before>#ifndef YQVMC_CI_MAGNETIZATION_HPP
#define YQVMC_CI_MAGNETIZATION_HPP

#include <algorithm>
#include <cmath>

namespace yqvmc { namespace ci {
  struct Magnetization {
    typedef double value_type;
    template <typename Conf>
    value_type measure(const Conf& conf) {
      value_type m = 0.;
      for (bool s : conf) m += (s ? +1. : -1.);
      return std::abs(m / conf.size());
    }
  };
} }

#endif<commit_msg>preparing magnetization for the new interface.<commit_after>#ifndef YQVMC_CI_MAGNETIZATION_HPP
#define YQVMC_CI_MAGNETIZATION_HPP

#include <algorithm>
#include <cmath>
#include <limits>

namespace yqvmc { namespace ci {
  struct Magnetization {
    typedef double value_type;

    template <typename Conf>
    value_type measure(const Conf& conf, std::size_t stamp = 0) {
      value_type m = 0.;
      for (bool s : conf) m += (s ? +1. : -1.);
      return std::abs(m / conf.size());
    }
  };
} }

#endif
{'fraction_non_alphanumeric': 0.12114771519659936, 'fraction_numerical': 0.007438894792773645, 'mean_word_length': 3.443396226415094, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '2129755', 'n_tokens_mistral': 344, 'n_tokens_neox': 331, 'n_words': 87}