[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [6202] Support yearly changes in supplemental specified am
From: |
Greg Chicares |
Subject: |
[lmi-commits] [6202] Support yearly changes in supplemental specified amount |
Date: |
Sun, 31 May 2015 20:02:41 +0000 |
Revision: 6202
http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6202
Author: chicares
Date: 2015-05-31 20:02:41 +0000 (Sun, 31 May 2015)
Log Message:
-----------
Support yearly changes in supplemental specified amount
Modified Paths:
--------------
lmi/trunk/account_value.hpp
lmi/trunk/ihs_avmly.cpp
Modified: lmi/trunk/account_value.hpp
===================================================================
--- lmi/trunk/account_value.hpp 2015-05-31 18:37:14 UTC (rev 6201)
+++ lmi/trunk/account_value.hpp 2015-05-31 20:02:41 UTC (rev 6202)
@@ -284,6 +284,7 @@
double minimum_specified_amount(bool issuing_now, bool term_rider) const;
void ChangeSpecAmtBy (double delta);
+ void ChangeSupplAmtBy (double delta);
void ChangeSurrChgSpecAmtBy (double delta);
void AddSurrChgLayer (int year, double delta_specamt);
void ReduceSurrChg (int year, double partial_surrchg);
Modified: lmi/trunk/ihs_avmly.cpp
===================================================================
--- lmi/trunk/ihs_avmly.cpp 2015-05-31 18:37:14 UTC (rev 6201)
+++ lmi/trunk/ihs_avmly.cpp 2015-05-31 20:02:41 UTC (rev 6202)
@@ -835,12 +835,33 @@
// the input classes, e.g.:
// yare_input_.TermRiderAmount
// as is appropriate for a 7702-integrated term rider. Another sort of
-// term rider might call for vector input.
+// term rider might call for vector input: SupplementalAmount is thus
+// handled by ChangeSupplAmtBy().
}
// Reset DB whenever SA changes.
TxSetDeathBft();
}
+void AccountValue::ChangeSupplAmtBy(double delta)
+{
+ TermSpecAmt += delta;
+
+ TermSpecAmt = std::max
+ (TermSpecAmt
+ ,0.0 // No minimum other than zero is defined.
+ );
+ TermSpecAmt = round_specamt()(TermSpecAmt);
+ // At least for now, there is no effect on surrender charges.
+
+ // Carry the new supplemental amount forward into all future years.
+ for(int j = Year; j < BasicValues::GetLength(); j++)
+ {
+ InvariantValues().TermSpecAmt[j] = TermSpecAmt;
+ }
+ // Reset DB whenever SA changes.
+ TxSetDeathBft();
+}
+
//============================================================================
// The spec amt used as the basis for surrender charges is not
// always the current spec amt, but rather the original spec amt
@@ -1021,6 +1042,12 @@
}
LMI_ASSERT(0 < Year);
+
+ if(TermIsNotRider && DeathBfts_->supplamt()[Year] != TermSpecAmt)
+ {
+ ChangeSupplAmtBy(DeathBfts_->supplamt()[Year] - TermSpecAmt);
+ }
+
double const old_specamt = DeathBfts_->specamt()[Year - 1];
// Nothing to do if no increase or decrease requested.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [6202] Support yearly changes in supplemental specified amount,
Greg Chicares <=