Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-solvers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
agnumpde
dune-solvers
Commits
7c839d70
Commit
7c839d70
authored
5 months ago
by
oliver.sander_at_tu-dresden.de
Browse files
Options
Downloads
Plain Diff
Merge branch 'improve-finding-ipopt' into 'master'
Minor fixes for finding IPOpt See merge request
!80
parents
3c7573d3
9b38d66a
No related branches found
No related tags found
1 merge request
!80
Minor fixes for finding IPOpt
Pipeline
#65376
failed
5 months ago
Stage: .pre
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cmake/modules/FindIPOpt.cmake
+3
-3
3 additions, 3 deletions
cmake/modules/FindIPOpt.cmake
dune/solvers/solvers/quadraticipopt.hh
+18
-4
18 additions, 4 deletions
dune/solvers/solvers/quadraticipopt.hh
with
21 additions
and
7 deletions
cmake/modules/FindIPOpt.cmake
+
3
−
3
View file @
7c839d70
...
@@ -9,12 +9,12 @@ find_library(DL_LIBRARY dl)
...
@@ -9,12 +9,12 @@ find_library(DL_LIBRARY dl)
find_path
(
IPOPT_INCLUDE_DIR
find_path
(
IPOPT_INCLUDE_DIR
NAMES
"IpNLP.hpp"
NAMES
"IpNLP.hpp"
PATHS
${
IPOPT_ROOT
}
PATHS
${
IPOPT_ROOT
}
PATH_SUFFIXES
"include"
"include/coin"
PATH_SUFFIXES
"include"
"include/coin"
"include/coin-or"
NO_DEFAULT_PATH
NO_DEFAULT_PATH
)
)
find_path
(
IPOPT_INCLUDE_DIR
find_path
(
IPOPT_INCLUDE_DIR
NAMES
"IpNLP.hpp"
NAMES
"IpNLP.hpp"
PATH_SUFFIXES
"include"
"include/coin"
PATH_SUFFIXES
"include"
"include/coin"
"include/coin-or"
)
)
find_library
(
IPOPT_LIBRARY
find_library
(
IPOPT_LIBRARY
...
@@ -40,7 +40,7 @@ find_library(HSL_LIBRARY
...
@@ -40,7 +40,7 @@ find_library(HSL_LIBRARY
find_package_handle_standard_args
(
hsl DEFAULT_MSG HSL_LIBRARY
)
find_package_handle_standard_args
(
hsl DEFAULT_MSG HSL_LIBRARY
)
find_package_handle_standard_args
(
dl DEFAULT_MSG DL_LIBRARY
)
find_package_handle_standard_args
(
dl DEFAULT_MSG DL_LIBRARY
)
find_package_handle_standard_args
(
I
po
pt DEFAULT_MSG IPOPT_INCLUDE_DIR IPOPT_LIBRARY
)
find_package_handle_standard_args
(
I
PO
pt DEFAULT_MSG IPOPT_INCLUDE_DIR IPOPT_LIBRARY
)
if
(
IPOPT_FOUND
)
if
(
IPOPT_FOUND
)
set
(
HAVE_IPOPT ENABLE_IPOPT
)
set
(
HAVE_IPOPT ENABLE_IPOPT
)
...
...
This diff is collapsed.
Click to expand it.
dune/solvers/solvers/quadraticipopt.hh
+
18
−
4
View file @
7c839d70
...
@@ -813,10 +813,24 @@ void QuadraticIPOptSolver<MatrixType,VectorType,JacobianType>::solve()
...
@@ -813,10 +813,24 @@ void QuadraticIPOptSolver<MatrixType,VectorType,JacobianType>::solve()
if
(
status
==
Ipopt
::
Solved_To_Acceptable_Level
)
if
(
status
==
Ipopt
::
Solved_To_Acceptable_Level
)
std
::
cout
<<
"WARNING: Desired tolerance could not be reached, but still acceptable tolerance is reached.
\n
"
;
std
::
cout
<<
"WARNING: Desired tolerance could not be reached, but still acceptable tolerance is reached.
\n
"
;
else
if
(
status
==
Ipopt
::
Search_Direction_Becomes_Too_Small
)
{
else
if
(
status
==
Ipopt
::
Search_Direction_Becomes_Too_Small
)
{
std
::
array
<
Ipopt
::
Number
,
4
>
inf
;
Ipopt
::
Number
dual_inf
;
// dual infeasibility (Gradient of Lagrangian not zero)
app
->
Statistics
()
->
Infeasibilities
(
inf
[
0
],
inf
[
1
],
inf
[
2
],
inf
[
3
]);
Ipopt
::
Number
constr_viol
;
// violation of constraints
if
(
inf
[
3
]
>
std
::
max
(
1e-10
,
this
->
tolerance_
))
#if IPOPT_VERSION_MAJOR>=3 && IPOPT_VERSION_MINOR>=14
DUNE_THROW
(
Dune
::
Exception
,
Dune
::
formatString
(
"Problem could not be solved to acceptable accuracy %d"
,
inf
[
3
]));
Ipopt
::
Number
varbounds_viol
;
// violation of variable bounds
#endif
Ipopt
::
Number
complementarity
;
// violation of complementarity
Ipopt
::
Number
kkt_error
;
// KKT error
app
->
Statistics
()
->
Infeasibilities
(
dual_inf
,
constr_viol
,
#if IPOPT_VERSION_MAJOR>=3 && IPOPT_VERSION_MINOR>=14
varbounds_viol
,
#endif
complementarity
,
kkt_error
);
if
(
kkt_error
>
std
::
max
(
1e-10
,
this
->
tolerance_
))
DUNE_THROW
(
Dune
::
Exception
,
Dune
::
formatString
(
"Problem could not be solved to acceptable accuracy %d"
,
kkt_error
));
}
else
if
(
status
!=
Ipopt
::
Solve_Succeeded
)
}
else
if
(
status
!=
Ipopt
::
Solve_Succeeded
)
DUNE_THROW
(
Dune
::
Exception
,
"IPOpt: Error during optimization!"
);
DUNE_THROW
(
Dune
::
Exception
,
"IPOpt: Error during optimization!"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment