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
d9f3de21
Commit
d9f3de21
authored
May 26, 2017
by
Martin Marinov
Browse files
Convert some DEB_line into DEB_warning and DEB_error in NewtonSolver as appropriate.
parent
b18573c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
NSolver/NewtonSolver.cc
View file @
d9f3de21
...
...
@@ -181,10 +181,11 @@ int NewtonSolver::solve(NProblemInterface* _problem, const SMatrixD& _A,
if
(
!
fact_ok
||
kkt_res2
>
KKT_res_eps
)
{
DEB_warning
(
2
,
"Warning: numerical issues in KKT system"
);
// alternatingly regularize hessian and constraints
if
(
reg_iters
%
2
==
0
||
regularize_constraints
>=
regularize_constraints_limit
)
{
DEB_line
(
2
,
"
Warning: numerical issues in KKT system with
residual
^
2 "
<<
kkt_res2
<<
"
->
regularize hessian"
);
DEB_line
(
2
,
"residual
^
2 "
<<
kkt_res2
<<
"->regularize hessian"
);
if
(
regularize_hessian
==
0.0
)
regularize_hessian
=
1e-6
;
else
...
...
@@ -192,7 +193,7 @@ int NewtonSolver::solve(NProblemInterface* _problem, const SMatrixD& _A,
}
else
{
DEB_line
(
2
,
"
Warning: numerical issues in KKT system with
residual^2 "
<<
kkt_res2
<<
" -> regularize constraints"
);
DEB_line
(
2
,
"residual^2 "
<<
kkt_res2
<<
" -> regularize constraints"
);
if
(
regularize_constraints
==
0.0
)
regularize_constraints
=
1e-8
;
else
...
...
@@ -206,7 +207,8 @@ int NewtonSolver::solve(NProblemInterface* _problem, const SMatrixD& _A,
// no valid step could be found?
if
(
kkt_res2
>
KKT_res_eps
||
reg_iters
>=
max_KKT_regularization_iters
)
{
DEB_line
(
2
,
"Warning: numerical issues in KKT system could not be resolved -> terminating NewtonSolver with current solution"
);
DEB_error
(
"numerical issues in KKT system could not be resolved "
"-> terminating NewtonSolver with current solution"
);
_problem
->
store_result
(
x
.
data
());
return
0
;
}
...
...
@@ -227,7 +229,7 @@ int NewtonSolver::solve(NProblemInterface* _problem, const SMatrixD& _A,
if
(
constraint_violation2
>
2
*
initial_constraint_violation2
&&
constraint_violation2
>
max_allowed_constraint_violation2
)
{
DEB_
line
(
2
,
"Warning: n
umerical issues in KKT system leads to constraint violation -> recovery phase"
);
DEB_
warning
(
2
,
"N
umerical issues in KKT system leads to constraint violation -> recovery phase"
);
// restore old solution
x
-=
dx
.
head
(
n
)
*
t
;
...
...
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