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
5963a2a0
Commit
5963a2a0
authored
Nov 08, 2016
by
Max Lyon
Browse files
allow setting max number of iterations in IPOPTSolverLean
parent
2e43feb1
Changes
2
Hide whitespace changes
Inline
Side-by-side
NSolver/IPOPTSolverLean.cc
View file @
5963a2a0
...
...
@@ -41,13 +41,14 @@ class IPOPTSolverLean::Impl
{
// Create an instance of the IpoptApplication
public:
Impl
()
:
app_
(
IpoptApplicationFactory
()),
alm_infsb_thrsh_
(
0.5
),
:
app_
(
IpoptApplicationFactory
()),
max_iter_
(
200
),
alm_infsb_thrsh_
(
0.5
),
incr_lazy_cnstr_max_iter_nmbr_
(
5
),
enbl_all_lzy_cnstr_
(
true
)
{}
public:
Ipopt
::
SmartPtr
<
Ipopt
::
IpoptApplication
>
app_
;
int
max_iter_
;
double
alm_infsb_thrsh_
;
int
incr_lazy_cnstr_max_iter_nmbr_
;
bool
enbl_all_lzy_cnstr_
;
...
...
@@ -96,6 +97,16 @@ double IPOPTSolverLean::energy()
//-----------------------------------------------------------------------------
void
IPOPTSolverLean
::
set_max_iterations
(
const
int
_max_iterations
)
{
impl_
->
max_iter_
=
_max_iterations
;
}
int
IPOPTSolverLean
::
max_iterations
()
const
{
return
impl_
->
max_iter_
;
}
double
IPOPTSolverLean
::
almost_infeasible_threshold
()
const
{
return
impl_
->
alm_infsb_thrsh_
;
...
...
@@ -268,6 +279,8 @@ void IPOPTSolverLean::solve(
std
::
vector
<
int
>
n_inf
;
std
::
vector
<
int
>
n_almost_inf
;
// set max iterations
impl_
->
app_
->
Options
()
->
SetIntegerValue
(
"max_iter"
,
impl_
->
max_iter_
);
while
(
!
feasible_point_found
&&
cur_pass
<
max_passes
)
{
...
...
NSolver/IPOPTSolverLean.hh
View file @
5963a2a0
...
...
@@ -49,6 +49,12 @@ public:
// *********** OPTIONS **************//
/*!
Set the maximum number of iterations
*/
void
set_max_iterations
(
const
int
_max_iterations
);
int
max_iterations
()
const
;
/*!
Set the threshold on the lazy inequality constraint to decide if we are near
the constraint boundary.
...
...
Write
Preview
Markdown
is supported
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