chiark
/
gitweb
/
~ianmdlvl
/
nlopt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0a1a910
)
AUGLAG: Fix arithmetic exception (#242)
author
Julien Schueller
<schueller@phimeca.com>
Fri, 14 Dec 2018 04:15:45 +0000
(
05:15
+0100)
committer
Steven G. Johnson
<stevenj@mit.edu>
Fri, 14 Dec 2018 04:15:45 +0000
(23:15 -0500)
src/algs/auglag/auglag.c
patch
|
blob
|
history
diff --git
a/src/algs/auglag/auglag.c
b/src/algs/auglag/auglag.c
index 384194afc99ab11f452c81cdf04baf14d6dd0800..18e5e664fc126b63cbf8172cab454e73762cdc7c 100644
(file)
--- a/
src/algs/auglag/auglag.c
+++ b/
src/algs/auglag/auglag.c
@@
-174,7
+174,7
@@
nlopt_result auglag_minimize(int n, nlopt_func f, void *f_data,
*minf = fcur;
minf_penalty = penalty;
minf_feasible = feasible;
- d.rho =
MAX(1e-6, MIN(10, 2 * fabs(*minf) / con2))
;
+ d.rho =
(con2 > 0) ? MAX(1e-6, MIN(10, 2 * fabs(*minf) / con2)) : 10
;
}
else
d.rho = 1; /* whatever, doesn't matter */