impure subroutine newton_rel_T0(this, F, dFdx, x0, x_sol)
interface
impure function Fun1(x)
import rk
real(rk), intent(in) :: x
real(rk) :: Fun1
end function Fun1
impure function dFun1(x)
import rk
real(rk), intent(in) :: x
real(rk) :: dFun1
end function dFun1
end interface
procedure(Fun1) :: F
procedure(dFun1), optional :: dFdx
class(nlsolver), intent(inout) :: this
real(rk), intent(in) :: x0
real(rk), intent(out) :: x_sol
if (this%verbosity == 1) then
print '(a)', '-----------------------------------------------'
print '(a)', 'maxit x0 tol'
print '(g0, 10x, f12.8, 10x, e12.4)', this%maxit, x0, this%TolFun
print '(a)', '-----------------------------------------------'
print '(a)', 'start newton'
print '(a)', '-----------------------------------------------'
print '(a)', 'it xn F(xn) dF(xn)/dxn'
end if
select case (this%nl_method)
case ('newton')
call newton_method_T0(this, F, dFdx, x0, x_sol)
case ('newton-modified')
call modified_newton_method_T0(this, F, dFdx, x0, x_sol)
case ('newton-quasi-fd')
call quasi_fd_newton_method_T0(this, F, x0, x_sol)
case ('newton-quasi-fd-modified')
call modified_quasi_fd_newton_method_T0(this, F, x0, x_sol)
! case ('newton-quasi-bfgs')
! call quasi_bfgs_newton_method_T0(this, F, x0, x_sol)
! case ('newton-quasi-bfgs-modified')
! call modified_quasi_bfgs_newton_method_T0(this, F, x0, x_sol)
end select
if (this%verbosity == 1) then
print '(a)', '-----------------------------------------------'
print '(a)', 'end newton'
print '(a)', '-----------------------------------------------'
print '(a, g0)', 'x_sol = ', x_sol
end if
end subroutine newton_rel_T0