[BACK]Return to continuation_parameters.adb CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Continuation

Annotation of OpenXM_contrib/PHC/Ada/Continuation/continuation_parameters.adb, Revision 1.1.1.1

1.1       maekawa     1: package body Continuation_Parameters is
                      2:
                      3:   procedure Tune ( estimate_for_condition : in natural ) is
                      4:   begin
                      5:     condition  := estimate_for_condition;
                      6:     block_size := 1;
                      7:     max_steps  := 500*(condition + 1);
                      8:     max_reruns := condition + 1;
                      9:     predictor_path_type := 0;
                     10:     min_path_step_size := 10.0**(-6 - condition/4);
                     11:     max_path_step_size := 0.1/(double_float(condition+1));
                     12:     success_path_steps := 1 + condition;
                     13:     if condition >= 4
                     14:      then relative_path_residual   := 10.0**( -9 - condition mod 4);
                     15:           absolute_path_residual   := 10.0**( -9 - condition mod 4);
                     16:           relative_path_correction := 10.0**( -9 - condition mod 4);
                     17:           absolute_path_correction := 10.0**( -9 - condition mod 4);
                     18:           relative_endg_residual   := 10.0**(-11 - condition mod 4);
                     19:           absolute_endg_residual   := 10.0**(-11 - condition mod 4);
                     20:           relative_endg_correction := 10.0**(-11 - condition mod 4);
                     21:           absolute_endg_correction := 10.0**(-11 - condition mod 4);
                     22:     end if;
                     23:     Tune_Endgm_Pred(endext_order);
                     24:   end Tune;
                     25:
                     26:   procedure Tune_Endgm_Pred ( extrapolation_order : in natural ) is
                     27:   begin
                     28:     if extrapolation_order = 0
                     29:      then min_endg_step_size := 10.0**(-8 - condition/4);
                     30:           max_endg_step_size := 0.1/(double_float(condition+2));
                     31:           success_endg_steps := 3 + condition;
                     32:      else if predictor_path_type <= 2
                     33:            then predictor_endg_type := 2;
                     34:            else predictor_endg_type := 5;
                     35:           end if;
                     36:           min_endg_step_size := min_path_step_size;
                     37:           max_endg_step_size := 0.5;
                     38:           reduction_endg_factor := 0.5;
                     39:           expansion_endg_factor := 1.7;
                     40:           success_endg_steps := 3 + condition;
                     41:     end if;
                     42:   end Tune_Endgm_Pred;
                     43:
                     44:   function Create_for_Path return Pred_Pars is
                     45:
                     46:     res : Pred_Pars;
                     47:
                     48:   begin
                     49:     res.maxstep := max_path_step_size;
                     50:     res.minstep := min_path_step_size;
                     51:     res.expfac  := expansion_path_factor;
                     52:     res.redfac  := reduction_path_factor;
                     53:     res.success_steps := success_path_steps;
                     54:     res.predictor_type := predictor_path_type;
                     55:     res.dist_target := start_end_game;
                     56:     res.power := power_of_t;
                     57:     return res;
                     58:   end Create_for_Path;
                     59:
                     60:   function Create_End_Game return Pred_Pars is
                     61:
                     62:     res : Pred_Pars;
                     63:
                     64:   begin
                     65:     res.maxstep := max_endg_step_size;
                     66:     res.minstep := min_endg_step_size;
                     67:     res.expfac  := expansion_endg_factor;
                     68:     res.redfac  := reduction_endg_factor;
                     69:     res.success_steps := success_endg_steps;
                     70:     res.predictor_type := predictor_endg_type;
                     71:     res.dist_target := 0.0;
                     72:     res.power := power_of_t;
                     73:     return res;
                     74:   end Create_End_Game;
                     75:
                     76:   function Create_for_Path return Corr_Pars is
                     77:
                     78:     res : Corr_Pars;
                     79:
                     80:   begin
                     81:     res.epsrx  := relative_path_correction;
                     82:     res.epsax  := absolute_path_correction;
                     83:     res.epsrf  := relative_path_residual;
                     84:     res.epsaf  := absolute_path_residual;
                     85:     res.maxit  := max_path_iter;
                     86:     res.maxtot := max_steps*res.maxit;
                     87:     return res;
                     88:   end Create_for_Path;
                     89:
                     90:   function Create_End_Game return Corr_Pars is
                     91:
                     92:     res : Corr_Pars;
                     93:
                     94:   begin
                     95:     res.epsrx  := relative_endg_correction;
                     96:     res.epsax  := absolute_endg_correction;
                     97:     res.epsrf  := relative_endg_residual;
                     98:     res.epsaf  := absolute_endg_residual;
                     99:     res.maxit  := max_endg_iter;
                    100:     res.maxtot := max_steps*res.maxit;
                    101:     return res;
                    102:   end Create_End_Game;
                    103:
                    104: end Continuation_Parameters;

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>