[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 338d589 10/14: Call set_partial_mortality() O
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 338d589 10/14: Call set_partial_mortality() OAOO |
Date: |
Sun, 6 Sep 2020 07:50:38 -0400 (EDT) |
branch: master
commit 338d589d9c7f5e04ece7e207836d778aa391f8df
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Call set_partial_mortality() OAOO
Partial mortality is independent of calculation basis, so it was
wasteful and pointless to calculate it once per basis.
The system test would have failed to run if, instead of being moved, the
call to set_partial_mortality() had merely been conditionalized thus:
if(mce_run_gen_curr_sep_full == RunBasis_)
(as seemed plausible). In that case, the function wouldn't have been
called early enough for solves on a guaranteed basis. One basis must be
"primary", and that's usually 'mce_run_gen_curr_sep_full', but not
always. Such conditionals in production code should instead compare
'RunBasis_' to that "primary" basis.
---
ihs_acctval.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ihs_acctval.cpp b/ihs_acctval.cpp
index 64c2b31..79ec645 100644
--- a/ihs_acctval.cpp
+++ b/ihs_acctval.cpp
@@ -106,6 +106,9 @@ AccountValue::AccountValue(Input const& input)
PerformSupplAmtStrategy();
InvariantValues().Init(this);
+ set_partial_mortality();
+ InvariantValues().InforceLives = partial_mortality_lx;
+
// Explicitly initialize antediluvian members. It's generally
// better to do this in the initializer-list, but here they can
// all be kept together.
@@ -411,9 +414,6 @@ void AccountValue::InitializeLife(mcenum_run_basis a_Basis)
);
double sa = specamt_for_7702(0);
- set_partial_mortality();
- InvariantValues().InforceLives = partial_mortality_lx;
-
// It is at best superfluous to do this for every basis.
// TAXATION !! Don't do that then.
Irc7702_->Initialize7702
- [lmi-commits] [lmi] master updated (c4f84b4 -> 59860e3), Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 123b572 01/14: Avoid reading back from ledger in class AccountValue, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master b4eb422 02/14: Rename a variable, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 14c2920 07/14: Factor out partial-mortality calculations, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 338d589 10/14: Call set_partial_mortality() OAOO,
Greg Chicares <=
- [lmi-commits] [lmi] master 915e4ef 03/14: Avoid reading back from ledger in class AccountValue, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 540e3ca 04/14: Simplify, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 73d5f2b 06/14: Refactor for terseness, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 2bcf8d3 08/14: Move commentary outside function body, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 7b9b0cf 11/14: Resolve a marked defect [339], Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 3cbd888 12/14: Improve documentation, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 3ff6e18 13/14: Add and use trivial const accessors, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 1f2d652 05/14: Calculate and store partial-mortality tpx along with lx, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master a1d6c16 09/14: Improve documentation, Greg Chicares, 2020/09/06
- [lmi-commits] [lmi] master 59860e3 14/14: Move partial mortality into base class, Greg Chicares, 2020/09/06