Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CoMISo
CoMISo
Commits
6f8ac128
Commit
6f8ac128
authored
Aug 09, 2019
by
Patric Schmitz
Browse files
IPOPTSolverLean: remove deprecated GMM problem interface
parent
c5b51cc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
NSolver/IPOPTSolverLean.cc
View file @
6f8ac128
...
...
@@ -469,56 +469,12 @@ void IPOPTSolverLean::solve(
//-----------------------------------------------------------------------------
void
IPOPTSolverLean
::
solve
(
NProblemInterface
*
_problem
)
{
std
::
vector
<
NConstraintInterface
*>
constraints
;
solve
(
_problem
,
constraints
);
}
//-----------------------------------------------------------------------------
void
IPOPTSolverLean
::
solve
(
NProblemGmmInterface
*
_problem
,
std
::
vector
<
NConstraintInterface
*>&
_constraints
)
{
DEB_enter_func
;
DEB_warning
(
1
,
"******NProblemGmmInterface is deprecated!!! -> use NProblemInterface *******"
);
//----------------------------------------------------------------------------
// 1. Create an instance of IPOPT NLP
//----------------------------------------------------------------------------
Ipopt
::
SmartPtr
<
Ipopt
::
TNLP
>
np
=
new
NProblemGmmIPOPT
(
_problem
,
_constraints
);
//----------------------------------------------------------------------------
// 2. solve problem
//----------------------------------------------------------------------------
// Initialize the IpoptApplication and process the options
Ipopt
::
ApplicationReturnStatus
status
=
impl_
->
app_
->
Initialize
();
if
(
status
!=
Ipopt
::
Solve_Succeeded
)
COMISO_THROW
(
IPOPT_INITIALIZATION_FAILED
);
//----------------------------------------------------------------------------
// 3. solve problem
//----------------------------------------------------------------------------
status
=
impl_
->
app_
->
OptimizeTNLP
(
np
);
//----------------------------------------------------------------------------
// 4. output statistics
//----------------------------------------------------------------------------
check_ipopt_status
(
status
);
// Retrieve some statistics about the solve
Ipopt
::
Index
iter_count
=
impl_
->
app_
->
Statistics
()
->
IterationCount
();
DEB_out
(
1
,
"
\n
*** IPOPT: The problem solved in "
<<
iter_count
<<
" iterations!
\n
"
);
Ipopt
::
Number
final_obj
=
impl_
->
app_
->
Statistics
()
->
FinalObjective
();
DEB_out
(
1
,
"
\n
*** IPOPT: The final value of the objective function is "
<<
final_obj
<<
"
\n
"
);
}
//=============================================================================
}
// namespace COMISO
//=============================================================================
...
...
NSolver/IPOPTSolverLean.hh
View file @
6f8ac128
...
...
@@ -96,11 +96,6 @@ public:
//! \throws Outcome
void
solve
(
NProblemInterface
*
_problem
);
// deprecated interface for backwards compatibility
//! \throws Outcome
void
solve
(
NProblemGmmInterface
*
_problem
,
std
::
vector
<
NConstraintInterface
*>&
_constraints
);
//! Get the computed solution energy
double
energy
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment