<commit_before>#ifndef __PML_PRIME__
#define __PML_PRIME__

#include <algorithm>
#include <cstdint>
#include <vector>

inline std::vector<uint64_t> atkin(uint64_t max)
{
    std::vector<uint64_t> primes;
    
    if (max <= 2)
        primes.push_back(2);
    if (max <= 3)
        primes.push_back(3);
    if (max <= 5)
        primes.push_back(5);
    if (max < 6)
        return primes;

    std::vector<bool> sieve(max + 1);
    std::fill(sieve.begin(), sieve.end(), true);

    uint64_t mod;
    for (uint64_t val = 6; val <= max; val++)
    {
        mod = val % 60;   
    }
}

inline std::vector<uint64_t> eratosthenes(uint64_t max)
{
    if (max == 0)
        return std::vector<uint64_t>();
    std::vector<bool> sieve(max + 1);
    std::fill(sieve.begin(), sieve.end(), true);
    sieve[0] = false; 

    std::vector<uint64_t> primes;

    uint64_t val = 2;
    while(val <= max)
    {
        if (sieve.at(val) != false) {
            primes.push_back(val);
            for (uint64_t i = val; i < sieve.size(); i += val)  
                sieve[i] = false;
        }
        val++;
    }

    return primes;
}

inline std::vector<uint64_t> prime_sieve(uint64_t max)
{
   return eratosthenes(max); 
}

inline std::vector<uint64_t> factorize(uint64_t val, 
                                       std::vector<uint64_t> primes)
{
    if (val <= 1)
        return std::vector<uint64_t>();

    std::vector<uint64_t> fac; <commit_msg>improved speed of prime_sieve<commit_after>#ifndef __PML_PRIME__
#define __PML_PRIME__

#include <algorithm>
#include <cstdint>
#include <vector>

inline std::vector<uint64_t> atkin(uint64_t max)
{
    std::vector<uint64_t> primes;
    
    if (max <= 2)
        primes.push_back(2);
    if (max <= 3)
        primes.push_back(3);
    if (max <= 5)
        primes.push_back(5);
    if (max < 6)
        return primes;

    std::vector<bool> sieve(max + 1);
    std::fill(sieve.begin(), sieve.end(), true);

    uint64_t mod;
    for (uint64_t val = 6; val <= max; val++)
    {
        mod = val % 60;   
    }
}

inline std::vector<uint64_t> eratosthenes(uint64_t max)
{
    if (max == 0)
        return std::vector<uint64_t>();
    std::vector<bool> sieve(max + 1);
    std::fill(sieve.begin(), sieve.end(), true);
    sieve[0] = false; 

    std::vector<uint64_t> primes;

    uint64_t val = 2;
    while(val <= max)
    {
        if (sieve.at(val) != false) {
            primes.push_back(val);
            for (uint64_t i = val; i < max + 1; i += val)  
                sieve[i] = false;
        }
        val++;
    }

    return primes;
}

inline std::vector<uint64_t> prime_sieve(uint64_t max)
{
   return eratosthenes(max); 
}

inline std::vector<uint64_t> factorize(uint64_t val, 
                                       std::vector<uint64_t> primes)
{
    if (val <= 1)
        return std::vector<uint64_t>();

    std::vector<uint64_t> fac; 
{'fraction_non_alphanumeric': 0.15081286751988932, 'fraction_numerical': 0.03631961259079903, 'mean_word_length': 2.3279631760644417, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1819577', 'n_tokens_mistral': 1182, 'n_tokens_neox': 1089, 'n_words': 226}