Il n'y a pas assez de petits nombres pour répondre aux nombreux demandes faites d'eux.
Cet article est uniquement disponible en anglais
Synopsis
#include <fastglc.h>
int (objective_t)( |
double x, |
void * context, | |
double * fx) ; |
extern int fastglc_eval( |
size_t n, |
objective_t * f, | |
void * context, | |
double * result) ; |
extern const char * fastgcl_strerror
( |
int errorcode) ; |
DESCRIPTION
The fastglc_eval
function evaluates the integral of the
function f
on the interval [-1, 1] using an n
-point Gauss-Legendre quadrature.
The parameters, in detail, are:
- size_t
n
-
The number of nodes in the quadrature, must be positive.
- objective_t *
f
-
A function with prototype objective_t as in the synopsis above, for which the integral is sought.
The function should return zero for success and non-zero on error.
- void *
context
-
Context for the function
f
, which may beNULL
provided that the function does not dereference it. - double *
result
-
The result of the quadrature which will be assigned on success.