Class inte_workspace_gsl (o2scl)¶
-
class inte_workspace_gsl¶
Integration workspace for the GSL integrators.
This is a simple rewrite of
inte_integration_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
Public Functions
-
inte_workspace_gsl()¶
-
~inte_workspace_gsl()¶
-
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
andb
.
-
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.
The workspace variable
i
is used to specify which interval is requested.
-
void make_table(o2scl::table_units<> &t)¶
Create a table from the current workspace.
-
int qpsrt()¶
Sort the workspace stack.
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 .
-
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 Members
-
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.
-
inte_workspace_gsl()¶