JuliaOpt / MathProgBase.jl

DEPRECATED: Solver-independent functions (i.e. linprog and mixintprog) and low-level interface for Mathematical Programming
Other
80 stars 38 forks source link

Specifying Grad & Hessian functions for MPB solvers #200

Open rt5592 opened 6 years ago

rt5592 commented 6 years ago

Hi My question is about providing grad, Jac and hess functions to MathProgBase solvers. Which solvers (Ipopt, Knitro) require these functions to be provided when using MPB?

Is the syntax below correct (i.e. using empty array) when these functions are not specified ?

function MathProgBase.initialize(d::AbstractNLPEvaluator, requested_features::Vector{Symbol})
    for feat in requested_features
        if !(feat in [ ])                                             # empty array here ?
            error("Unsupported feature $feat")
            # TODO: implement Jac-vec and Hess-vec products
            # for solvers that need them
        end
    end
end

 MathProgBase.features_available(d::AbstractNLPEvaluator) = [ ]        # empty array here ?

Thank you for clarifying.