<commit_before>#include "../src/benchmark_v2.hpp"
#include "../src/random_int_generator.hpp"
#include "../src/sort.hpp"
#include <cmath>
#include <iostream>
#include <memory>

class generator
{
    shino::random_int_generator<int, std::mt19937_64> gen;
public:
    using input_type = std::size_t;
    
    generator():
            gen(0, 100'000)
    {}
    
    generator(generator&& other):
            gen(std::move(other.gen))
    {}
    
    std::tuple<std::vector<int>, std::size_t> operator()(input_type input)
    {
        static std::vector<int> v(input);
        if (v.size() != input)
        {
            v.resize(input);
            gen(v.begin(), v.end());
        }
        
        return std::make_tuple(v, 0);
    }
};

class different_winsize_generator
{
    shino::random_int_generator<> gen;
    std::size_t vsize;
public:
    using input_type = std::size_t;

    different_winsize_generator(std::size_t size):
            vsize(size)
    {}

    different_winsize_generator(different_winsize_generator&& other):
            gen(std::move(other.gen)),
            vsize(other.vsize)
    {}

    std::tuple<std::vector<int>, std::size_t> operator()(input_type input)
    {
        static std::vector<int> v(vsize);
        static std::size_t window_length = input;
        if (window_length == input) //return cached value
        {
            return std::make_tuple(v, window_length);
        }
        window_length = input;
        std::uniform_int_distribution<std::size_t> dist(1, input - 1);
        for (int i = 0; i < v.size(); ++i)
        {
            v[i] = i;
        }

        for (std::size_t i = 0; i < v.size(); i += window_length)
        {
            std::shuffle(&v[i], &v[std::min(i + window_length, v.size())], gen.get_engine());
        }

        return std::make_tuple(v, window_length);
    }
};

int main()
{
    std::size_t counter = 0;
    auto combsort_bench = [&counter](std::vector<int>& v, std::size_t)<commit_msg>fixed warning about signed vs unsigned comparison<commit_after>#include "../src/benchmark_v2.hpp"
#include "../src/random_int_generator.hpp"
#include "../src/sort.hpp"
#include <cmath>
#include <iostream>
#include <memory>

class generator
{
    shino::random_int_generator<int, std::mt19937_64> gen;
public:
    using input_type = std::size_t;
    
    generator():
            gen(0, 100'000)
    {}
    
    generator(generator&& other):
            gen(std::move(other.gen))
    {}
    
    std::tuple<std::vector<int>, std::size_t> operator()(input_type input)
    {
        static std::vector<int> v(input);
        if (v.size() != input)
        {
            v.resize(input);
            gen(v.begin(), v.end());
        }
        
        return std::make_tuple(v, 0);
    }
};

class different_winsize_generator
{
    shino::random_int_generator<> gen;
    std::size_t vsize;
public:
    using input_type = std::size_t;

    different_winsize_generator(std::size_t size):
            vsize(size)
    {}

    different_winsize_generator(different_winsize_generator&& other):
            gen(std::move(other.gen)),
            vsize(other.vsize)
    {}

    std::tuple<std::vector<int>, std::size_t> operator()(input_type input)
    {
        static std::vector<int> v(vsize);
        static std::size_t window_length = input;
        if (window_length == input) //return cached value
        {
            return std::make_tuple(v, window_length);
        }
        window_length = input;
        std::uniform_int_distribution<std::size_t> dist(1, input - 1);
        for (int i = 0; i < (int)v.size(); ++i)
        {
            v[i] = i;
        }

        for (std::size_t i = 0; i < v.size(); i += window_length)
        {
            std::shuffle(&v[i], &v[std::min(i + window_length, v.size())], gen.get_engine());
        }

        return std::make_tuple(v, window_length);
    }
};

int main()
{
    std::size_t counter = 0;
    auto combsort_bench = [&counter](std::vector<int>& v, std::size_t)
{'fraction_non_alphanumeric': 0.15608531994981178, 'fraction_numerical': 0.01053952321204517, 'mean_word_length': 2.451082251082251, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 29, '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': '5158564', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1340, 'n_words': 247}