3 #include <fluxionum/IterativeEulerMethod.h>
24 template <
typename A,
typename B>
39 arma::Col<A>
const &
ta;
44 arma::Col<B>
const &
ya;
70 arma::Col<A>
const &
ta,
71 arma::Col<B>
const &
ya,
90 B
eval(A
const &h)
override{
94 if((
i<
ta.n_elem-1) && (th >=
ta.at(
i+1))){
95 for(
size_t j =
ta.n_elem-1 ; j >
i ; --j){
97 tdiff = h-(
ta.at(j)-
t);
122 inline arma::Col<A>
const &
getTa()
const {
return ta;}
126 inline arma::Col<B>
const &
getYa()
const {
return ya;}
Fixed iterative Euler method.
Definition: FixedIterativeEulerMethod.h:25
arma::Col< A > const & getTa() const
Definition: FixedIterativeEulerMethod.h:122
void setCurrentPieceIndex(size_t const i)
Definition: FixedIterativeEulerMethod.h:134
B eval(A const &h) override
Compute the iterative Euler method but considering given fixed frontiers.
Definition: FixedIterativeEulerMethod.h:90
arma::Col< A > const & ta
The frontiers such that . For the last frontier, the interval is .
Definition: FixedIterativeEulerMethod.h:39
arma::Col< B > const & ya
The value of at each of the frontiers such that .
Definition: FixedIterativeEulerMethod.h:44
arma::Col< B > const & getYa() const
Definition: FixedIterativeEulerMethod.h:126
FixedIterativeEulerMethod(Function< A, B > &dydt, A const &t0, B const &y0, arma::Col< A > const &ta, arma::Col< B > const &ya, size_t const i=0)
FixedIterativeEulerMethod default constructor.
Definition: FixedIterativeEulerMethod.h:66
size_t i
The index of the current piece.
Definition: FixedIterativeEulerMethod.h:52
void restart() override
Definition: FixedIterativeEulerMethod.h:112
size_t getCurrentPieceIndex() const
Definition: FixedIterativeEulerMethod.h:130
Abstract class representing a function.
Definition: Function.h:27
Iterative Euler method.
Definition: IterativeEulerMethod.h:26
A t
The current value of .
Definition: IterativeEulerMethod.h:49
B eval(A const &h) override
Iteratively compute the next value using Euler method.
Definition: IterativeEulerMethod.h:100
Function< A, B > & dydt
Reference to the derivative function.
Definition: IterativeEulerMethod.h:38
A t0
The initial value of , .
Definition: IterativeEulerMethod.h:43
virtual void restart()
Restart the IterativeEulerMethod so it is at its initial state again .
Definition: IterativeEulerMethod.h:110
B y0
The initial value of , .
Definition: IterativeEulerMethod.h:54
B y
The current value of .
Definition: IterativeEulerMethod.h:60