namespace polynomial_functions

Overview

Polynomial functions. More…

namespace polynomial_functions {

// global functions

real function, public evaluation_polynomial(coeff coeff, ncoef ncoef, x x);
real function, public first_derivative_polynomial(coeff coeff, ncoef ncoef, x x);
real function, public integration_polynomial(xi0 xi0, xi1 xi1, Coeff Coeff, npoly npoly);

} // namespace polynomial_functions

Detailed Documentation

Polynomial functions.

Date of creation: 2008.06.12 L. White

This module contains routines that handle polynomials.

Global Functions

real function, public evaluation_polynomial(coeff coeff, ncoef ncoef, x x)

Pointwise evaluation of a polynomial at x.

The polynomial is defined by the coefficients contained in the array of the same name, as follows: C(1) + C(2)x + C(3)x^2 + C(4)x^3 + … where C refers to the array ‘coeff’. The number of coefficients is given by ncoef and x is the coordinate where the polynomial is to be evaluated.

Parameters:

coeff

The coefficients of the polynomial

ncoef

The number of polynomial coefficients

x

The position at which to evaluate the polynomial

real function, public first_derivative_polynomial(coeff coeff, ncoef ncoef, x x)

Calculates the first derivative of a polynomial evaluated at a point x.

The polynomial is defined by the coefficients contained in the array of the same name, as follows: C(1) + C(2)x + C(3)x^2 + C(4)x^3 + … where C refers to the array ‘coeff’. The number of coefficients is given by ncoef and x is the coordinate where the polynomial’s derivative is to be evaluated.

Parameters:

coeff

The coefficients of the polynomial

ncoef

The number of polynomial coefficients

x

The position at which to evaluate the derivative

real function, public integration_polynomial(
    xi0 xi0,
    xi1 xi1,
    Coeff Coeff,
    npoly npoly
    )

Exact integration of polynomial of degree npoly.

The array of coefficients (Coeff) must be of size npoly+1.

Parameters:

xi0

The lower bound of the integral

xi1

The lower bound of the integral

coeff

The coefficients of the polynomial

npoly

The degree of the polynomial