Helios++
Helios software for LiDAR simulations
fluxionum::ParametricLinearPiecesFunction< A, B > Class Template Reference

Parametric linear pieces function. More...

#include <ParametricLinearPiecesFunction.h>

Inheritance diagram for fluxionum::ParametricLinearPiecesFunction< A, B >:
Collaboration diagram for fluxionum::ParametricLinearPiecesFunction< A, B >:

Public Member Functions

 ParametricLinearPiecesFunction (Col< A > const &start, Mat< B > const &slope, Mat< B > const &intercept)
 ParametricLinearPiecesFunction default constructor. More...
 
arma::Col< B > eval (A const &x) override
 Calculate the image of \(x\) by \(f\) assuming a linear behavior for each component. In this context, \(a_{ij}\) is the slope for the \(j\)-th variable while \(b_{ij}\) is the intercept for the \(j\)-th variable. More...
 
getStart (size_t const i=0) const
 
arma::Col< B > getSlope (size_t const i=0) const
 Obtain the \(i\)-th slope vector \(a_i = (a_{i1}, \ldots, a_{in})\) of the linear function. More...
 
arma::Col< B > getIntercept (size_t const i=0) const
 Obtain the \(i\)-th intercept vector \(b_i = (b_{i1}, \ldots, b_{in})\) of the linear function. More...
 
size_t findIndex (A const &x) const
 
- Public Member Functions inherited from fluxionum::Function< A, arma::Col< B > >
 Function ()=default
 
arma::Col< B > operator() (A const &x)
 Evaluate the function \(f(x)=y\). More...
 

Protected Attributes

arma::Col< A > const & start
 The set \(S\) of \(m\) sorted start points. More...
 
arma::Mat< B > const & slope
 The slope for each piece so \(a_{ij}\) is the slope of the \(j\)-th variable at the \(i\)-th interval.
 
arma::Mat< B > const & intercept
 The intercept for each piece so \(b_{ij}\) is the intercept of the \(j\)-th variable at the \(i\)-th interval.
 

Detailed Description

template<typename A, typename B>
class fluxionum::ParametricLinearPiecesFunction< A, B >

Parametric linear pieces function.

Author
Alberto M. Esmoris Pena
Version
1.0

\[ f(x) = \left[\begin{array}{c} a_{i1}x + b_{i1} \\ \vdots \\ a_{in}x + b_{in} \end{array}\right] \]

The \(i\)-th index comes from \(S\), the sorted set of \(m\) interval boundaries described for fluxionum::LinearPiecesFunction

Notice the domain is not \(B\) but \(B^n\)

See also
fluxionum::Function
fluxionum::LinearPiecesFunction

Constructor & Destructor Documentation

◆ ParametricLinearPiecesFunction()

template<typename A , typename B >
fluxionum::ParametricLinearPiecesFunction< A, B >::ParametricLinearPiecesFunction ( Col< A > const &  start,
Mat< B > const &  slope,
Mat< B > const &  intercept 
)
inline

Member Function Documentation

◆ eval()

template<typename A , typename B >
arma::Col<B> fluxionum::ParametricLinearPiecesFunction< A, B >::eval ( A const &  x)
inlineoverridevirtual

Calculate the image of \(x\) by \(f\) assuming a linear behavior for each component. In this context, \(a_{ij}\) is the slope for the \(j\)-th variable while \(b_{ij}\) is the intercept for the \(j\)-th variable.

Parameters
xThe input value belonging to the domain of the function
Returns
The image of \(x\) by \(ft\)

Implements fluxionum::Function< A, arma::Col< B > >.

◆ findIndex()

template<typename A , typename B >
size_t fluxionum::ParametricLinearPiecesFunction< A, B >::findIndex ( A const &  x) const
inline

◆ getIntercept()

template<typename A , typename B >
arma::Col<B> fluxionum::ParametricLinearPiecesFunction< A, B >::getIntercept ( size_t const  i = 0) const
inline

Obtain the \(i\)-th intercept vector \(b_i = (b_{i1}, \ldots, b_{in})\) of the linear function.

Parameters
iIndex of the intercept vector to be obtained. In case there are no multiple intercept vectors, the default value \(i=0\) must be used.
Returns
The \(i\)-th intercept vector \(b_i = (b_{i1}, \ldots, b_{in})\) of the linear function

◆ getSlope()

template<typename A , typename B >
arma::Col<B> fluxionum::ParametricLinearPiecesFunction< A, B >::getSlope ( size_t const  i = 0) const
inline

Obtain the \(i\)-th slope vector \(a_i = (a_{i1}, \ldots, a_{in})\) of the linear function.

Parameters
iIndex of the slope vector to be obtained. In case there are no multiple slope vectors, the default value \(i=0\) must be used.
Returns
The \(i\)-th slope vector \(a_i = (a_{i1}, \ldots, a_{in})\) of the linear function

◆ getStart()

template<typename A , typename B >
A fluxionum::ParametricLinearPiecesFunction< A, B >::getStart ( size_t const  i = 0) const
inline

Member Data Documentation

◆ start

template<typename A , typename B >
arma::Col<A> const& fluxionum::ParametricLinearPiecesFunction< A, B >::start
protected

The set \(S\) of \(m\) sorted start points.

See also
fluxionum::LinearPiecesFunction::start

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