[gnumeric] Solver: don't discard line search improvement for later errors
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Solver: don't discard line search improvement for later errors
- Date: Mon, 8 Jun 2015 18:08:45 +0000 (UTC)
commit dd17de4777e306eb0a281ee9d602f93529ef5704
Author: Morten Welinder <terra gnome org>
Date: Mon Jun 8 14:08:18 2015 -0400
Solver: don't discard line search improvement for later errors
src/tools/gnm-solver.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/tools/gnm-solver.c b/src/tools/gnm-solver.c
index 4bf74c3..3726670 100644
--- a/src/tools/gnm-solver.c
+++ b/src/tools/gnm-solver.c
@@ -1960,11 +1960,11 @@ gnm_solver_line_search (GnmSolver *sol,
s = s1 * (phi + 1);
if (gnm_abs (s) >= max_step)
- return gnm_nan;
+ goto bail;
y = try_step (sol, x0, dir, s);
if (!gnm_finite (y) || !gnm_solver_check_constraints (sol))
- return gnm_nan;
+ goto bail;
if (y < y1) {
y1 = y;
@@ -2002,7 +2002,7 @@ gnm_solver_line_search (GnmSolver *sol,
y = try_step (sol, x0, dir, s);
if (!gnm_finite (y) || !gnm_solver_check_constraints (sol))
- return gnm_nan;
+ goto bail;
if (y < y1) {
if (rbig) {
@@ -2029,6 +2029,7 @@ gnm_solver_line_search (GnmSolver *sol,
}
}
+bail:
if (debug)
g_printerr ("LS: step %.6" GNM_FORMAT_g "\n", s1);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]