28 #ifndef __EVOLUTION_H_ 29 #define __EVOLUTION_H_ 102 #define UNDEF_STEP -100000 151 Evolution(
const TyT& initial_value,
int initial_j,
152 double initial_time,
int initial_size) ;
169 virtual void update(
const TyT& new_value,
int j,
248 void save(
const char* filename)
const ;
310 double initial_time = 0.,
int fact_resize_i = 2) ;
334 virtual void update(
const TyT& new_value,
int j,
399 int initial_j = 0,
double initial_time = 0.) ;
420 virtual void update(
const TyT& new_value,
int j,
double time_j) ;
440 #include "Template/evolution.C" 441 #include "Template/evolution_full.C" 442 #include "Template/evolution_std.C" int position(int j) const
Gives the position in the arrays step, the_time and val corresponding to the time step j...
Evolution_std(const TyT &initial_value, int nstored, int initial_j=0, double initial_time=0.)
Constructor from initial value.
int j_min() const
Returns the smaller time step j stored in *this.
TyT operator()(double t, int order=2) const
Returns the value at time t, with a scheme of order order.
virtual void update(const TyT &new_value, int j, double time_j)
Sets a new value at a given time step.
virtual ~Evolution_full()
Destructor.
double get_time(int j) const
Returns the time t at time step j.
virtual ~Evolution()
Destructor.
TyT ** val
Array of pointers onto the values (size = size).
virtual void update(const TyT &new_value, int j, double time_j)
Sets a new value at a given time step.
int size
Maximum number of stored time steps.
int fact_resize
Factor by which the size size of the arrays val and the_time are to be multiplied when their limits h...
Evolution_full(const TyT &initial_value, int initial_j=0, double initial_time=0., int fact_resize_i=2)
Constructor from initial value.
int pos_jtop
Position in the arrays step, the_time and val of the most evolved time step.
TyT time_derive(int j, int n=2) const
Computes the time derivative at time step j by means of a n-th order scheme, from the values at steps...
virtual void operator=(const Evolution_full< TyT > &t_in)
Assignement to another Evolution_full.
bool is_known(int j) const
Checks whether the value a given time step has been set.
Evolution(const TyT &initial_value, int initial_j, double initial_time, int initial_size)
Constructor from some initial value.
virtual ~Evolution_std()
Destructor.
const TyT & operator[](int j) const
Returns the value at time step j.
Time evolution with partial storage (*** under development ***).
int * step
Array of time step indices (size = size).
void downdate(int j)
Suppresses a stored value.
double * the_time
Array of values of t at the various time steps (size = size).
int j_max() const
Returns the larger time step j stored in *this.
virtual void operator=(const Evolution_std< TyT > &t_in)
Assignement to another Evolution_std.
Time evolution (*** under development ***).
int get_size() const
Returns the member size.
virtual void update(const TyT &new_value, int j, double time_j)=0
Sets a new value at a given time step.
int next_position(int i) const
Returns the next valid position (returns -1 if none is found)
void save(const char *filename) const
Saves *this in a formatted file.
int previous_position(int i) const
Returns the previous valid position (returns -1 if none is found)
virtual void operator=(const Evolution< TyT > &t_in)
Assignement.
Time evolution with full storage (*** under development ***).