<commit_before>/*
 * Ensemble - Harness
 *
 * Authors:
 *   - <NAME> <<EMAIL>>
 *   - <NAME>
 * 
 * Copyright:
 *   - Advanced Processor Technologies, School of Computer Science,
 *      University of Manchester
 *   - Computational Neuroscience Research Group, Centre for
 *      Theoretical Neuroscience, University of Waterloo
 */

#include "ensemble.h"

/* Parameters and Buffers ***************************************************/
ensemble_parameters_t g_ensemble;

/* Initialisation ***********************************************************/
void initialise_ensemble(
  region_system_t *pars
) {
  // Save constants
  g_ensemble.n_neurons = pars->n_neurons;
  g_ensemble.machine_timestep = pars->machine_timestep;
  g_ensemble.t_ref = pars->t_ref;
  g_ensemble.one_over_t_rc = pars->one_over_t_rc;

  // Holder for bias currents
  g_ensemble.i_bias = spin1_malloc(
    g_ensemble.n_neurons * sizeof( current_t )
  );

  // Holder for refactory period and voltages
  g_ensemble.status = spin1_malloc(
    g_ensemble.n_neurons * sizeof( uint )
  );
  for( uint n = 0; n < g_ensemble.n_neurons; n++ ){
    g_ensemble.status[n].refractory_time = 0;<commit_msg>Bugfix: Allocated incorrect size of array for ensemble status.<commit_after>/*
 * Ensemble - Harness
 *
 * Authors:
 *   - <NAME> <<EMAIL>>
 *   - <NAME>
 * 
 * Copyright:
 *   - Advanced Processor Technologies, School of Computer Science,
 *      University of Manchester
 *   - Computational Neuroscience Research Group, Centre for
 *      Theoretical Neuroscience, University of Waterloo
 */

#include "ensemble.h"

/* Parameters and Buffers ***************************************************/
ensemble_parameters_t g_ensemble;

/* Initialisation ***********************************************************/
void initialise_ensemble(
  region_system_t *pars
) {
  // Save constants
  g_ensemble.n_neurons = pars->n_neurons;
  g_ensemble.machine_timestep = pars->machine_timestep;
  g_ensemble.t_ref = pars->t_ref;
  g_ensemble.one_over_t_rc = pars->one_over_t_rc;

  // Holder for bias currents
  g_ensemble.i_bias = spin1_malloc(
    g_ensemble.n_neurons * sizeof( current_t )
  );

  // Holder for refractory period and voltages
  g_ensemble.status = spin1_malloc(
    g_ensemble.n_neurons * sizeof( neuron_status_t )
  );
  for( uint n = 0; n < g_ensemble.n_neurons; n++ ){
    g_ensemble.status[n].refractory_time = 0;
{'fraction_non_alphanumeric': 0.1865328314512756, 'fraction_numerical': 0.003345880384776244, 'mean_word_length': 4.133047210300429, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 19, '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': '927818', 'n_tokens_mistral': 838, 'n_tokens_neox': 789, 'n_words': 167}