Drake
InverseFunctionInterpolator Class Reference

A linear interpolator for arbitrary inverse functions. More...

#include <automotive/maliput/rndf/spline_helpers.h>

## Public Member Functions

InverseFunctionInterpolator (std::function< double(double)> function, double xmin, double xmax, double error_boundary)
Constructor that takes the function, its domain interval and an error boundary for the interpolation. More...

double InterpolateMthDerivative (int derivative_order, double y)
Interpolates $$x^{(derivative_order)}(y)$$, that is, the inverse of the given function. More...

Does not allow copy, move, or assignment
InverseFunctionInterpolator (const InverseFunctionInterpolator &)=delete

InverseFunctionInterpolatoroperator= (const InverseFunctionInterpolator &)=delete

InverseFunctionInterpolator (InverseFunctionInterpolator &&)=delete

InverseFunctionInterpolatoroperator= (InverseFunctionInterpolator &&)=delete

## Detailed Description

A linear interpolator for arbitrary inverse functions.

Helpful for path-length parameterization with ignition::math::Splines. Given a function F, its domain D, and codomain CD, this class gives a linear interpolant of F's inverse that maps CD to D.

## Constructor & Destructor Documentation

 InverseFunctionInterpolator ( const InverseFunctionInterpolator & )
delete
 InverseFunctionInterpolator ( InverseFunctionInterpolator && )
delete
 InverseFunctionInterpolator ( std::function< double(double)> function, double xmin, double xmax, double error_boundary )
explicit

Constructor that takes the function, its domain interval and an error boundary for the interpolation.

The valid range of function's codomain is determined as follows. The minimum value is xmin applied to function. The maximum value is xmax applied to function. This is valid because function is assumed to be monotonically increasing with x.

Parameters
 [in] function an arbitrary continuous function for which to interpolate an inverse. It should be monotonically increasing with x. [in] xmin function 's domain interval low bound. [in] xmax function 's domain interval upper bound. [in] error_boundary a positive constraint on the maximum error allowed when approximating the inverse function.
Exceptions
 std::runtime_error When error_boundary is not positive. std::runtime_error When xmin is equal or greater than xmax. std::runtime_error When evaluating function throws.

## Member Function Documentation

 double InterpolateMthDerivative ( int derivative_order, double y )

Interpolates $$x^{(derivative_order)}(y)$$, that is, the inverse of the given function.

Parameters
 [in] derivative_order a non-negative integer describing the order of the inverse function derivative to interpolate. Any value bigger than 1 will make the function return 0.0 as this is a linear interpolant. [in] y the range value to interpolate at, constrained by the direct function image, which is inside the codomain of the direct function.
Returns
interpolated derivative_order derivative $$x^{(derivative_order)}(y)$$ .
Exceptions
 when derivative_order is a negative integer. when y is larger than the maximum range of the function's codomain as described in the constructor's documentation. std::runtime_error When y is smaller than the minimum range of the function's codomain as described in the constructor's documentation.

Here is the call graph for this function:

 InverseFunctionInterpolator& operator= ( const InverseFunctionInterpolator & )
delete
 InverseFunctionInterpolator& operator= ( InverseFunctionInterpolator && )
delete

The documentation for this class was generated from the following files: