ADORe
ADORe is a modular open source software library and toolkit for decision making, planning, control and simulation of automated vehicles
adore::mad::CubicPiecewiseFunction Class Reference

#include <cubicpiecewisefunction.h>

Collaboration diagram for adore::mad::CubicPiecewiseFunction:
Collaboration graph

Classes

struct  LocalCoordination
 
struct  PieceweisePolynomial
 

Static Public Member Functions

static void BreaksGenerator (double *Userbreaks, int UserbreaksLength, double start, double resolution)
 
static std::vector< double > BreaksGenerator (double start, double end, int NumberOfPoints)
 
static void BreaksGeneratorExp (double *Userbreaks, int NumOfPoints, double start, double end)
 
static void smoothingSpline (PieceweisePolynomial *pp, double *input_x, double *input_y, double *input_w, int inputLength, double smoothingFactor)
 
static void fit (PieceweisePolynomial *pp, double *input_x, double *input_y, double *input_w, int inputLength, double smoothingFactor)
 
static LocalCoordination localCoordination (double *Userbreaks, int UserbreaksLength, PieceweisePolynomial &pp)
 
static void CubicSplineEvaluation (double *interpolatedSpline, double *d_interpolatedSpline, double *dd_interpolatedSpline, double *ddd_interpolatedSpline, double *Userbreaks, int UserbreaksLength, PieceweisePolynomial &pp)
 
static void CubicSplineEvaluation (double *interpolatedSpline, double *d_interpolatedSpline, double *dd_interpolatedSpline, double *Userbreaks, int UserbreaksLength, PieceweisePolynomial &pp)
 
static void CubicSplineEvaluation (double *interpolatedSpline, double *d_interpolatedSpline, double *Userbreaks, int UserbreaksLength, PieceweisePolynomial &pp)
 
static void CubicSplineEvaluation (double *interpolatedSpline, double *Userbreaks, int UserbreaksLength, PieceweisePolynomial &pp)
 
static void toPolynomialFrom (PieceweisePolynomial *pp, double *input_breaks, double *input_coef1, double *input_coef2, double *input_coef3, double *input_coef4, int inputLength)
 
static int findIndex (double point, PieceweisePolynomial &pp)
 
static double splineEvaluation (int index, double point, PieceweisePolynomial &pp)
 
static void deleteCubicSplinepp (PieceweisePolynomial &pp)
 
static void deleteCubicSplinepp1 (PieceweisePolynomial *pp)
 

Static Private Member Functions

static void repeatedValueInterpolation (double *output_x, double *output_y, double *output_weight, int *outputLength, double *input_x, double *input_y, double *input_weight, int inputLength)
 

Detailed Description

This class creates smoothend cubic piecewise polynomial https://wiki.dlr.de/confluence/display/fau/How+to+use+Fit+function

Member Function Documentation

◆ BreaksGenerator() [1/2]

void CubicPiecewiseFunction::BreaksGenerator ( double *  Userbreaks,
int  UserbreaksLength,
double  start,
double  resolution 
)
static

generates the break points from a starting point with a given resolution

Parameters
Userbreaksis the generated breaks (output)
UserbreaksLengthis the size of Userbreaks (input)
startis the first break value (input)
resolutionis the breaks resolution (input)
Here is the caller graph for this function:

◆ BreaksGenerator() [2/2]

std::vector< double > CubicPiecewiseFunction::BreaksGenerator ( double  start,
double  end,
int  NumberOfPoints 
)
static

generates the break points from a starting point to an end point

Parameters
startis the first break value (input)
endis the last break value (input)
NumberOfPointsis the number of breaks
Returns
is breaks

◆ BreaksGeneratorExp()

void CubicPiecewiseFunction::BreaksGeneratorExp ( double *  Userbreaks,
int  NumOfPoints,
double  start,
double  end 
)
static

generates the break points from a starting point to an end point with exponential resolution

Parameters
Userbreaksis the generated breaks (output)
NumberOfPointsis the number of breaks
startis the first break value (input)
endis the last break value (input)
Returns
is breaks
Here is the call graph for this function:

◆ CubicSplineEvaluation() [1/4]

void CubicPiecewiseFunction::CubicSplineEvaluation ( double *  interpolatedSpline,
double *  d_interpolatedSpline,
double *  dd_interpolatedSpline,
double *  ddd_interpolatedSpline,
double *  Userbreaks,
int  UserbreaksLength,
PieceweisePolynomial pp 
)
static

evaluates the cubic piecewise polynomial and its first, second and third derivative for a given breaks

Parameters
interpolatedSplineis the interpolation result
d_interpolatedSplineis the first derivative of interpolation result
dd_interpolatedSplineis the second derivative of interpolation result
ddd_interpolatedSplineis the third derivative of interpolation result
Userbreaksis the given breaks
UserbreaksLengthis the size of Userbreaks
ppis the structure containing the piecewise polynomial (breaks, coef_1, coef_2, coef_3, coef_4)
Here is the call graph for this function:

◆ CubicSplineEvaluation() [2/4]

void CubicPiecewiseFunction::CubicSplineEvaluation ( double *  interpolatedSpline,
double *  d_interpolatedSpline,
double *  dd_interpolatedSpline,
double *  Userbreaks,
int  UserbreaksLength,
PieceweisePolynomial pp 
)
static

evaluates the cubic piecewise polynomial and its first and second derivative for a given breaks

Parameters
interpolatedSplineis the interpolation result
d_interpolatedSplineis the first derivative of interpolation result
dd_interpolatedSplineis the second derivative of interpolation result
Userbreaksis the given breaks
UserbreaksLengthis the size of Userbreaks
ppis the structure containing the piecewise polynomial (breaks, coef_1, coef_2, coef_3, coef_4)
Here is the call graph for this function:

