Write algorithm for general usage

The objective function, so you’d need to adapt it to fit your gssObj interface. You can then use the abstract type like so:

subroutine gss_1d(objective_function) ! Add other arguments as needed
    class(objective_function_t), intent(in) :: objective_function

    real(dp) :: f
    real(dp) :: x
 
    ! ...
    ! Evaluate objective function
    f = objective_function%eval(x)
    ! ...
end subroutine
1 Like