Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
CoMISo
CoMISo
Commits
2a138a42
Commit
2a138a42
authored
Aug 29, 2019
by
Max Lyon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
retry factorization with regularization if factorization was not ok in newton solver
parent
60a7a434
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
NSolver/NewtonSolver.cc
NSolver/NewtonSolver.cc
+3
-2
No files found.
NSolver/NewtonSolver.cc
View file @
2a138a42
...
...
@@ -160,10 +160,11 @@ int NewtonSolver::solve(NProblemInterface* _problem, const SMatrixD& _A,
double
kkt_res2
(
0.0
);
double
constraint_res2
(
0.0
);
int
reg_iters
(
0
);
bool
fact_ok
=
true
;
do
{
// get Newton search direction by solving LSE
bool
fact_ok
=
factorize
(
_problem
,
_A
,
_b
,
x
,
regularize_hessian
,
regularize_constraints
,
first_factorization
);
fact_ok
=
factorize
(
_problem
,
_A
,
_b
,
x
,
regularize_hessian
,
regularize_constraints
,
first_factorization
);
first_factorization
=
false
;
if
(
fact_ok
)
...
...
@@ -204,7 +205,7 @@ int NewtonSolver::solve(NProblemInterface* _problem, const SMatrixD& _A,
}
++
reg_iters
;
}
while
(
(
kkt_res2
>
KKT_res_eps
||
constraint_res2
>
max_allowed_constraint_violation2
)
&&
reg_iters
<
max_KKT_regularization_iters
);
while
(
(
!
fact_ok
||
kkt_res2
>
KKT_res_eps
||
constraint_res2
>
max_allowed_constraint_violation2
)
&&
reg_iters
<
max_KKT_regularization_iters
);
// no valid step could be found?
if
(
kkt_res2
>
KKT_res_eps
||
constraint_res2
>
max_allowed_constraint_violation2
||
reg_iters
>=
max_KKT_regularization_iters
)
...
...
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