Simple example: ``` minimize f(x) subject to x > 0 ``` The non-negativity constraint can be thought of as a penalty function: ``` minimize f(x) + g(x) ``` Where `g(x) = any(x) <= 0 ? Inf : 0` I have some code here that could be ported: https://github.com/JuliaML/ObjectiveFunctions.jl/tree/alex/src/constraints