func Function

private pure function func(me, f)

if the function is to be minimized, switch the sign of the function. note that all intermediate and final output switches the sign back to eliminate any possible confusion for the user.

Type Bound

simulated_annealing_type

Arguments

Type IntentOptional Attributes Name
class(simulated_annealing_type), intent(in) :: me
real(kind=wp), intent(in) :: f

Return Value real(kind=wp)


Called by

proc~~func~~CalledByGraph proc~func simulated_annealing_module::simulated_annealing_type%func proc~sa simulated_annealing_module::simulated_annealing_type%sa proc~sa->proc~func

Source Code

    pure function func(me,f)

    implicit none

    class(simulated_annealing_type),intent(in) :: me
    real(wp),intent(in) :: f
    real(wp) :: func

    if (me%maximize) then
        func = f
    else
        func = -f
    end if

    end function func