compute the function
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(nlesolver_type), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(in), | dimension(:) | :: | x | ||
| real(kind=wp), | intent(out), | dimension(:) | :: | f |
subroutine func(me,x,f) !! compute the function implicit none class(nlesolver_type),intent(inout) :: me real(wp),dimension(:),intent(in) :: x real(wp),dimension(:),intent(out) :: f f_evals = f_evals + 1 f(1) = x(1)**2 + x(2) - 0.1_wp f(2) = x(2) + 0.2_wp ! root is 5.477226E-01 -2.000000E-01 end subroutine func