<commit_before>#include "AllNeurons.h"
// Default constructor
AllNeurons::AllNeurons() :
        size(0)
{
    C1 = NULL;
    C2 = NULL;
    Cm = NULL;
    I0 = NULL;
    Iinject = NULL;
    Inoise = NULL;
    Isyn = NULL;
    Rm = NULL;
    Tau = NULL;
    Trefract = NULL;
    Vinit = NULL;
    Vm = NULL;
    Vreset = NULL;
    Vrest = NULL;
    Vthresh = NULL;
    deltaT = NULL;
    hasFired = NULL;
    nStepsInRefr = NULL;
    neuron_type_map = NULL;
    spikeCount = NULL;
    totalSpikeCount = NULL;
    spike_history = NULL;
    starter_map = NULL;
    summation_map = NULL;
}

AllNeurons::AllNeurons(const int size) :
        size(size)
{
    // TODO: Rename variables for easier identification
    C1 = new BGFLOAT[size];
    C2 = new BGFLOAT[size];
    Cm = new BGFLOAT[size];
    I0 = new BGFLOAT[size];
    Iinject = new BGFLOAT[size];
    Inoise = new BGFLOAT[size];
    Isyn = new BGFLOAT[size];
    Rm = new BGFLOAT[size];
    Tau = new BGFLOAT[size];
    Trefract = new BGFLOAT[size];
    Vinit = new BGFLOAT[size];
    Vm = new BGFLOAT[size];
    Vreset = new BGFLOAT[size];
    Vrest = new BGFLOAT[size];
    Vthresh = new BGFLOAT[size];
    deltaT = new BGFLOAT[size];
    hasFired = new bool[size];
    nStepsInRefr = new int[size];
    neuron_type_map = new neuronType[size];
    spikeCount = new int[size];
    totalSpikeCount = new int[size];
    starter_map = new bool[size];
    summation_map = new BGFLOAT[size];
    spike_history = new uint64_t*[size];

    for (int i = 0; i < size; ++i) {
        summation_map[i] = 0;
        nStepsInRefr[i] = 0;
        spike_history[i] = NULL;
        hasFired[i] = false;
        spikeCount[i] = 0;
        totalSpikeCount[i] = 0;
    }
}

AllNeurons::~AllNeurons()
{
    delete[] C1;
    delete[] C2;
    delete[] Cm;
    delete[] I0;
    delete[] Iinject;
    delete[] Inoise;
    delete[] Isyn;
    delete[] Rm;
    delete[] Tau;
    delete[] Trefract;
    delete[] Vinit;
    delete[] Vm;
    delete[] Vreset;
    delete[] Vrest;
    delete[] Vthresh;
    delete[] deltaT;
    delete[] hasFired;
    delete[] nStepsInRefr;
    delete[] neuron_type_map;
    delete[] spikeCount;
    delete[] totalSpikeCount;
    delete[] starter_map;
    delete[] summation_map;
    delete[] spike_history;

    for(int i = 0; i < size; i++) {
    	delete[] spike_history[i];    

    }

    C1 = NULL;
    C2 = NULL;
    Cm = NULL;
    I0 = NULL;
    Iinject = NULL;
    Inoise = NULL;
    Isyn = NULL;
    Rm = NULL;
    Tau = NULL;
    Trefract = NULL;
    Vinit = NULL;
    Vm = NULL;
    Vreset = NULL;
    Vrest = NULL;
    Vthresh = NULL;
    deltaT = NULL;
    hasFired = NULL;
    nStepsInRefr = NULL;
    neuron_type_map = NULL;
    spikeCount = NULL;
    totalSpikeCount = NULL;
    starter_map = NULL;
    summation_map = NULL;
}<commit_msg>Fixed spike history deletion in destructor.<commit_after>#include "AllNeurons.h"
// Default constructor
AllNeurons::AllNeurons() :
        size(0)
{
    C1 = NULL;
    C2 = NULL;
    Cm = NULL;
    I0 = NULL;
    Iinject = NULL;
    Inoise = NULL;
    Isyn = NULL;
    Rm = NULL;
    Tau = NULL;
    Trefract = NULL;
    Vinit = NULL;
    Vm = NULL;
    Vreset = NULL;
    Vrest = NULL;
    Vthresh = NULL;
    deltaT = NULL;
    hasFired = NULL;
    nStepsInRefr = NULL;
    neuron_type_map = NULL;
    spikeCount = NULL;
    totalSpikeCount = NULL;
    spike_history = NULL;
    starter_map = NULL;
    summation_map = NULL;
}

