[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master ffee06a 1/2: Remove code that can have no eff
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master ffee06a 1/2: Remove code that can have no effect [380] |
Date: |
Thu, 16 Nov 2017 11:56:08 -0500 (EST) |
branch: master
commit ffee06af0355ccfd609feb0d9cedc347582f45a4
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Remove code that can have no effect [380]
The upper bound for solves had been set as follows:
- initialize it to zero;
- for each duration, make it no lower than total specamt;
- unconditionally reset it to one cent less than a billion dollars.
Removed the first two steps because the third always overrode them.
---
ihs_avsolve.cpp | 24 +++++-------------------
1 file changed, 5 insertions(+), 19 deletions(-)
diff --git a/ihs_avsolve.cpp b/ihs_avsolve.cpp
index f644ee9..c2e0c63 100644
--- a/ihs_avsolve.cpp
+++ b/ihs_avsolve.cpp
@@ -337,10 +337,12 @@ double AccountValue::Solve
LMI_ASSERT(0 < SolveTargetDuration_);
LMI_ASSERT( SolveTargetDuration_ <= BasicValues::GetLength());
- // Defaults: may be overridden by some cases
- // We aren't interested in negative solve results
+ // Default bounds (may be overridden in some cases).
+ // Solve results are constrained to be nonnegative.
double lower_bound = 0.0;
- double upper_bound = 0.0;
+ // No amount solved for can plausibly reach one billion dollars.
+ double upper_bound = 999999999.99;
+
root_bias bias =
mce_solve_for_tax_basis == SolveTarget_
? bias_lower
@@ -348,26 +350,10 @@ double AccountValue::Solve
;
int decimals = 0;
- // Many things don't plausibly exceed max input face
- for(int j = 0; j < SolveTargetDuration_; j++)
- {
- upper_bound = std::max
- (upper_bound
- ,DeathBfts_->specamt()[j] + yare_input_.TermRiderAmount
- );
- }
- // TODO ?? Wait--initial premium may exceed input face, so
- // for now we'll bail out with this: no amount solved for can
- // plausibly reach one billion dollars.
- upper_bound = 999999999.99;
-
switch(a_SolveType)
{
case mce_solve_specamt:
{
-// This:
-// upper_bound = 1000000.0 * Outlay_->GetPmts()[0];
-// is not satisfactory; what would be better?
solve_set_fn = &AccountValue::SolveSetSpecAmt;
decimals = round_specamt().decimals();
// Generally, base and term are independent, and it is