Annotation of OpenXM_contrib/PHC/Ada/Continuation/multprec_residual_evaluations.adb, Revision 1.1.1.1
1.1 maekawa 1: with integer_io; use integer_io;
2: with Multprec_Floating_Numbers_io; use Multprec_Floating_Numbers_io;
3: with Multprec_Complex_Norms_Equals; use Multprec_Complex_Norms_Equals;
4:
5: package body Multprec_Residual_Evaluations is
6:
7: function Residual ( p_eval : Eval_Poly_Sys; zero : Vector )
8: return Floating_Number is
9:
10: res : Floating_Number;
11: eva : Vector(p_eval'range) := Eval(p_eval,zero);
12:
13: begin
14: res := Max_Norm(eva);
15: Clear(eva);
16: return res;
17: end Residual;
18:
19: procedure Residual ( file : in file_type;
20: p_eval : in Eval_Poly_Sys; sol : in Solution ) is
21:
22: res : Floating_Number := Residual(p_eval,sol.v);
23:
24: begin
25: put(file,res);
26: Clear(res);
27: end Residual;
28:
29: procedure Residuals ( file : in file_type;
30: p_eval : in Eval_Poly_Sys; sols : in Solution_List ) is
31:
32: tmp : Solution_List := sols;
33: ls : Link_to_Solution;
34:
35: begin
36: for i in 1..Length_Of(sols) loop
37: ls := Head_Of(tmp);
38: put(file,"residual "); put(file,i,1); put(file," : ");
39: Residual(file,p_eval,ls.all);
40: new_line(file);
41: tmp := Tail_Of(tmp);
42: end loop;
43: end Residuals;
44:
45: end Multprec_Residual_Evaluations;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>