Skip to content

Commit

Permalink
explicit return nothing
Browse files Browse the repository at this point in the history
  • Loading branch information
aml5600 committed Oct 29, 2024
1 parent 56f4601 commit ab79a1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/OptimizationMOI/src/nlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ function MOI.eval_constraint_jacobian_product(
else
error("Thou shalt provide the v'J of the constraint jacobian, not doing so is associated with great misfortune and also no ice cream for you.")
end
return nothing
end

function MOI.eval_constraint_jacobian_transpose_product(
Expand All @@ -326,6 +327,7 @@ function MOI.eval_constraint_jacobian_transpose_product(
else
error("Thou shalt provide the v'J of the constraint jacobian, not doing so is associated with great misfortune and also no ice cream for you.")
end
return nothing
end

function MOI.hessian_lagrangian_structure(evaluator::MOIOptimizationNLPEvaluator)
Expand Down
4 changes: 2 additions & 2 deletions lib/OptimizationMOI/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,14 @@ end
@test (evaluator.f.cons_j !== nothing) || (evaluator.f.cons_jvp !== nothing)
y = zeros(1)
w = ones(2)
@test MathOptInterface.eval_constraint_jacobian_product(evaluator, y, x, w) isa Any
@test MathOptInterface.eval_constraint_jacobian_product(evaluator, y, x, w) === nothing

# constraint jacobian-vector product
@test (evaluator.f.cons_j !== nothing) || (evaluator.f.cons_vjp !== nothing)
y = zeros(2)
w = ones(1)
@test MathOptInterface.eval_constraint_jacobian_transpose_product(
evaluator, y, x, w) isa Any
evaluator, y, x, w) === nothing
end

@testset "NLP" begin
Expand Down

0 comments on commit ab79a1b

Please sign in to comment.