88 matrix_generator_neuromodulation_write_synapse,
93 void *synaptic_matrix) {
99 if (
hash == type->hash) {
103 if (generator ==
NULL) {
109 generator->type = type;
112 generator->data = type->initialize(in_region, synaptic_matrix);
116 log_error(
"Matrix generator with hash %u not found", hash);
121 generator->type->free(generator->data);
127 matrix_generator_t generator,
128 uint32_t pre_index, uint16_t post_index, accum weight, uint16_t delay,
129 unsigned long accum weight_scale) {
130 return generator->type->write_synapse(
131 generator->data, pre_index, post_index, weight, delay, weight_scale);
void log_error(const char *message,...)
Declarations for delay extensions.
General types associated with generators.
bool() write_synapse_func(void *generator, uint32_t pre_index, uint16_t post_index, accum weight, uint16_t delay, unsigned long accum weight_scale)
How to write a synapse to a matrix.
void *() initialize_matrix_func(void **region, void *synaptic_matrix)
How to initialise the matrix generator.
uint32_t generator_hash_t
The type of values used to indicate the subtype of generator to create. Must match the constants on t...
void() free_func(void *data)
How to free any data for the generator; all generator types use the same signature of free func.
matrix_generator_t matrix_generator_init(uint32_t hash, void **in_region, void *synaptic_matrix)
Initialise a specific matrix generator.
initialize_matrix_func * initialize
Initialise the generator.
static const struct matrix_generator_info matrix_generators[]
An Array of known generators.
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.
@ PLASTIC_MATRIX_GENERATOR
Generate a synaptic matrix with STDP.
@ NEUROMODULATION_MATRIX_GENERATOR
Generate a synaptic matrix for Neuromodulation.
@ N_MATRIX_GENERATORS
The number of known generators.
@ STATIC_MATRIX_GENERATOR
Generate a pure static synaptic matrix.
generator_hash_t hash
The hash of the generator.
free_func * free
Free any data for the generator.
void matrix_generator_free(matrix_generator_t generator)
Finish with a matrix generator.
write_synapse_func * write_synapse
Generate a row of a matrix with a matrix generator.
The data for a matrix generator.
A "class" for matrix generators.
Interface for matrix generation.
Neuromodulation synaptic matrix implementation.
void * matrix_generator_neuromodulation_initialize(void **region, void *synaptic_matrix)
Initialise the Neuromodulation synaptic matrix generator.
void matrix_generator_neuromodulation_free(void *generator)
Free any data for the STDP synaptic matrix generator.
Static synaptic matrix implementation.
static bool matrix_generator_static_write_synapse(void *generator, uint32_t pre_index, uint16_t post_index, accum weight, uint16_t delay, unsigned long accum weight_scale)
How to write a synapse to a matrix.
static void matrix_generator_static_free(void *generator)
How to free any data for the static synaptic matrix generator.
static void * matrix_generator_static_initialize(void **region, void *synaptic_matrix)
How to initialise the static synaptic matrix generator.
STDP synaptic matrix implementation.
void * matrix_generator_stdp_initialize(void **region, void *synaptic_matrix)
Initialise the STDP synaptic matrix generator.
void matrix_generator_stdp_free(void *generator)
Free any data for the STDP synaptic matrix generator.
static bool matrix_generator_stdp_write_synapse(void *generator, uint32_t pre_index, uint16_t post_index, accum weight, uint16_t delay, unsigned long accum weight_scale)
How to write a synapse to a matrix.
void sark_free(void *ptr)