94 template<
typename TyT>
96 double initial_time,
int fact_resize_i)
97 :
Evolution<TyT>(initial_value, initial_j, initial_time, 100),
98 fact_resize(fact_resize_i)
102 template<
typename TyT>
105 fact_resize(fact_resize_i)
109 template<
typename TyT>
112 fact_resize(evo.fact_resize)
122 template<
typename TyT>
131 template<
typename TyT>
137 for (
int j=0; j<size; j++) {
138 step[j] = evo.
step[j] ;
141 for (
int j=0; j<size; j++) {
146 for (
int j=0; j<size; j++) {
153 for (
int j=0; j<size; j++) {
154 if (evo.
val[j] != 0x0) {
155 val[j] =
new TyT( *(evo.
val[j]) ) ;
165 template<
typename TyT>
168 cerr <<
"void Evolution_full<TyT>::operator= : not implemented yet ! \n" ;
175 template<
typename TyT>
182 int pos = position(j) ;
183 assert( fabs(the_time[pos] - time_j) < 1.e-14 ) ;
184 assert( val[pos] != &new_value ) ;
186 val[pos] =
new TyT(new_value) ;
190 if ( (pos_jtop != -1) && (j < step[pos_jtop]) ) {
192 "Evolution_full<TyT>::update : the time step j = " 193 << j <<
" must be in the future\n" 194 <<
" of the last stored time step (" << step[pos_jtop] <<
") !" 201 if (pos_jtop == size) {
204 int size_new = fact_resize * size ;
206 int* step_new =
new int[size_new] ;
207 for (
int i=0; i<size; i++) {
208 step_new[i] = step[i] ;
210 for (
int i=size; i<size_new; i++) {
211 step_new[i] = UNDEF_STEP ;
214 double* the_time_new =
new double[size_new] ;
215 for (
int i=0; i<size; i++) {
216 the_time_new[i] = the_time[i] ;
218 for (
int i=size; i<size_new; i++) {
219 the_time_new[i] = -1e20 ;
222 TyT** val_new =
new TyT*[size_new] ;
223 for (
int i=0; i<size; i++) {
224 val_new[i] = val[i] ;
226 for (
int i=size; i<size_new; i++) {
234 the_time = the_time_new ;
240 assert( pos_jtop < size ) ;
241 assert( val[pos_jtop] == 0x0 ) ;
245 the_time[pos_jtop] = time_j ;
246 val[pos_jtop] =
new TyT( new_value ) ;
TyT ** val
Array of pointers onto the values (size = size).
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.
int * step
Array of time step indices (size = size).
double * the_time
Array of values of t at the various time steps (size = size).
Time evolution (*** under development ***).
Time evolution with full storage (*** under development ***).