8 Numerical integration

8.1 Overview

To use these functionalities, you should include pnl/pnl_integration.h.

Numerical integration methods are designed to numerically evaluate the integral over a finite or non finite interval (resp. over a square) of real valued functions defined on (resp. on 2).

typedef struct { 
  double (*function) (double x, void *params); 
  void *params; 
} PnlFunc; 
 
typedef struct { 
  double (*function) (double x, double y, void *params); 
  void *params; 
} PnlFunc2D;

We provide the following two macros to evaluate a PnlFunc or PnlFunc2D at a given point

#define PNL_EVAL_FUNC(F, x) (*((F)->function))(x, (F)->params) 
#define PNL_EVAL_FUNC2D(F, x, y) (*((F)->function))(x, y, (F)->params)

8.2 Functions