PISM, A Parallel Ice Sheet Model  stable v2.1-1-g6902d5502 committed by Ed Bueler on 2023-12-20 08:38:27 -0800
Classes | Macros | Typedefs | Functions
cubature.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <limits.h>
#include <float.h>
#include "cubature.h"

Go to the source code of this file.

Classes

struct  esterr
 
struct  hypercube
 
struct  region
 
struct  rule_s
 
struct  rule75genzmalik
 
struct  heap
 

Macros

#define num0_0(dim)   (1U)
 
#define numR0_0fs(dim)   (2 * (dim))
 
#define numRR0_0fs(dim)   (2 * (dim) * (dim-1))
 
#define numR_Rfs(dim)   (1U << (dim))
 
#define real(x)   ((double)(x))
 
#define to_int(n)   ((int)(n))
 
#define KEY(hi)   ((hi).ee.err)
 

Typedefs

typedef struct rule_s rule
 
typedef region heap_item
 

Functions

static double relError (esterr ee)
 
static double compute_vol (const hypercube *h)
 
static hypercube make_hypercube (unsigned dim, const double *center, const double *width)
 
static hypercube make_hypercube_range (unsigned dim, const double *xmin, const double *xmax)
 
static void destroy_hypercube (hypercube *h)
 
static region make_region (const hypercube *h)
 
static void destroy_region (region *R)
 
static void cut_region (region *R, region *R2)
 
static void destroy_rule (rule *r)
 
static region eval_region (region R, integrand f, void *fdata, rule *r)
 
static unsigned ls0 (unsigned n)
 
static double evalR_Rfs (integrand f, void *fdata, unsigned dim, double *p, const double *c, const double *r)
 
static double evalRR0_0fs (integrand f, void *fdata, unsigned dim, double *p, const double *c, const double *r)
 
static unsigned evalR0_0fs4d (integrand f, void *fdata, unsigned dim, double *p, const double *c, double *sum0_, const double *r1, double *sum1_, const double *r2, double *sum2_)
 
static int isqr (int x)
 
static void destroy_rule75genzmalik (rule *r_)
 
static unsigned rule75genzmalik_evalError (rule *r_, integrand f, void *fdata, const hypercube *h, esterr *ee)
 
static rulemake_rule75genzmalik (unsigned dim)
 
static unsigned rule15gauss_evalError (rule *r, integrand f, void *fdata, const hypercube *h, esterr *ee)
 
static rulemake_rule15gauss (unsigned dim)
 
static void heap_resize (heap *h, unsigned nalloc)
 
static heap heap_alloc (unsigned nalloc)
 
static void heap_free (heap *h)
 
static void heap_push (heap *h, heap_item hi)
 
static heap_item heap_pop (heap *h)
 
static int ruleadapt_integrate (rule *r, integrand f, void *fdata, const hypercube *h, unsigned maxEval, double reqAbsError, double reqRelError, esterr *ee)
 
int adapt_integrate (integrand f, void *fdata, unsigned dim, const double *xmin, const double *xmax, unsigned maxEval, double reqAbsError, double reqRelError, double *val, double *estimated_error)