lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 9ba754c 11/14: Replace 'EePmt' and 'ErPmt' (p


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 9ba754c 11/14: Replace 'EePmt' and 'ErPmt' (production)
Date: Sat, 29 Aug 2020 19:34:50 -0400 (EDT)

branch: master
commit 9ba754cf64fdc2a6f31f032576c60b983c6e9fc0
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Replace 'EePmt' and 'ErPmt' (production)
    
    In the production system, these are used only in circumstances where
    they happen to equal their initial values in class modal_outlay. Each
    replacement is guarded by an assertion that guarantees it's okay; those
    assertions can be removed when 'EePmt' and 'ErPmt' are eradicated.
---
 ihs_avstrtgy.cpp | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/ihs_avstrtgy.cpp b/ihs_avstrtgy.cpp
index 6dcb90d..751c2a9 100644
--- a/ihs_avstrtgy.cpp
+++ b/ihs_avstrtgy.cpp
@@ -63,11 +63,13 @@ double AccountValue::CalculateSpecAmtFromStrategy
     ,mcenum_sa_strategy strategy
     ) const
 {
+    LMI_ASSERT(Outlay_->ee_modal_premiums() == InvariantValues().EePmt);
+    LMI_ASSERT(Outlay_->er_modal_premiums() == InvariantValues().ErPmt);
     double annualized_pmt =
-            Outlay_->ee_premium_modes()[reference_year]
-          * InvariantValues().EePmt [reference_year]
-        +   Outlay_->er_premium_modes()[reference_year]
-          * InvariantValues().ErPmt [reference_year]
+            Outlay_->ee_premium_modes ()[reference_year]
+          * Outlay_->ee_modal_premiums()[reference_year]
+        +   Outlay_->er_premium_modes ()[reference_year]
+          * Outlay_->er_modal_premiums()[reference_year]
         ;
     switch(strategy)
         {
@@ -318,12 +320,13 @@ double AccountValue::DoPerformPmtStrategy
 
 double AccountValue::PerformEePmtStrategy() const
 {
+    LMI_ASSERT(Outlay_->ee_modal_premiums() == InvariantValues().EePmt);
     return DoPerformPmtStrategy
         (mce_solve_ee_prem
         ,Outlay_->ee_premium_modes()[Year]
         ,Outlay_->ee_premium_modes()[0]
         ,yare_input_.InsuredPremiumTableFactor
-        ,InvariantValues().EePmt
+        ,Outlay_->ee_modal_premiums()
         ,yare_input_.PaymentStrategy
         );
 }
@@ -332,12 +335,13 @@ double AccountValue::PerformEePmtStrategy() const
 
 double AccountValue::PerformErPmtStrategy() const
 {
+    LMI_ASSERT(Outlay_->er_modal_premiums() == InvariantValues().ErPmt);
     return DoPerformPmtStrategy
         (mce_solve_er_prem
         ,Outlay_->er_premium_modes()[Year]
         ,Outlay_->er_premium_modes()[0]
         ,yare_input_.CorporationPremiumTableFactor
-        ,InvariantValues().ErPmt
+        ,Outlay_->er_modal_premiums()
         ,yare_input_.CorporationPaymentStrategy
         );
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]