Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(nlsolver), | intent(inout) | :: | this | |||
procedure(Fun17) | :: | F | ||||
complex(kind=rk), | intent(in), | dimension(:) | :: | x0 | ||
complex(kind=rk), | intent(out), | dimension(size(x0)) | :: | x_sol |
impure subroutine modified_quasi_cs_newton_method_T1(this, F, x0, x_sol) interface impure function Fun17(x) result(res) import rk complex(rk), dimension(:), intent(in) :: x complex(rk), dimension(:), allocatable :: res end function Fun17 end interface procedure(Fun17) :: F class(nlsolver), intent(inout) :: this complex(rk), dimension(:), intent(in) :: x0 complex(rk), dimension(size(x0)), intent(out) :: x_sol complex(rk), dimension(size(x0)) :: xk complex(rk), dimension(:), allocatable :: F_val real(rk), dimension(:,:), allocatable :: dFdx_val real(rk) :: criteriaFun integer :: k logical :: convergenz real(rk), dimension(size(x0)) :: dk real(rk) :: alphak k = 0 xk = x0 convergenz = .false. do while (.not. convergenz .and. k < this%maxit) F_val = F(xk) if (mod(k, this%nmp) == 0) dFdx_val = derivative(f=F, x=real(xk,kind=rk), h=this%cs_tol) criteriaFun = norm2(real(F_val, kind=rk)) if (this%verbosity == 1) then print '(g0, e12.4)', k, criteriaFun end if if (criteriaFun <= this%TolFun) then convergenz = .true. x_sol = xk return else dk = - solve(dFdx_val, real(F_val, kind=rk), this%lin_method) alphak = 1.0_rk xk = xk + alphak*dk k = k + 1 end if end do end subroutine modified_quasi_cs_newton_method_T1