test_convergence Subroutine

public subroutine test_convergence(x, xo, f, g, lg, xtol, ftol, gtol, c, cx, cf, cg, xnorm, fnorm)

Tests for convergence.

Arguments

Type IntentOptional Attributes Name
real(kind=real64), intent(in), dimension(:) :: x

The current solution estimate.

real(kind=real64), intent(in), dimension(:) :: xo

The previous solution estimate.

real(kind=real64), intent(in), dimension(:) :: f

The current residual based upon x.

real(kind=real64), intent(in), dimension(:) :: g

The current estimate of the gradient vector at x.

logical, intent(in) :: lg

Set to true if the gradient slope check should be performed; else, false.

real(kind=real64), intent(in) :: xtol

The tolerance on the change in variable.

real(kind=real64), intent(in) :: ftol

The tolerance on the residual.

real(kind=real64), intent(in) :: gtol

The tolerance on the slope of the gradient.

logical, intent(out) :: c

True if the solution converged on either the residual or change in variable.

logical, intent(out) :: cx

True if convergence occurred due to change in variable.

logical, intent(out) :: cf

True if convergence occurred due to residual.

logical, intent(out) :: cg

True if convergence occured due to slope of the gradient.

real(kind=real64), intent(out) :: xnorm

The largest magnitude component of the scaled change in variable vector.

real(kind=real64), intent(out) :: fnorm

The largest magnitude residual component.


Contents