Skip to content

Commit 303b496

Browse files
committed
Update
1 parent 32618b1 commit 303b496

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

test/General/sets.jl

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,39 @@ function test_VectorNonlinearOracle()
431431
eval_jacobian = (ret, x) -> nothing,
432432
),
433433
)
434+
set = MOI.VectorNonlinearOracle(;
435+
dimension = 3,
436+
l = [0.0, 0.0],
437+
u = [1.0, 0.0],
438+
eval_f = (ret, x) -> begin
439+
ret[1] = x[2]^2
440+
ret[2] = x[3]^2 + x[4]^3 - x[1]
441+
return
442+
end,
443+
jacobian_structure = [(1, 2), (2, 1), (2, 3), (2, 4)],
444+
eval_jacobian = (ret, x) -> begin
445+
ret[1] = 2.0 * x[2]
446+
ret[2] = -1.0
447+
ret[3] = 2.0 * x[3]
448+
ret[4] = 3.0 * x[4]^2
449+
return
450+
end,
451+
hessian_lagrangian_structure = [(2, 2), (3, 3), (4, 4)],
452+
eval_hessian_lagrangian = (ret, x, u) -> begin
453+
ret[1] = 2.0 * u[1]
454+
ret[2] = 2.0 * u[2]
455+
ret[3] = 6.0 * x[4] * u[2]
456+
return
457+
end,
458+
)
459+
contents = """
460+
VectorNonlinearOracle{Float64}(;
461+
dimension = 3,
462+
l = [0.0, 0.0],
463+
u = [1.0, 0.0],
464+
...,
465+
)"""
466+
@test sprint(show, set) == contents
434467
return
435468
end
436469

0 commit comments

Comments
 (0)