[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master e360e0d 07/10: Add some commentary on a marke
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master e360e0d 07/10: Add some commentary on a marked defect |
Date: |
Fri, 4 Sep 2020 21:16:10 -0400 (EDT) |
branch: master
commit e360e0ddfd00f805da8e12c878254280bd86efb4
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Add some commentary on a marked defect
The root cause of this problem is probably that ledger objects are used
to hold evanescent state of class AccountValue. Ideally they would be
treated as write-only storage for output values.
---
ihs_avmly.cpp | 38 ++++++++++++++++++++++++--------------
1 file changed, 24 insertions(+), 14 deletions(-)
diff --git a/ihs_avmly.cpp b/ihs_avmly.cpp
index af8d465..fa959ae 100644
--- a/ihs_avmly.cpp
+++ b/ihs_avmly.cpp
@@ -962,24 +962,34 @@ void AccountValue::TxSpecAmtChange()
{
if(0 != Month || 0 == Year)
{
- // What needful thing does this accomplish?
- // Set option 2 death benefit, e.g.?
-
// > This initializes DBReflectingCorr and others so that the at-issue but
// > post-1035 exchange calculation of the seven pay will have a death benefit
// > amount to base its calculations on.
-//
-// TODO ?? We should find a better way. The original intention of this block
-// was to return immediately without doing anything at all except on renewal
-// anniversaries, because elective spec amt changes are not allowed at the
-// issue date or in any off-anniversary month. The line added to change the
-// specified amount by zero is executed almost every month. The call is costly
-// and very probably superfluous. It is probably one reason why calculations
-// are so slow when the term rider is present. ChangeSpecAmtBy() was designed
-// to be called only when the spec amt changes; calling it with an argument
-// of zero is a rather bizarre concept.
-
+#if 1
ChangeSpecAmtBy(0.0);
+#else // 0
+ // TODO ?? Changing specamt by zero is absurd. The following
+ // commented-out alternative seems to do the same thing as
+ // the line above--at least the regression test succeeds.
+ // However, both ways are unclean, and both may be incorrect.
+ //
+ // Carry specamt forward into all future years.
+ for(int j = Year; j < BasicValues::GetLength(); ++j)
+ {
+ ActualSpecAmt = std::max
+ (ActualSpecAmt
+ ,minimum_specified_amount(0 == Year && 0 == Month,
TermRiderActive)
+ );
+ ActualSpecAmt = round_specamt()(ActualSpecAmt);
+ InvariantValues().SpecAmt[j] = ActualSpecAmt;
+ if(!TermIsNotRider)
+ {
+ InvariantValues().TermSpecAmt[j] = TermSpecAmt;
+ }
+ }
+ // Set BOM DB for 7702 and 7702A.
+ TxSetDeathBft();
+#endif // 0
return;
}
- [lmi-commits] [lmi] master updated (520bb97 -> c4f84b4), Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master f2e2cd7 01/10: Refactor to do less work, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master 9878b92 02/10: Refactor, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master 8fa4ca4 03/10: Reformat and append to commentary, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master 4f10238 05/10: Rename a local variable, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master 42f390d 06/10: Improve documentation, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master e8c4054 04/10: Localize a data member, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master e360e0d 07/10: Add some commentary on a marked defect,
Greg Chicares <=
- [lmi-commits] [lmi] master 6a54fd9 09/10: Never read 7702 or 7702A specamt directly from LedgerInvariant, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master f474d10 08/10: Prepare to abstract specified amount, Greg Chicares, 2020/09/04
- [lmi-commits] [lmi] master c4f84b4 10/10: Never read specamt directly from LedgerInvariant, Greg Chicares, 2020/09/04