lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [5330] Refactor for parallelism


From: Greg Chicares
Subject: [lmi-commits] [5330] Refactor for parallelism
Date: Wed, 07 Dec 2011 00:59:28 +0000

Revision: 5330
          http://svn.sv.gnu.org/viewvc/?view=rev&root=lmi&revision=5330
Author:   chicares
Date:     2011-12-07 00:59:28 +0000 (Wed, 07 Dec 2011)
Log Message:
-----------
Refactor for parallelism

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

Modified: lmi/trunk/ChangeLog
===================================================================
--- lmi/trunk/ChangeLog 2011-12-06 23:56:11 UTC (rev 5329)
+++ lmi/trunk/ChangeLog 2011-12-07 00:59:28 UTC (rev 5330)
@@ -28759,3 +28759,20 @@
   ihs_avmly.cpp
 Remove assertions that can never fire.
 
+20111206T2355Z <address@hidden> [600]
+
+  ihs_basicval.cpp
+Follow through on 20090118T1124Z deprecation.
+
+20111206T2356Z <address@hidden> [600]
+
+  basic_values.hpp
+Correct misleading documentation.
+
+20111207T0059Z <address@hidden> [600]
+
+  basic_values.hpp
+  ihs_avstrtgy.cpp
+  ihs_basicval.cpp
+Refactor for parallelism.
+

Modified: lmi/trunk/basic_values.hpp
===================================================================
--- lmi/trunk/basic_values.hpp  2011-12-06 23:56:11 UTC (rev 5329)
+++ lmi/trunk/basic_values.hpp  2011-12-07 00:59:28 UTC (rev 5330)
@@ -246,24 +246,25 @@
         ,mcenum_mode a_er_mode
         ,double      a_er_pmt
         ) const;
-    double GetModalSpecAmtCorridor
+    double GetModalSpecAmtGLP
         (mcenum_mode a_ee_mode
         ,double      a_ee_pmt
         ,mcenum_mode a_er_mode
         ,double      a_er_pmt
         ) const;
-    double GetModalSpecAmtGLP
+    double GetModalSpecAmtGSP
         (mcenum_mode a_ee_mode
         ,double      a_ee_pmt
         ,mcenum_mode a_er_mode
         ,double      a_er_pmt
         ) const;
-    double GetModalSpecAmtGSP
+    double GetModalSpecAmtCorridor
         (mcenum_mode a_ee_mode
         ,double      a_ee_pmt
         ,mcenum_mode a_er_mode
         ,double      a_er_pmt
         ) const;
+    double GetModalSpecAmtSalary   (int   a_year) const;
     // Deprecated--used only by the antediluvian branch, which does
     // not distinguish ee from er premium.
     double GetModalMaxSpecAmt

Modified: lmi/trunk/ihs_avstrtgy.cpp
===================================================================
--- lmi/trunk/ihs_avstrtgy.cpp  2011-12-06 23:56:11 UTC (rev 5329)
+++ lmi/trunk/ihs_avstrtgy.cpp  2011-12-07 00:59:28 UTC (rev 5330)
@@ -58,11 +58,7 @@
 /// argument for some strategies but not for others would introduce
 /// inconsistency in addition to complexity.
 ///
-/// The result of a salary-based strategy is constrained to be
-/// nonnegative, because if 'SalarySpecifiedAmountOffset' is
-/// sufficiently large, then specamt would be negative, which cannot
-/// make any sense. Other than that, no minimum is imposed here; see
-/// PerformSpecAmtStrategy().
+/// No minimum is imposed here; see PerformSpecAmtStrategy().
 
 double AccountValue::CalculateSpecAmtFromStrategy
     (int actual_year
@@ -144,16 +140,7 @@
             }
         case mce_sa_salary:
             {
-            double z =
-                  yare_input_.ProjectedSalary[actual_year]
-                * yare_input_.SalarySpecifiedAmountFactor
-                ;
-            if(0.0 != yare_input_.SalarySpecifiedAmountCap)
-                {
-                z = std::min(z, yare_input_.SalarySpecifiedAmountCap);
-                }
-            z -= yare_input_.SalarySpecifiedAmountOffset;
-            return std::max(0.0, z);
+            return GetModalSpecAmtSalary(actual_year);
             }
         default:
             {

Modified: lmi/trunk/ihs_basicval.cpp
===================================================================
--- lmi/trunk/ihs_basicval.cpp  2011-12-06 23:56:11 UTC (rev 5329)
+++ lmi/trunk/ihs_basicval.cpp  2011-12-07 00:59:28 UTC (rev 5330)
@@ -1274,6 +1274,27 @@
     return round_min_specamt()(annualized_pmt * rate);
 }
 
+/// Calculate specified amount based on salary.
+///
+/// The result of a salary-based strategy is constrained to be
+/// nonnegative, because if 'SalarySpecifiedAmountOffset' is
+/// sufficiently large, then specamt would be negative, which cannot
+/// make any sense.
+
+double BasicValues::GetModalSpecAmtSalary(int a_year) const
+{
+    double z =
+          yare_input_.ProjectedSalary[a_year]
+        * yare_input_.SalarySpecifiedAmountFactor
+        ;
+    if(0.0 != yare_input_.SalarySpecifiedAmountCap)
+        {
+        z = std::min(z, yare_input_.SalarySpecifiedAmountCap);
+        }
+    z -= yare_input_.SalarySpecifiedAmountOffset;
+    return round_min_specamt()(std::max(0.0, z));
+}
+
 /// In general, strategies linking specamt and premium commute. The
 /// "pay deductions" strategy, however, doesn't have a useful analog
 /// for determining specamt as a function of initial premium: the




reply via email to

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