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

Annotation of OpenXM_contrib/PHC/Ada/Continuation/vlprs_algorithm.ads, Revision 1.1

1.1     ! maekawa     1: with text_io;                            use text_io;
        !             2: with Standard_Floating_Numbers;          use Standard_Floating_Numbers;
        !             3: with Standard_Floating_Vectors;          use Standard_Floating_Vectors;
        !             4: with Standard_Floating_Matrices;         use Standard_Floating_Matrices;
        !             5:
        !             6: package vLpRs_Algorithm is
        !             7:
        !             8: -- DESCRIPTION :
        !             9: --   This package provides several routines for an extrapolation method on
        !            10: --   the power series x(s) = a s^w ( 1 + O(s) ).
        !            11: --   Because the aim is to estimate the leading power w, the algorithm
        !            12: --   takes the logs as input.  So it considers the sequence
        !            13: --     log(|x(s_k)|) = log(|a|) + w log(s_k) + log(1 + O(s_k)),
        !            14: --   for a sequence s_0 > s_1 > .. > s_m > 0, with m >= the order r.
        !            15:
        !            16: -- USAGE :
        !            17: --   The first two routines are interesting to fill up the pipe, until
        !            18: --   sufficient data points are available to match the order.
        !            19: --   From then on, the fully incremental version can be used.
        !            20:
        !            21: -- START UP FROM SCRATCH :
        !            22:
        !            23:   procedure vLpRs_full
        !            24:                 ( r : in natural; s,logs,logx : in Vector;
        !            25:                   srp,dsp,p,l,v : in out Vector; rt1,rt2 : in out Matrix );
        !            26:
        !            27:   -- DESCRIPTION :
        !            28:   --   Calls the full version of the vLpRs-Algorithm.
        !            29:
        !            30:   -- REQUIRED :
        !            31:   --   s'range = logs'range = logx'range, s'last >= r,
        !            32:   --   srp'range = dsp'range = 1..r-1 = rt1'range(*) = rt2'range(*),
        !            33:   --   p'range = 0..r-1, l'range = v'range = 0..r.
        !            34:
        !            35:   -- ON ENTRY :
        !            36:   --   r          order of the extrapolation method;
        !            37:   --   s          strictly decreasing sequence of positive numbers;
        !            38:   --   logs       logarithms of the s-values;
        !            39:   --   logx       logarithms of |x(s_k)|.
        !            40:
        !            41:   -- ON RETURN :
        !            42:   --   srp        last row of powers of consecutive s-values;
        !            43:   --   dsp        last row of differences of consecutive s-powers;
        !            44:   --   p          last row of p-factors;
        !            45:   --   l          last row in the L-table, with error O(s^r).
        !            46:   --   v          last row in the v-table, with error O(s^r).
        !            47:   --   rt1,rt2    last consecutive R-tables.
        !            48:
        !            49:   procedure vLpRs_pipe
        !            50:                 ( file : in file_type;
        !            51:                   r : in natural; s,logs,logx : in Vector;
        !            52:                   srp,dsp,p,l,v : in out Vector; rt1,rt2 : in out Matrix );
        !            53:
        !            54:   -- DESCRIPTION :
        !            55:   --   Constructs the extrapolation table in an incremental way.
        !            56:
        !            57:   -- REQUIRED :
        !            58:   --   s'range = logs'range = logx'range, s'last >= r,
        !            59:   --   srp'range = dsp'range = 1..r-1 = rt1'range(*) = rt2'range(*),
        !            60:   --   p'range = 0..r-1, l'range = v'range = 0..r.
        !            61:
        !            62:   -- ON ENTRY :
        !            63:   --   file       to write error table on;
        !            64:   --   r          order of the extrapolation method;
        !            65:   --   s          strictly decreasing sequence of positive numbers;
        !            66:   --   logs       logarithms of the s-values;
        !            67:   --   logx       logarithms of |x(s_k)|.
        !            68:
        !            69:   -- ON RETURN :
        !            70:   --   srp        last row of powers of consecutive s-values;
        !            71:   --   dsp        last row of differences of consecutive s-powers;
        !            72:   --   p          last row of p-factors;
        !            73:   --   l          last row in the L-table, with error O(s^r).
        !            74:   --   v          last row in the v-table, with error O(s^r).
        !            75:   --   rt1,rt2    last consecutive R-tables.
        !            76:
        !            77: -- INCREMENTAL UPDATE :
        !            78:
        !            79:   procedure vLpRs_pipe
        !            80:                 ( s,logs,logx : in double_float;
        !            81:                   srp,dsp,p,l,v : in out Vector; rt1,rt2 : in out Matrix );
        !            82:
        !            83:   procedure vLpRs_pipe
        !            84:                 ( file : in file_type; s,logs,logx : in double_float;
        !            85:                   srp,dsp,p,l,v : in out Vector; rt1,rt2 : in out Matrix );
        !            86:
        !            87:   -- DESCRIPTION :
        !            88:   --   One additional row of every table is computed.
        !            89:
        !            90:   -- REQUIRED :
        !            91:   --   srp'range = dsp'range = 1..r-1 = rt1'range(*) = rt2'range(*),
        !            92:   --   p'range = 0..r-1, l'range = v'range = 0..r.
        !            93:
        !            94:   -- ON ENTRY :
        !            95:   --   file       to write table with errors on;
        !            96:   --   s          new s-value, must be smaller than latest one and nonzero;
        !            97:   --   logs       logarithm of s;
        !            98:   --   logx       logarithm of the absolute value of |x(s)|;
        !            99:   --   srp        last row of powers of consecutive s-values;
        !           100:   --   dsp        last row of differences of consecutive s-powers;
        !           101:   --   p          last row of p-factors;
        !           102:   --   l          last row of extrapolated logarithms of s-values;
        !           103:   --   v          last row of extrapolated logarithms of data points;
        !           104:   --   rt1,rt2    last consecutive R-tables.
        !           105:
        !           106:   -- ON RETURN :
        !           107:   --   srp        updated row of powers of consecutive s-values;
        !           108:   --   dsp        updated row of differences of consecutive s-powers;
        !           109:   --   p          updated row of p-factors;
        !           110:   --   l          updated row of extrapolated logarithms of s-values;
        !           111:   --   v          updated row of extrapolated logarithms of data points;
        !           112:   --   rt1,rt2    updated consecutive R-tables.
        !           113:
        !           114: end vLpRs_Algorithm;

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