Function Evaluator

Function Evaluator — A general purpose multi-threaded function evaluator

Synopsis

void                (*NcFunctionLoop1)                  (gsize i,
                                                         gpointer data,
                                                         gpointer glob_data);
void                ncm_function_eval_threaded          (gsl_function *F,
                                                         gdouble *x,
                                                         gdouble *val,
                                                         gulong n,
                                                         guint x_stride,
                                                         guint val_stride);
void                ncm_function_eval_threaded_vec      (gsl_function *F,
                                                         gsl_vector *x,
                                                         gsl_vector *val);

Description

FIXME

Details

NcFunctionLoop1 ()

void                (*NcFunctionLoop1)                  (gsize i,
                                                         gpointer data,
                                                         gpointer glob_data);

ncm_function_eval_threaded ()

void                ncm_function_eval_threaded          (gsl_function *F,
                                                         gdouble *x,
                                                         gdouble *val,
                                                         gulong n,
                                                         guint x_stride,
                                                         guint val_stride);

Using the thread pool, evaluate the gsl_function in each value of the array x[x_stride * i] and stores the result in val[val_stride * i] for i in [0, n-1]. Note that F must contain a reentrant function.

F :

gsl_function to be evaluated in threads

x :

array of values to evaluate the function

val :

array to store the values of F evaluated in x

n :

number of elements in x

x_stride :

the space between elements in the x array

val_stride :

the space between elements in the val array

ncm_function_eval_threaded_vec ()

void                ncm_function_eval_threaded_vec      (gsl_function *F,
                                                         gsl_vector *x,
                                                         gsl_vector *val);

Using the thread pool, evaluate the gsl_function in each value of the gsl_vector x and stores the result in the gsl_vector val for the x->size values of x. Note that F must contain a reentrant function.

F :

gsl_function to be evaluated in threads

x :

gsl_vector of values to evaluate the function

val :

gsl_vector to store the values of F evaluated in x