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 | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(pikaia_class), | intent(inout) | :: | me | |||
real(kind=wp), | intent(in), | dimension(:) | :: | x | ||
real(kind=wp), | intent(out) | :: | f |
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