Engineering Papers⌕ Search

DOE OSTI · code-27852

numericalFunctions

Abstract

The numericalFunction C library is designed to handle point-wise interpolative data representing a mathematical function. The library currently handles 1-d functions (i.e., functions of the format f(x)). The main object is the ptwXYPoints C struct that holds list of x,y pairs sorted by ascending x-values with an interpolation rule. That is, it contains the 1-d function f(x) = y(x). Functions are included that support common unitary and binary operations (e.g., negation, addition, multiplication). As example, if f(x) and g(x) are two ptwXYPoints instances, then routines to calculate f(x) + g(x) and f(x) * g(x) are included. The library support storage of data with lin-lin, lin-log, log-lin, log-log and flat (or histogram) interpolation. Functions to convert any of the supported interpolation to lin-lin are included. However, many of the binary functions only support lin-lin interpolation. The library also contains a C struct for storing a Legendre series representation of a 1-d function, and functions to convert Legendre series to and from a ptwXYPoints instance. A python interface to the library is included, with the ptwXYPoints C struct treated as a class. This class has many of the standard python math methods (e.g., __add__, __mul__).

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Beck, Bret. 2019-02-25. numericalFunctions. https://doi.org/10.11578/dc.20190715.11

Cite the original work for its findings. Save a collection to share your selection of sources.