Brainsimulation
Simulation of the human brain.
|
Supports different types of kernel-function, which can be chosen live. More...
#include "definitions.h"
Go to the source code of this file.
Functions | |
kernelfunc_t | d_kernel_function_factory (char *name) |
Returns a function pointer to function of the direct neighborhood kernel. More... | |
kernelfunc_t | id_kernel_function_factory (char *name) |
Returns a function pointer to function of the indirect neighborhood kernel. More... | |
int | d_kernel_4neighbors (nodeval_t *result, int number_nodes_x, int number_nodes_y, nodeval_t **nodegrid, int x, int y) |
Calculates the direct kernel for one specific node of the node grid, i.e., the direct neighborhood. More... | |
int | id_kernel_4neighbors (nodeval_t *result, int number_nodes_x, int number_nodes_y, nodeval_t **nodegrid, int x, int y) |
Calculates the indirect kernel for one specific node of the node grid, i.e., the indirect neighborhood. More... | |
Supports different types of kernel-function, which can be chosen live.
All kernel functions have to conform to the same interface, in order to be executable. All kernels should, but do not need to come in pairs (d_kernel and id_kernel).
int d_kernel_4neighbors | ( | nodeval_t * | result, |
int | number_nodes_x, | ||
int | number_nodes_y, | ||
nodeval_t ** | nodegrid, | ||
int | x, | ||
int | y | ||
) |
Calculates the direct kernel for one specific node of the node grid, i.e., the direct neighborhood.
result | The array to store the kernel into. Length 4 required. |
number_nodes_x | The number of nodes in the first dimension of nodes. |
number_nodes_y | The number of nodes in the second dimension of nodes. |
nodegrid | 2D array of nodes with their current energy level. Size number_nodes_x * number_nodes_y. |
x | The x-Coordinate of the specific node for which the kernel is to be executed for. |
y | The y-Coordinate of the specific node for which the kernel is to be executed for. |
kernelfunc_t d_kernel_function_factory | ( | char * | name | ) |
Returns a function pointer to function of the direct neighborhood kernel.
name | The name of the required function. (Currently not implemented.) |
int id_kernel_4neighbors | ( | nodeval_t * | result, |
int | number_nodes_x, | ||
int | number_nodes_y, | ||
nodeval_t ** | nodegrid, | ||
int | x, | ||
int | y | ||
) |
Calculates the indirect kernel for one specific node of the node grid, i.e., the indirect neighborhood.
result | The array to store the kernel into. Length 4 required. |
number_nodes_x | The number of nodes in the first dimension of nodes. |
number_nodes_y | The number of nodes in the second dimension of nodes. |
nodegrid | 2D array of nodes with their current energy level. Size number_nodes_x * number_nodes_y. |
x | The x-Coordinate of the specific node for which the kernel is to be executed for. |
y | The y-Coordinate of the specific node for which the kernel is to be executed for. |
kernelfunc_t id_kernel_function_factory | ( | char * | name | ) |
Returns a function pointer to function of the indirect neighborhood kernel.
name | The name of the required function. (Currently not implemented.) |