lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [6242] Refactor to accommodate group premium quotes


From: Greg Chicares
Subject: [lmi-commits] [6242] Refactor to accommodate group premium quotes
Date: Wed, 12 Aug 2015 23:20:53 +0000

Revision: 6242
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=6242
Author:   chicares
Date:     2015-08-12 23:20:52 +0000 (Wed, 12 Aug 2015)
Log Message:
-----------
Refactor to accommodate group premium quotes

Modified Paths:
--------------
    lmi/trunk/basic_values.hpp
    lmi/trunk/ihs_basicval.cpp

Modified: lmi/trunk/basic_values.hpp
===================================================================
--- lmi/trunk/basic_values.hpp  2015-08-10 16:39:17 UTC (rev 6241)
+++ lmi/trunk/basic_values.hpp  2015-08-12 23:20:52 UTC (rev 6242)
@@ -241,6 +241,24 @@
         ,mcenum_mode a_mode
         ,double      a_specamt
         ) const;
+    double GetModalPremMlyDed
+        (int         a_year
+        ,mcenum_mode a_mode
+        ,double      a_specamt
+        ,yare_input const&
+        ) const;
+    double GetModalPremMlyDedEe
+        (int         a_year
+        ,mcenum_mode a_mode
+        ,double      a_specamt
+        ,yare_input const&
+        ) const;
+    double GetModalPremMlyDedEr
+        (int         a_year
+        ,mcenum_mode a_mode
+        ,double      a_specamt
+        ,yare_input const&
+        ) const;
     double GetModalSpecAmtMax      (double annualized_pmt) const;
     double GetModalSpecAmtTgt      (double annualized_pmt) const;
     double GetModalSpecAmtMinNonMec(double annualized_pmt) const;

Modified: lmi/trunk/ihs_basicval.cpp
===================================================================
--- lmi/trunk/ihs_basicval.cpp  2015-08-10 16:39:17 UTC (rev 6241)
+++ lmi/trunk/ihs_basicval.cpp  2015-08-12 23:20:52 UTC (rev 6242)
@@ -1073,6 +1073,46 @@
 
 /// Determine an approximate "pay as you go" modal premium.
 ///
+/// Rationale for overloading this function and its siblings. The
+/// simple three-argument form is intended for general use, parallel
+/// to similar 'GetModalPrem*' functions; it simply forwards to the
+/// four-argument implementation. That four-argument version, with an
+/// extra yare_input argument, is intended for calculating premiums
+/// under scenarios that differ from actual input, motivated by the
+/// group premium quote's need for premiums with and without certain
+/// riders. Another means to the same end would be to add an argument
+/// for each rider of interest, but that set of riders might expand,
+/// whereas the chosen technique is more future-proof.
+
+double BasicValues::GetModalPremMlyDed
+    (int         a_year
+    ,mcenum_mode a_mode
+    ,double      a_specamt
+    ) const
+{
+    return GetModalPremMlyDed(a_year, a_mode, a_specamt, yare_input_);
+}
+
+double BasicValues::GetModalPremMlyDedEe
+    (int         a_year
+    ,mcenum_mode a_mode
+    ,double      a_specamt
+    ) const
+{
+    return GetModalPremMlyDedEe(a_year, a_mode, a_specamt, yare_input_);
+}
+
+double BasicValues::GetModalPremMlyDedEr
+    (int         a_year
+    ,mcenum_mode a_mode
+    ,double      a_specamt
+    ) const
+{
+    return GetModalPremMlyDedEr(a_year, a_mode, a_specamt, yare_input_);
+}
+
+/// Determine an approximate "pay as you go" modal premium.
+///
 /// This more or less represents actual monthly deductions, at least
 /// for monthly mode on an option B contract, generally favoring
 /// sufficiency over minimality, but simplicity most of all.
@@ -1097,30 +1137,31 @@
 /// to the fee's uneven incidence.
 
 double BasicValues::GetModalPremMlyDed
