nonlin 1.5.2
A library that provides routines to compute the solutions to systems of nonlinear equations.
|
Data Types | |
type | least_squares_solver |
Defines a Levenberg-Marquardt based solver for unconstrained least-squares problems. More... | |
Functions/Subroutines | |
pure real(real64) function | lss_get_factor (this) |
Gets a factor used to scale the bounds on the initial step. | |
subroutine | lss_set_factor (this, x) |
Sets a factor used to scale the bounds on the initial step. | |
subroutine | lss_solve (this, fcn, x, fvec, ib, err) |
Applies the Levenberg-Marquardt method to solve the nonlinear least-squares problem. | |
subroutine | lmpar (r, ipvt, diag, qtb, delta, par, x, sdiag, wa1, wa2) |
Completes the solution of the Levenberg-Marquardt problem when provided with a QR factored form of the system Jacobian matrix. The form of the problem at this stage is J*X = B (J = Jacobian), and D*X = 0, where D is a diagonal matrix. | |
subroutine | lmfactor (a, pivot, ipvt, rdiag, acnorm, wa) |
Computes the QR factorization of an M-by-N matrix. | |
subroutine | lmsolve (r, ipvt, diag, qtb, x, sdiag, wa) |
Solves the QR factored system A*X = B, coupled with the diagonal system D*X = 0 in the least-squares sense. | |
|
private |
Computes the QR factorization of an M-by-N matrix.
[in,out] | a | On input, the M-by-N matrix to factor. On output, the strict upper triangular portion contains matrix R1 of the factorization, the lower trapezoidal portion contains the factored form of Q1, and the diagonal contains the corresponding elementary reflector. |
[in] | pivot | Set to true to utilize column pivoting; else, set to false for no pivoting. |
[out] | ipvt | An N-element array that is used to contain the pivot indices unless pivot is set to false. In such event, this array is unused. |
[out] | rdiag | An N-element array used to store the diagonal elements of the R1 matrix. |
[out] | acnorm | An N-element array used to contain the norms of each column in the event column pivoting is used. If pivoting is not used, this array is unused. |
[out] | wa | An N-element workspace array. |
Definition at line 737 of file nonlin_least_squares.f90.
|
private |
Completes the solution of the Levenberg-Marquardt problem when provided with a QR factored form of the system Jacobian matrix. The form of the problem at this stage is J*X = B (J = Jacobian), and D*X = 0, where D is a diagonal matrix.
[in,out] | r | On input, the N-by-N upper triangular matrix R1 of the QR factorization. On output, the upper triangular portion is unaltered, but the strict lower triangle contains the strict upper triangle (transposed) of the matrix S. |
[in] | ipvt | An N-element array tracking the pivoting operations from the original QR factorization. |
[in] | diag | An N-element array containing the diagonal components of the matrix D. |
[in] | qtb | An N-element array containing the first N elements of Q1**T * B. |
[in] | delta | A positive input variable that specifies an upper bounds on the Euclidean norm of D*X. |
[in,out] | par | On input, the initial estimate of the Levenberg-Marquardt parameter. On output, the final estimate. |
[out] | x | The N-element array that is the solution of A*X = B, and of D*X = 0. |
[out] | sdiag | An N-element array containing the diagonal elements of the matrix S. |
[out] | wa1 | An N-element workspace array. |
[out] | wa2 | An N-element workspace array. |
Definition at line 570 of file nonlin_least_squares.f90.
|
private |
Solves the QR factored system A*X = B, coupled with the diagonal system D*X = 0 in the least-squares sense.
[in,out] | r | On input, the N-by-N upper triangular matrix R1 of the QR factorization. On output, the upper triangular portion is unaltered, but the strict lower triangle contains the strict upper triangle (transposed) of the matrix S. |
[in] | ipvt | An N-element array tracking the pivoting operations from the original QR factorization. |
[in] | diag | An N-element array containing the diagonal components of the matrix D. |
[in] | qtb | An N-element array containing the first N elements of Q1**T * B. |
[out] | x | The N-element array that is the solution of A*X = B, and of D*X = 0. |
[out] | sdiag | An N-element array containing the diagonal elements of the matrix S. |
[out] | wa | An N-element workspace array. |
Definition at line 840 of file nonlin_least_squares.f90.
pure real(real64) function nonlin_least_squares::lss_get_factor | ( | class(least_squares_solver), intent(in) | this | ) |
Gets a factor used to scale the bounds on the initial step.
[in] | this | The least_squares_solver object. |
Definition at line 49 of file nonlin_least_squares.f90.
|
private |
Sets a factor used to scale the bounds on the initial step.
[in] | this | The least_squares_solver object. |
[in] | x | The factor. Notice, the factor is limited to the interval [0.1, 100]. |
Definition at line 68 of file nonlin_least_squares.f90.
|
private |
Applies the Levenberg-Marquardt method to solve the nonlinear least-squares problem.
[in,out] | this | The least_squares_solver object. |
[in] | fcn | The vecfcn_helper object containing the equations to solve. |
[in,out] | x | On input, an M-element array containing an initial estimate to the solution. On output, the updated solution estimate. M is the number of variables. |
[out] | fvec | An N-element array that, on output, will contain the values of each equation as evaluated at the variable values given in x . N is the number of equations. |
[out] | ib | An optional output, that if provided, allows the caller to obtain iteration performance statistics. |
[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 236 of file nonlin_least_squares.f90.