John W. Campbell
This class provides a means to store a Chebyshev polynomial with
methods to evaluate the function value for a given coordinate.
Class, fields, constructor and methods:
Class Details
Accessible Fields
Constructor
Methods
- Package:
- Jdl.JdlLib;
- Class name:
- JdlChebyshevPolynomial
- Class definition:
- public class JdlChebyshevPolynomial
- Extends:
- Object
- Implements:
- none
- Actions:
- none
The following accessible fields have been defined:
- double xmin
- double xmax
- int n
- double[] c
- double outlim
A single constructor is available.
Constructor:
Standard constructor
Constructs a JdlChebyshevPolynomial object with the required resources.
- Constructor Definition:
- public JdlChebyshevPolynomial(double xmin, double xmax, int n, double[] coeff, double outlim)
- Parameters List:
- xmin
- Minimum 'x' used in polynomials calculation.
- xmax
- Maximum 'x' used in polynomials calculation.
- n
- The number of Chebyshev coefficients (polynomial order + 1).
- coeff
- Array of the'n' Chebyshev coefficients.
- outlim
- A value to be returned if an attempt is made to evaluate
the polynomial outside the range 'xmin' to 'xmax'.
This section contains methods to evaluate the function at a given coordinate.
Method:
Evaluate polynomial - evaluate
Evaluate polynomial - evaluate
Set 'outlim' - setOutlim
List data - listContents
This method evaluates the polynomial for a given 'x' coordinate.
- Method Definition:
- public double evaluate(double x)
- Parameters List:
- x
- The coordinate for which the function is to be evaluated.
- Method Return:
-
The function value or the stored value of 'outlim' if the
'x' coordinate is out of range.
This method evaluates the polynomial for a given 'x' coordinate.
- Method Definition:
- public double evaluate(double x, JdlError err)
- Parameters List:
- x
- The coordinate for which the function is to be evaluated.
- err
- This returns details of any error. If the evaluation was
OK then err.err is returned as false. If an error was found err.err
is returned as true, err.flag is set and an error message is
returned in err.msg1. Flag:
= -1, Polynomial not properly defined
= 1, 'x' coordinate out of range
- Method Return:
-
The function value or the stored value of 'outlim' if the
'x' coordinate is out of range.
This method sets the stored value of the 'outlim' parameter.
- Method Definition:
- public void setOutlim(double outlim)
- Parameters List:
- outlim
- A value to be returned if an attempt is made to evaluate
the polynomial outside the range 'xmin' to 'xmax'.
This method lists the curve data to the standard output stream.
- Method Definition:
- public void listContents()
- Parameters List:
- none
⇑ Up 2
⇑ Up 1
⇑ Top of this