Annotation of OpenXM_contrib/PHC/Ada/Continuation/multprec_root_refiners.ads, Revision 1.1
1.1 ! maekawa 1: with text_io; use text_io;
! 2: with Multprec_Floating_Numbers; use Multprec_Floating_Numbers;
! 3: with Multprec_Complex_Poly_Systems; use Multprec_Complex_Poly_Systems;
! 4: with Multprec_Complex_Poly_SysFun; use Multprec_Complex_Poly_SysFun;
! 5: with Multprec_Complex_Jaco_Matrices; use Multprec_Complex_Jaco_Matrices;
! 6: with Multprec_Complex_Solutions; use Multprec_Complex_Solutions;
! 7:
! 8: package Multprec_Root_Refiners is
! 9:
! 10: -- DESCRIPTION:
! 11: -- The aim of this package is to provide some routines to
! 12: -- perform root refining, to validate the approximate solutions.
! 13: -- It can be used as a postprocessor to check the computed roots,
! 14: -- or, as preprocessor, to find some suitable starting values for
! 15: -- the continuation procedure.
! 16:
! 17: -- The basic root refiner is Newton's method. There are two versions
! 18: -- provided : a silent and a reporting version. The reporting version puts
! 19: -- intermediate results on file during the iterations, while the silent
! 20: -- version simply returns the refined solutions.
! 21:
! 22: -- NEWTON'S METHOD :
! 23:
! 24: procedure Silent_Newton
! 25: ( p_eval : in Eval_Poly_Sys; j_eval : in Eval_Jaco_Mat;
! 26: zero : in out Solution; epsxa,epsfa : in Floating_Number;
! 27: numit : in out natural; max : in natural; fail : out boolean );
! 28:
! 29: procedure Reporting_Newton
! 30: ( file : in file_type;
! 31: p_eval : in Eval_Poly_Sys; j_eval : in Eval_Jaco_Mat;
! 32: zero : in out Solution; epsxa,epsfa : in Floating_Number;
! 33: numit : in out natural; max : in natural; fail : out boolean );
! 34:
! 35: -- DESCRIPTION :
! 36: -- Newton's method is applied to refine the approximation of a root.
! 37: -- The stopping criteria are:
! 38: -- * numit > max (maximum number of iterations is exceeded);
! 39: -- * zero.err < epsxa (accuracy for x is reached);
! 40: -- * zero.res < epsfa (tolerance for residual is reached).
! 41: -- When one of these conditions is fulfilled, the procedure stops.
! 42:
! 43: -- ON ENTRY :
! 44: -- file to write intermediate results on;
! 45: -- p_eval evaluable form of the polynomial system;
! 46: -- j_eval evaluable form of the Jacobian matrix;
! 47: -- zero starting value;
! 48: -- epsxa maximum absolute error on the zero;
! 49: -- epsfa maximum absolute value of the residue;
! 50: -- numit number of iterations, to be initialized with zero;
! 51: -- max maximum number of iterations.
! 52:
! 53: -- ON RETURN :
! 54: -- zero refined root;
! 55: -- numit number of iterations performed;
! 56: -- fail is true when the desired precision is not reached.
! 57:
! 58: -- APPLICATION of Newton's Method on a list of solutions.
! 59: -- The silent versions simply perform the calculations.
! 60: -- The reporting root refiners allow the output of intermediate results and
! 61: -- produce a summary of the calculations.
! 62: -- With each version, an additional output parameter can be supplied to
! 63: -- contain only those solutions that satisfy the accuracy requirements.
! 64:
! 65: procedure Silent_Root_Refiner
! 66: ( p : in Poly_Sys; sols : in out Solution_List;
! 67: epsxa,epsfa,tolsing : in Floating_Number;
! 68: numit : in out natural; max : in natural );
! 69:
! 70: procedure Silent_Root_Refiner
! 71: ( p : in Poly_Sys; sols,refsols : in out Solution_List;
! 72: epsxa,epsfa,tolsing : in Floating_Number;
! 73: numit : in out natural; max : in natural );
! 74:
! 75: procedure Reporting_Root_Refiner
! 76: ( file : in file_type;
! 77: p : in Poly_Sys; sols : in out Solution_List;
! 78: epsxa,epsfa,tolsing : in Floating_Number;
! 79: numit : in out natural; max : in natural; wout : in boolean );
! 80:
! 81: procedure Reporting_Root_Refiner
! 82: ( file : in file_type;
! 83: p : in Poly_Sys; sols,refsols : in out Solution_List;
! 84: epsxa,epsfa,tolsing : in Floating_Number;
! 85: numit : in out natural; max : in natural; wout : in boolean );
! 86:
! 87: -- DESCRIPTION :
! 88: -- The list of solutions sols is refined w.r.t. the system p.
! 89: -- The multiplicity of each solution in sols is determined as follows:
! 90: -- m = 0 : if the solution is singular and probably non isolated
! 91: -- or if the solution lies at infinity ( in fact no solution );
! 92: -- m = 1 : if the solution is regular;
! 93: -- m > 1 : a multiple solution with multiplicity m.
! 94:
! 95: -- ON ENTRY :
! 96: -- file file for writing diagnostics on;
! 97: -- p a polynomial system;
! 98: -- sols the start solutions;
! 99: -- epsxa maximum absolute error on the zero;
! 100: -- epsfa maximum absolute value for the residue;
! 101: -- tolsing tolerance on inverse condition number for singular solution;
! 102: -- numit the number of iterations, to be initialized with zero;
! 103: -- max maximum number of iterations per zero;
! 104: -- wout has to be true when intermediate output is wanted.
! 105:
! 106: -- ON RETURN :
! 107: -- sols a list of computed solutions;
! 108: -- refsols only those solutions which satisfy the given accuracy;
! 109: -- numit the number of iterations.
! 110:
! 111: end Multprec_Root_Refiners;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>