[BACK]Return to generic_polynomial_functions.ads CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Polynomials

Annotation of OpenXM_contrib/PHC/Ada/Math_Lib/Polynomials/generic_polynomial_functions.ads, Revision 1.1.1.1

1.1       maekawa     1: with Abstract_Ring;
                      2: with Generic_Vectors;
                      3: with Generic_Polynomials;
                      4:
                      5: generic
                      6:
                      7:   with package Ring is new Abstract_Ring(<>);
                      8:   with package Vectors is new Generic_Vectors(Ring);
                      9:   with package Polynomials is new Generic_Polynomials(Ring);
                     10:
                     11: package Generic_Polynomial_Functions is
                     12:
                     13: -- DESCRIPTION :
                     14: --   Besides the term by term evaluation, two special data structures are
                     15: --   provided for efficient evaluation of polynomials in several variables.
                     16:
                     17:   use Ring,Vectors,Polynomials;
                     18:
                     19: -- FUNCTION TYPE :
                     20:
                     21:   type Evaluator is access function ( x : Vector ) return number;
                     22:
                     23: -- DATA STRUCTURES :
                     24:
                     25:   type Eval_Poly is private;
                     26:   type Eval_Coeff_Poly is private;
                     27:
                     28: -- CONSTRUCTORS :
                     29:
                     30:   function Create ( p : Poly ) return Eval_Poly;
                     31:   function Create ( p : Poly ) return Eval_Coeff_Poly;
                     32:
                     33:   procedure Diff ( p : in Poly; i : in integer;
                     34:                    cp : out Eval_Coeff_Poly; m : out Vector );
                     35:     -- evaluable coefficient polynomial of the partial derivative,
                     36:     -- with m the multiplication factors of the coefficients of p
                     37:
                     38:   function Coeff ( p : Poly ) return Vector;    -- returns coefficient vector
                     39:
                     40: -- EVALUATORS :
                     41:
                     42:   function Eval ( p : Poly; x : number; i : integer ) return Poly;
                     43:      -- return p(x1,..,xi=x,..,xn);
                     44:      -- Number_of_Unknowns(Eval(p,x,i)) = Number_of_Unknowns(p)-1
                     45:
                     46:   function Eval ( d : Degrees; c : number; x : Vector ) return number;
                     47:                                                             -- return c*x**d
                     48:   function Eval ( t : Term; c : number; x : Vector ) return number;
                     49:                                              -- return c*x**d, with d = t.dg
                     50:   function Eval ( t : Term; x : Vector ) return number;
                     51:
                     52:   function Eval ( p : Poly; x : Vector ) return number;       -- return p(x)
                     53:   function Eval ( p : Poly; c,x : Vector ) return number;
                     54:                      -- return p(c,x), with c = vector of coefficients for p
                     55:
                     56:   function Eval ( p : Eval_Poly; x : Vector ) return number;  -- return p(x)
                     57:   function Eval ( p : Eval_Coeff_Poly; c,x : Vector ) return number;
                     58:      -- return p(c,x), with c = vector of coefficients for p
                     59:
                     60: -- DESTRUCTORS : deallocate memory.
                     61:
                     62:   procedure Clear ( p : in out Eval_Poly );
                     63:   procedure Clear ( p : in out Eval_Coeff_Poly );
                     64:
                     65: private
                     66:
                     67:   type Eval_Poly_Rep;
                     68:   type Eval_Coeff_Poly_Rep;
                     69:
                     70:   type Eval_Poly is access Eval_Poly_Rep;
                     71:   type Eval_Coeff_Poly is access Eval_Coeff_Poly_Rep;
                     72:
                     73: end Generic_Polynomial_Functions;

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