Storage and manipulation of parametric functions collection. More...
#include <param_func.h>
Classes | |
struct | FuncCtrlPt |
Control point variable. More... | |
struct | ParamFuncsStructure |
Containts parametric function initialization data. More... | |
Public Types | |
enum | CtrlPtDim { CtrlPtDim::VAL, CtrlPtDim::ARC } |
Control point variable dimension. More... | |
enum | EvalArcGuarantee { EvalArcGuarantee::NONE, EvalArcGuarantee::AFTER_LAST, EvalArcGuarantee::BEFORE_LAST, EvalArcGuarantee::AT_BEGIN, EvalArcGuarantee::AT_END } |
Flags if any guarantees about evaluation arc relative to last evaluation arc are present. More... | |
enum | FuncEvalMode { FuncEvalMode::DIFF1, FuncEvalMode::DIFF2, FuncEvalMode::INT1, FuncEvalMode::INT2, FuncEvalMode::FUNC, FuncEvalMode::ENUM_SIZE } |
Required type of computation relative to the parametric function. More... | |
using | FuncEvalModesFlags = std::array< bool, nrModesMax_ > |
Public Member Functions | |
virtual double | computeFuncDiff1 (const std::size_t &_funcIdx) const =0 |
Computes 1st derivative of parametric function with index _funcIdx at parametric arc set by setEvalArc. More... | |
virtual double | computeFuncDiff2 (const std::size_t &_funcIdx) const =0 |
Computes 2nd derivative of parametric function with index _funcIdx at parametric arc set by setEvalArc. More... | |
virtual double | computeFuncInt1 (const std::size_t &_funcIdx) const =0 |
Computes integral of parametric function with index _funcIdx on interval [funcsArcBegin_, funcsArcEnd_]. More... | |
virtual double | computeFuncInt2 (const std::size_t &_funcIdx) const =0 |
Computes double integral of parametric function with index _funcIdx on interval [funcsArcBegin_, funcsArcEnd_]. More... | |
virtual double | computeFuncVal (const std::size_t &_funcIdx) const =0 |
Computes value of parametric function with index _funcIdx at parametric arc set by setEvalArc. More... | |
FuncCtrlPt & | ctrlPt (const std::size_t &_funcIdx, const std::size_t &_funcCtrlPtIdx) |
Access of a parametric function control point. More... | |
const FuncCtrlPt & | ctrlPt (const std::size_t &_funcIdx, const std::size_t &_funcCtrlPtIdx) const |
Const access of a parametric function control point. More... | |
double & | ctrlPtVal (const std::size_t &_funcIdx, const std::size_t &_funcCtrlPtIdx, const CtrlPtDim &_ctrlPtDim=CtrlPtDim::VAL) |
Access of a parametric function control point dimension. More... | |
const double & | ctrlPtVal (const std::size_t &_funcIdx, const std::size_t &_funcCtrlPtIdx, const CtrlPtDim &_ctrlPtDim=CtrlPtDim::VAL) const |
Const of a parametric function control point dimension. More... | |
std::size_t | funcCtrlPtSize (const std::size_t &_i) const |
Number of control points for a parametric function. More... | |
double & | funcsArc (const std::size_t &_i, const std::size_t &_j) |
Access to the arc parameter vector at index _i, control point _j. More... | |
const double & | funcsArc (const std::size_t &_i, const std::size_t &_j) const |
Const access the arc parameter vector at index _i, control point _j. More... | |
double & | funcsArcBegin () |
Access to the initial value of the arc parametrization. More... | |
const double & | funcsArcBegin () const |
Const access to the initial value of the arc parametrization. More... | |
double & | funcsArcEnd () |
Access to the final value of the arc parametrization. More... | |
const double & | funcsArcEnd () const |
Const access to the finall value of the arc parametrization. More... | |
const double & | funcsArcEval () const |
Const access to the active evaluation point arc parametrization. More... | |
std::size_t | funcsArcSize () const |
Number of arc parametrizations. More... | |
std::size_t | funcsArcSize (const std::size_t &_i) const |
Number of control points of parametrization _i. More... | |
std::size_t | funcsSize () const |
Number of parametric functions. More... | |
void | init (const std::vector< tuw::ParamFuncs::ParamFuncsStructure > &_paramFuncsStructure) |
Initializes the control structure. More... | |
ParamFuncs & | operator= (const ParamFuncs &) |
ParamFuncs & | operator= (ParamFuncs &&)=delete |
ParamFuncs ()=default | |
ParamFuncs (const ParamFuncs &) | |
ParamFuncs (ParamFuncs &&)=delete | |
virtual void | precompute ()=0 |
Precomputes cached data. More... | |
virtual void | setEvalArc (const double &_funcsArcEval, const EvalArcGuarantee &_evalArcGuarantee=EvalArcGuarantee::NONE)=0 |
Sets parametric function evaluation arc. More... | |
void | shiftStartCtrlPt (const double &_dt) |
virtual | ~ParamFuncs ()=default |
Static Public Attributes | |
static constexpr const std::size_t | nrModesMax_ = asInt(FuncEvalMode::ENUM_SIZE) - 1 |
Maximum number of computation modes (except the parametric function itself FUNC). Currently 4 other choices supported. More... | |
Protected Member Functions | |
virtual void | initImpl ()=0 |
Called at end of init. To be used by extended classes. More... | |
Protected Attributes | |
std::vector< std::size_t > | func2Arc_ |
Maps the parametrized functions to their afferent arc parametrizations. More... | |
std::vector< std::vector< FuncCtrlPt > > | funcCtrlPt_ |
Stores the control points for all the parametrized functions. More... | |
std::vector< FuncEvalModesFlags > | funcEvalReq_ |
Flags for required function computation modes. More... | |
double | funcsArcBegin_ |
Arc parametrization at the beginning of the functions domain definitions (common for all functions). More... | |
double | funcsArcEnd_ |
Arc parametrization at the end of the functions domain definitions (common for all functions). More... | |
double | funcsArcEval_ |
Arc parametrization at the evaluation point (set by setEvalArc)/. More... | |
std::vector< ParamFuncsStructure > | paramFuncsStructure_ |
Initialization structure "store" variable. More... | |
Private Member Functions | |
void | initBase (const std::vector< tuw::ParamFuncs::ParamFuncsStructure > &_paramFuncsStructure) |
Initializes the control structure for the base class. More... | |
Private Attributes | |
std::vector< std::vector< double > > | funcCtrlPtArc_ |
Stores the control points arc parameters for all the parametrized functions. More... | |
Storage and manipulation of parametric functions collection.
Making rules for unconsistent arcs (works only with nondecreasing function arcs) and document what the functions assume before and stuff.
Making rules for initial conditions (either tBegin should be allways 0 or something)
cout the control points and their arc parametrizations
Definition at line 57 of file param_func.h.
using tuw::ParamFuncs::FuncEvalModesFlags = std::array<bool, nrModesMax_> |
Definition at line 95 of file param_func.h.
|
strong |
Control point variable dimension.
Enumerator | |
---|---|
VAL |
control point value |
ARC |
control point arc parameter |
Definition at line 73 of file param_func.h.
|
strong |
Flags if any guarantees about evaluation arc relative to last evaluation arc are present.
Definition at line 80 of file param_func.h.
|
strong |
Required type of computation relative to the parametric function.
Definition at line 62 of file param_func.h.
|
default |
|
virtualdefault |
ParamFuncs::ParamFuncs | ( | const ParamFuncs & | _other | ) |
Definition at line 102 of file param_func.cpp.
|
delete |
|
pure virtual |
Computes 1st derivative of parametric function with index _funcIdx at parametric arc set by setEvalArc.
Implemented in tuw::ParamFuncsSpline0Dist< TNumType, TFuncSize, TArcLatticeSize >, tuw::ParamFuncsSpline0Dist< TNumType, 2, 2 >, and tuw::ParamFuncsSpline0Dist< TNumType, 2, 1 >.
|
pure virtual |
Computes 2nd derivative of parametric function with index _funcIdx at parametric arc set by setEvalArc.
Implemented in tuw::ParamFuncsSpline0Dist< TNumType, TFuncSize, TArcLatticeSize >, tuw::ParamFuncsSpline0Dist< TNumType, 2, 2 >, and tuw::ParamFuncsSpline0Dist< TNumType, 2, 1 >.
|
pure virtual |
Computes integral of parametric function with index _funcIdx on interval [funcsArcBegin_, funcsArcEnd_].
Implemented in tuw::ParamFuncsSpline0Dist< TNumType, TFuncSize, TArcLatticeSize >, tuw::ParamFuncsSpline0Dist< TNumType, 2, 2 >, and tuw::ParamFuncsSpline0Dist< TNumType, 2, 1 >.
|
pure virtual |
Computes double integral of parametric function with index _funcIdx on interval [funcsArcBegin_, funcsArcEnd_].
Implemented in tuw::ParamFuncsSpline0Dist< TNumType, TFuncSize, TArcLatticeSize >, tuw::ParamFuncsSpline0Dist< TNumType, 2, 2 >, and tuw::ParamFuncsSpline0Dist< TNumType, 2, 1 >.
|
pure virtual |
Computes value of parametric function with index _funcIdx at parametric arc set by setEvalArc.
Implemented in tuw::ParamFuncsSpline0Dist< TNumType, TFuncSize, TArcLatticeSize >, tuw::ParamFuncsSpline0Dist< TNumType, 2, 2 >, and tuw::ParamFuncsSpline0Dist< TNumType, 2, 1 >.
FuncCtrlPt& tuw::ParamFuncs::ctrlPt | ( | const std::size_t & | _funcIdx, |
const std::size_t & | _funcCtrlPtIdx | ||
) |
Access of a parametric function control point.
const FuncCtrlPt& tuw::ParamFuncs::ctrlPt | ( | const std::size_t & | _funcIdx, |
const std::size_t & | _funcCtrlPtIdx | ||
) | const |
Const access of a parametric function control point.
double& tuw::ParamFuncs::ctrlPtVal | ( | const std::size_t & | _funcIdx, |
const std::size_t & | _funcCtrlPtIdx, | ||
const CtrlPtDim & | _ctrlPtDim = CtrlPtDim::VAL |
||
) |
Access of a parametric function control point dimension.
const double& tuw::ParamFuncs::ctrlPtVal | ( | const std::size_t & | _funcIdx, |
const std::size_t & | _funcCtrlPtIdx, | ||
const CtrlPtDim & | _ctrlPtDim = CtrlPtDim::VAL |
||
) | const |
Const of a parametric function control point dimension.
size_t ParamFuncs::funcCtrlPtSize | ( | const std::size_t & | _i | ) | const |
Number of control points for a parametric function.
Definition at line 188 of file param_func.cpp.
double& tuw::ParamFuncs::funcsArc | ( | const std::size_t & | _i, |
const std::size_t & | _j | ||
) |
Access to the arc parameter vector at index _i, control point _j.
const double& tuw::ParamFuncs::funcsArc | ( | const std::size_t & | _i, |
const std::size_t & | _j | ||
) | const |
Const access the arc parameter vector at index _i, control point _j.
double & ParamFuncs::funcsArcBegin | ( | ) |
Access to the initial value of the arc parametrization.
Definition at line 197 of file param_func.cpp.
const double & ParamFuncs::funcsArcBegin | ( | ) | const |
Const access to the initial value of the arc parametrization.
Definition at line 201 of file param_func.cpp.
double & ParamFuncs::funcsArcEnd | ( | ) |
Access to the final value of the arc parametrization.
Definition at line 205 of file param_func.cpp.
const double & ParamFuncs::funcsArcEnd | ( | ) | const |
Const access to the finall value of the arc parametrization.
Definition at line 209 of file param_func.cpp.
const double & ParamFuncs::funcsArcEval | ( | ) | const |
Const access to the active evaluation point arc parametrization.
Definition at line 213 of file param_func.cpp.
size_t ParamFuncs::funcsArcSize | ( | ) | const |
Number of arc parametrizations.
Definition at line 192 of file param_func.cpp.
std::size_t tuw::ParamFuncs::funcsArcSize | ( | const std::size_t & | _i | ) | const |
Number of control points of parametrization _i.
size_t ParamFuncs::funcsSize | ( | ) | const |
Number of parametric functions.
Definition at line 184 of file param_func.cpp.
void ParamFuncs::init | ( | const std::vector< tuw::ParamFuncs::ParamFuncsStructure > & | _paramFuncsStructure | ) |
Initializes the control structure.
_paramFuncsStructure | parametric functions structure |
Note: _paramFuncsStructure[].ctrlPtsArcRefIdx has to be consistent (first function has to have value 0. Next functions can only reference previous referenced indexes or increse maximum reference index by 1). Some examples:
_paramFuncsStructure[].ctrlPtsArcRefIdx = [0,0,0] ok! means one arc parameter set for all 3 functions;
_paramFuncsStructure[].ctrlPtsArcRefIdx = [0,1,0] ok! means one arc parameter set for function 0 and 2 and another arc parameter set for function 1;
_paramFuncsStructure[].ctrlPtsArcRefIdx = [0,1,2] ok! means separate arc parameter set for each function;
_paramFuncsStructure[].ctrlPtsArcRefIdx = [0,2,1] inconsistent! indexes not consistent step-increasing;
Definition at line 96 of file param_func.cpp.
|
private |
Initializes the control structure for the base class.
_paramFuncsStructure | parametric functions structure |
Note: _paramFuncsStructure[].ctrlPtsArcRefIdx has to be consistent (first function has to have value 0. Next functions can only reference previous referenced indexes or increse maximum reference index by 1). Some examples:
_paramFuncsStructure[].ctrlPtsArcRefIdx = [0,0,0] ok! means one arc parameter set for all 3 functions;
_paramFuncsStructure[].ctrlPtsArcRefIdx = [0,1,0] ok! means one arc parameter set for function 0 and 2 and another arc parameter set for function 1;
_paramFuncsStructure[].ctrlPtsArcRefIdx = [0,1,2] ok! means separate arc parameter set for each function;
_paramFuncsStructure[].ctrlPtsArcRefIdx = [0,2,1] inconsistent! indexes not consistent step-increasing;
Definition at line 41 of file param_func.cpp.
|
protectedpure virtual |
Called at end of init. To be used by extended classes.
Implemented in tuw::ParamFuncsSpline0Dist< TNumType, TFuncSize, TArcLatticeSize >, tuw::ParamFuncsSpline0Dist< TNumType, 2, 2 >, and tuw::ParamFuncsSpline0Dist< TNumType, 2, 1 >.
ParamFuncs & ParamFuncs::operator= | ( | const ParamFuncs & | _other | ) |
Definition at line 122 of file param_func.cpp.
|
delete |
|
pure virtual |
Precomputes cached data.
Implemented in tuw::ParamFuncsSpline0Dist< TNumType, TFuncSize, TArcLatticeSize >, tuw::ParamFuncsSpline0Dist< TNumType, 2, 2 >, and tuw::ParamFuncsSpline0Dist< TNumType, 2, 1 >.
|
pure virtual |
Sets parametric function evaluation arc.
Implemented in tuw::ParamFuncsSpline0Dist< TNumType, TFuncSize, TArcLatticeSize >, tuw::ParamFuncsSpline0Dist< TNumType, 2, 2 >, and tuw::ParamFuncsSpline0Dist< TNumType, 2, 1 >.
void ParamFuncs::shiftStartCtrlPt | ( | const double & | _dt | ) |
Definition at line 148 of file param_func.cpp.
|
protected |
Maps the parametrized functions to their afferent arc parametrizations.
Definition at line 243 of file param_func.h.
|
protected |
Stores the control points for all the parametrized functions.
Definition at line 237 of file param_func.h.
|
private |
Stores the control points arc parameters for all the parametrized functions.
Definition at line 240 of file param_func.h.
|
protected |
Flags for required function computation modes.
Definition at line 234 of file param_func.h.
|
protected |
Arc parametrization at the beginning of the functions domain definitions (common for all functions).
Definition at line 246 of file param_func.h.
|
protected |
Arc parametrization at the end of the functions domain definitions (common for all functions).
Definition at line 249 of file param_func.h.
|
protected |
Arc parametrization at the evaluation point (set by setEvalArc)/.
Definition at line 252 of file param_func.h.
|
static |
Maximum number of computation modes (except the parametric function itself FUNC). Currently 4 other choices supported.
Definition at line 92 of file param_func.h.
|
protected |
Initialization structure "store" variable.
Definition at line 255 of file param_func.h.