Brainsimulation
Simulation of the human brain.
Functions
kernels.h File Reference

Supports different types of kernel-function, which can be chosen live. More...

#include "definitions.h"
Include dependency graph for kernels.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...
 

Detailed Description

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).

Function Documentation

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.

Parameters
resultThe array to store the kernel into. Length 4 required.
number_nodes_xThe number of nodes in the first dimension of nodes.
number_nodes_yThe number of nodes in the second dimension of nodes.
nodegrid2D array of nodes with their current energy level. Size number_nodes_x * number_nodes_y.
xThe x-Coordinate of the specific node for which the kernel is to be executed for.
yThe y-Coordinate of the specific node for which the kernel is to be executed for.
Returns
The number of neighbors generated, i.e., the length of the given result array.
kernelfunc_t d_kernel_function_factory ( char *  name)

Returns a function pointer to function of the direct neighborhood kernel.

Parameters
nameThe name of the required function. (Currently not implemented.)
Returns
A function pointer to the specific function.
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.

Parameters
resultThe array to store the kernel into. Length 4 required.
number_nodes_xThe number of nodes in the first dimension of nodes.
number_nodes_yThe number of nodes in the second dimension of nodes.
nodegrid2D array of nodes with their current energy level. Size number_nodes_x * number_nodes_y.
xThe x-Coordinate of the specific node for which the kernel is to be executed for.
yThe y-Coordinate of the specific node for which the kernel is to be executed for.
Returns
The number of neighbors generated, i.e., the length of the given result array.
kernelfunc_t id_kernel_function_factory ( char *  name)

Returns a function pointer to function of the indirect neighborhood kernel.

Parameters
nameThe name of the required function. (Currently not implemented.)
Returns
A function pointer to the specific function.