Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add default values #222

Merged
merged 5 commits into from
Aug 7, 2024
Merged
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
17 changes: 3 additions & 14 deletions src/default.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,21 +162,10 @@ function __init_interpolation()
return (T, U) -> Interpolations.linear_interpolation(T, U, extrapolation_bc = Interpolations.Line())
end

# ------------------------------------------------------------------------------------
# IPOPT

"""
$(TYPEDSIGNATURES)

Used to set the default value of the print level of ipopt for the direct method.
The default value is `5`.
"""
__print_level_ipopt() = 5

"""
$(TYPEDSIGNATURES)

Used to set the default value of the μ strategy of ipopt for the direct method.
The default value is `adaptive`.
Used to set the default initial guess.
The default value is `nothing`.
"""
__mu_strategy_ipopt() = "adaptive"
__ocp_init() = nothing
10 changes: 2 additions & 8 deletions test/test_default.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,8 @@ function test_default()
@test CTBase.__init_interpolation() isa Function
end

@testset "Default value of the print level of ipopt for the direct method" begin
@test CTBase.__print_level_ipopt() isa Integer
@test CTBase.__print_level_ipopt() ≤ 12
@test CTBase.__print_level_ipopt() ≥ 0
end

@testset "Default value of the mu strategy of ipopt for the direct method" begin
@test CTBase.__mu_strategy_ipopt() isa String
@testset "Default value of the initial guess" begin
@test isnothing(CTBase.__ocp_init())
end

end
Loading