int_pointer_to_f_pointer Subroutine

public subroutine int_pointer_to_f_pointer(iproblem, p)

Convert an integer pointer to a c_sa_wrapper_type pointer.

Arguments

Type IntentOptional Attributes Name
integer(kind=c_intptr_t), intent(in) :: iproblem

integer pointer from C

type(c_sa_wrapper_type), pointer :: p

fortran pointer


Called by

proc~~int_pointer_to_f_pointer~~CalledByGraph proc~int_pointer_to_f_pointer int_pointer_to_f_pointer proc~destroy_simulated_annealing destroy_simulated_annealing proc~destroy_simulated_annealing->proc~int_pointer_to_f_pointer proc~solve_simulated_annealing solve_simulated_annealing proc~solve_simulated_annealing->proc~int_pointer_to_f_pointer

Source Code

    subroutine int_pointer_to_f_pointer(iproblem, p)

        integer(c_intptr_t), intent(in) :: iproblem !! integer pointer from C
        type(c_sa_wrapper_type), pointer :: p !! fortran pointer

        type(c_ptr) :: cp

        cp = transfer(iproblem, c_null_ptr)
        if (c_associated(cp)) then
            call c_f_pointer(cp, p)
        else
            p => null()
        end if

    end subroutine int_pointer_to_f_pointer