Skip to content

Support Function Calls #119

@lukasscheffold

Description

@lukasscheffold

It would be useful to be able to implement function calls into constraints. Pyomo has a similar functionality under the external() module. Here you can supply a function call, such as a function or an external library (DLL) call, to calculate a value. This value, along with its derivatives, can then be applied to a constraint or logicalConstraint. I am thinking of a functionality like the following:

using DisjunctiveProgramming
using HiGHS

m = GDPModel(HiGHS.Optimizer)

@variable(m, 0 <= a)

function quadratic(x)
return y = (x + 2)^2 + 1
end

@constraint(m, 0 == quadratic(a))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions