Annotation of OpenXM_contrib/PHC/Ada/Continuation/dispatch_predictors.adb, Revision 1.1.1.1
1.1 maekawa 1: with Predictors; use Predictors;
2:
3: package body Dispatch_Predictors is
4:
5: procedure Single_Predictor
6: ( s : in out Solu_Info; p : in Pred_Pars;
7: prev_x,prev_v : in Vector; v : in out Vector;
8: prev_t,target : in Complex_Number;
9: step,tol : in double_float; trial : in out natural ) is
10:
11: procedure TR_Predictor is new Tangent_Single_Real_Predictor(Norm,dH,dH);
12: procedure TC_Predictor is new Tangent_Single_Complex_Predictor(Norm,dH,dH);
13: procedure TG_Predictor is new Tangent_Geometric_Predictor(Norm,dH,dH);
14: procedure HR_Predictor is new Hermite_Single_Real_Predictor(Norm,dH,dH);
15:
16: begin
17: case p.predictor_type is
18: when 0 => Secant_Single_Real_Predictor
19: (s.sol.v,prev_x,s.sol.t,prev_t,target,step,tol,p.power);
20: when 1 => Secant_Single_Complex_Predictor
21: (s.sol.v,prev_x,s.sol.t,prev_t,target,step,tol,
22: p.dist_target,trial);
23: when 2 => Secant_Geometric_Predictor
24: (s.sol.v,prev_x,s.sol.t,prev_t,target,step,tol);
25: when 3 => TR_Predictor(s.sol.v,s.sol.t,target,step,tol,p.power);
26: s.nsyst := s.nsyst + 1;
27: when 4 => TC_Predictor
28: (s.sol.v,s.sol.t,target,step,tol,p.dist_target,trial);
29: s.nsyst := s.nsyst + 1;
30: when 5 => TG_Predictor(s.sol.v,s.sol.t,target,step,tol);
31: s.nsyst := s.nsyst + 1;
32: when 6 => HR_Predictor
33: (s.sol.v,prev_x,s.sol.t,prev_t,target,v,prev_v,step,tol);
34: s.nsyst := s.nsyst + 1;
35: when others => null;
36: end case;
37: end Single_Predictor;
38:
39: procedure Multiple_Predictor
40: ( s : in out Solu_Info_Array; p : in Pred_Pars;
41: sa : in out Solution_Array; prev_sa : in Solution_Array;
42: t : in out Complex_Number; prev_t,target : in Complex_Number;
43: step,tol,dist : in double_float; trial : in natural ) is
44:
45: cnt : natural := 0;
46:
47: procedure TR_Predictor is new Tangent_Multiple_Real_Predictor(Norm,dH,dH);
48: procedure TC_Predictor is
49: new Tangent_Multiple_Complex_Predictor(Norm,dH,dH);
50:
51: begin
52: case p.predictor_type is
53: when 0 => Secant_Multiple_Real_Predictor
54: (sa,prev_sa,t,prev_t,target,step,tol,dist,p.power);
55: when 1 => Secant_Multiple_Complex_Predictor
56: (sa,prev_sa,t,prev_t,target,step,tol,dist,
57: p.dist_target,trial);
58: when 3 => TR_Predictor(sa,t,target,step,tol,dist,cnt,p.power);
59: for k in s'range loop
60: s(k).nsyst := s(k).nsyst + 1;
61: end loop;
62: when 4 => TC_Predictor
63: (sa,t,target,step,tol,dist,p.dist_target,trial,cnt);
64: for k in s'range loop
65: s(k).nsyst := s(k).nsyst + 1;
66: end loop;
67: when others => null;
68: end case;
69: end Multiple_Predictor;
70:
71: end Dispatch_Predictors;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>