Type for a 1D objective function
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | public | :: | derivativeOrder | = | 2 | Order of finite difference approximations | |
| real(kind=wp), | public | :: | stepSize | = | 1.0E-3_wp | Step size for finite differences | 
Compute the first derivative using finite differences
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(obj_t), | intent(in) | :: | self | Function to differentiate | ||
| real(kind=wp), | intent(in) | :: | x | Evaluation point | 
First derivative
Compute the second derivative using finite differences
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(obj_t), | intent(in) | :: | self | Function to differentiate | ||
| real(kind=wp), | intent(in) | :: | x | Evaluation point | 
Second derivative
Find the root of a 1-D function using Newton's method
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(obj_t), | intent(in) | :: | self | Function for root finding | ||
| real(kind=wp), | intent(in) | :: | x0 | Initial guess | ||
| real(kind=wp), | intent(in), | optional | :: | tol | Tolerance | |
| integer, | intent(in), | optional | :: | maxIts | Maximum iterations | 
Location of root
Find the minimum of a 1-D function using Newton's method
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(obj_t), | intent(in) | :: | self | Function for minimization | ||
| real(kind=wp), | intent(in) | :: | x0 | Intial guess | ||
| real(kind=wp), | intent(in), | optional | :: | tol | Tolerance | |
| integer, | intent(in), | optional | :: | maxIts | Maximum iterations | 
Location of minimum