maliput_malidrive
|
Describes a Function defined in pieces.
Queries accept p ∈ [p0, p1] with a linear tolerance.
#include <src/maliput_malidrive/road_curve/piecewise_function.h>
Public Types | |
enum | ContinuityCheck { kLog = 0, kThrow } |
Continuity check behavior. More... | |
Public Member Functions | |
PiecewiseFunction (std::vector< std::unique_ptr< Function >> functions, double tolerance, const ContinuityCheck &continuity_check) | |
Constructs PiecewiseFunction from a collection of Functions. More... | |
PiecewiseFunction (std::vector< std::unique_ptr< Function >> functions, double tolerance) | |
Constructs PiecewiseFunction from a collection of Functions. More... | |
Public Member Functions inherited from Function | |
MALIDRIVE_NO_COPY_NO_MOVE_NO_ASSIGN (Function) | |
virtual | ~Function ()=default |
double | f (double p) const |
Evaluates \( F(p) \). More... | |
double | f_dot (double p) const |
Evaluates \( F'(p) \). More... | |
double | f_dot_dot (double p) const |
Evaluates \( F''(p) \). More... | |
double | p0 () const |
double | p1 () const |
bool | IsG1Contiguous () const |
Additional Inherited Members | |
Static Public Attributes inherited from Function | |
static constexpr double | kEpsilon = 0. |
Implementations may opt to allow a tolerance or be up to kEpsilon away from [p0(); p1()]. More... | |
Protected Member Functions inherited from Function | |
Function ()=default | |
|
strong |
PiecewiseFunction | ( | std::vector< std::unique_ptr< Function >> | functions, |
double | tolerance, | ||
const ContinuityCheck & | continuity_check | ||
) |
Constructs PiecewiseFunction from a collection of Functions.
Functions are expected to be C1 continuous and C1 continuity is evaluated at the extents. Constraints can be disabled with continuity_check
.
functions | Hold the Functions. |
tolerance | Tolerance used to verify continuity. |
continuity_check | Select continuity check behavior. ContinuityCheck::kThrow by default. |
maliput::common::assertion_error | When functions is empty. |
maliput::common::assertion_error | When functions has a nullptr item. |
maliput::common::assertion_error | When two consecutive items in functions are not C¹ contiguous up to tolerance and continuity_check is kThrow. |
PiecewiseFunction | ( | std::vector< std::unique_ptr< Function >> | functions, |
double | tolerance | ||
) |
Constructs PiecewiseFunction from a collection of Functions.
Uses PiecewiseFunction() constructor using ContinuityCheck::kThrow.
functions | Hold the Functions. |
tolerance | Tolerance used to verify continuity. |