lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 5d0c118 10/10: Refactor


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 5d0c118 10/10: Refactor
Date: Thu, 11 Mar 2021 21:12:36 -0500 (EST)

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

    Refactor
    
    Finished separating initialization of data members from calculations
    that use their values.
---
 i7702.cpp | 61 +++++++++++++++++++++++++++++++------------------------------
 1 file changed, 31 insertions(+), 30 deletions(-)

diff --git a/i7702.cpp b/i7702.cpp
index 6f18b7f..288d80e 100644
--- a/i7702.cpp
+++ b/i7702.cpp
@@ -268,36 +268,6 @@ i7702::i7702
     database.query_into(DB_CurrAcctValLoad, Dsep_);
     Dsep_ += stratified.minimum_tiered_sepacct_load_for_7702();
 
-    std::vector<double> guar_int = Bgen_;
-    assign(guar_int, Max(guar_int, Bflr_));
-
-    gross_.assign(database.length(), 0.0);
-    assign
-        (gross_
-        ,apply_unary
-            (i_upper_12_over_12_from_i<double>()
-            ,Max(A0_, guar_int)
-            )
-        );
-
-    net_glp_.assign(database.length(), 0.0);
-    assign
-        (net_glp_
-        ,apply_unary
-            (i_upper_12_over_12_from_i<double>()
-            ,Max(A0_, guar_int) - Dsep_
-            )
-        );
-
-    net_gsp_.assign(database.length(), 0.0);
-    assign
-        (net_gsp_
-        ,apply_unary
-            (i_upper_12_over_12_from_i<double>()
-            ,Max(0.02 + A0_, guar_int) - Dsep_
-            )
-        );
-
     // Eckley's 'ig' represents the interest rate by which death
     // benefit is discounted for calculating mortality charges,
     // as seen in his formula (1):
@@ -335,6 +305,37 @@ i7702::i7702
     constexpr double tolerance {0.0000001};
     LMI_ASSERT(no_naar_discount || mm < tolerance);
 
+    // Here begin the dubious calculations that will be replaced.
+    std::vector<double> guar_int = Bgen_;
+    assign(guar_int, Max(guar_int, Bflr_));
+
+    gross_.assign(database.length(), 0.0);
+    assign
+        (gross_
+        ,apply_unary
+            (i_upper_12_over_12_from_i<double>()
+            ,Max(A0_, guar_int)
+            )
+        );
+
+    net_glp_.assign(database.length(), 0.0);
+    assign
+        (net_glp_
+        ,apply_unary
+            (i_upper_12_over_12_from_i<double>()
+            ,Max(A0_, guar_int) - Dsep_
+            )
+        );
+
+    net_gsp_.assign(database.length(), 0.0);
+    assign
+        (net_gsp_
+        ,apply_unary
+            (i_upper_12_over_12_from_i<double>()
+            ,Max(0.02 + A0_, guar_int) - Dsep_
+            )
+        );
+
     std::vector<double> operative_naar_discount(database.length(), 0.0);
     operative_naar_discount +=
         Max



reply via email to

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