3 #include <fluxionum/Function.h>
4 #include <fluxionum/LinearPiecesFunction.h>
32 template <
typename A,
typename B>
85 arma::Col<B>
eval(A
const &x)
override{
105 inline arma::Col<B>
getSlope(
size_t const i=0)
const
106 {
return slope.row(i).as_col();}
Abstract class representing a function.
Definition: Function.h:27
size_t findIndex(A const &x) const
Obtain the index identifying the interval where belongs to. It is, find such that .
Definition: LinearPiecesFunction.h:115
Parametric linear pieces function.
Definition: ParametricLinearPiecesFunction.h:35
arma::Col< A > const & start
The set of sorted start points.
Definition: ParametricLinearPiecesFunction.h:43
ParametricLinearPiecesFunction(Col< A > const &start, Mat< B > const &slope, Mat< B > const &intercept)
ParametricLinearPiecesFunction default constructor.
Definition: ParametricLinearPiecesFunction.h:64
arma::Col< B > getSlope(size_t const i=0) const
Obtain the -th slope vector of the linear function.
Definition: ParametricLinearPiecesFunction.h:105
size_t findIndex(A const &x) const
Definition: ParametricLinearPiecesFunction.h:121
arma::Mat< B > const & slope
The slope for each piece so is the slope of the -th variable at the -th interval.
Definition: ParametricLinearPiecesFunction.h:48
A getStart(size_t const i=0) const
Definition: ParametricLinearPiecesFunction.h:96
arma::Col< B > getIntercept(size_t const i=0) const
Obtain the -th intercept vector of the linear function.
Definition: ParametricLinearPiecesFunction.h:116
arma::Mat< B > const & intercept
The intercept for each piece so is the intercept of the -th variable at the -th interval.
Definition: ParametricLinearPiecesFunction.h:53
arma::Col< B > eval(A const &x) override
Calculate the image of by assuming a linear behavior for each component. In this context,...
Definition: ParametricLinearPiecesFunction.h:85