Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ jobs:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v3
- name: MOI
shell: julia --project=@. {0}
run: |
using Pkg
Pkg.add([
PackageSpec(name="MathOptInterface", rev="bl/linearity"),
])
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
with:
Expand Down
6 changes: 6 additions & 0 deletions src/ArrayDiff.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ function from_onnx end

model(::Mode{S}) where {S} = Model{eltype(S)}()

# Hook so that solvers using `MOI.Nonlinear.model(backend)` (for example,
# NLopt and NLPModelsJuMP) receive an ArrayDiff model for an ArrayDiff mode.
# ArrayDiff's model natively parses scalar and array nonlinear functions, but
# not the `MOI.VectorNonlinearOracle` set, hence no oracle layer either.
Nonlinear.model(mode::Mode) = model(mode)

# Extend MOI.Nonlinear.set_objective so that solvers calling
# MOI.Nonlinear.set_objective(arraydiff_model, snf) dispatch here.
function Nonlinear.set_objective(model::Model, obj::MOI.ScalarNonlinearFunction)
Expand Down
Loading