-    (int         a_year
-    ,mcenum_mode a_mode
-    ,double      a_specamt
+    (int               a_year
+    ,mcenum_mode       a_mode
+    ,double            a_specamt
+    ,yare_input const& a_yi
     ) const
 {
     double z = a_specamt * DBDiscountRate[a_year];
     z *= GetBandedCoiRates(mce_gen_curr, a_specamt)[a_year];
 
-    if(yare_input_.AccidentalDeathBenefit)
+    if(a_yi.AccidentalDeathBenefit)
         {
         double r = MortalityRates_->AdbRates()[a_year];
         z += r * std::min(a_specamt, AdbLimit);
         }
 
-    if(yare_input_.SpouseRider)
+    if(a_yi.SpouseRider)
         {
         double r = MortalityRates_->SpouseRiderRates(mce_gen_curr)[a_year];
-        z += r * yare_input_.SpouseRiderAmount;
+        z += r * a_yi.SpouseRiderAmount;
         }
 
-    if(yare_input_.ChildRider)
+    if(a_yi.ChildRider)
         {
         double r = MortalityRates_->ChildRiderRates()[a_year];
-        z += r * yare_input_.ChildRiderAmount;
+        z += r * a_yi.ChildRiderAmount;
         }
 
     if(true) // Written thus for parallelism and to keep 'r' local.
@@ -1133,7 +1174,7 @@
 
     double annual_charge = Loads_->annual_policy_fee(mce_gen_curr)[a_year];
 
-    if(yare_input_.WaiverOfPremiumBenefit)
+    if(a_yi.WaiverOfPremiumBenefit)
         {
         double const r = MortalityRates_->WpRates()[a_year];
         switch(WaiverChargeMethod)
@@ -1174,30 +1215,31 @@
 // conditionals for ease of comparison to the unsuffixed original.
 
 double BasicValues::GetModalPremMlyDedEe
-    (int         a_year
-    ,mcenum_mode a_mode
-    ,double      a_specamt
+    (int               a_year
+    ,mcenum_mode       a_mode
+    ,double            a_specamt
+    ,yare_input const& a_yi
     ) const
 {
     double z = a_specamt * DBDiscountRate[a_year];
     z *= GetCurrentTermRates()[a_year];
 #if 0
-    if(yare_input_.AccidentalDeathBenefit)
+    if(a_yi.AccidentalDeathBenefit)
         {
         double r = MortalityRates_->AdbRates()[a_year];
         z += r * std::min(a_specamt, AdbLimit);
         }
 #endif // 0
-    if(yare_input_.SpouseRider)
+    if(a_yi.SpouseRider)
         {
         double r = MortalityRates_->SpouseRiderRates(mce_gen_curr)[a_year];
-        z += r * yare_input_.SpouseRiderAmount;
+        z += r * a_yi.SpouseRiderAmount;
         }
 
-    if(yare_input_.ChildRider)
+    if(a_yi.ChildRider)
         {
         double r = MortalityRates_->ChildRiderRates()[a_year];
-        z += r * yare_input_.ChildRiderAmount;
+        z += r * a_yi.ChildRiderAmount;
         }
 
 #if 0
@@ -1212,7 +1254,7 @@
     double annual_charge = Loads_->annual_policy_fee(mce_gen_curr)[a_year];
 #endif // 0
 
-    if(yare_input_.WaiverOfPremiumBenefit)
+    if(a_yi.WaiverOfPremiumBenefit)
         {
         double const r = MortalityRates_->WpRates()[a_year];
         switch(WaiverChargeMethod)
@@ -1255,31 +1297,32 @@
 }
 
 double BasicValues::GetModalPremMlyDedEr
-    (int         a_year
-    ,mcenum_mode a_mode
-    ,double      a_specamt
+    (int               a_year
+    ,mcenum_mode       a_mode
+    ,double            a_specamt
+    ,yare_input const& a_yi
     ) const
 {
     double z = a_specamt * DBDiscountRate[a_year];
     z *= GetBandedCoiRates(mce_gen_curr, a_specamt)[a_year];
 
-    if(yare_input_.AccidentalDeathBenefit)
+    if(a_yi.AccidentalDeathBenefit)
         {
         double r = MortalityRates_->AdbRates()[a_year];
         z += r * std::min(a_specamt, AdbLimit);
         }
 
 #if 0
-    if(yare_input_.SpouseRider)
+    if(a_yi.SpouseRider)
         {
         double r = MortalityRates_->SpouseRiderRates(mce_gen_curr)[a_year];
-        z += r * yare_input_.SpouseRiderAmount;
+        z += r * a_yi.SpouseRiderAmount;
         }
 
-    if(yare_input_.ChildRider)
+    if(a_yi.ChildRider)
         {
         double r = MortalityRates_->ChildRiderRates()[a_year];
-        z += r * yare_input_.ChildRiderAmount;
+        z += r * a_yi.ChildRiderAmount;
         }
 #endif // 0
 
@@ -1293,7 +1336,7 @@
 
     double annual_charge = Loads_->annual_policy_fee(mce_gen_curr)[a_year];
 
-    if(yare_input_.WaiverOfPremiumBenefit)
+    if(a_yi.WaiverOfPremiumBenefit)
         {
         double const r = MortalityRates_->WpRates()[a_year];
         switch(WaiverChargeMethod)




reply via email to

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