3 #include <fluxionum/Function.h>
27 template <
typename A,
typename B>
36 arma::Col<A>
const &
t;
42 arma::Col<B>
const &
y;
60 arma::Col<A>
const &
t,
61 arma::Col<B>
const &
y,
90 B
eval(A
const &tx)
override{
92 if((
i < (
t.n_elem)-1) && (tx >=
t.at(
i+1) || tx <
t.at(
i))){
93 if(
i < (
t.n_elem-2) && tx <
t.at(
i+2)) ++
i;
96 for(
size_t j =
t.n_elem-1 ; j > 0 ; --j){
119 inline arma::Col<A>
const &
getT()
const {
return t;}
123 inline arma::Col<B>
const &
getY()
const {
return y;}
Closest lesser sample function.
Definition: ClosestLesserSampleFunction.h:28
size_t i
The index of the current sorted domain sample.
Definition: ClosestLesserSampleFunction.h:46
arma::Col< B > const & y
The vector of sorted image components such that .
Definition: ClosestLesserSampleFunction.h:42
arma::Col< B > const & getY() const
Definition: ClosestLesserSampleFunction.h:123
arma::Col< A > const & t
The vector of sorted domain components .
Definition: ClosestLesserSampleFunction.h:36
virtual void restart()
Restart the ClosestLesserSampleFunction so it is at its initial state again (it is,...
Definition: ClosestLesserSampleFunction.h:112
ClosestLesserSampleFunction< A, B > & operator=(ClosestLesserSampleFunction< A, B > const &clsf)
Assignment reference operator.
Definition: ClosestLesserSampleFunction.h:76
void setCurrentSampleIndex(size_t const i)
Definition: ClosestLesserSampleFunction.h:131
size_t getCurrentSampleIndex() const
Definition: ClosestLesserSampleFunction.h:127
B eval(A const &tx) override
Find the sample with closest lesser domain with respect to given and return its known image .
Definition: ClosestLesserSampleFunction.h:90
arma::Col< A > const & getT() const
Definition: ClosestLesserSampleFunction.h:119
ClosestLesserSampleFunction(arma::Col< A > const &t, arma::Col< B > const &y, size_t const i=0)
ClosestLesserSampleFunction default constructor.
Definition: ClosestLesserSampleFunction.h:59
Abstract class representing a function.
Definition: Function.h:27