Defines a type capable of encapsulating a system of nonlinear equations of the form: F(X) = 0. This type is used to establish the system of equations to solve, and provides a means for computing the Jacobian matrix for the system of equations, and any other ancillary operations that may be needed by the solver.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=int32), | public | :: | m_nvar | = | 0 |
The number of variables in m_fcn. |
Executes the routine containing the system of equations to solve. No action is taken if the pointer to the subroutine has not been defined.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vecfcn_helper), | intent(in) | :: | this |
The vecfcn_helper object. |
||
| real(kind=real64), | intent(in), | dimension(:) | :: | x |
An N-element array containing the independent variables. |
|
| real(kind=real64), | intent(out), | dimension(:) | :: | f |
An M-element array that, on output, contains the values of the M functions. |
Gets the number of equations in this system.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vecfcn_helper), | intent(in) | :: | this |
The vecfcn_helper object. |
The function count.
Gets the number of variables in this system.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vecfcn_helper), | intent(in) | :: | this |
The vecfcn_helper object. |
The number of variables.
Tests if the pointer to the subroutine containing the system of equations to solve has been assigned.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vecfcn_helper), | intent(in) | :: | this |
The vecfcn_helper object. |
Returns true if the pointer has been assigned; else, false.
Tests if the pointer to the Jacobian calculation routine has been defined.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vecfcn_helper), | intent(in) | :: | this |
The vecfcn_helper object. |
Returns true if the pointer has been assigned; else, false.
Executes the routine containing the Jacobian matrix if supplied. If not supplied, the Jacobian is computed via finite differences.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vecfcn_helper), | intent(in) | :: | this |
The vecfcn_helper object. |
||
| real(kind=real64), | intent(inout), | dimension(:) | :: | x |
An N-element array containing the independent variables defining the point about which the derivatives will be calculated. |
|
| real(kind=real64), | intent(out), | dimension(:,:) | :: | jac |
An M-by-N matrix where, on output, the Jacobian will be written. |
|
| real(kind=real64), | intent(in), | optional, | dimension(:), target | :: | fv |
An optional M-element array containing the function values at x. If not supplied, the function values are computed at x. |
| real(kind=real64), | intent(out), | optional, | dimension(:), target | :: | work |
An optional input, that if provided, prevents any local memory allocation. If not provided, the memory required is allocated within. If provided, the length of the array must be at least olwork. Notice, a workspace array is only utilized if the user does not provide a routine for computing the Jacobian. |
| integer(kind=int32), | intent(out), | optional | :: | olwork |
An optional output used to determine workspace size. If supplied, the routine determines the optimal size for work, and returns without performing any actual calculations. |
|
| integer(kind=int32), | intent(out), | optional | :: | err |
An optional integer output that can be used to determine error status. If not used, and an error is encountered, the routine simply returns silently. If used, the following error codes identify error status:
|
Establishes a pointer to the routine containing the system of equations to solve.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vecfcn_helper), | intent(inout) | :: | this |
The vecfcn_helper object. |
||
| procedure(vecfcn), | intent(in), | pointer | :: | fcn |
The function pointer. |
|
| integer(kind=int32), | intent(in) | :: | nfcn |
The number of functions. |
||
| integer(kind=int32), | intent(in) | :: | nvar |
The number of variables. |
Establishes a pointer to the routine for computing the Jacobian matrix of the system of equations. If no routine is defined, the Jacobian matrix will be computed numerically (this is the default state).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(vecfcn_helper), | intent(inout) | :: | this |
The vecfcn_helper object. |
||
| procedure(jacobianfcn), | intent(in), | pointer | :: | jac |
The function pointer. |