<commit_before>#include <cmath>
#include <limits>
#include <fstream>
#include <iostream>
#include <algorithm>

#include "Tools/Display/bash_tools.h"

#include "Frozenbits_generator_GA.hpp"

template <typename B>
Frozenbits_generator_GA<B>
::Frozenbits_generator_GA(const int K, const int N, const float sigma)
: Frozenbits_generator<B>(K, N, sigma), m((int)std::log2(N)), z((int)std::exp2(m), 0)
{
	std::cerr << bold_yellow("(WW) The GA (Gaussian Approximation) frozen bits generator is inaccurate.") 
	          << std::endl;
}

template <typename B>
Frozenbits_generator_GA<B>
::~Frozenbits_generator_GA()
{
}

template <typename B>
void Frozenbits_generator_GA<B>
::evaluate()
{
	for (unsigned i = 0; i != this->best_channels.size(); i++) 
		this->best_channels[i] = i;

	for (auto i = 0; i < std::exp2(m); i++)
		z[i] = 2.0 / std::pow((double)this->sigma, 2.0);

	for (auto l = 1; l <= m; l++)
	{
		auto o1 = (int)std::exp2(m - l + 1);
		auto o2 = (int)std::exp2(m - l);

		for (auto t = 0; t < (int)std::exp2(l - 1); t++)
		{
			double T = z[t * o1];
			
			z[t * o1     ] = phi_inv(1.0 - std::pow(1.0 - phi(T), 2.0));
			if (z[t * o1] == HUGE_VAL)<commit_msg>Remove warning message for inaccurate GA after fix.<commit_after>#include <cmath>
#include <limits>
#include <fstream>
#include <iostream>
#include <algorithm>

#include "Tools/Display/bash_tools.h"

#include "Frozenbits_generator_GA.hpp"

template <typename B>
Frozenbits_generator_GA<B>
::Frozenbits_generator_GA(const int K, const int N, const float sigma)
: Frozenbits_generator<B>(K, N, sigma), m((int)std::log2(N)), z((int)std::exp2(m), 0)
{
}

template <typename B>
Frozenbits_generator_GA<B>
::~Frozenbits_generator_GA()
{
}

template <typename B>
void Frozenbits_generator_GA<B>
::evaluate()
{
	for (unsigned i = 0; i != this->best_channels.size(); i++) 
		this->best_channels[i] = i;

	for (auto i = 0; i < std::exp2(m); i++)
		z[i] = 2.0 / std::pow((double)this->sigma, 2.0);

	for (auto l = 1; l <= m; l++)
	{
		auto o1 = (int)std::exp2(m - l + 1);
		auto o2 = (int)std::exp2(m - l);

		for (auto t = 0; t < (int)std::exp2(l - 1); t++)
		{
			double T = z[t * o1];
			
			z[t * o1     ] = phi_inv(1.0 - std::pow(1.0 - phi(T), 2.0));
			if (z[t * o1] == HUGE_VAL)
{'fraction_non_alphanumeric': 0.19606967396159, 'fraction_numerical': 0.025011165698972757, 'mean_word_length': 4.221445221445221, 'pattern_counts': {'":': 0, '<': 37, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4941110', 'n_tokens_mistral': 1011, 'n_tokens_neox': 935, 'n_words': 222}