nonlin 1.5.2
A library that provides routines to compute the solutions to systems of nonlinear equations.
|
Defines a polynomial, and associated routines for performing polynomial operations. More...
Public Member Functions | |
generic, public | initialize (this, order, err) |
Initializes the polynomial instance. | |
generic, public | initialize (this, c, err) |
Initializes the polynomial instance. | |
procedure, public | order (this) |
Returns the order of the polynomial object. | |
procedure, public | fit (this, x, y, order, err) |
Fits a polynomial of the specified order to a data set. | |
procedure, public | fit_thru_zero (this, x, y, order, err) |
Fits a polynomial of the specified order that passes through zero to a data set. | |
generic, public | evaluate evaluate_real |
Evaluates a polynomial at the specified points. | |
generic, public | evaluate evaluate_complex |
Evaluates a polynomial at the specified points. | |
procedure, public | companion_mtx (this) |
Returns the companion matrix for the polynomial. | |
procedure, public | roots (this, err) |
Computes all the roots of a polynomial. | |
procedure, public | get (this, ind, err) |
Gets the requested polynomial coefficient. | |
procedure, public | get_all (this) |
Gets an array containing all the coefficients of the polynomial. | |
procedure, public | set (this, ind, c, err) |
Sets the requested polynomial coefficient by index. | |
procedure | evaluate_real (this, x) |
Evaluates a polynomial at the specified points. | |
procedure | evaluate_complex (this, x) |
Evaluates a polynomial at the specified points. | |
procedure | init_poly (this, order, err) |
Initializes the polynomial instance, and sets all coefficients to zero. | |
procedure | init_poly_coeffs (this, c, err) |
Initializes the polynomial instance. | |
Private Attributes | |
real(real64), dimension(:), allocatable | m_coeffs |
An array that contains the polynomial coefficients in ascending order. | |
Defines a polynomial, and associated routines for performing polynomial operations.
Definition at line 60 of file nonlin_polynomials.f90.
procedure, public nonlin_polynomials::polynomial::companion_mtx | ( | class(polynomial), intent(in) | this | ) |
Returns the companion matrix for the polynomial.
[in] | this | The polynomial object. |
Definition at line 77 of file nonlin_polynomials.f90.
generic, public nonlin_polynomials::polynomial::evaluate |
Evaluates a polynomial at the specified points.
Definition at line 75 of file nonlin_polynomials.f90.
generic, public nonlin_polynomials::polynomial::evaluate |
Evaluates a polynomial at the specified points.
Definition at line 75 of file nonlin_polynomials.f90.
procedure nonlin_polynomials::polynomial::evaluate_complex | ( | class(polynomial), intent(in) | this, |
complex(real64), intent(in) | x ) |
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 88 of file nonlin_polynomials.f90.
procedure nonlin_polynomials::polynomial::evaluate_real | ( | class(polynomial), intent(in) | this, |
real(real64), intent(in) | x ) |
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 87 of file nonlin_polynomials.f90.
procedure, public nonlin_polynomials::polynomial::fit | ( | class(polynomial), intent(inout) | this, |
real(real64), dimension(:), intent(in) | x, | ||
real(real64), dimension(:), intent(inout) | y, | ||
integer(int32), intent(in) | order, | ||
class(errors), intent(inout), optional, target | err ) |
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 70 of file nonlin_polynomials.f90.
procedure, public nonlin_polynomials::polynomial::fit_thru_zero | ( | class(polynomial), intent(inout) | this, |
real(real64), dimension(:), intent(in) | x, | ||
real(real64), dimension(:), intent(inout) | y, | ||
integer(int32), intent(in) | order, | ||
class(errors), intent(inout), optional, target | err ) |
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 73 of file nonlin_polynomials.f90.
procedure, public nonlin_polynomials::polynomial::get | ( | class(polynomial), intent(in) | this, |
integer(int32), intent(in) | ind, | ||
class(errors), intent(inout), optional, target | err ) |
Gets the requested polynomial coefficient.
[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 81 of file nonlin_polynomials.f90.
procedure, public nonlin_polynomials::polynomial::get_all | ( | class(polynomial), intent(in) | this | ) |
Gets an array containing all the coefficients of the polynomial.
[in] | this | The polynomial object. |
Definition at line 83 of file nonlin_polynomials.f90.
procedure nonlin_polynomials::polynomial::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 89 of file nonlin_polynomials.f90.
procedure nonlin_polynomials::polynomial::init_poly_coeffs | ( | class(polynomial), intent(inout) | this, |
real(real64), dimension(:), intent(in) | c, | ||
class(errors), intent(inout), optional, target | err ) |
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 90 of file nonlin_polynomials.f90.
generic, public nonlin_polynomials::polynomial::initialize | ( | class(polynomial), intent(inout) | this, |
real(real64), dimension(:), intent(in) | c, | ||
class(errors), intent(inout), optional, target | err ) |
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 66 of file nonlin_polynomials.f90.
generic, public nonlin_polynomials::polynomial::initialize | ( | class(polynomial), intent(inout) | this, |
integer(int32), intent(in) | order, | ||
class(errors), intent(inout), optional, target | err ) |
Initializes the polynomial instance.
[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 66 of file nonlin_polynomials.f90.
procedure, public nonlin_polynomials::polynomial::order | ( | class(polynomial), intent(in) | this | ) |
Returns the order of the polynomial object.
[in] | this | The polynomial object. |
Definition at line 68 of file nonlin_polynomials.f90.
procedure, public nonlin_polynomials::polynomial::roots | ( | class(polynomial), intent(in) | this, |
class(errors), intent(inout), optional, target | err ) |
Computes all the roots of a polynomial.
[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 79 of file nonlin_polynomials.f90.
procedure, public nonlin_polynomials::polynomial::set | ( | class(polynomial), intent(inout) | this, |
integer(int32), intent(in) | ind, | ||
real(real64), intent(in) | c, | ||
class(errors), intent(inout), optional, target | err ) |
Sets the requested polynomial coefficient by index.
[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 85 of file nonlin_polynomials.f90.
|
private |
An array that contains the polynomial coefficients in ascending order.
Definition at line 63 of file nonlin_polynomials.f90.