nonlin 1.5.2
A library that provides routines to compute the solutions to systems of nonlinear equations.
|
polynomials More...
Data Types | |
interface | assignment(=) |
Defines polynomial assignment. More... | |
interface | operator(*) |
Defines polynomial multiplication. More... | |
interface | operator(+) |
Defines polynomial addition. More... | |
interface | operator(-) |
Defines polynomial subtraction. More... | |
type | polynomial |
Defines a polynomial, and associated routines for performing polynomial operations. More... | |
Functions/Subroutines | |
subroutine | init_poly (this, order, err) |
Initializes the polynomial instance, and sets all coefficients to zero. | |
subroutine | init_poly_coeffs (this, c, err) |
Initializes the polynomial instance. | |
pure integer(int32) function | get_poly_order (this) |
Returns the order of the polynomial object. | |
subroutine | poly_fit (this, x, y, order, err) |
Fits a polynomial of the specified order to a data set. | |
subroutine | poly_fit_thru_zero (this, x, y, order, err) |
Fits a polynomial of the specified order that passes through zero to a data set. | |
elemental real(real64) function | poly_eval_double (this, x) |
Evaluates a polynomial at the specified points. | |
elemental complex(real64) function | poly_eval_complex (this, x) |
Evaluates a polynomial at the specified points. | |
pure real(real64) function, dimension(this%order(), this%order()) | poly_companion_mtx (this) |
Returns the companion matrix for the polynomial. | |
complex(real64) function, dimension(this%order()) | poly_roots (this, err) |
Computes all the roots of a polynomial by computing the eigenvalues of the polynomial companion matrix. | |
real(real64) function | get_poly_coefficient (this, ind, err) |
Gets the requested polynomial coefficient by index. The coefficient index is established as follows: c(1) + c(2) * x + c(3) * x**2 + ... c(n) * x**n-1. | |
pure real(real64) function, dimension(this%order()+1) | get_poly_coefficients (this) |
Gets an array containing all the coefficients of the polynomial. The coefficient index is established as follows: c(1) + c(2) * x + c(3) * x**2 + ... c(n) * x**n-1. | |
subroutine | set_poly_coefficient (this, ind, c, err) |
Sets the requested polynomial coefficient by index. The coefficient index is established as follows: c(1) + c(2) * x + c(3) * x**2 + ... c(n) * x**n-1. | |
subroutine | poly_equals (x, y) |
Assigns the contents of one polynomial to another. | |
subroutine | poly_dbl_equals (x, y) |
Assigns a number to each coefficient of the polynomial. | |
subroutine | poly_equals_array (x, y) |
Assigns the contents of an array as polynomial coefficients. | |
type(polynomial) function | poly_poly_add (x, y) |
Adds two polynomials. | |
type(polynomial) function | poly_poly_subtract (x, y) |
Subtracts two polynomials. | |
type(polynomial) function | poly_poly_mult (x, y) |
Multiplies two polynomials. | |
type(polynomial) function | poly_dbl_mult (x, y) |
Multiplies a polynomial by a scalar value. | |
type(polynomial) function | dbl_poly_mult (x, y) |
Multiplies a polynomial by a scalar value. | |
polynomials
|
private |
Multiplies a polynomial by a scalar value.
[in] | x | The scalar value. |
[in] | y | The polynomial. |
Definition at line 988 of file nonlin_polynomials.f90.
|
private |
Gets the requested polynomial coefficient by index. The coefficient index is established as follows: c(1) + c(2) * x + c(3) * x**2 + ... c(n) * x**n-1.
[in] | this | The polynomial. |
[in] | ind | The polynomial coefficient index (0 < ind <= order + 1). |
[out] | err | An optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
|
Definition at line 655 of file nonlin_polynomials.f90.
|
private |
Gets an array containing all the coefficients of the polynomial. The coefficient index is established as follows: c(1) + c(2) * x + c(3) * x**2 + ... c(n) * x**n-1.
[in] | this | The polynomial object. |
Definition at line 698 of file nonlin_polynomials.f90.
|
private |
Returns the order of the polynomial object.
[in] | this | The polynomial object. |
Definition at line 203 of file nonlin_polynomials.f90.
subroutine nonlin_polynomials::init_poly | ( | class(polynomial), intent(inout) | this, |
integer(int32), intent(in) | order, | ||
class(errors), intent(inout), optional, target | err ) |
Initializes the polynomial instance, and sets all coefficients to zero.
[in,out] | this | The polynomial object. |
[in] | order | The order of the polynomial (must be >= 0). |
[out] | err | An optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
|
Definition at line 110 of file nonlin_polynomials.f90.
|
private |
Initializes the polynomial instance.
[in,out] | this | The polynomial object. |
[in] | c | The array of polynomial coefficients. The coefficients are established as follows: c(1) + c(2) * x + c(3) * x**2 + ... c(n) * x**n-1. |
[out] | err | An optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
|
Definition at line 167 of file nonlin_polynomials.f90.
|
private |
Returns the companion matrix for the polynomial.
[in] | this | The polynomial object. |
Definition at line 529 of file nonlin_polynomials.f90.
|
private |
Assigns a number to each coefficient of the polynomial.
[in,out] | x | The assignee. |
[in] | y | The value to assign. |
Definition at line 786 of file nonlin_polynomials.f90.
|
private |
Multiplies a polynomial by a scalar value.
[in] | x | The polynomial. |
[in] | y | The scalar value. |
Definition at line 964 of file nonlin_polynomials.f90.
|
private |
Assigns the contents of one polynomial to another.
[in,out] | x | The assignee. |
[in] | y | The polynomial to copy |
Definition at line 765 of file nonlin_polynomials.f90.
|
private |
Assigns the contents of an array as polynomial coefficients.
[in,out] | x | The assignee. |
[in] | y | The coefficient array. |
Definition at line 806 of file nonlin_polynomials.f90.
|
private |
Evaluates a polynomial at the specified points.
[in] | this | The polynomial object. |
[in] | x | The value(s) at which to evaluate the polynomial. |
x
. Definition at line 489 of file nonlin_polynomials.f90.
|
private |
Evaluates a polynomial at the specified points.
[in] | this | The polynomial object. |
[in] | x | The value(s) at which to evaluate the polynomial. |
x
. Definition at line 452 of file nonlin_polynomials.f90.
|
private |
Fits a polynomial of the specified order to a data set.
[in,out] | this | The polynomial object. |
[in] | x | An N-element array containing the independent variable data points. Notice, must be N > order . |
[in,out] | y | On input, an N-element array containing the dependent variable data points. On output, the contents are overwritten. |
[in] | order | The order of the polynomial (must be >= 1). |
[out] | err | An optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
|
Definition at line 284 of file nonlin_polynomials.f90.
|
private |
Fits a polynomial of the specified order that passes through zero to a data set.
[in,out] | this | The polynomial object. |
[in] | x | An N-element array containing the independent variable data points. Notice, must be N > order . |
[in,out] | y | On input, an N-element array containing the dependent variable data points. On output, the contents are overwritten. |
[in] | order | The order of the polynomial (must be >= 1). |
[out] | err | An optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
|
Definition at line 375 of file nonlin_polynomials.f90.
|
private |
Adds two polynomials.
[in] | x | The left-hand-side argument. |
[in] | y | The right-hand-side argument. |
Definition at line 820 of file nonlin_polynomials.f90.
|
private |
Multiplies two polynomials.
[in] | x | The left-hand-side argument. |
[in] | y | The right-hand-side argument. |
Definition at line 934 of file nonlin_polynomials.f90.
|
private |
Subtracts two polynomials.
[in] | x | The left-hand-side argument. |
[in] | y | The right-hand-side argument. |
Definition at line 877 of file nonlin_polynomials.f90.
|
private |
Computes all the roots of a polynomial by computing the eigenvalues of the polynomial companion matrix.
[in] | this | The polynomial object. |
[out] | err | An optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
|
Definition at line 614 of file nonlin_polynomials.f90.
|
private |
Sets the requested polynomial coefficient by index. The coefficient index is established as follows: c(1) + c(2) * x + c(3) * x**2 + ... c(n) * x**n-1.
[in,out] | this | The polynomial. |
[in] | ind | The polynomial coefficient index (0 < ind <= order + 1). |
[in] | c | The polynomial coefficient. |
[out] | err | An optional errors-based object that if provided can be used to retrieve information relating to any errors encountered during execution. If not provided, a default implementation of the errors class is used internally to provide error handling. Possible errors and warning messages that may be encountered are as follows.
|
Definition at line 724 of file nonlin_polynomials.f90.