Public Member Functions | Public Attributes | List of all members
o2scl::inte_workspace_gsl Class Reference

Integration workspace for the GSL integrators. More...

#include <inte_kronrod_gsl.h>

Public Member Functions

int allocate (size_t sz)
 Allocate a workspace.
 
int free ()
 Free allocated workspace memory.
 
int initialise (double a, double b)
 Initialize the workspace for an integration with limits a and b.
 
int set_initial_result (double result, double error)
 Update the workspace with the result and error from the first integration.
 
int retrieve (double *a, double *b, double *r, double *e) const
 Retrieve the ith result from the workspace stack. More...
 
int qpsrt ()
 Sort the workspace stack. More...
 
int update (double a1, double b1, double area1, double error1, double a2, double b2, double area2, double error2)
 Determine which new subinterval to add to the workspace stack and perform update.
 
double sum_results ()
 Add up all of the contributions to construct the final result.
 
int subinterval_too_small (double a1, double a2, double b2)
 Test whether the proposed subdivision falls before floating-point precision.
 
void append_interval (double a1, double b1, double area1, double error1)
 Push a new interval to the workspace stack.
 

Public Attributes

size_t limit
 Maximum number of subintervals allocated.
 
size_t size
 Current number of subintervals being used.
 
size_t nrmax
 Counter for extrapolation routine.
 
size_t i
 Index of current subinterval.
 
size_t maximum_level
 Depth of subdivisions reached.
 
double * alist
 Left endpoints of subintervals.
 
double * blist
 Right endpoints of subintervals.
 
double * rlist
 Integral approximations on subintervals.
 
double * elist
 Integral error estimates.
 
size_t * order
 Linear ordering vector for sort routine.
 
size_t * level
 Numbers of subdivisions made.
 

Detailed Description

This is a simple rewrite of inte_gslgration_workspace into a class.

QUADPACK workspace documentation:

c    parameters (meaning at output)
c       limit  - integer
c                maximum number of error estimates the list
c                can contain
c          last   - integer
c                number of error estimates currently in the list
c          maxerr - integer
c                maxerr points to the nrmax-th largest error
c                estimate currently in the list
c          ermax  - double precision
c                nrmax-th largest error estimate
c                ermax = elist(maxerr)
c          elist  - double precision
c                vector of dimension last containing
c                the error estimates
c          iord   - integer
c                vector of dimension last, the first k elements
c                of which contain pointers to the error
c                estimates, such that
c                elist(iord(1)),...,  elist(iord(k))
c                form a decreasing sequence, with
c                k = last if last.le.(limit/2+2), and
c                k = limit+1-last otherwise
c          nrmax  - integer
c      maxerr = iord(nrmax)
c     alist   - real
c               vector of dimension at least limit, the first
c                last  elements of which are the left
c               end points of the subintervals in the partition
c               of the given integration range (a,b)
c            blist   - real
c               vector of dimension at least limit, the first
c                last  elements of which are the right
c               end points of the subintervals in the partition
c               of the given integration range (a,b)
c            rlist   - real
c               vector of dimension at least limit, the first
c                last  elements of which are the
c               integral approximations on the subintervals
c            elist   - real
c               vector of dimension at least limit, the first
c                last  elements of which are the moduli of the
c               absolute error estimates on the subintervals
c            iord    - integer
c               vector of dimension at least limit, the first k
c               elements of which are pointers to the
c               error estimates over the subintervals,
c               such that elist(iord(1)), ...,
c               elist(iord(k)) form a decreasing sequence,
c               with k = last if last.le.(limit/2+2), and
c               k = limit+1-last otherwise
c            last    - integer
c               number of subintervals actually produced in the
c               subdivision process

Definition at line 499 of file inte_kronrod_gsl.h.

Member Function Documentation

◆ qpsrt()

int o2scl::inte_workspace_gsl::qpsrt ( )

This routine maintains the descending ordering in the list of the local error estimated resulting from the interval subdivision process. at each call two error estimates are inserted using the sequential search method, top-down for the largest error estimate and bottom-up for the smallest error estimate.

Originally written in QUADPACK by R. Piessens and E. de Doncker, translated into C for GSL by Brian Gough, and then rewritten for O2scl .

◆ retrieve()

int o2scl::inte_workspace_gsl::retrieve ( double *  a,
double *  b,
double *  r,
double *  e 
) const

The workspace variable i is used to specify which interval is requested.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).