lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [6428] Refactor for reusability


From: Greg Chicares
Subject: [lmi-commits] [6428] Refactor for reusability
Date: Sun, 06 Dec 2015 19:51:48 +0000

Revision: 6428
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6428
Author:   chicares
Date:     2015-12-06 19:51:47 +0000 (Sun, 06 Dec 2015)
Log Message:
-----------
Refactor for reusability

Modified Paths:
--------------
    lmi/trunk/account_value.hpp
    lmi/trunk/ihs_acctval.cpp

Modified: lmi/trunk/account_value.hpp
===================================================================
--- lmi/trunk/account_value.hpp 2015-12-06 19:40:35 UTC (rev 6427)
+++ lmi/trunk/account_value.hpp 2015-12-06 19:51:47 UTC (rev 6428)
@@ -289,6 +289,7 @@
     double SurrChg                 ();
 
     double MinInitDumpin() const;
+    double MinInitPrem() const;
     double ModalMinInitPremShortfall() const;
     double SuppositiveModalPremium
         (bool        with_adb

Modified: lmi/trunk/ihs_acctval.cpp
===================================================================
--- lmi/trunk/ihs_acctval.cpp   2015-12-06 19:40:35 UTC (rev 6427)
+++ lmi/trunk/ihs_acctval.cpp   2015-12-06 19:51:47 UTC (rev 6428)
@@ -1096,6 +1096,24 @@
         }
 }
 
+double AccountValue::MinInitPrem() const
+{
+    if
+        (  0 == Year
+        && 1 == Database_->Query(DB_MinInitPremType)
+        && yare_input_.EffectiveDate == yare_input_.InforceAsOfDate
+        )
+        {
+        mcenum_mode const er_mode = InvariantValues().ErMode[0].value();
+        double const modal_min_prem = InvariantValues().ModalMinimumPremium[0];
+        return MinInitDumpin() + modal_min_prem * er_mode;
+        }
+    else
+        {
+        return 0.0;
+        }
+}
+
 /// Required modal increment to initial planned premium.
 ///
 /// If the minimum is not otherwise satisfied, then employee payments
@@ -1132,9 +1150,7 @@
         )
         {
         mcenum_mode const ee_mode = InvariantValues().EeMode[0].value();
-        mcenum_mode const er_mode = InvariantValues().ErMode[0].value();
-        double const modal_min_prem = InvariantValues().ModalMinimumPremium[0];
-        double const required = MinInitDumpin() + modal_min_prem * er_mode;
+        double const required = MinInitPrem();
         double const shortfall = std::max(0.0, required - InitAnnPlannedPrem_);
         return round_min_premium()(shortfall / ee_mode);
         }




reply via email to

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