<commit_before>#ifndef __STAN__PROB__AUTOCORRELATION_HPP__
#define __STAN__PROB__AUTOCORRELATION_HPP__

#include <stan/math/matrix.hpp>
#include <stan/math/matrix/mean.hpp>

#include <vector>
#include <complex>
#include <unsupported/Eigen/FFT>


namespace stan {
  
  namespace prob {

    namespace {
      /**
       * Find the optimal next size for the FFT so that 
       * a minimum number of zeros are padded. 
       */ 
      size_t fft_next_good_size(size_t N) { 
        while (true) {
          size_t m = N;
          while((m % 2) == 0) m /= 2;
          while((m % 3) == 0) m /= 3;
          while((m % 5) == 0) m /= 5;
          if (m <= 1)
            return N; <commit_msg>set next good fft size to 2 for 0 to avoid infinite loop<commit_after>#ifndef __STAN__PROB__AUTOCORRELATION_HPP__
#define __STAN__PROB__AUTOCORRELATION_HPP__

#include <stan/math/matrix.hpp>
#include <stan/math/matrix/mean.hpp>

#include <vector>
#include <complex>
#include <unsupported/Eigen/FFT>


namespace stan {
  
  namespace prob {

    namespace {
      /**
       * Find the optimal next size for the FFT so that 
       * a minimum number of zeros are padded. 
       */ 
      size_t fft_next_good_size(size_t N) { 
        if (N <= 2) return 2;
        while (true) {
          size_t m = N;
          while((m % 2) == 0) m /= 2;
          while((m % 3) == 0) m /= 3;
          while((m % 5) == 0) m /= 5;
          if (m <= 1)
            return N; 
{'fraction_non_alphanumeric': 0.11768754301445286, 'fraction_numerical': 0.016517549896765314, 'mean_word_length': 2.113490364025696, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 13, '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': '5916818', 'n_tokens_mistral': 550, 'n_tokens_neox': 509, 'n_words': 145}