Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function PolyEval(Val: TCplx; Coeff: TVec): TCplx; | Evaluates a polynomial with coefficients Coeff at complex value Val and returns complex results. |
| 2 | procedure PolyEval(Val: TVec; Coeff: TVec; R: TMtx; DegFreedom: Integer; L2R: Double; EvalResult: TVec; Delta: TVec); | Evaluate a polynomial. |
| 3 | procedure PolyEval(Val: TVec; Coeff: TVec; EvalResult: TVec); | Evaluates a polynomial with coefficients Coeff at value Val and returns the results in EvalResult. |
| 4 | function PolyEval(Val: Double; Coeff: TVec): Double; | Evaluates a polynomial with coefficients Coeff at real value Val and returns real result. |
Overload 1: function PolyEval(Val: TCplx; Coeff: TVec): TCplx;
Evaluates a polynomial with coefficients Coeff at complex value Val and returns complex results.
Returns: TCplx (complex)
Evaluates a polynomial with coefficients Coeff at complex value Val and returns complex results.
Overload 2: procedure PolyEval(Val: TVec; Coeff: TVec; R: TMtx; DegFreedom: Integer; L2R: Double; EvalResult: TVec; Delta: TVec);
Evaluate a polynomial.
| # | Name | Description |
|---|---|---|
| 1 | Val | Stores values doe which the polynomial will be evaluated (x values). |
| 2 | Coeff | Stores polynomial coefficients for which the polynomial will be evaaluted. |
| 3 | R | Returns the Cholesky factor of the Vandermonde matrix. |
| 4 | DegFreedom | Returns the residuals degree of freedom. |
| 5 | L2R | Returns the L2 norm of the residuals. |
| 6 | EvalResult | Returns the results P(x), evaluated at Val. |
| 7 | Delta | Returns the error estimates for Results. |
Result: stored in self (calling object)
Evaluate a polynomial with coefficients Coeff at value Val. The order of polynomial (N) is determined as: N := Coeff.Length - 1. The algorithm employed uses Horners rule. The following formula is used to evaluate the polynomial:
P(x) = coeff[0]*x^n + coeff[1]*x^(n-1) + .. + coeff[n]
To estimate the error of polynomial interpolation after a call to Polynoms.PolyFit additional parameters have to be passed to the routine.
uses MtxExpr, Math387, MtxVec, MtxVecEdit, MtxVecTee,Polynoms;
procedure TForm1.Button1Click(Sender: TObject);
var X, Y, Coeff: Vector;
begin
X := Ramp(10,-5,1); // X = [-5,-4,-3,-2,-1, 0, 1, 2, 3, 4]
// construct a parabola
Coeff.SetIt(false,[2, -1, 3]);
PolyEval(X,Coeff,Y);
// Y now holds the values of polynomial, evaluated at all X.Values
DrawIt(X,Y,'Parabola');
end;
Overload 3: procedure PolyEval(Val: TVec; Coeff: TVec; EvalResult: TVec);
Evaluates a polynomial with coefficients Coeff at value Val and returns the results in EvalResult.
Result: stored in self (calling object)
Evaluates a polynomial with coefficients Coeff at value Val and returns the results in EvalResult.
Overload 4: function PolyEval(Val: Double; Coeff: TVec): Double;
Evaluates a polynomial with coefficients Coeff at real value Val and returns real result.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Val | Double | scalar |
| 2 | Coeff | TVec | source TVec |
Returns: Double
Evaluates a polynomial with coefficients Coeff at real value Val and returns real result.