func_wrapper Subroutine

private subroutine func_wrapper(me, x, f)

Wrapper for the user's function that is used by the main pikaia routine The x input to this function comes from pikaia, and will be between [0,1].

Type Bound

pikaia_class

Arguments

Type IntentOptional Attributes Name
class(pikaia_class), intent(inout) :: me
real(kind=wp), intent(in), dimension(:) :: x
real(kind=wp), intent(out) :: f

Called by

proc~~func_wrapper~~CalledByGraph proc~func_wrapper pikaia_module::pikaia_class%func_wrapper proc~newpop pikaia_module::pikaia_class%newpop proc~newpop->proc~func_wrapper proc~pikaia pikaia_module::pikaia_class%pikaia proc~pikaia->proc~func_wrapper proc~pikaia->proc~newpop proc~solve_with_pikaia pikaia_module::pikaia_class%solve_with_pikaia proc~solve_with_pikaia->proc~pikaia

Source Code

    subroutine func_wrapper(me,x,f)

    implicit none

    class(pikaia_class),intent(inout) :: me   ! pikaia class
    real(wp),dimension(:),intent(in)  :: x    ! optimization variable vector [0,1]
    real(wp),intent(out)              :: f    ! fitness value

    real(wp),dimension(me%n) :: xp    !unscaled x vector: [xu,xl]

    !map each x variable from [0,1] to [xl,xu]:
    xp = me%xl + me%del*x

    !call the user's function with xp:
    call me%user_f(xp,f)

    end subroutine func_wrapper