Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
tuw::ParamFuncs Class Referenceabstract

Storage and manipulation of parametric functions collection. More...

#include <param_func.h>

Inheritance diagram for tuw::ParamFuncs:
Inheritance graph
[legend]

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...
 
FuncCtrlPtctrlPt (const std::size_t &_funcIdx, const std::size_t &_funcCtrlPtIdx)
 Access of a parametric function control point. More...
 
const FuncCtrlPtctrlPt (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...
 
ParamFuncsoperator= (const ParamFuncs &)
 
ParamFuncsoperator= (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< FuncEvalModesFlagsfuncEvalReq_
 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< ParamFuncsStructureparamFuncsStructure_
 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...
 

Detailed Description

Storage and manipulation of parametric functions collection.

Todo:

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.

Member Typedef Documentation

Definition at line 95 of file param_func.h.

Member Enumeration Documentation

Control point variable dimension.

Enumerator
VAL 

control point value

ARC 

control point arc parameter

Definition at line 73 of file param_func.h.

Flags if any guarantees about evaluation arc relative to last evaluation arc are present.

Enumerator
NONE 
AFTER_LAST 

previous evaluation arc <= this evaluation arc

BEFORE_LAST 

previous evaluation arc >= this evaluation arc

AT_BEGIN 

this evaluation arc is at the arc parametrization begin

AT_END 

this evaluation arc is at the arc parametrization end

Definition at line 80 of file param_func.h.

Required type of computation relative to the parametric function.

Enumerator
DIFF1 

function first derivative

DIFF2 

function second derivative

INT1 

function single integral

INT2 

function double integral

FUNC 

function value (always assumed to have the highest integer value of the enum)

ENUM_SIZE 

Definition at line 62 of file param_func.h.

Constructor & Destructor Documentation

tuw::ParamFuncs::ParamFuncs ( )
default
virtual tuw::ParamFuncs::~ParamFuncs ( )
virtualdefault
ParamFuncs::ParamFuncs ( const ParamFuncs _other)

Definition at line 102 of file param_func.cpp.

tuw::ParamFuncs::ParamFuncs ( ParamFuncs &&  )
delete

Member Function Documentation

virtual double tuw::ParamFuncs::computeFuncDiff1 ( const std::size_t &  _funcIdx) const
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 >.

virtual double tuw::ParamFuncs::computeFuncDiff2 ( const std::size_t &  _funcIdx) const
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 >.

virtual double tuw::ParamFuncs::computeFuncInt1 ( const std::size_t &  _funcIdx) const
pure virtual
virtual double tuw::ParamFuncs::computeFuncInt2 ( const std::size_t &  _funcIdx) const
pure virtual
virtual double tuw::ParamFuncs::computeFuncVal ( const std::size_t &  _funcIdx) const
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.

Parameters
_paramFuncsStructureparametric 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.

void ParamFuncs::initBase ( const std::vector< tuw::ParamFuncs::ParamFuncsStructure > &  _paramFuncsStructure)
private

Initializes the control structure for the base class.

Parameters
_paramFuncsStructureparametric 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.

virtual void tuw::ParamFuncs::initImpl ( )
protectedpure virtual
ParamFuncs & ParamFuncs::operator= ( const ParamFuncs _other)

Definition at line 122 of file param_func.cpp.

ParamFuncs& tuw::ParamFuncs::operator= ( ParamFuncs &&  )
delete
virtual void tuw::ParamFuncs::precompute ( )
pure virtual
virtual void tuw::ParamFuncs::setEvalArc ( const double &  _funcsArcEval,
const EvalArcGuarantee _evalArcGuarantee = EvalArcGuarantee::NONE 
)
pure virtual
void ParamFuncs::shiftStartCtrlPt ( const double &  _dt)
Todo:
not nice

Definition at line 148 of file param_func.cpp.

Member Data Documentation

std::vector<std::size_t> tuw::ParamFuncs::func2Arc_
protected

Maps the parametrized functions to their afferent arc parametrizations.

Definition at line 243 of file param_func.h.

std::vector<std::vector<FuncCtrlPt> > tuw::ParamFuncs::funcCtrlPt_
protected

Stores the control points for all the parametrized functions.

Definition at line 237 of file param_func.h.

std::vector<std::vector<double> > tuw::ParamFuncs::funcCtrlPtArc_
private

Stores the control points arc parameters for all the parametrized functions.

Definition at line 240 of file param_func.h.

std::vector<FuncEvalModesFlags> tuw::ParamFuncs::funcEvalReq_
protected

Flags for required function computation modes.

Definition at line 234 of file param_func.h.

double tuw::ParamFuncs::funcsArcBegin_
protected

Arc parametrization at the beginning of the functions domain definitions (common for all functions).

Definition at line 246 of file param_func.h.

double tuw::ParamFuncs::funcsArcEnd_
protected

Arc parametrization at the end of the functions domain definitions (common for all functions).

Definition at line 249 of file param_func.h.

double tuw::ParamFuncs::funcsArcEval_
protected

Arc parametrization at the evaluation point (set by setEvalArc)/.

Definition at line 252 of file param_func.h.

constexpr const std::size_t tuw::ParamFuncs::nrModesMax_ = asInt(FuncEvalMode::ENUM_SIZE) - 1
static

Maximum number of computation modes (except the parametric function itself FUNC). Currently 4 other choices supported.

See also
FuncEvalMode.

Definition at line 92 of file param_func.h.

std::vector<ParamFuncsStructure> tuw::ParamFuncs::paramFuncsStructure_
protected

Initialization structure "store" variable.

Definition at line 255 of file param_func.h.


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


tuw_control
Author(s): George Todoran
autogenerated on Mon Jun 10 2019 15:27:23