94 int initial_j,
double initial_time)
95 :
Evolution<TyT>(initial_value, initial_j, initial_time, nstored)
105template<
typename TyT>
118template<
typename TyT>
128template<
typename TyT>
134 for (
int j=0; j<size; j++) {
135 step[j] = evo.
step[j] ;
138 for (
int j=0; j<size; j++) {
143 for (
int j=0; j<size; j++) {
150 for (
int j=0; j<size; j++) {
151 if (evo.
val[j] != 0x0) {
152 val[j] =
new TyT( *(evo.
val[j]) ) ;
160template<
typename TyT>
163 cerr <<
"void Evolution_std<TyT>::operator= : not implemented yet ! \n" ;
170template<
typename TyT>
176 int pos = position(j) ;
177 assert( fabs(the_time[pos] - time_j) < 1.e-14 ) ;
178 assert( val[pos] != &new_value ) ;
180 val[pos] =
new TyT(new_value) ;
185 if ( (pos_jtop != -1) && (j < step[pos_jtop]) ) {
187 "Evolution_std<TyT>::update : the time step j = "
188 << j <<
" must be in the future\n"
189 <<
" of the last stored time step (" << step[pos_jtop] <<
") !"
196 if (pos_jtop == size) {
199 if ( val[0] != 0x0 )
delete val[0] ;
201 for (
int i=0; i<size-1; i++) {
202 step[i] = step[i+1] ;
203 the_time[i] = the_time[i+1] ;
211 assert( pos_jtop < size ) ;
212 assert( val[pos_jtop] == 0x0 ) ;
216 the_time[pos_jtop] = time_j ;
217 val[pos_jtop] =
new TyT( new_value ) ;
Time evolution with partial storage (*** under development ***).
virtual void operator=(const Evolution_std< TyT > &t_in)
Assignement to another Evolution_std.
Evolution_std(const TyT &initial_value, int nstored, int initial_j=0, double initial_time=0.)
Constructor from initial value.
virtual ~Evolution_std()
Destructor.
virtual void update(const TyT &new_value, int j, double time_j)
Sets a new value at a given time step.
Time evolution (*** under development ***).
TyT ** val
Array of pointers onto the values (size = size).
int size
Maximum number of stored time steps.
int * step
Array of time step indices (size = size).
int pos_jtop
Position in the arrays step, the_time and val of the most evolved time step.
double * the_time
Array of values of t at the various time steps (size = size).