<commit_before>/// (c) Koheron 

#include "tests.hpp"

#include <cmath>
#include <random>
#include <thread>

Tests::Tests(Klib::DevMem& dvm_unused_)
: data(0)
{
    waveform_size = 0;
    mean = 0;
    std_dev = 0;
    status = CLOSED;
}
 
Tests::~Tests()
{
    Close();
}

int Tests::Open(uint32_t waveform_size_)
{
    // Reopening
    if (status == OPENED && waveform_size_ != waveform_size)
        Close();

    if (status == CLOSED) {
        waveform_size = waveform_size_;        
        data = Klib::KVector<float>(waveform_size, 0);       
        status = OPENED;
    }
    
    return 0;
}

void Tests::Close()
{
    if (status == OPENED)
        status = CLOSED;
}

Klib::KVector<float>& Tests::read()
{
    std::default_random_engine generator(std::random_device{}());
    std::normal_distribution<float> distribution(mean, std_dev);

    for (unsigned int i=0; i<data.size(); i++)
        data[i] = distribution(generator);

    return data;
}

void Tests::set_mean(float mean_)
{
    mean = mean_;
}

void Tests::set_std_dev(float std_dev_)
{
    std_dev = std_dev_;
}

std::array<uint32_t, 10>& Tests::send_std_array()
{    
    for (uint32_t i=0; i<data_std_array.size(); i++)
        data_std_array[i] = i*i;

    return data_std_array;
}

uint64_t Tests::read64()
{
    return (1UL << 63);
}
<commit_msg>Fix to unsigned long long<commit_after>/// (c) Koheron 

#include "tests.hpp"

#include <cmath>
#include <random>
#include <thread>

Tests::Tests(Klib::DevMem& dvm_unused_)
: data(0)
{
    waveform_size = 0;
    mean = 0;
    std_dev = 0;
    status = CLOSED;
}
 
Tests::~Tests()
{
    Close();
}

int Tests::Open(uint32_t waveform_size_)
{
    // Reopening
    if (status == OPENED && waveform_size_ != waveform_size)
        Close();

    if (status == CLOSED) {
        waveform_size = waveform_size_;        
        data = Klib::KVector<float>(waveform_size, 0);       
        status = OPENED;
    }
    
    return 0;
}

void Tests::Close()
{
    if (status == OPENED)
        status = CLOSED;
}

Klib::KVector<float>& Tests::read()
{
    std::default_random_engine generator(std::random_device{}());
    std::normal_distribution<float> distribution(mean, std_dev);

    for (unsigned int i=0; i<data.size(); i++)
        data[i] = distribution(generator);

    return data;
}

void Tests::set_mean(float mean_)
{
    mean = mean_;
}

void Tests::set_std_dev(float std_dev_)
{
    std_dev = std_dev_;
}

std::array<uint32_t, 10>& Tests::send_std_array()
{    
    for (uint32_t i=0; i<data_std_array.size(); i++)
        data_std_array[i] = i*i;

    return data_std_array;
}

uint64_t Tests::read64()
{
    return (1ULL << 63);
}

{'fraction_non_alphanumeric': 0.15471273000375516, 'fraction_numerical': 0.017273751408186256, 'mean_word_length': 3.1047765793528503, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 17, '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': '2457536', 'n_tokens_mistral': 1041, 'n_tokens_neox': 986, 'n_words': 198}