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

File: [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Polynomials / generic_polynomial_functions.ads (download)

Revision 1.1.1.1 (vendor branch), Sun Oct 29 17:45:26 2000 UTC (23 years, 7 months ago) by maekawa
Branch: PHC, MAIN
CVS Tags: v2, maekawa-ipv6, RELEASE_1_2_3, RELEASE_1_2_2_KNOPPIX_b, RELEASE_1_2_2_KNOPPIX, RELEASE_1_2_2, RELEASE_1_2_1, HEAD
Changes since 1.1: +0 -0 lines

Import the second public release of PHCpack.

OKed by Jan Verschelde.

with Abstract_Ring;
with Generic_Vectors;
with Generic_Polynomials;

generic

  with package Ring is new Abstract_Ring(<>);
  with package Vectors is new Generic_Vectors(Ring);
  with package Polynomials is new Generic_Polynomials(Ring);

package Generic_Polynomial_Functions is

-- DESCRIPTION :
--   Besides the term by term evaluation, two special data structures are
--   provided for efficient evaluation of polynomials in several variables.

  use Ring,Vectors,Polynomials;

-- FUNCTION TYPE :

  type Evaluator is access function ( x : Vector ) return number;

-- DATA STRUCTURES :

  type Eval_Poly is private;
  type Eval_Coeff_Poly is private;

-- CONSTRUCTORS :

  function Create ( p : Poly ) return Eval_Poly;
  function Create ( p : Poly ) return Eval_Coeff_Poly;

  procedure Diff ( p : in Poly; i : in integer;
                   cp : out Eval_Coeff_Poly; m : out Vector );
    -- evaluable coefficient polynomial of the partial derivative,
    -- with m the multiplication factors of the coefficients of p

  function Coeff ( p : Poly ) return Vector;    -- returns coefficient vector

-- EVALUATORS :

  function Eval ( p : Poly; x : number; i : integer ) return Poly;
     -- return p(x1,..,xi=x,..,xn);
     -- Number_of_Unknowns(Eval(p,x,i)) = Number_of_Unknowns(p)-1

  function Eval ( d : Degrees; c : number; x : Vector ) return number; 
                                                            -- return c*x**d
  function Eval ( t : Term; c : number; x : Vector ) return number;
                                             -- return c*x**d, with d = t.dg
  function Eval ( t : Term; x : Vector ) return number;

  function Eval ( p : Poly; x : Vector ) return number;       -- return p(x)
  function Eval ( p : Poly; c,x : Vector ) return number;
                     -- return p(c,x), with c = vector of coefficients for p

  function Eval ( p : Eval_Poly; x : Vector ) return number;  -- return p(x)
  function Eval ( p : Eval_Coeff_Poly; c,x : Vector ) return number;
     -- return p(c,x), with c = vector of coefficients for p

-- DESTRUCTORS : deallocate memory.

  procedure Clear ( p : in out Eval_Poly );
  procedure Clear ( p : in out Eval_Coeff_Poly );

private

  type Eval_Poly_Rep;
  type Eval_Coeff_Poly_Rep;

  type Eval_Poly is access Eval_Poly_Rep;
  type Eval_Coeff_Poly is access Eval_Coeff_Poly_Rep;

end Generic_Polynomial_Functions;