struct Subgradient{Tf} <: NonSmoothOptimizer{Tf} end

Base.@kwdef mutable struct SubgradientState{Tf} <: OptimizerState{Tf}
    x::Vector{Tf}           # point
    v::Vector{Tf}           # subgradient
    k::Int64 = 1
end

initial_state(::Subgradient, initial_x, pb) =
    SubgradientState(x = initial_x, v = initial_x .* 0)


#
### Printing
#
print_header(::Subgradient) = println("**** Subgradient algorithm")


#
### Subgradient method
#
function update_iterate!(state, ::Subgradient, pb)
    state.v = âˆ‚F_elt(pb, state.x)

    state.x -= 1 / state.k * state.v
    state.k += 1

    return NamedTuple(), iteration_completed
end



get_minimizer_candidate(state::SubgradientState) = state.x
