86 void *generator, uint32_t pre_lo, uint32_t pre_hi,
87 uint32_t post_lo, uint32_t post_hi, UNUSED uint32_t post_index,
88 uint32_t post_slice_start, uint32_t post_slice_count,
89 unsigned long accum weight_scale, accum timestep_per_delay,
90 param_generator_t weight_generator, param_generator_t delay_generator,
96 uint32_t post_start = max(post_slice_start, post_lo);
97 uint32_t post_end =
min(post_slice_start + post_slice_count - 1, post_hi);
107 div_mod(post_start, obj->n_neurons_per_group, &post_group, &post_value);
111 uint32_t pre_start = pre_lo + post_group * obj->n_neurons_per_group;
112 uint32_t pre_end =
min(pre_start + obj->n_neurons_per_group - 1, pre_hi);
115 for (uint32_t post = post_start; post <= post_end; post++) {
116 uint32_t local_post = post - post_slice_start;
120 int32_t pre = post - obj->offset;
122 if (pre < (int32_t) pre_start) {
124 pre += obj->n_neurons_per_group;
128 }
else if (pre > (int32_t) pre_end) {
130 pre -= obj->n_neurons_per_group;
141 local_post, weight, delay, weight_scale)) {
142 log_error(
"Matrix not sized correctly!");
150 if (post_value == obj->n_neurons_per_group) {
152 pre_start += obj->n_neurons_per_group;
153 pre_end =
min(pre_start + obj->n_neurons_per_group - 1, pre_hi);
154 if (pre_start > pre_hi) {
static bool connection_generator_one_to_one_offset_generate(void *generator, uint32_t pre_lo, uint32_t pre_hi, uint32_t post_lo, uint32_t post_hi, uint32_t post_index, uint32_t post_slice_start, uint32_t post_slice_count, unsigned long accum weight_scale, accum timestep_per_delay, param_generator_t weight_generator, param_generator_t delay_generator, matrix_generator_t matrix_generator)
Generate connections with the one_to_one_offset connection generator.
bool matrix_generator_write_synapse(matrix_generator_t generator, uint32_t pre_index, uint16_t post_index, accum weight, uint16_t delay, unsigned long accum weight_scale)
Write a synapse with a matrix generator.