[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master ec0a308 06/22: Refactor
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master ec0a308 06/22: Refactor |
Date: |
Sun, 6 Jun 2021 21:38:00 -0400 (EDT) |
branch: master
commit ec0a3089905f17b0214c0afd80034e83a7cc09da
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Refactor
Conditionally warn about the (const) return value just before return.
---
ihs_avsolve.cpp | 21 ++++++++++-----------
solve.cpp | 10 +++++-----
2 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index 95ce206..05332b4 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -457,17 +457,6 @@ currency AccountValue::Solve
,solve_helper
,os_trace
);
-
- if(root_not_bracketed == solution.second)
- {
- LMI_ASSERT(0.0 == solution.first);
- // Don't want this firing continually in census runs.
- if(!SolvingForGuarPremium)
- {
- warning() << "Solution not found: using zero instead." <<
LMI_FLUSH;
- // TODO ?? What can we do when no solution exists for guar prem?
- }
- }
currency const solution_cents = round_minutiae().c(solution.first);
Solving = false;
@@ -479,5 +468,15 @@ currency AccountValue::Solve
// now, and actual values are freshly generated downstream.
(this->*solve_set_fn)(solution_cents);
+ if(root_not_bracketed == solution.second)
+ {
+ LMI_ASSERT(0.0 == solution.first);
+ // Don't want this firing continually in census runs.
+ if(!SolvingForGuarPremium)
+ {
+ warning() << "Solution not found: using zero instead." <<
LMI_FLUSH;
+ // TODO ?? What can we do when no solution exists for guar prem?
+ }
+ }
return solution_cents;
}
diff --git a/solve.cpp b/solve.cpp
index e0673c9..7dfb3c9 100644
--- a/solve.cpp
+++ b/solve.cpp
@@ -330,11 +330,6 @@ currency AccountValue::Solve()
,SolveFn
,status()
);
- if(root_not_bracketed == solution.second)
- {
- LMI_ASSERT(0.0 == solution.first);
- warning() << "solution not found. Using zero instead." << LMI_FLUSH;
- }
currency const solution_cents = round_to_cents.c(solution.first);
Solving = false;
@@ -352,5 +347,10 @@ currency AccountValue::Solve()
// now, and actual values are freshly generated downstream.
SolveFn(dblize(solution_cents));
+ if(root_not_bracketed == solution.second)
+ {
+ LMI_ASSERT(0.0 == solution.first);
+ warning() << "solution not found. Using zero instead." << LMI_FLUSH;
+ }
return solution_cents;
}
- [lmi-commits] [lmi] master updated (f0526be -> 86661b6), Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 7bd1245 01/22: Add a unit test: root of another unfriendly function, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master c01b9b0 02/22: Improve concinnity, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 012967c 08/22: Diagnose any attempt to find a root in a zero-measure interval, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 83eb025 05/22: Rename a local variable, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master ec0a308 06/22: Refactor,
Greg Chicares <=
- [lmi-commits] [lmi] master 99aebcc 07/22: Treat decimal_root return value more flexibly, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 5c31ab3 09/22: Fix latent unit-test errors, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 2391573 11/22: Rename a variable, for terseness, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master b14e318 18/22: Adjust tolerance for a particular unit-test function, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 1c448d8 20/22: Augment decimal_root()'s return type, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 53c3513 21/22: Reorder unit tests, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 5cf534c 04/22: Constify, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 3865416 10/22: Rearrange certain unit tests, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 1f8316c 16/22: Test actual return value, Greg Chicares, 2021/06/06
- [lmi-commits] [lmi] master 3d4adb3 17/22: Clarify, Greg Chicares, 2021/06/06