Functional analysis and optimization