AllNeurons::AllNeurons(const int size) :
        size(size)
{
    // TODO: Rename variables for easier identification
    C1 = new BGFLOAT[size];
    C2 = new BGFLOAT[size];
    Cm = new BGFLOAT[size];
    I0 = new BGFLOAT[size];
    Iinject = new BGFLOAT[size];
    Inoise = new BGFLOAT[size];
    Isyn = new BGFLOAT[size];
    Rm = new BGFLOAT[size];
    Tau = new BGFLOAT[size];
    Trefract = new BGFLOAT[size];
    Vinit = new BGFLOAT[size];
    Vm = new BGFLOAT[size];
    Vreset = new BGFLOAT[size];
    Vrest = new BGFLOAT[size];
    Vthresh = new BGFLOAT[size];
    deltaT = new BGFLOAT[size];
    hasFired = new bool[size];
    nStepsInRefr = new int[size];
    neuron_type_map = new neuronType[size];
    spikeCount = new int[size];
    totalSpikeCount = new int[size];
    starter_map = new bool[size];
    summation_map = new BGFLOAT[size];
    spike_history = new uint64_t*[size];

    for (int i = 0; i < size; ++i) {
        summation_map[i] = 0;
        nStepsInRefr[i] = 0;
        spike_history[i] = NULL;
        hasFired[i] = false;
        spikeCount[i] = 0;
        totalSpikeCount[i] = 0;
    }
}

AllNeurons::~AllNeurons()
{
    for(int i = 0; i < size; i++) {
    	delete[] spike_history[i];    
    }

    delete[] C1;
    delete[] C2;
    delete[] Cm;
    delete[] I0;
    delete[] Iinject;
    delete[] Inoise;
    delete[] Isyn;
    delete[] Rm;
    delete[] Tau;
    delete[] Trefract;
    delete[] Vinit;
    delete[] Vm;
    delete[] Vreset;
    delete[] Vrest;
    delete[] Vthresh;
    delete[] deltaT;
    delete[] hasFired;
    delete[] nStepsInRefr;
    delete[] neuron_type_map;
    delete[] spikeCount;
    delete[] totalSpikeCount;
    delete[] starter_map;
    delete[] summation_map;
    delete[] spike_history;

    C1 = NULL;
    C2 = NULL;
    Cm = NULL;
    I0 = NULL;
    Iinject = NULL;
    Inoise = NULL;
    Isyn = NULL;
    Rm = NULL;
    Tau = NULL;
    Trefract = NULL;
    Vinit = NULL;
    Vm = NULL;
    Vreset = NULL;
    Vrest = NULL;
    Vthresh = NULL;
    deltaT = NULL;
    hasFired = NULL;
    nStepsInRefr = NULL;
    neuron_type_map = NULL;
    spikeCount = NULL;
    totalSpikeCount = NULL;
    starter_map = NULL;
    summation_map = NULL;
    spike_history = NULL;
}
{'fraction_non_alphanumeric': 0.12352422907488987, 'fraction_numerical': 0.0074008810572687225, 'mean_word_length': 2.3685459940652818, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, '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': '1317884', 'n_tokens_mistral': 2213, 'n_tokens_neox': 2190, 'n_words': 523}