<commit_before>#include "ModuleFactories.h"
#include "Gradient.h"
#include "NormLPQ.h"
#include "MakeReseedable.h"

using noise::module::Abs;
using noise::module::ScaleBias;
using noise::module::Clamp;
using noise::module::TranslatePoint;
using noise::module::ScalePoint;
using noise::module::Perlin;

Reseedable makePeak(bool x)
{
    Reseedable gradient;
    if (x)
        gradient = makeReseedable(std::make_shared<GradientX>());
    else
        gradient = makeReseedable(std::make_shared<GradientY>());

    std::shared_ptr<Abs> abs = std::make_shared<Abs>();
    abs->SetSourceModule(0, *gradient.module);

    std::shared_ptr<ScaleBias> scale_bias = std::make_shared<ScaleBias>();
    scale_bias->SetSourceModule(0, *abs.get());
    scale_bias->SetScale(-1.);
    scale_bias->SetBias(1.);

    std::shared_ptr<ModuleGroup> mg = std::make_shared<ModuleGroup>();
    mg->insert( mg->output_id, makeReseedable(scale_bias) );
    mg->insert( "abs",makeReseedable(abs) );
    mg->insert( "gradient",gradient );

    return makeReseedable(mg);
}

Reseedable makeCornerCombiner(bool x_positive, bool y_positive, double power)
{
    std::shared_ptr<CornerCombinerBase> corner_combiner_base = std::make_shared<CornerCombinerBase>(power);

    std::shared_ptr<ScaleBias> scale_bias = std::make_shared<ScaleBias>();
    scale_bias->SetBias(0.5);
    scale_bias->SetScale(0.5);
    scale_bias->SetSourceModule(0, *corner_combiner_base.get());

    std::shared_ptr<Clamp> clamp = std::make_shared<Clamp>();
    clamp->SetBounds(0., 1.);
    clamp->SetSourceModule(0, *scale_bias.get());

    std::shared_ptr<ModuleGroup> mg = std::make_shared<ModuleGroup>();
    mg->insert( mg->output_id,makeReseedable(clamp) );
    mg->insert( "scale_bias", makeReseedable(scale_bias) );
    mg->insert( "corner_combiner_base", makeReseedable(corner_combiner_base) );

    return makeReseedable(mg);

}

Reseedable makeEdgeFavouringMask(double p, double q, double min)
{
    std::shared_ptr<NormLPQ> norm_lp_q = std::make_shared<NormLPQ>(p, q);

    std::shared_ptr<TranslatePoint> translate = std::make_shared<TranslatePoint>();
    translate->SetXTranslation(-1.);<commit_msg>Use new Reseedable operations to make Peaks<commit_after>#include "ModuleFactories.h"
#include "Gradient.h"
#include "NormLPQ.h"
#include "MakeReseedable.h"

using noise::module::Abs;
using noise::module::ScaleBias;
using noise::module::Clamp;
using noise::module::TranslatePoint;
using noise::module::ScalePoint;
using noise::module::Perlin;

Reseedable makePeak(bool x)
{
    Reseedable gradient;
    if (x)
        gradient = makeReseedable(std::make_shared<GradientX>());
    else
        gradient = makeReseedable(std::make_shared<GradientY>());
    return gradient.abs().scaleBias(-1, 1);
}

Reseedable makeCornerCombiner(bool x_positive, bool y_positive, double power)
{
    std::shared_ptr<CornerCombinerBase> corner_combiner_base = std::make_shared<CornerCombinerBase>(power);

    std::shared_ptr<ScaleBias> scale_bias = std::make_shared<ScaleBias>();
    scale_bias->SetBias(0.5);
    scale_bias->SetScale(0.5);
    scale_bias->SetSourceModule(0, *corner_combiner_base.get());

    std::shared_ptr<Clamp> clamp = std::make_shared<Clamp>();
    clamp->SetBounds(0., 1.);
    clamp->SetSourceModule(0, *scale_bias.get());

    std::shared_ptr<ModuleGroup> mg = std::make_shared<ModuleGroup>();
    mg->insert( mg->output_id,makeReseedable(clamp) );
    mg->insert( "scale_bias", makeReseedable(scale_bias) );
    mg->insert( "corner_combiner_base", makeReseedable(corner_combiner_base) );

    return makeReseedable(mg);

}

Reseedable makeEdgeFavouringMask(double p, double q, double min)
{
    std::shared_ptr<NormLPQ> norm_lp_q = std::make_shared<NormLPQ>(p, q);

    std::shared_ptr<TranslatePoint> translate = std::make_shared<TranslatePoint>();
    translate->SetXTranslation(-1.);
{'fraction_non_alphanumeric': 0.15226977950713358, 'fraction_numerical': 0.0062256809338521405, 'mean_word_length': 5.96028880866426, 'pattern_counts': {'":': 0, '<': 37, '<?xml version=': 0, '>': 65, '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': '5873703', 'n_tokens_mistral': 1360, 'n_tokens_neox': 1319, 'n_words': 200}