Functions

Class Realfunction1d

Generic real 1D function class (real function of a real argument). Polymorphic input and output is provided for pointers to objects of this class. Polymorphic data format:
function_type
data_for_that_function
The data format depends on the type of function chosen. Names (for identifying the function type) and formats are defined below.

Class Constant

Name: constant Data format:
value

Class Parameter

Name: parameter Data format:
name (up to 80 characters)
The function returns the argument. (Parameters are used in data-fitting and differential calculus.)

Class Heaviside

Name: heaviside, Heaviside step function (no data). The function returns zero if the argument is negative and one if the argument is positive.

Class Polynomial

Name: polynomial Data format:
number of coefficients
For each coefficient:
   ci
The function evaluated is c0+c1x+...+cn-1xn-1

Class: Gaussian

Name: gaussian Data format:
centre (xc) 	width (rho)
The function evaluated is exp[-(x - xc)2 / rho2] / [sqrt(2 pi) rho].

Class: Monomial

Name: monomial Data format:
power_of_argument (p)   factor (c)
The function evaluated is cxp.

Class: General_polynomial

An array of monomials. Name: general_polynomial Data format:
number_of_terms
For each:
   pi ci
The function evaluated is m0(x)+m1(x)+...+mn-1(x)

Class: Table1d

A 1D linearly-interpolated (or extrapolated) table, defined as an array of pairs of doubles modelling f(x) as piecewise linear. Name: table1d Data format:
number_of_points_in_table
For each:
   xi fi

Class: Table1d_polyint

A 1D tabulation with polynomial interpolation and extrapolation. Data is an array of pairs of doubles modelling f(x) as piecewise polynomial. Data format: as `Table1d', plus
order_of_interpolating_polynomial
(The order is the highest power of x.)

Class: Sum

Name: sum Data format:
number_of_functions_in_sum
For each:
   function_type
   function_data
Data is an Array of Realfunction1ds. The function evaluated is the sum of the constituent functions.

Class: Product

Name: product Data format:
number_of_functions_in_product
For each:
   function_type
   function_data
Data is an Array of Realfunction1ds. The function evaluated is the product of the constituent functions.

Class: Nested

Name: nested Data format:
number_of_functions_in_product
For each:
   function_type
   function_data
Data is an Array of Realfunction1ds. The function evaluated is the nest of the constituent functions, i.e. f1(f2(...(fn(x))...)).

Class: Piecewise

Name: piecewise A default function, and a set of functions each with a range of validity in x. Data format:
f0		default function
number_of_ranged_functions
For each:
   x1 x2 f	range (min, max x) and function
f0 and each f are Realfunction1ds

Spline

Name: spline A set of functions fi with associated knots x0i, the spline function being
f(x) = sumi fi(x - x0i) theta(x - x0i)

where theta is the Heaviside step function. Functions must be specified in order of increasing x0. Data format:
number_of_functions
For each:
   x0 f 
Each f is a Realfunction1d.

Displaced function

Name: displaced An offset x0 and function g, the displaced function being
f(x) = g(x - x0)

Data format:
x0 g 
g is a Realfunction1d.

Transcendental functions (class Transcendental)

This class is used as a contained for transcendental functions requiring no parameters. Subclass names are exp, ln, log10,sin, cos, tan, sinh, cosh, tanh, alegpoly, lnGamma, Gamma, Bessel_J0, Bessel_J1, Bessel_Y0, Bessel_Y1, elliptic_K, elliptic_E, Erfc, Erf, Fresnel_C, Fresnel_S.