Defines a polynomial, and associated routines for performing polynomial operations.
Returns the companion matrix for the polynomial.
See Also
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(polynomial), | intent(in) | :: | this |
The polynomial object. |
The companion matrix.
Evaluates a polynomial at the specified points.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(polynomial), | intent(in) | :: | this |
The polynomial object. |
||
| real(kind=real64), | intent(in) | :: | x |
The value(s) at which to evaluate the polynomial. |
The value(s) of the polynomial at x.
Evaluates a polynomial at the specified points.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(polynomial), | intent(in) | :: | this |
The polynomial object. |
||
| complex(kind=real64), | intent(in) | :: | x |
The value(s) at which to evaluate the polynomial. |
The value(s) of the polynomial at x.
Fits a polynomial of the specified order to the supplied data set.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(polynomial), | intent(inout) | :: | this |
The polynomial object. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | x |
An N-element array containing the independent variable data points. Notice, must be N > order. |
|
| real(kind=real64), | intent(inout), | dimension(:) | :: | y |
On input, an N-element array containing the dependent variable data points. On output, the contents are overwritten. |
|
| integer(kind=int32), | intent(in) | :: | order |
The order of the polynomial (must be >= 1). |
||
| class(errors), | intent(inout), | optional, | target | :: | err |
An error handling object. |
Fits a polynomial of the specified order that passes through zero to the supplied data set.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(polynomial), | intent(inout) | :: | this |
The polynomial object. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | x |
An N-element array containing the independent variable data points. Notice, must be N > order. |
|
| real(kind=real64), | intent(inout), | dimension(:) | :: | y |
On input, an N-element array containing the dependent variable data points. On output, the contents are overwritten. |
|
| integer(kind=int32), | intent(in) | :: | order |
The order of the polynomial (must be >= 1). |
||
| class(errors), | intent(inout), | optional, | target | :: | err |
Gets the requested polynomial coefficient by index. The coefficient index is established as follows: c(1) + c(2) * x + c(3) * x2 + ... c(n) * xn-1.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(polynomial), | intent(in) | :: | this |
The polynomial object. |
||
| integer(kind=int32), | intent(in) | :: | ind |
The polynomial coefficient index. |
||
| class(errors), | intent(inout), | optional, | target | :: | err |
An error handling object. |
The requested coefficient.
Gets an array containing all the coefficients of the polynomial. The coefficient index is established as follows: c(1) + c(2) * x + c(3) * x2 + ... c(n) * xn-1.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(polynomial), | intent(in) | :: | this |
The polynomial object. |
The array of coefficients.
Initializes the polynomial instance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(polynomial), | intent(inout) | :: | this |
The polynomial object. |
||
| integer(kind=int32), | intent(in) | :: | order |
The order of the polynomial (must be >= 0). |
||
| class(errors), | intent(inout), | optional, | target | :: | err |
An error handling object. |
Initializes the polynomial instance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(polynomial), | intent(inout) | :: | this |
The polynomial object. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | c |
The array of polynomial coefficients. The coefficients are established as follows: c(1) + c(2) * x + c(3) * x2 + ... c(n) * xn-1. |
|
| class(errors), | intent(inout), | optional, | target | :: | err |
An error handling object. |
Returns the order of the polynomial object.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(polynomial), | intent(in) | :: | this |
The polynomial object. |
The order of the polynomial. Returns -1 in the event no polynomial coefficients have been defined.
Computes all the roots of a polynomial by computing the eigenvalues of the polynomial companion matrix.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(polynomial), | intent(in) | :: | this |
The polynomial object. |
||
| class(errors), | intent(inout), | optional, | target | :: | err |
An error handling object. |
The roots of the polynomial.
Sets the requested polynomial coefficient by index. The coefficient index is established as follows: c(1) + c(2) * x + c(3) * x2 + ... c(n) * xn-1.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(polynomial), | intent(inout) | :: | this |
The polynomial object. |
||
| integer(kind=int32), | intent(in) | :: | ind |
The polynomial coefficient index. |
||
| real(kind=real64), | intent(in) | :: | c |
The polynomial coefficient. |
||
| class(errors), | intent(inout), | optional, | target | :: | err |
An error handling object. |