Opm::MonotCubicInterpolator Class Reference Represents one dimensional function f with single valued argument x that can be interpolated using monotone cubic interpolation. More...
Detailed DescriptionRepresents one dimensional function f with single valued argument x that can be interpolated using monotone cubic interpolation. Class to represent a one-dimensional function f with single-valued argument x. The function is represented by a table of function values. Interpolation between table values is cubic and monotonicity preserving if input values are monotonous. Outside x_min and x_max, the class will extrapolate using the constant f(x_min) or f(x_max). Extra functionality:
Monotonicity preserving cubic interpolation algorithm is taken from Fritsch and Carlson, "Monotone piecewise cubic interpolation", SIAM J. Numer. Anal. 17, 238–246, no. 2, $Id$ Algorithm also described here: http://en.wikipedia.org/wiki/Monotone_cubic_interpolation Constructor & Destructor Documentation
Accepts a filename as input and parses this file for two-column floating point data, interpreting the data as representing function values x and f(x). Ignores all lines not conforming to <whitespace><float><whitespace><float><whatever><newline> References read().
Accepts a filename as input and parses this file for two-column floating point data, interpreting the data as representing function values x and f(x). Ignores all lines not conforming to <whitespace><float><whitespace><float><whatever><newline> All commas in the file will be treated as spaces when parsing. References read().
Accepts a filename as input, and parses the chosen columns in that file. References read().
Accepts a filename as input, and parses the chosen columns in that file. References read().
Accepts two equal-length vectors as input for constructing the interpolation object. First vector is the x-values, the second vector is the function values
No input, an empty function object is created. This object must be treated with care until populated. Member Function Documentation
Adds a new datapoint to the function. This causes all the derivatives at all points of the functions to be recomputed and then adjusted for monotone cubic interpolation. If this function ever enters a critical part of any code, the locality of the algorithm for monotone adjustment must be exploited.
Checks if the function curve is flat at the endpoints, chop off endpoint data points if that is the case. The notion of "flat" is determined by the input parameter "epsilon" Values whose difference are less than epsilon are regarded as equal. This is implemented to be able to obtain a strictly monotone curve from a data set that is strictly monotone except at the endpoints. Example: The data points (1,3), (2,3), (3,4), (4,5), (5,5), (6,5) will become (2,3), (3,4), (4,5) Assumes at least 3 datapoints. If less than three, this function is a noop.
Wrapper function for chopFlatEndpoints(const double) providing a default epsilon parameter
Returns f(x) for given x (input). Interpolates (monotone cubic or linearly) if necessary. Extrapolates using the constants f(x_min) or f(x_max) if input x is outside (x_min, x_max)
Referenced by operator()().
Interpolates (linearly) if necessary. Throws an exception if extrapolation would be necessary for evaluation. We do not want to do extrapolation (yet). The error estimate for x1 < x < x2 is (x2 - x1)^2/8 * f''(x) where f''(x) is evaluated using the stencil (1 -2 1) using either (x0, x1, x2) or (x1, x2, x3); Throws an exception if the table contains only two x-values. NOT IMPLEMENTED YET!
Provide a copy of tghe function data as a vector Unspecified order, but corresponds to get_xVector
Provide a copy of the x-data as a vector Unspecified order, but corresponds to get_fVector.
Maximum f-value, returns both x and f in a pair.
Maximum x-value, returns both x and f in a pair.
Minimum f-value, returns both x and f in a pair
Minimum x-value, returns both x and f in a pair.
Returns an x-value that is believed to yield the best improvement in global accuracy for the interpolation if computed. Searches for the largest jump in f-values, and returns a x value being the average of the two x-values representing the f-value-jump.
Determines if the current function-value-data is monotone.
Determines if the current function-value-data is monotone and decreasing
Determines if the current function-value-data is monotone and increasing.
Determines if the current function-value-data is strictly decreasing. This is a utility function for outsiders if they want to invert the data for example.
Determines if the current function-value-data is strictly increasing. This is a utility function for outsiders if they want to invert the data for example.
Determines if the current function-value-data is strictly monotone. This is a utility function for outsiders if they want to invert the data for example.
Returns f(x) for given x (input). Interpolates (monotone cubic or linearly) if necessary. Extrapolates using the constants f(x_min) or f(x_max) if input x is outside (x_min, x_max)
References evaluate().
Accepts a filename as input and parses this file for two-column floating point data, interpreting the data as representing function values x and f(x). returns true on success All commas in file will be treated as spaces when parsing Ignores all lines not conforming to <whitespace><float><whitespace><float><whatever><newline> Referenced by MonotCubicInterpolator().
Accepts a filename as input, and parses the chosen columns in that file.
Scale all the function value data by a constant
If function is monotone, but not strictly monotone, this function will remove datapoints from intervals with zero derivative so that the curve become strictly monotone. Example The data points (1,2), (2,3), (3,4), (4,4), (5,5), (6,6) will become (1,2), (2,3), (3,4), (5,5), (6,6) Assumes at least two datapoints, if one or zero datapoint, this is a noop.
Wrapper function for shrinkFlatAreas(const double) providing a default epsilon parameter
Constructs a string containing the data in a table
The documentation for this class was generated from the following file: |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||