• Keine Ergebnisse gefunden

Part I: Background and Existing Work 8

A.2 Bernstein Expansion Software

The algorithms detailed in Section 3.3 and in Subsection 9.3.2 are implemented in BeBP, a C++ software package for the computation of Bernstein-based affine bound functions for polynomials. Interval arithmetic is used extensively throughout, for which the filib++

library [LTWvG01] is employed. As noted in Section 3.3, there is very little previously exist-ing software in the public domain that deals with the Bernstein expansion either rigorously or in the multivariate case.

We give here a brief overview of this software package. The following subsections introduce the data structures used by the program, and some of the most important routines available.

By default, the program operates in a rigorous mode, whereby the coefficients of polynomials and Bernstein coefficients are stored and manipulated as intervals with double-precision floating point endpoints. This delivers bounds which are guaranteed to be valid.

There are two versions of the main data structure and routines (with the exception of the bounding functions), one for the standard Bernstein form, and one for the implicit Bernstein form.

Data Structure: Polynomial

Polynomials are passed to the program in a sparse representation, consisting of a one-dimensional array of non-zero terms. The ordering of the terms in the polynomial is unim-portant. Each term thus consists of a coefficient with an array of associated variable expo-nents. Coefficients are stored as intervals; they may be entered as point values, in which case they are converted to intervals of machine-precision width. Implicit in this data structure aren, the number of variables, andl, the degrees in each variable. These values are instead stored alongside the polynomial in the BCPB data structure, below.

Polynomial:

• k: number of terms (integer)

• t: terms (array ofkterms); each term consists of a: coefficient (interval)

i: multi-index exponent (array of nintegers) Data Structure: BCPB

The principal data construct created by the program, designed as a ‘workspace’ for appli-cations, is an aggregate structure called a BCPB (Bernstein coefficients, polynomial, box).

By storing the Bernstein coefficients in such a workspace alongside the corresponding poly-nomial and box, they do not need to be recomputed from scratch in subsequent application iterations; the more efficient subdivision-based scheme can be used.

BCPB:

• n: number of variables (integer)

A Software

• l: degrees in each variablel1, . . . , ln (array ofn integers)

• p: polynomial (polynomial)

• X: box (array ofnintervals)

• b: Bernstein coefficients ((l1+ 1)×. . .×(ln+ 1)array of intervals) Data Structure: IBCPB

An alternative to the BCPB data structure, above, is an aggregrate which makes use of the implicit Bernstein form (cf. Section 9.3). This workspace has the same data fields as the BCPB, but the Bernstein coefficients of the component univariate monomials are stored, instead of the whole set of the Bernstein coefficients.

IBCPB:

• n: number of variables (integer)

• l: degrees in each variablel1, . . . , ln (array ofn integers)

• p: polynomial (polynomial)

• X: box (array ofnintervals)

• b: Bernstein coefficients (kPn

i=1li+ 1array of intervals) Routine: Initialise

Given a polynomial and box as input, this procedure initialises a workspace and calculates and stores the corresponding Bernstein coefficients. In the case of the usual Bernstein form, the entire set of coefficients are computed, according to the algorithm in Subsection 3.3.1; in the case of the implicit Bernstein form, instead those of the component univariate monomials are computed.

INPUT:

• n: number of variables (integer)

• l: degrees in each variable (array ofn integers)

• p: polynomial (polynomial)

• X: box (array ofnintervals) OUTPUT:

• w: work structure (pointer to BCPB or IBCPB)

A Software

Routine: Subdivide

Given a workspace as input (containing a box and Bernstein coefficients), this procedure performs a subdivision into two sub-boxes, according to the algorithm in Subsection 3.3.2.

The old workspace is destroyed and two new workspaces are created. The boxes and Bern-stein coefficients are updated for each new workspace.

INPUT:

• w: work structure (pointer to BCPB or IBCPB)

• d: subdivision direction (integer)

• xλ: split point (floating point) OUTPUT:

• w1: work structure (pointer to BCPB or IBCPB)

• w2: work structure (pointer to BCPB or IBCPB) Routine: Range

Given a workspace as input (containing a polynomial and a box), this procedure returns a tight outer estimation for the range of the polynomial over the box. This range is equal to the Bernstein enclosure, i.e. the range spanned by the minimum and maximum Bernstein coefficients. In many cases (often for small boxes and/or where the polynomial is monotonic over the box), the range is provided without overestimation (except for the outward rounding which is inherent in the interval arithmetic). Due to the use of interval arithmetic, this range is a guaranteed outer estimation. In the case of the implicit Bernstein form, the algorithm in Subsection 9.3.2 is used.

INPUT:

• w: work structure (pointer to BCPB or IBCPB) OUTPUT:

• r: range (interval) Routine: Derivative

Given a workspace as input (containing a polynomial and Bernstein coefficients), together with a choice of one of the variables, this procedure calculates the Bernstein coefficients of the partial derivative of the polynomial with respect to the chosen variable, over the same box, according to Subsection 3.3.4. These coefficients are placed into a new workspace which is created, along with the derivative of the polynomial and the same box.

INPUT:

• w: work structure (pointer to BCPB or IBCPB)

A Software

• d: index of differentiation variable (integer) OUTPUT:

• w1: work structure (pointer to BCPB or IBCPB) Routine: LowerBF (6 Versions)

Given a workspace as input (containing a polynomial and a box), this procedure returns a tight affine lower bounding function for the polynomial over the box. The workspace must be of type BCPB, i.e. the entire set of Bernstein coefficients is explicity required. The coefficientsa0, . . . , anof the bound function are returned in an array. There are six versions of this routine, according to the variant methods described in Subsections 10.2.2 to 10.2.7.

For the variant which requires it (Method LP), theLP_SOLVE[BD+] package for solving linear programming problems is used. Other methods may require the solution of a system of linear equations; here a Householder transformation is employed to yield a QR decom-position. In the case of the method using the linear least squares approximation (Method LLS), it is worth noting that the bulk of the computation does not need to be performed using interval arithmetic; the midpoints of the Bernstein coefficient intervals are used to construct the linear least squares problem. Only the final stage of the computation, the downward shift, needs to be performed with interval arithmetic. This suffices for the lower bounding function to be guaranteed to be valid.

INPUT:

• w: work structure (pointer to BCPB) OUTPUT:

• c: affine function (array ofn+ 1coefficients(floating point)) Routine: UpperBF (6 Versions)

This procedure is entirely analogous to LowerBF (in all variants), except that an affine upper bounding function is computed.

INPUT:

• w: work structure (pointer to BCPB) OUTPUT:

• c: affine function (array ofn+ 1coefficients(floating point))

A Software

Routine: AffineAF

This procedure takes the same input as LowerBF (and UpperBF), but instead yields an affine function which closely approximates the polynomial over the box. As in Subsection 10.2.7, a linear least squares approximation is employed in the same fashion, except that the final stage, the downward (or upward) shift, is omitted. This then yields an affine function which closely approximates the polynomial over the box. It may be of use for applications in which an affine approximator, instead of an affine relaxation, is required. As before, the coefficients a0, . . . , an of the approximating function are returned in an array.

INPUT:

• w: work structure (pointer to BCPB) OUTPUT:

• c: affine function (array ofn+ 1coefficients(floating point))