◆ CubicSplineEvaluation() [3/4]

void CubicPiecewiseFunction::CubicSplineEvaluation ( double *  interpolatedSpline,
double *  d_interpolatedSpline,
double *  Userbreaks,
int  UserbreaksLength,
PieceweisePolynomial pp 
)
static

evaluates the cubic piecewise polynomial and its first derivative for a given breaks

Parameters
interpolatedSplineis the interpolation result
d_interpolatedSplineis the first derivative of interpolation result
Userbreaksis the given breaks
UserbreaksLengthis the size of Userbreaks
ppis the structure containing the piecewise polynomial (breaks, coef_1, coef_2, coef_3, coef_4)
Here is the call graph for this function:

◆ CubicSplineEvaluation() [4/4]

void CubicPiecewiseFunction::CubicSplineEvaluation ( double *  interpolatedSpline,
double *  Userbreaks,
int  UserbreaksLength,
PieceweisePolynomial pp 
)
static

evaluates the cubic piecewise polynomial for a given breaks

Parameters
interpolatedSplineis the interpolation result
Userbreaksis the given breaks
UserbreaksLengthis the size of Userbreaks
ppis the structure containing the piecewise polynomial (breaks, coef_1, coef_2, coef_3, coef_4)
Here is the call graph for this function:

◆ deleteCubicSplinepp()

void CubicPiecewiseFunction::deleteCubicSplinepp ( PieceweisePolynomial pp)
static

delete a piecewise polynomial structure

Parameters
ppis the structure containing the piecewise polynomial (breaks, coef_1, coef_2, coef_3, coef_4)

◆ deleteCubicSplinepp1()

void CubicPiecewiseFunction::deleteCubicSplinepp1 ( PieceweisePolynomial pp)
static

delete a piecewise polynomial structure

Parameters
ppis the structure containing the piecewise polynomial (breaks, coef_1, coef_2, coef_3, coef_4)

◆ findIndex()

int CubicPiecewiseFunction::findIndex ( double  point,
PieceweisePolynomial pp 
)
static

returns the index of a point witin breaks of a cubic peicewise polynomial

Parameters
pointis the given point
ppis the structure containing the piecewise polynomial (breaks, coef_1, coef_2, coef_3, coef_4)
Returns
is the index

◆ fit()

void CubicPiecewiseFunction::fit ( PieceweisePolynomial pp,
double *  input_x,
double *  input_y,
double *  input_w,
int  inputLength,
double  smoothingFactor 
)
static

generates smoothend cubinc piecewise polynomial of a data

Parameters
ppis the structure containing the piecewise polynomial (breaks, coef_1, coef_2, coef_3, coef_4)
input_xis data vector (x_axis)
input_yis data vector (y_axis)
input_wis the weight of data [0, 1]
inputLengthis the input size
smoothingFactoris the smoothing factor [0 , 1]
Here is the call graph for this function:
Here is the caller graph for this function:

◆ localCoordination()

CubicPiecewiseFunction::LocalCoordination CubicPiecewiseFunction::localCoordination ( double *  Userbreaks,
int  UserbreaksLength,
PieceweisePolynomial pp 
)
static

matches the given breaks to the polynomial breaks

Parameters
Userbreaksis the given breaks
UserbreaksLengthis the size of Userbreaks
ppis the structure containing the piecewise polynomial (breaks, coef_1, coef_2, coef_3, coef_4)
Here is the caller graph for this function:

◆ repeatedValueInterpolation()

void CubicPiecewiseFunction::repeatedValueInterpolation ( double *  output_x,
double *  output_y,
double *  output_weight,
int *  outputLength,
double *  input_x,
double *  input_y,
double *  input_weight,
int  inputLength 
)
inlinestaticprivate
Here is the call graph for this function:
Here is the caller graph for this function:

◆ smoothingSpline()

void CubicPiecewiseFunction::smoothingSpline ( PieceweisePolynomial pp,
double *  input_x,
double *  input_y,
double *  input_w,
int  inputLength,
double  smoothingFactor 
)
static

generates smoothend cubinc piecewise polynomial of a data

Parameters
ppis the structure containing the piecewise polynomial (breaks, coef_1, coef_2, coef_3, coef_4)
input_xis data vector (x_axis)
input_yis data vector (y_axis)
input_wis the weight of data [0, 1]
inputLengthis the input size
smoothingFactoris the smoothing factor [0 , 1]

dx from 1 to N-2 (Dx_i-1)

Here is the call graph for this function:
Here is the caller graph for this function:

◆ splineEvaluation()

double CubicPiecewiseFunction::splineEvaluation ( int  index,
double  point,
PieceweisePolynomial pp 
)
static

evaluate a cubic piecewise polynomial at a given point

Parameters
indexis the index of a given point
pointis the given point
ppis the structure containing the piecewise polynomial (breaks, coef_1, coef_2, coef_3, coef_4)
Returns
is the evaluated value

◆ toPolynomialFrom()

void CubicPiecewiseFunction::toPolynomialFrom ( PieceweisePolynomial pp,
double *  input_breaks,
double *  input_coef1,
double *  input_coef2,
double *  input_coef3,
double *  input_coef4,
int  inputLength 
)
static

makes the piecewise polynomial

Parameters
ppis the structure containing the piecewise polynomial (breaks, coef_1, coef_2, coef_3, coef_4)
input_breaksis the given breaks
input_coef1is the given coef_1
input_coef2is the given coef_2
input_coef3is the given coef_3
input_coef4is the given coef_4
inputLengthis the size of the inputs
Here is the caller graph for this function:

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